210 likes | 361 Views
CENG415 – Communication Networks. Lectures 11 Principle of Congestion Control. Transport layer. We will cover Transport-layer services Multiplexing and demultiplexing Connectionless transport: UDP Principles of reliable data transfer Connection-oriented transport: TCP
E N D
CENG415 – Communication Networks Lectures 11 Principle of Congestion Control
Transport layer We will cover • Transport-layer services • Multiplexing and demultiplexing • Connectionless transport: UDP • Principles of reliable data transfer • Connection-oriented transport: TCP • segment structure • reliable data transfer • flow control • connection management • Principles of congestion control • TCP congestion control
TCP overview Congestion: • Too many sources sending too much data too fast for network to handle • different from flow control (do not overload receiver) • Manifestations & Consequences: • lost packets (buffer overflow at routers) • long delays (queuing in router buffers)
lout lin : original data unlimited shared output link buffers Host A Host B Causes / Costs of congestion: scenario 1 • Two senders, two receivers • one router, infinite buffers • no retransmission • λin: bytes/seconds average rate of arriving bytes from the application layer. • λout: bytes/seconds average rate of arriving bytes to the receiver transport layer.
lout lin : original data unlimited shared output link buffers Host A Host B Causes / Costs of congestion: scenario 1 • λin These bytes arrive once to thetransport layer. If we have retransmission, the transport layer retransmit, the application layer has nothing to do with retransmission • λoutThese bytes include all retransmission bytes
Causes / Costs of congestion: scenario 1 • C is the capacity of the link (number of bytes per second) • A is sending to be and B is sending to A • each is using C/2 Max value that can go through the link • In first graph, λoutcannot exceed C/2 • In second graph, when λinexceeds C/2, the buffering is unbounded and the waiting time is large
Causes / Costs of congestion: scenario 2 • One router, finite buffer • Sender retransmission of lost packet • always:λin= λout (goodput) Host A lout lin : original data l'in: original data, plus retransmitted data Host B finite shared output link buffers
Causes / Costs of congestion: scenario 2 Host A lout lin : original data • “perfect” retransmission only when loss: λ’in > λ out • retransmission of delayed (not lost) packet makes λ’in larger (than perfect case) for same λ out • “costs” of congestion: • more work (retransmissions) for given “goodput” • unneeded retransmissions: link carries multiple copies of pkt l'in: original data, plus retransmitted data Host B finite shared output link buffers
Host A Host B Causes / Costs of congestion: scenario 3 • four senders • multihop (multi routers) paths • timeout/retransmit • Another “cost” of congestion: • when packet dropped, any “upstream transmission capacity used for that packet was wasted! lout lin : original data l'in: original data, plus retransmitted data finite shared output link buffers
Approaches towards congestion control Two broad approaches towards congestion control: End-end congestion control: • no explicit feedback from network • congestion inferred from end-system observed loss and delay • approach taken by TCP Network-assisted congestion control: • routers provide feedback to end systems • single bit indicating congestion (SNA, DECbit, TCP/IP ECN, ATM) • explicit rate sender should send at
Transport layer We will cover • Transport-layer services • Multiplexing and demultiplexing • Connectionless transport: UDP • Principles of reliable data transfer • Connection-oriented transport: TCP • segment structure • reliable data transfer • flow control • connection management • Principles of congestion control • TCP congestion control
TCP congestion control Revision Windows: • Receiver Buffer: number of bytes that can be buffered • Receiver Window: number of bytes that can be received and buffered • Congestion window: defined by the sender according to the number of duplicate acknowledgements • What the sender can send is MIN(RcvBuffer, RcvWindow, CongWin)
CongWin rate = Bytes/sec RTT TCP congestion control - Details • sender limits transmission according to Congestion: LastByteSent-LastByteAcked CongWin • CongWin is dynamic, function of perceived network congestion How does sender perceive congestion? • loss event = timeout or 3 duplicate acks • TCP sender reduces rate (CongWin) after loss event • two mechanisms: • AIMD (additive increase, multiplicative decrease) • slow start (after RTO)
TCP congestion control - AIMD Additive increase / multiplicative decrease • Approach: increase transmission rate (window size), probing for usable bandwidth, until loss occurs • additive increase: increase CongWin by 1 MSS every RTT until loss detected • multiplicative decrease: cut CongWin in half after loss • Loss detected with 3 duplicate ACKs Lost packet (3 duplicate ACKs) congestion window size time
TCP congestion control – Slow Start • When connection begins, CongWin = 1 MSS* • Example: MSS = 500 bytes & RTT = 200 msec • initial rate = 20 kbps • available bandwidth may be >> MSS/RTT • desirable to quickly ramp up to respectable rate When connection begins, increase rate exponentially fast until first loss event (doubles every RTT) * MSS = maximum segment size (e.g.. , 1420 bytes). specified as a TCP option in SYN and SYN-ACK packets.
time TCP congestion control – Slow Start Host B Host A • When connection begins, increase rate exponentially until first loss event: • double CongWin every RTT • done by incrementing CongWin for every ACK received • Summary: initial rate is slow but ramps up exponentially fast one segment RTT two segments four segments
TCP congestion control – Slow Start • Implementation • Variable Threshold • At loss event, Threshold is set to 1/2 of CongWin just before loss event Refinement • When CongWin gets to 1/2 of its value before timeout, we switch to linear increase Congestion Window /mss “Slow Start” Transmission Round (time/rtt)
Slow Start - Refinement After timeout event: • CongWin instead set to 1 MSS; • window then grows exponentially • to a threshold, then grows linearly After 3 dup ACKs: • CongWin is cut in half • window then grows linearly “Fast Recovery” • Philosophy: • 3 dup ACKs indicates network capable of delivering some segments • timeout indicates a “more alarming” congestion scenario Congestion Window /mss “Slow Start” Transmission Round (time/rtt)
Scenario • CongWin <= Threshold: Doubles each RTT (add MSS for each MSS ACKed) • CongWin > Threshold: Adds MSS each RTT • Time Out: Threshold = 1/2 CongWin, CongWin = 1 (Slow-Start) • 3-Dup Ack: Threshold = 1/2 CongWin, CongWin = Threshold (Fast Recovery)
TCP congestion control - Summary • CongWinis below Threshold, sender in slow-start phase, window grows exponentially. • CongWinis above Threshold, sender is in congestion-avoidancephase Window grows linearly. • Three duplicate ACKoccurs Thresholdset to CongWin/2 and CongWin set to Threshold (no slow start, linear mode immediatly). • Timeout occurs Thresholdset to CongWin/2 and CongWin is set to 1 MSS.