240 likes | 378 Vues
An Introduction to Computer Networks. Lecture 13: Queuing disciplines. University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani. Outline. Router responsibility in Network Queuing discipline FIFO Fair Queuing. Router Support For Conges. Traditional Internet
E N D
An IntroductiontoComputer Networks Lecture 13: Queuing disciplines University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Introduction to Computer Network
Outline • Router responsibility in Network • Queuing discipline • FIFO • Fair Queuing Introduction to Computer Network
Router Support For Conges. • Traditional Internet • No Congestion control initially mechanisms at end-systems, mainly implemented in TCP • Routers play little role • Router mechanisms affecting congestion management • Scheduling • Buffer management • Traditional routers • FIFO • Tail drop Introduction to Computer Network
Router Packet Processing • Scheduling: • Decide when to send a packet • Decide which packet to transmit • Buffer management: • Decide when to drop a packet • Decide which packet to drop Introduction to Computer Network
Flow 1 Flow 2 Round-robin service Flow 3 Flow 4 Queuing Discipline • First-In-First-Out (FIFO) • does not discriminate between traffic sources • Fair Queuing (FQ) • explicitly segregates traffic based on flows • ensures no flow captures more than its share of capacity • variation: weighted fair queuing (WFQ) • Problem? Introduction to Computer Network
Next to transmit Arriving packet Queued packets FIFO: First-In First-Out • Maintain a queue to store all packets • When to send? • When there is at least a packet in the queue • Which packet to send? • The packet at the head of the queue Introduction to Computer Network
Tail-drop Buffer Management • When to drop? • When buffer is full • Which packet to drop • The arriving packet Next to transmit Arriving packet Drop Introduction to Computer Network
Drawbacks of FIFO with Tail-drop • Synchronizing effect for multiple TCP flows • Buffer lock out by misbehaving flows • Burst or multiple consecutive packet drops Introduction to Computer Network
Synchronizing effect for multiple TCP flows • When buffer overflows many/all flows experience losses • Flows which experience losses will scale down their transmission (by reducing the window size) • This will cause the link to be underutilized • … the process repeats • Net result: inefficient link utilization Introduction to Computer Network
UDP UDP (#1) UDP (#1) - 10 Mbps TCP (#2) TCP (#2) . . . . . . TCP (#32) TCP (#32) Bottleneck link (10 Mbps) Buffer Lock Out by Misbehaving Flows • “Aggressive” flows can squeeze out TCP flows • Example: one 10 Mbps link shared by • 1 UDP flow that sends at 10 Mbps, and does not implement any congestion control • 31 TCP flows Introduction to Computer Network
Burst of Packet Losses • A TCP flow sends a burst of packets that arrive at a router when buffer is full • All packets in the burst are lost • This may cause RTO to trigger: cwnd 1 • For example, with TCP Reno if there are three packet losses in a window, this will almost sure trigger an RTO Introduction to Computer Network
FIFO Router with Two TCP Flows Introduction to Computer Network
RED Router with Two TCP Sessions Introduction to Computer Network
Solution? • Round-robin among different flows [Nagle ‘87] • one queue per flow Introduction to Computer Network
Round-Robin Discussion • Advantages: protection among flows • Misbehaving flows will not affect the performance of well-behaving flows • Misbehaving flow – a flow that does not implement any congestion control • FIFO does not have such a property • Disadvantages: • More complex than FIFO: per flow queue/state • Biased toward large packets – a flow receives service proportional to the length of packets (When is this bad?) Introduction to Computer Network
Solution? • Bit-by-bit round robin • Can you do this in practice? • No, packets cannot be preempted (why?) • …we can only approximate it Introduction to Computer Network
Fair Queueing (FQ) [DKS’89] • Define a fluid flow system: a system in which flows are served bit-by-bit • Then serve packets in the increasing order of their deadlines • Advantages • Each flow will receive exactly its fair rate • Work conserving Introduction to Computer Network
FQ Algorithm • Suppose clock ticks each time a bit is transmitted • Let Pi denotes the length, Si the time start to transmit and Fi denote the time when finish transmitting of packet i, then, Fi = Si + Pi • When does router start transmitting packet i? • if before router finished packet i - 1 from this flow, then immediately after last bit of i - 1 (Fi-1) • if no current packets for this flow, then start transmitting when arrives (call this Ai) • Thus: Fi = MAX (Fi - 1, Ai) + Pi Introduction to Computer Network
Implementing Fair Queueing • Idea: serve packets in the order in which they would have finished transmission in the fluid flow system Introduction to Computer Network
Flow 1 Flow 2 Flow 1 Flow 2 Output (arriving) (transmitting) Output F = 10 F = 10 F = 8 F = 5 F = 2 (a) (b) FQ Algorithm (cont) • For multiple flows • calculate Fi for each packet that arrives on each flow • treat all Fi’s as timestamps • next packet to transmit is one with lowest timestamp • Not perfect: can’t preempt current packet Introduction to Computer Network
Example Flow 1 (arrival traffic) 1 2 3 4 5 6 time Flow 2 (arrival traffic) 1 2 3 4 5 time Service in fluid flow system 1 2 3 4 5 6 1 2 3 4 5 time Packet system 1 2 1 3 2 3 4 4 5 5 6 time Introduction to Computer Network
FQ Advantages • FQ protect well-behaved flows from ill-behaved flows • Example: 1 UDP (10 Mbps) and 31 TCP’s sharing a 10 Mbps link Introduction to Computer Network
Big Picture • FQ does not eliminate congestion it just manages the congestion • You need both end-host congestion control and router support for congestion control • end-host congestion control to adapt • router congestion control to protect/isolate • Don’t forget buffer management: you still need to drop in case of congestion. Which packet’s would you drop in FQ? • one possibility: packet from the longest queue Introduction to Computer Network