Client Role in Congestion Avoidance
Client Role in Congestion Avoidance
This sequence diagram was generated with EventStudio System Designer (http://www.EventHelix.com/EventStudio).
We have already seen that TCP connection starts up in slow start mode, geometrically increasing the congestion window
(cwnd) until it crosses the slow start threshold (ssthresh). Once cwnd is greater that ssthresh, TCP enters the congestion
avoidance mode of operation. In this mode, the primary objective is to maintain high throughput without causing congestion. If
TCP detects segment loss, it assumes that congestion has been detected over the internet. As a corrective action, TCP
reduces its data flow rate by reducing cwnd. After reducing cwnd, TCP goes back to slow start.
Socket initialization
Server awaits client socket connections.
ACK Client now acknowledges the first segment, thus completing the
src = Client_Port, three way handshake. The receive window is set to 5000. Ack
dst = Server_Port, sequence number is set to 101, this means that the next
ack_num = 101, expected sequence number is 101.
window = 5000
Established At this point, the client assumes that the TCP connection has
been established
Slow start
cwnd = 512 bytes (1 segment) TCP connection begins with a congestion window size of 1
segment
Client Net Server
Client App Client Network Server
Socket Socket
ssthresh = 65535 bytes The slow start threshold starts with 64 Kbytes as the threshold
value.
TCP session begins with 'Slow Start' Click on the action title for a detailed description of the TCP
slow start.
Slow Start Since cwnd < ssthresh, TCP state is slow start
TCP congestion window grows from 512 bytes (1 segment) to TCP congestion window grows at the start of the session if no
64947 segment losses are detected during slow start). During slow
start the congestion window was being incremented by 1
segment for every TCP Ack from the other end.
About to exit slow start
Data Client Application sends data for transmission over the TCP
Socket
TCP Segment Data is split into TCP Segments. The segments are sent over
seq_num = 100000, the Internet
len = 512
TCP Segment
seq_num = 100512,
len = 512
ACK
ack_num = 101024,
window = 80000
cwnd = 64947 + 512 = 65459 Since TCP is in slow start, every ack leads to the window
growing by one segment.
Congestion Avoidance
Congestion Avoidance At this point cwnd (=65459) > ssthresh (=65535) thus TCP
changes state to congestion avoidance. Now TCP window
growth will be much more conservative. If no segment or ack
losses are detected, the congestion window will grow no more
than one segment per roundtrip. (Compare this with geometric
growth of 1 segment per TCP ack in slow start)
Data More data is received from the client application
TCP Segment Client data is split into TCP segments
seq_num = 101024,
len = 512
TCP Segment
seq_num = 101536,
len = 512
ACK
ack_num = 102048,
window = 80000
cwnd = 65459 + [(512 * 512) / Now TCP is in congestion avoidance mode, so the TCP window
65459] = 65459 + 4 = 65463 advances very slowly. Here the window increased by only 4
bytes.
Client Net Server
Client App Client Network Server
Socket Socket
ACK
ack_num = 102560
cwnd = 512 + 512 = 1024 Since TCP is in slow start, a TCP acknowledgement results in
the window growing by one segment
Data
size = 3072
TCP Segment Six TCP segments are transmitted in the slow start mode
size = 512
TCP Segment
size = 512
TCP Segment
size = 512
Client Net Server
Client App Client Network Server
Socket Socket
TCP Segment
size = 512
TCP Segment
size = 512
TCP Segment
size = 512
delete
This sequence diagram was generated with EventStudio System Designer (http://www.EventHelix.com/EventStudio).