NOTE: each weight wi is normalized by R. Hence, all weights are wi < 1
wi gi = ------------------ R w1 + w1 + ... wN
Unfortunately, the packets in FFQ are scrabbled beyond recognition....
In particular, shorter packets get speedier service, which is also the case in FFQ
The scheme is a little bit involved and I will use a number of detailed example to illustrate what WFQ is doing.
Try to compute the finish times of packets transmissions in these examples:
Flow 1: FLow 2: Arrival Time Packet length Arrival Time Packet length Packet 1: 1 1 0 3 Packet 2: 2 1 5 2 Packet 3: 3 2 9 2 Packet 4: 11 2 - -
Flow 1: FLow 2: Arrival Time Finish Time Arrival Time Finish Time Packet 1: 1 3 0 5 Packet 2: 2 5 5 9 Packet 3: 3 9 9 11 Packet 4: 11 13 - -
Flow 1: FLow 2: Arrival Time Finish Time Arrival Time Finish Time Packet 1: 1 4 0 4 Packet 2: 2 5 5 8 Packet 3: 3 9 9 11 Packet 4: 11 13 - -
Hence, packets arrive "instantaneously" at a router, just like the assumption in GPS...
Packet transmission order:
packets present: (Flow 2, Packet 1, Fin Time = 5).
Selected: (Flow 2, Packet 1)
Note: eventhough (Flow 1, packet 1) has smaller finish time,
this packet is not present at time 0, so (Flow 2, Packet 1) gets selected
Time 0-3: transmits (Flow 2, Packet 1)
packets present: (Flow 1, packet 1, Fin Time = 3),
(Flow 1, packet 2, Fin Time = 5)
Selected: (Flow 1, Packet 1)
Time 3-4: transmits (Flow 1, Packet 1)
packets present: (Flow 1, packet 2, Fin Time = 5)
Selected: (Flow 1, Packet 2)
Time 4-5: transmits (Flow 1, Packet 2)
packets present: (Flow 1, packet 3, Fin Time = 9),
(Flow 2, packet 2, Fin Time = 9)
Selected: a tie, just pick one - (Flow 1, Packet 3)
Time 5-7: transmits (Flow 1, Packet 3)
packets present: (Flow 2, packet 2, Fin Time = 9)
Selected: (Flow 2, Packet 2)
Time 7-9: transmits (Flow 2, Packet 2)
packets present: (Flow 2, packet 3, Fin Time = 11)
Selected: (Flow 2, Packet 3)
Time 9-11: transmits (Flow 2, Packet 3)
packets present: (Flow 1, packet 4, Fin Time = 13)
Selected: (Flow 1, Packet 4)
Time 11-13: transmits (Flow 1, Packet 4)
This is a very strong result, because 1 packet difference is also the best you can do (to get 0 packet difference you will need to transmit packets non-atomically as in GPS - so 1 is the best you can do)
Note: a flow is active is it has some packet waiting in the router to be transmitted.
In the "normal" earth time, the rate of increase in time value (or the speed of the clock) is contant - (look at your watch, the second hand jumps ahead very regularly).
Parekh defines a clock that has rate of increase (or the speed of the clock) that is different at different situations - if you are a fan of relativity theory or had the opportunity to travel near the speed of light, you will delight in this discussion....
(It makes sence, before the first packet arrival, the system is idle and we do not to do any time keeping exercise.)
x VT(tj-1 + x) = VT(tj-1) + ---------------- sum_{i in Bj} wi(Recall that Bj is the set of active flows in the event interval (tj-1, tj).
The following figure shows the advancement of the virtual time clock in the packet transmission example 1:
The following figure shows the advancement of the virtual time clock in the packet transmission example 2:
Length of packet of flow i Normalize packet length of flow i = -------------------------- wi
The following figure shows the advancement of the virtual time clock along with the normalized packet length in example 1:
Notice that the difference of the ending virtual time and the starting virtual time of every packet is equal to the normalized length of that packet !
The following figure shows the advancement of the virtual time clock in the packet transmission example 2:
Notice again that the difference of the ending virtual time and the starting virtual time of every packet is equal to the normalized length of that packet !
x VT(tj-1 + x) = VT(tj-1) + ---------------- sum_{i in Bj} wiThus, for every x units of real time, the virtual time increases by x/sum_{i in Bj} wi
The data transmission rate received by flow k
is equal to:
wk
----------------
sum_{i in Bj} wi
So in x units of real time, the router has
has transmitted this amount of data from flow k:
wk
---------------- x
sum_{i in Bj} wi
In x/sum_{i in Bj} wi units
of virtual time, the router has transmitted
wk
---------------- x
sum_{i in Bj} wi
amount of data, so the "virtual transmission data rate" is equal to:
wk units per virtual time unit.
Notice this is constant no matter how many flows are active !!!
L ----- wkAnd this is the behavior you see in the plots above...
Lji V(pji) = max(VT(t), V(pji - 1)) + ----- wjwhere VT(t) is the value of the virtual time clock at the (arrival time) t.
So, a flow may be active at a certain time while there are no packets in the system !
For example, during the interval [3,5], flow 2 is active. But packet 1 of flow 2 has already departed from the system at time 3 !
But since packet 1 of flow 2 has a virtual finish time of 6, flow 2 "remains" active until virtual time 6 (which is real time 5).