290 likes | 463 Views
Tutorial 9. Traffic Management at the Packet Level Cont. Fair and Weighted Fair Queuing. Problem with previous strategies. NO FAIRNESS among users. Ex: HOL queuing (high priority queues served until empty disregarding the pkts from which user). Fair Queuing.
E N D
Tutorial 9 Traffic Management at the Packet Level Cont. Fair and Weighted Fair Queuing
Problem with previous strategies • NO FAIRNESS among users. • Ex: HOL queuing (high priority queues served until empty disregarding the pkts from which user)
Fair Queuing • Each user flow has its own buffer • Ideal Case (bit by bit fair queuing) • Divide the BW equally among all non empty buffers (If total transmission capacity C bps, then each flow has C/n bps, assuming n-flows) Pkt flow 1 C/n bps Tx Link C bps Pkt flow 2 C/n bps Approximated bit level round robin service Pkt flow n C/n bps
Bit by bit fair queuing • Disadvantage: • Introduction of framing information and extensive processing at the o/p • Example: • Buffer 1: arrival at t=0, length=1 • Buffer 2: arrival at t=0, length=2 t=0 t=0
t=0 t=0 Pkt Size Both Packets are served at rate=1/2 4 3 2 Packet from buffer 2 served at rate=1 1 Time 0 1 2 3 4 5 6
Packet by Packet Fair Queuing (practical case) • Pkts are transmitted from the buffers, so the pkt completion time approximates those of an ideal fair queuing systemhow? • The completion time is derived from ideal bit by bit queuing and this number is used as a finish tag for the pkt • Next pkt to be transmitted is the one with smallest finish tag F
t=5 t=0 Calculate a finish tag for each pkt arriving at the buffers assuming ideal case t=0 t=6
- Total rounds to output pkt=3 rounds - Total time=3sec 1 round =1unit out t=5 t=5 t=0 t=0 t=0 1 round =1unit out 1 round =1unit out t=0 - Total rounds to output pkt 1=3 rounds - Total time= 5 secTotal rounds to output pkt 2=2 rounds - Total time= 4sec 1 round =1unit out 1 round =1unit out 1 round =1unit out 1 round =1unit out 1 round =1unit out
Finish Tag • For a pkt arriving at empty buffer (you have to consider a finish tag of previous pkts in buffer if it’s not empty) F(i,k)=R(t)+P(i,k) • Where, • F(i,k): finish tag of kthpkt in buffer i, arriving at time t • R(t):number of rounds at time (t)number of cycles of services that have been completed at time t (1/sum of active buffers (buffers that have pkts)) • P(i,k): pkt length Buffer i, pkt k
Finish tag-non empty buffer F(i,k)= F(i,k-1)+P(i,k) • F(i,k-1): finish tag of previous pkt in buffer I F(i,k)=max{F(i,k-1),R(t)}+P(i,k) Example Buffer 1: arrival at t=0, length=1 Buffer 2: arrival at t=0, length=2 F(1,1)=R(0)+1=1 R(0)=0 F(2,1)=R(0)+2=2 F(1,1)<F(2,1) transmit pkts from buffer 1 @ beginning t=0 t=0
t=0 t=0 Pkt Size Transmit pkt from buffer 1 @ rate=1 pkt @ buffer 2 wait 4 3 2 Packet from buffer 2 served at rate=1 1 Time 0 1 2 3 4 5 6
Problem • Pkt by pkt fair queuing system: Buffer 1: arrival @ t=0, length =2 arrival @ t=4, length =1 Buffer 2: arrival @ t=1, length=3 arrival @ t=2, length=1 Buffer 3: arrival @ t=3, length=5 The rate of the transmission link is 1 unit/sec
Pkt Size (3,1) 5 4 (2,1) 3 (1,1) 2 (2,2) (1,2) 1 Time 0 1 2 3 4 5 6 7 8 9 10 11 12
Pkt Size (3,1) 5 4 (2,1) 3 (1,1) 2 (2,2) (1,2) 1 Time 0 1 2 3 4 5 6 7 8 9 10 11 12 R(0)=0 R(1)=1 R(2)=1.5 R(3)=2.5 R(4)=3
Finish Tag Calculation R(0)=0 F(1,1)=R(0)+2=2 F(2,1)=R(1)+3=4 F(2,2)=max{F(2,1),R(2)}+1=4+1=5 F(3,1)=R(3)+5=7.5 F(1,2)=max{F(1,1),R(4)}+1=3+1=4 R(1)=1 R(2)=1.5 R(3)=2.5 R(4)=3 R(1)=R(0)+(R(t=0->t=1)=1/1)=1 R(2)=R(1)+(R(t=1>t=2)=1/2)=1.5 R(3)=R(2)+(R(t=2>t=3)=1/1)=2.5 R(4)=R(3)+(R(t=t>t=4)=1/2)=3
Weighted Fair Queuing (WFQ) • Different users have different shares of the BW • Ex: • Buffer 1: has weight 1Receives ¼ of the BW • Buffer 2: has weight 3Receives ¾ of the BW • Assume bit by bit queuing (ideal case with weights) W i=1 t=0 W i=3 t=0
W i=1 t=0 W i=3 t=0 Pkt Size Pkt from buffer 1 served @ rate=1/4 Pkt from buffer 2 served @ rate=3/4 4 3 2 Packet from buffer 1 served at rate=1 2/3 units left 1 Time 4/3 0 1 2 3 4 5 6
Finish Tag • In each round, each non empty buffer would transmit a no. of pkts proportional to its weight • F(i,k)=max{F(i,k-1),R(t)}+P(i,k)/wi • So, for previous ex: F(1,1)=R(0)+1/1=1 F(2,1)=R(0)+1/3=1/3 F(2,1)<F(1,1) Start by pkt from buffer 1 R(0)=0
W i=1 t=0 W i=3 t=0 Pkt Size Pkt from buffer 2 served @ rate=1 4 3 2 Packet from buffer 1 served at rate=1 1 Time 0 1 2 3 4 5 6
Problem • Pkt by pkt fair queuing system: Buffer 1: arrival @ t=0, length =2 arrival @ t=4, length =1 Buffer 2: arrival @ t=1, length=3 arrival @ t=2, length=1 Buffer 3: arrival @ t=3, length=5 The rate of the transmission link is 1 unit/sec W 1=2 W 2=3 W 3=5
Pkt Size (3,1) 5 4 (2,1) 3 (1,1) 2 (2,2) (1,2) 1 Time 0 1 2 3 4 5 6 7 8 9 10 11 12
Finish tag calculation R(0)=0 R(3)=1.03 R(1)=0.5 F(1,1)=R(0)+2/2=1 F(2,1)=R(1)+3/3=1.5 F(2,2)=max{F(2,1),R(2)}+1/3=max{1.5,0.7}+1/3=1.83 F(3,1)=R(3)+5/5=2.03 F(1,2)=max{F(1,1),R(4)}+1/2=1.15+0.5=1.65 • R(t) is the reciprocal of the sum of the weights of active buffers at a given time R(4)=1.15 R(2)=0.7 R(1)=R(0)+(R(t=0->t=1)=1/2)=0.5 R(2)=R(1)+(R(t=1>t=2)=1/5)=0.7 R(3)=R(2)+(R(t=2>t=3)=1/3)=1.03 R(4)=R(3)+(R(t=t>t=4)=1/10)=1.15
Pkt Size (3,1) 5 4 (2,1) 3 (1,1) 2 (2,2) (1,2) 1 Time 0 1 2 3 4 5 6 7 8 9 10 11 12 R(0)=0 R(1)=0.5 R(2)=0.7 R(3)=1.03 R(4)=1.15
Queue 1H W H1=4 Queue 2H W H2=6 Queue 1L 1 data unit/unit time W L1=1 Non-preemptive priority Queue 2L W L2=2
H(1,2) F=1.375 Pkt Size 3 F=2 L(2,2) H(1,1) 2.5 F=0.625 F=2 L(1,1) 2 L(2,1) H(2,2) F=0.75 F=1.692 1.5 H(2,1) L(1,2) F=0.4167 F=3 1 0.5 Time 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15