TCP Sequence Numbers and Acknowledgments (Seq# & ACK#) Sequence Numbers
TCP Sequence Numbers and Acknowledgments (Seq# & ACK#) Sequence Numbers
Sequence Numbers:
o TCP divides data into segments, and each byte within those segments is
assigned a sequence number.
o This numbering ensures that even if segments arrive out of order, the
receiving TCP can reassemble them correctly.
o The initial sequence number (ISN) is randomly generated, which enhances
security.
o Each byte of data in a TCP segment is assigned a unique sequence number,
which is essentially the "number" of the first byte in the segment's data within
the byte stream.
Acknowledgments:
o ACKs confirm the successful receipt of data segments.
o An acknowledgment in TCP serves to acknowledge the receipt of data and
inform the sender about the next sequence number expected from the other
side.
o In Cumulative ACK, when the receiver acknowledges a specific sequence
number, it implies that all bytes with lower sequence numbers have been
received successfully."
o TCP uses cumulative ACKs, meaning an ACK number indicates that all bytes
up to that number have been received.
o This reduces the number of ACKs needed, improving efficiency.
Slow Start: Slow Start is used to rapidly increase the cwnd at the beginning of a connection
or after a timeout. The congestion window (cwnd) starts at 1 Maximum Segment Size (MSS)
and doubles every RTT. This leads to rapid initial growth of the cwnd. The growth continues
until the slow start threshold (ssthresh) is reached, or a loss event occurs.
Congestion Avoidance: After slow start or detecting packet loss, the congestion window
size increases linearly to probe for available bandwidth.
Fast Retransmit Upon receiving three duplicate ACKs, the sender retransmits the lost
packet without waiting for a timeout.
Fast Recovery: After fast retransmit, the sender enters a recovery phase, adjusting the
congestion window size to avoid further congestion.