Professional Documents
Culture Documents
Cnpa B: Nasser S. Abouzakhar
Cnpa B: Nasser S. Abouzakhar
Nasser S. Abouzakhar
Queuing Disciplines
Week 8 Lecture 2
16th November, 2009
Content
Introduction
FIFO (first-in-first-out)
FQ (fair queuing)
Introduction
Each router must implement some queuing discipline
that governs how packets are buffered while waiting
to be transmitted.
The queuing algorithm can be thought of as:
FIFO
FIFO, cont.
FIFO, cont.
The high-priority queue can starve out all the other queues.
Source: Peterson & Davie, 2007 p 469
FIFO, cont.
FQ, cont.
FQ, cont.
The packets being processed at a router may not
have the same length.
To allocate the BW of outgoing link in a fair manner,
packets length is taken into account.
Example:
10
FQ, cont.
11
FQ, cont.
Routers often have more than one active flow i.e. has
data in the queue.
We calculate Fi for each packet that arrives using the
above formula.
Fi Si Pi
12
FQ, cont.
If so, then let Ai denote the time that packet i arrives at the
router, thus
Si max Fi 1 , Ai Fi max Fi 1 , Ai Pi
Source: Peterson & Davie, 2007 p 472
13
FQ, cont.
14
15
WFQ, cont.
Solution
The first flow will get 1/3 of the available BW.
The second flow will get of the available BW.
The third flow will get 1/6 of the available BW.
16
Example
Suppose a router has 3 input flows and one output. It
receives the packets listed in Table 1 all at about the same
time, in the order listed, during a period in which the output
port is busy but all queues are otherwise empty. Give the
order in which the packets are transmitted, assuming:
(a) Fair queuing.
(b) Weighted fair queuing with flow 1 having a weight of 2,
flow 2 having twice as much share as flow 1, and flow 3
having 1.5 times as much share as flow 1. Note that ties are
to be resolved in order flow 1, flow 2, flow 3.
17
Example, cont.
Packet
Size
Flow
200
200
160
120
160
210
150
90
Table 1
18
Solution
(a) Fi is the cumulative per-flow size.
Fi max Fi 1 , Ai Pi
Consider Ai = 0 as all packets are
received at about the same time so
there is no waiting.
Fi Fi 1 Pi
Packet
Size
Flow
Fi
200
200
200
400
160
160
120
160
210
150
90
19
Solution, cont.
Packet
Size
Flow
Fi
200
200
200
400
160
160
120
280
160
440
210
210
150
360
90
450
20
Solution, cont.
Packet
Size
Flow
Fi
200
200
200
400
160
160
120
280
160
440
210
210
150
360
90
450
21
Solution, cont.
(b) Flow 1 has a weight of 2, so
Fi Fi 1 Pi / 2
Flow 2 has a weight of 4, so
Fi Fi 1 Pi / 4
Flow 3 has a weight of 3, so
Packet
Size
Flow
Weighted Fi
200
100
200
200
160
40
120
160
210
150
90
Fi Fi 1 Pi / 3
22
Solution, cont.
Packet
Size
Flow
Weighted Fi
200
100
200
200
160
40
120
70
160
110
210
70
150
120
90
150
23
Solution, cont.
Packet
Size
Flow
Weighted Fi
200
100
200
200
160
40
120
70
160
110
210
70
150
120
90
150
24
Reference
25