0% found this document useful (0 votes)
6 views4 pages

TCP Sequence Numbers and Acknowledgments (Seq# & ACK#) Sequence Numbers

TCP (Transmission Control Protocol) ensures reliable and ordered delivery of data between applications over an IP network, utilizing sequence numbers and acknowledgments for data integrity. It incorporates flow control through a receive window (rwnd) to prevent buffer overflow and manages connections via a three-way handshake for establishment and a four-way handshake for termination. Additionally, TCP employs congestion control algorithms, such as AIMD, Slow Start, and Fast Recovery, to optimize data transmission and maintain network efficiency.

Uploaded by

Priyanka Rajput
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

TCP Sequence Numbers and Acknowledgments (Seq# & ACK#) Sequence Numbers

TCP (Transmission Control Protocol) ensures reliable and ordered delivery of data between applications over an IP network, utilizing sequence numbers and acknowledgments for data integrity. It incorporates flow control through a receive window (rwnd) to prevent buffer overflow and manages connections via a three-way handshake for establishment and a four-way handshake for termination. Additionally, TCP employs congestion control algorithms, such as AIMD, Slow Start, and Fast Recovery, to optimize data transmission and maintain network efficiency.

Uploaded by

Priyanka Rajput
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

TCP (Transmission Control Protocol) is a cornerstone of the internet, providing reliable,

ordered, and error-checked delivery of a stream of bytes between applications running on


hosts communicating via an IP network.

TCP Sequence Numbers and Acknowledgments (Seq# & ACK#)

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.

TCP Flow Control


Receive Window:
o The receiver's advertised window size (rwnd) tells the sender how much data
it can accept without overflowing its buffers.
o This mechanism prevents the sender from overwhelming the receiver.

 How rwnd Helps in TCP Flow Control:


Every TCP receiver has a buffer to store incoming data. However, this buffer has a
limited size. The receiver advertises its available buffer space to the sender in the form of
the receive window (rwnd). This rwnd value essentially tells the sender, "Here's how
much data I can currently accept."
The sender is then obligated to respect this rwnd value. It must not send more data than
the receiver has indicated it can handle. This prevents the receiver's buffer from
overflowing and losing data.
The rwnd is not a static value. The receiver can dynamically adjust it as its buffer space
changes. For example, if the receiving application consumes data from the buffer, the
receiver can increase the rwnd, allowing the sender to send more data. If the receiver is
becoming overwhelmed, the receiver will decrease the rwnd value, and if the buffer is
full, the receiver can set the rwnd value to 0.
TCP's flow control mechanism, allows the receiver to regulate the amount of data it
receives and prevent buffer overflows.
TCP Connection Management
Three-Way Handshake: This process establishes a synchronized and reliable connection.
o SYN (synchronize)
o SYN-ACK (synchronize-acknowledge)
o ACK (acknowledge)

Connection Termination: A four-way handshake is typically used for full-duplex connection


termination.
o FIN (finish) segments are used
to close a connection.

TCP Congestion Control


TCP uses algorithms like AIMD (Additive Increase/Multiplicative Decrease), Slow Start, and
Congestion Avoidance to manage the cwnd.
TCP Congestion Policy
 Slow Start Phase: Starts slow increment is exponential to the threshold.
 Congestion Avoidance Phase: After reaching the threshold increment is by 1.
After this, The sender goes back to the Slow start phase or the Congestion
avoidance phase.
AIMD (Additive Increase/Multiplicative Decrease):
 AIMD is a congestion control algorithm used by
TCP to manage the congestion window (cwnd).
 The congestion window (cwnd) is a variable
maintained by the TCP sender. It limits the amount
of data the sender can transmit into the network
before receiving acknowledgments (ACKs). The
cwnd works in conjunction with the receiver's
advertised window (rwnd), which is used for flow
control.
 It's designed to balance network efficiency and
fairness among multiple TCP connections
Additive Increase (AI): When ACKs are received, indicating successful data delivery, TCP
increases the cwnd. This increase is linear, meaning the cwnd grows by a fixed amount
(typically 1 MSS) per RTT. This slow and steady increase allows TCP to probe for available
bandwidth without overwhelming the network.
Multiplicative Decrease (MD): If packet loss is detected (e.g., via timeouts or triple
duplicate ACKs), TCP reduces the cwnd. This reduction is multiplicative, typically halving the
cwnd. This rapid decrease is essential for quickly alleviating congestion and preventing
further packet loss.

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.

Feature TCP Tahoe TCP Reno


Response to Enters Slow Start. cwnd = 1 Enters Slow Start. cwnd = 1 MSS,
Timeout MSS, ssthresh = cwnd/2 ssthresh = cwnd/2
Response to 3 Enters Slow Start. cwnd = 1 Enters Fast Recovery. ssthresh =
Duplicate ACKs MSS, ssthresh = cwnd/2 cwnd/2, cwnd = ssthresh
Fast Retransmit Not implemented Implemented
Fast Recovery Not implemented Implemented
More sophisticated; differentiates
Congestion Less sophisticated; treats all between timeouts and triple duplicate
Handling packet loss the same ACKs
Faster recovery after triple duplicate
Recovery Speed Slower recovery after packet loss ACKs
Can lead to more aggressive Generally higher throughput,
Overall window reduction and lower especially in networks with some
Performance throughput packet reordering

You might also like