[Network] 3.7 TCP Congestion Control

0

Network

목록 보기
4/6

3.7.1 Classic TCP Congestion Control

  • Approach taken by TCP was to limit the sending rate by perceiving the network congestion level. This approach raises 3 questions.
    1. How does TCP limit the rate which it sends into its connection?
    2. How does TCP sender perceive that there is a congestion?
    3. What algorithm should sender use to change send rate as funciton of congestion? changeSendingRate(float congestionLevel)

TCP sender keeps track of congestion window (cwnd). Amount of unacked data at sender cannot exceed the minumum of cwnd, and rwnd

Assume receive buffer is large so rwnd can be ignored. Also ignore loss and packet transmission delays.

💡 *Thus the sender’s send rate is roughly cwnd/RTT bytes/sec. By adjusting the value of* cwnd*, the sender can therefore adjust the rate at which it sends data into its connection.*

Then how does it preceive congestion? When there is excessive congestion, loss event (timeout or three dupe ACKs) will occur from router buffers overflowing along the path.

💡 The dropped datagram, in turn, results in a loss event at the sender—either a timeout or the receipt of three duplicate ACKs—which is taken by the sender to be an indication of congestion on the sender-to-receiver path.

When network is congestion free (no loss event), acknowledgements from succssful delivery of the segments will be used as an indication to increase the cwnd → increase the transmission rate.

If ACKs arrive at slow rate, cwnd will increase slowly. vice versa.

💡 TCP usesACKs to trigger(clock) increase/decrease cwnd, it is called self-clocking.

TCP uses three principles to decide sendrate

  • Lost segment implies congestion, so decerase rate when segment is lost.
  • ACK segment means successful delivery so rate can be increased.
  • Bandwidth probing: increase send rate in response with ACK until loss occurs. Then decrease rate.

Note that these are all implicit signals and TCP senders acts on local information asynchronously from other TCP senders.

TCP congestion-control algorithm

The algorithm has three major componenets: slow start, congestion avoidance, and fast recovery. Slow start and congestion avoidance is required for TCP sender to control cwnd size. Despite its name, slow start increases cwnd more rapidly than congestion avoidance. Fast recovery is recommended but not required.

Slow Start

CWND is initially 1 MSS, so send rate is MSS/RTT.

Example: MSS = 500bytes, RTT = 200ms, send rate is roughly 20kbps.

Since bandwidth is much larger, MSS is doubled each time.

Starts at 1MSS, then increases

The exponential growth stops when there is loss event indicated by timeout. Then cwnd is reset to 1 and set the second state variable ssthresh to cwnd/2.

Also ss stops when cwnd == ssthresh, then enter congestion avoidance.

Also ss stops when TCP performs fast retransmit(3 duplicate ACKS) and enters fast recovery state.

Congestion Avoidance

Since entry of CA means congestion is close, cwnd is only increased by 1MSS. Commonly cwnd is increased by MSS bytes every new ACK arrives.

Example: MSS = 1460, cwnd = 14,600, 10segments per RTT, each ACK will increase cwnd by 1/10MSS. So all 10 returning will increase 1 MSS.

CA algorithm behaves same as SS when timeout occurs: cwnd = 1 MSS, ssthresh = cwnd/2.

But when loss occurs by triple duplicate ACK (not timeout), network is continuing to deliver some segments from sender so it is less drastic then a timeout-indicated loss. →

In this case, cwnd/2 + 3 MSS and ssthresh /= 2 , then enter fast-recovery state.

0개의 댓글