240 likes | 333 Views
Communication Networks. Recitation 4 Scheduling & Drop Policies. Queueing Basics. A queue consists of a scheduling discipline and a drop policy. input. scheduling discipline: what packet gets sent next. drop policy: what is dropped upon overflow. queued packets.
E N D
Communication Networks Recitation 4 Scheduling & Drop Policies Comnet 2010
Queueing Basics • A queue consists of a scheduling discipline and a drop policy input scheduling discipline: what packet gets sent next drop policy: what is dropped upon overflow queued packets Comnet 2010
Generalized Processor Sharing • The ideal max-min fair scheduling scheme • Visit each non-empty queue in turn • Serve infinitesimal from each • GPS is not implement able; we can serve only packets Comnet 2010
Weighted Fair Queueing Problem: We need to serve a whole packet at a time. Solution: • Determine what time a packet, p, would complete if we served flows by GPS. Call this the packet’s finish time, F(p). • Serve packets in the order of increasing finish time. Comnet 2010
WFQ Round -- Virtual Time • Round number is a real-valued variable that increases at a rate inversely proportional to the number/weight of active connections • Updating the number of connections: • A connection becomes active when a packet arrives to an empty queue • A connection becomes inactive when R(t) > F(p), where p is the last packet served Comnet 2010
A F1=1 L=1 F2=3.5 L=2 B F1=2 L=2 C F1=2 L=2 Virtual time Example 1 1/3 1/2 1/3 Comnet 2010
6 5 4 3 2 1 0 Time A1 = 4 1 1 1 1 1 1 1 1 1 1 1 1 B1 = 3 C2 = 1 C1 = 1 D1 = 1 D2 = 2 Weights : 1:1:1:1 6 5 4 3 2 1 0 D1, C1 Depart at R=1 Time A2, C3 arrive A2 = 2 A1 = 4 C1 = 1 D1 C1 B1 A1 B1 = 3 C1 = 1 C3 = 2 C2 = 1 C1 = 1 Round 1 D1 = 1 D2 = 2 Weights : 1:1:1:1 6 5 4 3 2 1 0 Time C2 Departs at R=2 C2 = 1 C1 = 1 A2 = 2 A1 = 4 D2 C2 B1 A1 D1 C1 B1 A1 B1 = 3 C2 = 1 C1 = 1 C3 = 2 C2 = 1 C1 = 1 Round 2 Round 1 D1 = 1 D2 = 2 C2 = 1 Weights : 1:1:1:1 Understanding bit by bit WFQ 4 queues, sharing 4 bits/sec of bandwidth Comnet 2010
C1 = 1 C1 = 1 C1 = 1 1 1 1 1 1 1 1 1 1 1 1 1 B1 = 3 C2 = 1 C2 = 1 C1 = 1 D1 = 1 D2 = 2 A2 = 2 A1 = 4 B1 = 3 C3 = 2 C2 = 1 C1 = 1 D1 = 1 D2 = 2 Round 2 Round 1 Round 2 Round 1 Understanding bit by bit WFQ 4 queues, sharing 4 bits/sec of bandwidth 6 5 4 3 2 1 0 Time D2, B1 Depart at R=3 A2 = 2 A1 = 4 D2 C2 B1 A1 D2 C3 B1 A1 D1 C1 B1 A1 C3 = 2 Round 3 Weights : 1:1:1:1 6 5 4 3 2 1 0 A2 Departs at R=6 C3, A1 Depart at R=4 Time D2 C2 B1 A1 A2 A2 C3 A1 D2 C3 B1 A1 D1 C1 B1 A1 6 5 Round 4 Round 3 Sort packets Weights : 1:1:1:1 6 5 4 3 2 1 0 Time Departure order for packet by packet WFQ: Sort by finish round of packets A2 = 2 A1 = 4 A2 A2 C3 C3 A 1 A 1 A1 A 1 D2 D2 B1 B1 B1 C2 D1 C1 B1 = 3 C3 = 2 C2 = 1 C1 = 1 D1 = 1 D2 = 2 Weights : 1:1:1:1 Comnet 2010
Problem with WFQ • The large discrepancy between GPS and WFQ is WFQ could provide service for a session far ahead of GPS. • This large difference will result in unstable and less efficient network control algorithms. Comnet 2010
WF2Q - Worst-Case Fair Weighted Fair Queuing • Is a packet approximation algorithm of GPS. • WF2Q provides almost identical service with GPS, the maximum difference is no more than one packet size. • Difference between WF2Q and WFQ • In a WFQ system, when the server chooses the next packet for transmission at time t, it selects among all the packets that are backlogged at t, and selects the first packet that would complete service in the corresponding GPS. • In a WF2Q system, when the server chooses the next packet at time t, it chooses only from the packets that have started receiving service in the corresponding GPS at t, and chooses the packet among them that would complete service first in the corresponding GPS. Comnet 2010
WF²Q • Packet approximation algorithm of GPS. • Choosing the packet with the smallest finish time among all the packets that have already started service in the corresponding GPS emulation. Comnet 2010
Problem with WF2Q • The time complexity of implementing WF2Q is high. Because it’s based on a virtual time function which is defined with respect to the corresponding GPS system. It leads to considerable computational complexity due to the need for simulating events in the GPS system. Comnet 2010
GPS vs. WFQ • 5 classes A, B, C, D, E • Weight 2 for class A • Weight 1 for other classes • Link speed: 1 Bps Comnet 2010
GPS vs. WFQ (cont.) • t=0 • 2x4Byte packets in A • 1x3Byte packet in B • t=1 • 1x2Byte packet in C • 1x4Byte packet in D • t=2 • 1x4Byte packet in E • 1x2Byte packet in A Comnet 2010
2/3 2/5 1/3 (T-2) 1/6 (T-2) 1/5 1/6 (T-2) 1/5 1/3 1/6 (T-2) 1/5 1/6 (T-2) GPS Simulation (4-(2/3+2/5))/(1/3) =8 4/5, 8 4/5 +2= 10 4/5 A T(A1) = 10 4/5 T(C1) = 12 4/5 B C D E 1/3 0 1 2 T Comnet 2010
Simulation (cont.) • After 12 4/5 seconds, the status of the partial transmissions is: • 2/3 Bytes of A2 (total size: 4 bytes) • 2 1/3 Bytes of B1 (total size: 3 bytes) • 2 Bytes of D1 (total size: 4 bytes) • 1 4/5 Bytes of E1 (total size: 4 bytes) • Next Packet to finish is B1 Comnet 2010
1 1/3 2/3 1/2T 2 1/3 2/3 2 1/4 T 2/3 2 1/4 T 2/3 1 4/5 GPS Simulation A T(B1) = 16 2/15 T(A2) = 20 2/15 T(D1) = 21 7/15 B C D E … 12.8 16 2/15 T Comnet 2010
Simulation (cont.) • After 21 7/15 seconds, the status of the partial transmissions is: • 2/3 Bytes of A3 (total size: 2 bytes) • 3 4/5 Bytes of E1 (total size: 4 bytes) • Next Packet to finish is E1 Comnet 2010
2/3 2/5 4 1/5 3 4/5 GPS Simulation A 14/15 T(E1) = 22 1/15 T(A3) = 23 D E … 21.47 22.07 23 Comnet 2010
WFQ • Order of packets in GPS is:A1, C1, B1, A2, D1, E1, A3 • WFQ uses the same order • Departure time is therefore:T(A1)=4 T(C1)=6 T(B1)=9T(A2)=13 T(D1)=17 T(E1)=21T(A3)=23 • In WF2Q D1 departs before A2 Comnet 2010
Solution with Virtual Time • For few events, we can use virtual time. • Virtual time gives us WFQ order without calculating GPS time. • In the example, we may ignore the events of a class getting empty, since it never refills. • V-depart = V-start + size/weight Comnet 2010
Virtual Time (cont) • Virtual time of t=0 is Vt(0)=0 • Virtual time of t=1 is Vt(1)=1/3 • Virtual time of t=2 is Vt(2)=1/3+1/5=8/15 • Departure times: • V(A1) = 0 + 4/2 = 2 • V(A2) = 2 + 4/2 = 4 • V(A3) = 4 + 2/2 = 5 Comnet 2010
Virtual Time (cont) • Departure times (cont.) • V(B1) = 0 + 3/1 = 3 • V(C1) = 1/3 + 2/1 = 2 1/3 • V(D1) = 1/3 + 4/1 = 4 1/3 • V(E1) = 8/15 + 4/1 = 4 8/15 • Order is: A1, C1, B1, A2, D1, E1, A3 Comnet 2010