TCP Sequence Numbers, ACKs and Retransmission
Bytes, not packet numbers
TCP numbers the bytes in each direction of a connection independently. A segment with sequence number 1000 and 500 payload bytes covers 1000 through 1499; the receiver can acknowledge 1500 when all preceding bytes have arrived. ACK is cumulative: it names the next expected byte, not the last packet. SYN and FIN each occupy one sequence position; an ordinary ACK without payload consumes none. Sequence arithmetic wraps modulo 2^32. Compare positions in a bounded window, not by ordinary unsigned ordering across wrap.
A missing range and selective acknowledgment
Assume the handshake is complete, the receiver expects byte 1000, SACK was negotiated, and the receiver retains out-of-order data. Each interval below includes its left endpoint but excludes its right endpoint. The receiver reports the gap using its cumulative ACK and can advertise received ranges using SACK. Once the missing 500 bytes arrive, the cumulative ACK advances through the buffered range. A retransmission carries the original sequence range, not a fresh range.
Receiver event ACK SACK blockReceive [1500,2000) 1000 [1500,2000)Receive [1000,1500) again* 2000 none needed* Retransmitted by sender; first copy was missing.RTT, delayed ACK and retransmission timers
RTT is round-trip time. An ACK observed 40 ms after an unambiguously matched send provides a 40 ms timing sample at that observation point. Delayed ACK can add receiver waiting time; one ACK may cover multiple segments. RFC 6298 uses a smoothed RTT (SRTT), RTT variation (RTTVAR) and clock granularity G: RTO = SRTT + max(G, 4 × RTTVAR), subject to its timer rules. With SRTT 200 ms, RTTVAR 50 ms and G 10 ms, the raw result is 400 ms; the RFC recommends rounding computed values below one second up to one second. A timeout backs off the RTO. Without timestamp disambiguation, do not take a sample from retransmitted data: the ACK might refer to either copy. Fast retransmit and newer loss detectors can act before a timeout.
Read a trace carefully
A repeated ACK can result from reordering, loss or duplicated traffic. A capture gap can also hide the first copy. Confirm capture direction and completeness, sequence ranges, ACK/SACK evidence and timing before attributing loss to a link. An ACK confirms transport receipt, not that the application saved or processed the data. Practice with a different gap in the manual lab; then continue to flow and congestion control.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
TCP Sequence Numbers, ACKs and Retransmission Quiz
Apply transport reasoning to fictional traces and calculations.
A receiver expects byte 4000. It receives 300 contiguous bytes starting at 4000. What ACK can it send?
The receiver expects 1000 and buffers [1500,2000). What is its cumulative ACK?
Which item consumes one sequence position without payload?
An ACK arrives after a retransmission, without timestamps that resolve which copy it acknowledges. What should the sender do for RTT sampling?
Given SRTT 300 ms, RTTVAR 200 ms and G 10 ms, what is the raw RFC 6298 RTO?