Advanced Computer Networks CS716 Advanced Computer Networks By Dr. Amir Qayyum 1
Lecture No. 37
Congestion Control Basics: problem, terminology, approaches, metrics Solutions Router-based: queuing disciplines Host-based: TCP congestion control Router-based congestion avoidance DECbit RED gateways Quality of service
Router-based Congestion Avoidance
DECbit: Destination Experiencing Congestion bit Developed for Digital Network Architecture Basic idea One bit allocated in packet header Any router experiencing congestion sets bit Destination returns bit to source Source adjusts rate based on bits Note that responsibility is shared Routers identify congestion Hosts act to avoid congestion
DECbit (continued) Routers Calculate average queue length Averaging interval spans last busy+idle cycles busy: queue is non-empty idle: queue is empty Set DECbit when: average queue length >= 1 Why 1? Maximizes power function Smaller values result in more idle time Larger values result in more queuing delay
DECbit – Average Queue Length
DECbit (continued) Hosts Count number of marked packets in last congestion window of packets Increase congestion window by 1 if less than 50% of packets marked Decrease congestion window by factor of 7/8 if greater than or equal to 50% of packets marked Why 50%? Maximizes power function Resurfaced as Explicit Congestion Notification (ECN) in last few years, proposed TCP extension
Congestion Control Basics: problem, terminology, approaches, metrics Solutions Router-based: queuing disciplines Host-based: TCP congestion control Router-based congestion avoidance DECbit RED gateways Quality of service
Random Early Detection (RED) Gateways Developed for use with TCP Basic idea Implicit rather than explicit notification When a router is “almost” congested Drop packets randomly Responsibility is again shared Router identifies, host acts Relies on TCP’s response to dropped packets
Weighted Running Average Queue length
Random Early Detection (RED) Gateways Hosts Implement TCP congestion control Back off when a packet is dropped Routers calculate average queue length (as exponential moving average) length = (A) measurement + (1 – A) length Routers act based on average queue length Below minimum length, keep new packets Above maximum length, drop new packets Between the two, drop randomly
RED Thresholds on a FIFO Queue
Drop Probability Function for RED
Random Early Detection (RED) Gateways Router drop probability depends on two factors Relation of average queue length to bounds Number of packets (count) since Last drop, or Length outside random drop range
Random Early Detection (RED) Gateways Router calculates Base probability for drop: baseProb = MaxP × (length – minThresh) /(maxThresh – minThresh) Actual probability for drop prob = baseProb / (1 – baseProb × count)
Random Early Detection (RED) Gateways Parameter values MaxP is typically 0.02 (drops roughly 1 in 50 packets at midpoint) min (threshold) is typically max/2 Choosing parameters Carefully tuned to maximize power function Confirmed through simulation But answer depends on accuracy of traffic model May create oscillating behavior in the Internet
Tuning the RED Gateways Drops roughly in proportion to flow bandwidths Queue size changes Due to difference in input/output rates Not related absolute magnitude of those rates min must allow reasonable link utilization Difference between min and max thresholds Large enough to absorb burstiness In practice, can use max = 2 × min Use penalty box for offenders!
Host-based Congestion Avoidance
TCP Vegas – Basic Idea Watch for signs of queue growth In particular, difference between Increasing congestion window Stable throughput (presumably at maximum capacity) Keep just enough “extra data” in the network Time to react if bandwidth decreases Data available if bandwidth increases
Trace of TCP Vegas Congestion Avoidance Mechanism
TCP Vegas - Implementation Estimate un-congested RTT, baseRTT, as minimum measured RTT Calculate expected throughput as congestion window / baseRTT Measure throughput each RTT Mark time of sending distinguished packet Calculate data sent between send time and receipt of ACK
TCP Vegas - Implementation Act to keep the difference between estimated and actual throughput in a specified range Below min threshold, increase congestion window Above max threshold, decrease congestion window Additive decrease used only to avoid congestion Want between 1 and 3 packets of extra data (used to pick min/max thresholds)
Congestion Control & Resource Allocation Basics: problem, terminology, approaches, metrics Solutions Router-based: queuing disciplines Host-based: TCP congestion control Router-based congestion avoidance DECbit RED gateways Quality of service
Quality of Service Outline Realtime Applications Integrated Services Differentiated Services
Quality of Service How “good” are late data and low-throughput channels? It depends on the application. Do you care if... your e-mail takes 1/2 hour to reach your friend? you have to spend 1/2 hour to make a cheaper plane reservation on the Web? your call to Rescue-15 takes 1/2 hour to go through your nifty new IP phone service?
Quality of Service High-throughput allows new classes of applications Some are sensitive to network delay, e.g. voice, video Called real-time applications Control applications (e.g. factories) More an issue of possible starvation (see below) But fit within QoS framework
Quality of Service How to achieve timely delivery When actual RTT small (less than 2/3) relative to acceptable delay, retransmit When base RTT (no queuing delay) large (greater than 2) relative to acceptable delay, impossible Otherwise possible, but not through retransmission
Quality of Service Within the United States, for example Base RTT (no queuing delay) peaks around 75 ms Actual RTT is often 10-100 ms Humans notice about 50 ms delay for voice When in comparable regime, retransmission cannot satisfy, so... Use erasure codes across packets (e.g. FEC) , or Support delay preferences in the network, called quality of service, or QoS
QoS Granularity Fine-grained: guarantees for individual flows, used in RSVP and ATM virtual circuits between applications Coarse-grained: guarantees for flow, used in DIFFSERV and ATM VC’s between routers IETF is standardizing extensions …
Real Time Applications Require “deliver on time” assurances Must come from inside the network Example application (audio) Sample voice once every 125µs Each sample has a playback time Packets experience variable delay in network Add constant factor to playback time: playback point Microphone Speaker Sampler A D converter Buffer D A