Download TCP Congestion Control & Network Optimization: RTT, Avoidance & Notification and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!
ECE 8833 TCP Congestion Domain Names (DNS)^ Jan 13th
Some Reading:
-^ RFCs on web page: IP, UDP, TCP, Congestion, DNS
RTT estimate
• RTTnew
= (a)RTT
+ (1-a)RTTold
pkt
• Enhanced scheme, Van Jacobson, 1988• Uses “enhanced measurement”– Accounts for
average^ plus
variance
• RTTpkt
often measured at 500ms precision
Round Trip Timeout (RTO) • RTO = Avg + (4)Deviation – Initialized to Avg = 0, Deviation = 6 (seconds) • Retransmit after RTO, – And again at 2xRTO – And again at 4xRTO – And again at 8xRTO – And so on (doubling multiplier each time) – Until receiving an ack (or finally terminating)
TCP Windows
• Network temporarily “stores” data while intransit • Simple formula (complex implications)^ • Average bandwidth (B)^ • Average Delay (D)^ • Stored data (S)^ S = D x B^ Delay-Bandwidth Product
Delay-Bandwidth
• Bandwidth = Data/Delay^ – TCP acknowledges data sent^ – If you limit the amount of
unacknowledged
data:^ • Ie, sender quits sending when it reaches a certainnumber bytes that have not been acknowledged^ • Then: bandwidth is reduced accordingly – This is the basis of TCP congestion control
TCP bandwidth algorithm • Start with slow sending rate (small CWND) • Grow CWND for every ack – (note that as CWND exceeds packet size,multiple acks create geometric CWND growth) • When a packet is lost, slow down to ½current rate and grow “slowly” (lineargrowth)
Slow Start
• Slow Start^ – Uses congestion window (CWND)^ • Measured in bytes,^ • Incremented in segment size (MSS)^ – CWND initialized to one MSS^ • Grows by MSS for each packet that is received andacknowledged before RTO^ • Exponential growth^ – Attempting to approximate:^ • CWND = Delay x Bandwidth
Congestion Avoidance • When a “lost packet” is detected: – Set SSTHRESH = ½ min( CWND, RCVR_Win) • New variable, SSTHRESH, is “
Slow Start Threshold
”
- If “lost packet” is due to timeout, set CWND = MSS • Growing CWND on successful packet (ack):^ • Previously “add MSS to CWND for every successful packet –^ If CWND<SSTHRESH, add MSS
( Slow Start )
-^ If CWND>SSTHRESH, add 1/CWND
(Congestion Avoidance)
-^ Note that congestion avoidance is linear
growth, slow start is exponential^ growth
Fast Retransmit & Fast Recovery • More modifications (proposed 1990, VJ), “duplicate acks”^ –^ Indicates a packet was lost but later packets arrived (CWND >>MSS) ,OR packets were reordered along the way^ –^ Receiver must “ack” immediately for incorrect packet (cannot delay) • If three or more “duplicate” acks received:^ –^ “Mild” congestion, one packet was lost, others flowing …^ –^ Don’t overreact:^ • Set SSTHRESH = ½ CWND^ • Retransmit the missing packet^ • Set CWND = SSTHRESH + 3 segments^ – Add one segment to CWND for any more duplicate acks^ • On next non-duplicate ack, set CWND = SSTHRESH from above^ – Continue with normal CWND>SSTHRESH congestion avoidance
Extensions & Tricks
-^ Problems with synchronization:^ – What if queue fills up and drops many packets at thesame time^ • Causes all TCP connections to slow down at the same time^ • Network is suddenly “underutilized”^ • Solution: try to throw away a few packets before queues arecompletely full •^ In special cases:^ – Can slow one application down by throwing away itspackets more often^ – Same as giving one application more queue space ormore priority
Explicit Congestion Notification • RFC 3168 (Sept 2001):
http://www.ietf.org/rfc/rfc3168.txt
- Instead of dropping a packet, set a “congestion” bit inthe packet header^ • 1) Negotiate ECN capable sender/receiver^ – Use bit pair in
IP^ header (NOT TCP header)
- Set bit pair to 10 or 01 to indication ECN capable – Leave at 00 for not ecn capable • 2) Queues set congestion bit pair to 11 when consistently nearfull – This is a notification to the receiver that the sender-> receiverlink was full • 3) Receiver sets new bit from RESERVED field in TCP header(receiver tells sender) called ECN-Echo (ECE) • 4) Sender reacts to ECE bit in ack packet as if a packet waslost (congestion avoidance),
without resending
- Sender replies with TCP RESERVED field CWR bit to letreceiver know that it is responding to congestion