|
|
|
|
|
|
Time stamps: p11 arrives, receives V(p11) = 6 ^ p12 arrives, receives V(p11) = 6 + 3 = 9 | ^ p13 arrives, receives V(p11) = 9 + 6 = 16 | | ^ | | | |--------+--------+--------+--------+--------+--------+------------> real time t=0 t=1 t=2 t=3 t=4 t=5 t=6 | | | | | V | V p12 finishes (V(p11) = 15) V p12 finishes (V(p11) = 9) p11 finishes (V(p11) = 6) Virtual time: VT(t) = 3 × t V(2)=6 V(3)=9 V(5)=15 |-----------------|--------|-----------------|--------------> virtual time |
Conclusion:
|
|
Example:
packet px finishes service packet py finishes service (Vpx = A) (Vpy = B) | | | | V V |-------+-------+-------+-------+-------+-------+-------+----------> real time |---------------|-------------------------------|------------------> virtual time VT=A VT=B |
|
Answer from Gelestani:
|
Time stamps: p11 arrives, receives V(p11) = 6 ^ p12 arrives, receives V(p11) = 6 + 3 = 9 | ^ p13 arrives, receives V(p11) = 9 + 6 = 16 | | ^ | | | |--------+--------+--------+--------+--------+--------+------------> real time t=0 t=1 t=2 t=3 t=4 t=5 t=6 | | | | | V | V p12 finishes (V(p11) = 15) V p12 finishes (V(p11) = 9) p11 finishes (V(p11) = 6) |
Graphically:
|
Let A(pji+1) = time (real time) that packet pji+1 arrives Let len(pji+1) = length (#bytes) of the packet pji+1 ---- \ 1 S(t) = > --- / wf ---- All active flows f at time real time t |
Let V(p) = time stamp of the packet p |
|
Time stamps assigned in WFQ: p11 arrives, receives V(p11) = 6 ^ p12 arrives, receives V(p11) = 3 + 3 = 6 | ^ | | | | |--------+--------+--------+--------+--------+--------+------------> real time t=0 t=1 t=2 t=3 t=4 t=5 t=6 vt=0 vt=3 |--------+ vt=3t |
Because: VT(3) = 3
Time stamps assigned in WFQ: p11 arrives, receives V(p11) = 6 ^ p12 arrives, receives V(p11) = 6 + 3 = 9 | ^ | | | | |--------+--------+--------+--------+--------+--------+------------> real time t=0 t=1 t=2 t=3 t=4 t=5 t=6 vt=6 vt=6 |-----------------+ <----- vt=6 -----> |
Because: VT(3) = 6 !!!
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 - - |
Initialization: t = 0 vt = 0 SCFQ server ---------- Last time stamp(Flow 1): 0 Last time stamp(Flow 2): 0 PacketQ: |
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 - - |
When an arrival and a departure happens "at the same time", assume that the arrival happens first
Real Time | Virt Time | Arrival | Departure | Max TS flow1 | Max TS flow2 | Queued Packets | Packet Transmitted |
---|---|---|---|---|---|---|---|
0 | 0 | --- | --- | 0 | 0 | --- | --- |
0 | 0 | Flow2,Pkt1, len=3,TS=4.5 | --- | 0 | 4.5 | Flow2,Pkt1(TS=4.5) | --- |
0+ | 4.5 | --- | --- | 0 | 4.5 | Flow2,Pkt1(TS=4.5) | Flow2,Pkt1(Fin=3) |
1 | 4.5 | Flow1,Pkt1, len=1,TS=7.5 | --- | 7.5 | 4.5 |
Flow2,Pkt1(TS=4.5)
Flow1,Pkt1(TS=7.5) |
Flow2,Pkt1(Fin=3) |
2 | 4.5 | Flow1,Pkt2, len=1,TS=10.5 | --- | 10.5 | 4.5 |
Flow2,Pkt1(TS=4.5)
Flow1,Pkt1(TS=7.5) Flow1,Pkt2(TS=10.5) |
Flow2,Pkt1(Fin=3) |
3- | 4.5 | Flow1,Pkt3, len=2,TS=16.5 | --- | 16.5 | 4.5 |
Flow2,Pkt1(TS=4.5)
Flow1,Pkt1(TS=7.5) Flow1,Pkt2(TS=10.5) Flow1,Pkt3(TS=16.5) |
Flow2,Pkt1(Fin=3) |
3 | 4.5 | --- | Flow2,Pkt1(TS=4.5) | 16.5 | 4.5 |
Flow1,Pkt1(TS=7.5)
Flow1,Pkt2(TS=10.5) Flow1,Pkt3(TS=16.5) |
--- |
3+ | 7.5(!!) | --- | --- | 16.5 | 4.5 |
Flow1,Pkt1(TS=7.5)
Flow1,Pkt2(TS=10.5) Flow1,Pkt3(TS=16.5) |
Flow1,Pkt1(Fin=4) |
4 | 7.5 | --- | Flow1,Pkt1(TS=7.5) | 16.5 | 4.5 |
Flow1,Pkt2(TS=10.5)
Flow1,Pkt3(TS=16.5) |
--- |
4+ | 10.5(!!) | --- | --- | 16.5 | 4.5 |
Flow1,Pkt2(TS=10.5)
Flow1,Pkt3(TS=16.5) |
Flow1,Pkt2(Fin=5) |
5- | 10.5 | Flow2,Pkt2, len=2,TS=13.5** | --- | 16.5 | 13.5 |
Flow1,Pkt2(TS=10.5)
Flow2,Pkt2(TS=13.5) Flow1,Pkt3(TS=16.5) |
Flow1,Pkt2(Fin=5) |
5 | 10.5 | --- | Flow1,Pkt2(TS=10.5) | 16.5 | 13.5 |
Flow2,Pkt2(TS=13.5)
Flow1,Pkt3(TS=16.5) |
--- |
5+ | 13.5(!!) | --- | --- | 16.5 | 13.5 |
Flow2,Pkt2(TS=13.5)
Flow1,Pkt3(TS=16.5) |
Flow2,Pkt2(Fin=7) |
7 | 13.5 | --- | Flow2,Pkt2(TS=13.5) | 16.5 | 13.5 | Flow1,Pkt3(TS=16.5) | --- |
7+ | 16.5(!!) | --- | --- | 16.5 | 13.5 | Flow1,Pkt3(TS=16.5) | Flow1,Pkt3(Fin=9) |
9- | 16.5 | Flow2,Pkt3, len=2,TS=19.5 | --- | 16.5 | 19.5 |
Flow1,Pkt3(TS=16.5)
Flow2,Pkt3(TS=19.5) |
Flow1,Pkt3(Fin=9) |
9 | 16.5 | --- | Flow1,Pkt3(TS=16.5) | 16.5 | 19.5 | Flow2,Pkt3(TS=19.5) | --- |
9+ | 19.5(!!) | --- | --- | 16.5 | 19.5 | Flow2,Pkt3(TS=19.5) | Flow2,Pkt3(Fin=11) |
11- | 19.5 | Flow1,Pkt4, len=2,TS=25.5 | --- | 25.5 | 19.5 | Flow2,Pkt3(TS=18) Flow1,Pkt4,(TS=25.5) | Flow2,Pkt3(Fin=11) |
11 | 19.5 | --- | Flow2,Pkt3(TS=19.5) | 25.5 | 19.5 | Flow1,Pkt4,(TS=25.5) | --- |
11+ | 25.5 | --- | --- | 25.5 | 19.5 | Flow1,Pkt4,(TS=25.5) | Flow1,Pkt4,(Fin=13) |
13 | 25.5 | --- | Flow1,Pkt4,(Fin=13) | 25.5 | 19.5 | --- | --- |
Notes:
|
In other words:
Departure time of packet p from flow k in FFS | | max. packet size | lag time ≤ -------------------- | rk V <---------------------------------->| -------------+--------------------------------------------- |<--------------------------------------------->| Possible departure times of packet p in SCFQ |
(If a packet depart before its departure time in FFS, there is no lag time)
|
So what did we gain ?
|
To find the place of insertion, SCFQ must do a binary search which has running time log(n) in the number of packets in the queue)