TCP Functions
TCP’s superpowers are reliability, ordering, and flow control. This lesson dissects the exact machinery: sequence numbers, cumulative acknowledgements, retransmission, the advertised window, and how receiver and sender cooperate through a sliding window.
TCP’s three headline characteristics
Every CCNA answer about TCP starts with the same three adjectives:
- Connection-oriented — before any data flows, the two hosts establish a session (Lesson 4) and tear it down afterwards (Lesson 5).
- Reliable — the sender is told, segment by segment, what was received successfully, and retransmits anything that was not.
- Ordered — even if segments arrive out of order, the receiver delivers them to the application in the original order.
Connection-oriented
A session is established before data flows and torn down afterwards.
Reliable
Every byte is acknowledged; unacknowledged data is resent.
Ordered
Out-of-order segments are buffered and released in the original order.
Sequence numbers: the backbone
TCP does not accept data blindly; it numbers every byte of the stream. The sequence number (SEQ) in a segment is the number of the first byte carried in that segment. Consider a sender delivering a 3000-byte stream:
1, then: segment 1 carries bytes 1–1000 and its SEQ field is the first byte’s number = 1. Segment 2 carries bytes 1001–2000 and has SEQ = 1001. Segment 3 carries bytes 2001–3000 and has SEQ = 2001. The sequence number counts bytes, not segments.
Why bytes? Because the receiver can detect loss (a gap appears in the byte count), duplication (the same byte number appears twice), and reordering (higher numbers arrive before lower ones) purely by arithmetic. Ordering and reliability both reduce to one counter.
2500, the ACK field it sends is 2501 — the number of the byte it expects next, not a count of bytes received. The answer choices will fence this exact distinction.
Acknowledgements: the cumulative ACK
When the receiver gets data, it replies with a segment whose acknowledgement number (ACK) says: “I have received everything up to this number — send me this byte next.” The acknowledgement is cumulative: one ACK confirms every byte up to ACK − 1, even if the segments arrived separately. This makes ACKs extremely cheap to process — the receiver needs no per-segment ledger, only “the next byte I am waiting for.”
In practice the receiver does not ACK every segment individually; it groups them. Many TCP stacks ACK every second full-size segment (fast path) or at least every 500 ms, and modern implementations send delayed ACKs. On the exam, though, the model you must apply is the classic one: each segment (or small burst) is acknowledged by a single cumulative ACK.
Retransmission after timeout
The sender starts a timer when it sends data. If the timer expires before the cumulative ACK covers the sent bytes, the sender retransmits. The timeout is the retransmission timeout (RTO), which TCP adapts to the measured round-trip time (RTT) so it does not wait forever and does not resend prematurely: RTO ≈ RTT + a safety margin (4×RTT’s variation in the classic RFC 6298 formula). When the network is genuinely congested, waiting and retransmitting is exactly what TCP must do, and it slows down as well (Part 7).
Resequencing and reassembly
Segments can arrive out of order: two different paths through the network, routers queuing unevenly, or a retransmission arriving after an original copy finally shows up. The receiver buffers out-of-order bytes and only releases them to the application when the byte stream is gap-free up to that point. This is resequencing. Reassembly is the companion half: rebuilding the application’s original data stream from those in-order bytes so the application sees one continuous stream, exactly as the sender’s application handed it over.
SENDER (window open) RECEIVER
|
|---- SEQ=1 (bytes 1-1000) -------->
|---- SEQ=1001 (bytes 1001-2000) -------->
|---- SEQ=2001 (bytes 2001-3000) -------->
| | buffered in order:
|<--- ACK=1001 (got up to 1000) --------| next expected = 1001
|<--- ACK=3001 (got up to 3000) --------| ONE ack covers ALL three
| | (cumulative!)
|
|---- SEQ=3001 (bytes 3001-4000) -------->
| ...segment lost on the path...
| (waits for RTO)
|---- SEQ=3001 (bytes 3001-4000) -------->| RETRANSMIT after timeout
|<--- ACK=4001 (got up to 4000) --------|
Flow control: windowing and the sliding window
Reliability alone is not enough: a fast sender could flood a slow receiver’s buffers. TCP’s answer is flow control built on a window. Every ACK (and SYN) carries a window size field: the amount of data, in bytes, that the receiver’s buffer currently has room for. The sender may transmit at most one window’s worth of unacknowledged data, then must pause and wait for ACKs, which bring a fresh window.
- Window = 0: stop sending entirely; that is the receiver saying “buffer full.”
- Window sliding: as ACKs arrive, the window’s left edge moves right (bytes confirmed), and the sender is permitted more bytes on the right. The set of bytes the sender may transmit “slides” forward — hence sliding window.
- Receiving side: the receiver also uses a window when accepting out-of-order bytes, so the name appears on both ends of the description.
Example of the arithmetic: the receiver advertises a window of 4000 bytes. The sender transmits segments covering bytes 1–4000. When the receiver ACKs 1001 (bytes 1–1000 confirmed), the window slides and the sender may transmit bytes 4001–5000 next. The window size field itself is 16 bits; when a larger window is needed, the TCP window scale option multiplies it (Lesson 4 mentions how options are negotiated during setup).
Congestion control and full duplex
Flow control protects one receiver. Congestion control protects the whole path: if every sender hammered at maximum speed, routers would fill and drop packets everywhere. TCP paces itself with two famous mechanisms you will see detailed in later lessons and labs:
- Slow start — a new connection (or a recovery) begins with a small window (e.g.
initial cwndof 10 segments) that doubles every RTT until a threshold is reached — exponential growth to find the available capacity quickly. - AIMD — additive increase / multiplicative decrease — once the threshold is hit, the window grows additively (one segment per RTT) but reacts to a detected loss by cutting the window multiplicatively (often halving it).
The sender keeps two windows in mind: the receiver’s advertised window (flow control) and its own congestion window (cwnd). It may send no more than the smaller of the two. That single sentence is the whole trick of “flow vs congestion” questions.
TCP is full duplex: both directions carry independent data and their own sequence and acknowledgment numbers at the same time. In a duplex pair, the ACK for server→client data can even be piggybacked in the next segment the server sends client→server-bound. There is no “turn-taking” as in half-duplex links; each host is simultaneously sender and receiver, and each tracks its own send and receive windows.
Key terms
| Term | Meaning |
|---|---|
| Sequence number (SEQ) | The byte number of the first byte carried in a segment. |
| Acknowledgement number (ACK) | The next byte the receiver expects; cumulative — confirms everything below it. |
| RTO | Retransmission Timeout; derived from the measured RTT; when it expires, the sender resends unacknowledged data. |
| Resequencing | Buffering out-of-order bytes until the stream is gap-free, then delivering in order. |
| Window | Bytes of unacknowledged data the receiver currently has room for. |
| Sliding window | The mechanism by which the usable window moves forward as ACKs arrive. |
| Slow start | Congestion-control growth phase: window doubles each RTT until a threshold. |
| AIMD | Additive increase, multiplicative decrease: grow gently, cut sharply on loss. |
Review
Check what you have learned with these review questions.
Sources & references
- Postel, J. RFC 793: Transmission Control Protocol (1981), Sections 2.6 (reliability), 3.3 (sequence numbers), 3.7 (ACK), 3.3 flow control (window). rfc-editor.org/rfc/rfc793.
- Jacobson, V., Braden, R. & Borman, D. RFC 1323: TCP Extensions for High Performance (1992), window scale option. rfc-editor.org/rfc/rfc1323.
- Allman, M., Paxson, V. & Blanton, E. RFC 6298: Computing TCP's Retransmission Timer (2011). rfc-editor.org/rfc/rfc6298.
- IANA. Service Name and Transport Protocol Port Number Registry (context for TCP/UDP port usage). iana.org.
- Cisco. CCNA (200-301) Exam Topics, Network Fundamentals. cisco.com.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.