Week 8 · Lesson 3

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.

CCNA 200-301 Domain 1.0 Network Fundamentals Verified 2026-10-11
Part 1

TCP’s three headline characteristics

Every CCNA answer about TCP starts with the same three adjectives:

Definition — TCP The Transmission Control Protocol provides a reliable, connection-oriented, ordered-byte-stream service between two processes. It uses sequence numbers, acknowledgements, timeouts, and an advertised window to keep that promise over an unreliable network.

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.

Part 2

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:

Example If the stream starts at byte 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.

Exam tip — the ACK number is the next expected byte If the receiver has received all bytes up to and including byte 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.
Sequence & ACK calculator · type your values

Part 3

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.

Cumulative ACK · walk the exchange

      

Part 4

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).

Remember Retransmission is what makes TCP reliable. The network does not guarantee delivery; TCP notices the missing acknowledgment and sends again. A retransmitted byte may then arrive twice at the receiver, which drops the duplicate because its sequence number is below the next expected byte.
Part 5

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)  --------|
Note Upper half: three segments acknowledged by one cumulative ACK=3001. Lower half: byte sequence resumes; a lost segment is retransmitted after the RTO and only then acknowledged. The ACK value always equals the next byte the receiver expects.
Part 6

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.

Exam tip Flow control is receiver-driven: the receiver advertises the window; the sender obeys it. If a question says “the sender’s window shrank to zero,” the cause is the receiver’s buffer filling up, not a network problem. Keep window (flow control, L4, receiver) separate from congestion control (network-wide, sender-driven, Part 7) in your answer.

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).

Sliding window · step through the exchange

Part 7

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:

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.

Flow control vs congestion control · move the sliders

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.

Note Because each direction numbers bytes independently, the two ends hold four values for one connection: their own send sequence and the peer’s expected byte (the ACK they send) — on both sides. Symmetric, by design.

Key terms

TermMeaning
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.
RTORetransmission Timeout; derived from the measured RTT; when it expires, the sender resends unacknowledged data.
ResequencingBuffering out-of-order bytes until the stream is gap-free, then delivering in order.
WindowBytes of unacknowledged data the receiver currently has room for.
Sliding windowThe mechanism by which the usable window moves forward as ACKs arrive.
Slow startCongestion-control growth phase: window doubles each RTT until a threshold.
AIMDAdditive increase, multiplicative decrease: grow gently, cut sharply on loss.
Part 8 · Your turn

Review

Check what you have learned with these review questions.

Review · 6 questions

Sources

Sources & references

  1. 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.
  2. Jacobson, V., Braden, R. & Borman, D. RFC 1323: TCP Extensions for High Performance (1992), window scale option. rfc-editor.org/rfc/rfc1323.
  3. Allman, M., Paxson, V. & Blanton, E. RFC 6298: Computing TCP's Retransmission Timer (2011). rfc-editor.org/rfc/rfc6298.
  4. IANA. Service Name and Transport Protocol Port Number Registry (context for TCP/UDP port usage). iana.org.
  5. 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.