What to practice
- Trace exact TCP sequence (Seq) and acknowledgment (Ack) numbers across connection establishment, data transfer, and teardown.
- Contrast TCP vs. UDP header fields, reliability mechanisms, and application port mappings (22, 53, 67/68, 80, 123, 443).
- Analyze recursive vs. iterative DNS resolution and A, AAAA, CNAME, MX, TXT, and PTR records.
Limited preview notice: AP Networking is not yet open to all schools. College Board lists 2026-27 as its third and final pilot year, with a multiple-choice pilot exam in May 2027 for pilot schools, availability for all schools in 2027-28, and the AP Networking Exam in May 2028. This free preview teaches networking foundations. It is not a complete course, it is not for sale, and College Board does not endorse it.
Framework
TCP 3-Way Handshake: (1) Client SYN (Seq = X) -> (2) Server SYN-ACK (Seq = Y, Ack = X + 1) -> (3) Client ACK (Seq = X + 1, Ack = Y + 1) | TCP Data Acknowledgment: Next Expected Byte Ack = Received_Seq + Payload_Bytes | Bandwidth-Delay Product: Effective Throughput <= min(Window_Size / RTT, Bottleneck_BW) | Well-Known Ports: SSH=22, DNS=53, DHCP=67/68, HTTP=80, NTP=123, HTTPS=443
In this chapter, Layer 4 Transport protocols multiplex conversations using 16-bit port numbers (Well-Known 0-1023, Registered 1024-49151, Ephemeral 49152-65535). TCP (Transmission Control Protocol) provides connection-oriented, reliable, ordered delivery via a Three-Way Handshake (SYN with initial sequence number Seq = X -> SYN-ACK with Seq = Y, Ack = X + 1 -> ACK with Seq = X + 1, Ack = Y + 1), forward byte-count acknowledgments (Ack = Seq + Payload_Bytes), sliding-window flow control (rwnd), and congestion control (serving HTTPS:443, HTTP:80, SSH:22, SMTP:25). UDP (User Datagram Protocol) provides low-overhead, connectionless, best-effort delivery with an 8-byte header and no handshake or retransmission delay (serving real-time VoIP, gaming, DHCP:67/68, NTP:123, and standard DNS:53 queries). At Layer 7, recursive and authoritative DNS servers resolve FQDNs across Root (.), TLD (.com, .org), and Authoritative name servers using A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail), and PTR (reverse) resource records.
Worked TCP Three-Way Handshake, Payload Sequence/ACK Tracking & DNS Resolution Audit
A client initiates a TCP connection to an HTTPS server (Port 443) with an initial SYN segment carrying Seq = 1,000. The server responds with a SYN-ACK carrying Seq = 5,000. After completing the third handshake packet, the client transmits its first HTTP/TLS data segment containing 600 bytes of payload. State the exact Seq and Ack numbers on (1) the server's SYN-ACK, (2) the client's handshake ACK, (3) the client's 600-byte data segment, and (4) the server's acknowledgment of that 600-byte payload.
Step 1 (Packet 2 — Server SYN-ACK): The server acknowledges the client's SYN (which consumes 1 logical sequence number) with Seq = 5,000, Ack = 1,000 + 1 = 1,001.
Step 2 (Packet 3 — Client Handshake ACK): The client acknowledges the server's SYN with Seq = 1,001, Ack = 5,000 + 1 = 5,001.
Step 3 (Packet 4 — Client 600-Byte Data Segment): Starting at byte Seq = 1,001 and carrying 600 payload bytes (bytes 1,001 through 1,600), the segment carries Seq = 1,001, Ack = 5,001, Len = 600.
Step 4 (Packet 5 — Server Data ACK): The server acknowledges receipt of all 600 bytes by requesting the next expected byte: Ack = 1,001 + 600 = 1,601 (with Seq = 5,001).
Each SYN (and FIN) flag consumes 1 sequence number (+1), and every TCP data acknowledgment specifies the next expected byte sequence number: Ack = Received_Seq + Payload_Length.
Practice procedure
Add 1 to the initial SYN sequence number (X + 1) to find the first data segment's starting Seq, then add Payload_Length to find the receiver's returned Ack number.
Common mistakes
Forgetting that the initial TCP SYN flag consumes 1 sequence number (X -> X + 1) before the first payload byte is sent.
Confusing DNS A records (which map a hostname to a 32-bit IPv4 address) with AAAA records (which map a hostname to a 128-bit IPv6 address) or CNAME records (which alias one domain name to another).
Key terms
Term: Three-Way Handshake (SYN, SYN-ACK, ACK)
Definition: The TCP connection-establishment procedure that synchronizes initial sequence numbers and receive window sizes between endpoints.
Term: Forward Acknowledgment (TCP Ack)
Definition: The TCP header field indicating the sequence number of the next contiguous byte the receiver expects to receive (Seq + Len).
Term: DNS Authoritative Record Types
Definition: A maps FQDN to IPv4; AAAA maps FQDN to IPv6; CNAME maps alias to canonical name; MX specifies mail servers.
Term: Ephemeral Source Port
Definition: A temporary port number (49152-65535) dynamically allocated by a client OS to uniquely identify an outbound TCP or UDP socket.