CNPA B

25
1 CNPA B Nasser S. Abouzakhar Queuing Disciplines Week 8 – Lecture 2 16 th November, 2009

description

CNPA B. Nasser S. Abouzakhar Queuing Disciplines Week 8 – Lecture 2 16 th November, 2009. Content. Introduction FIFO (first-in-first-out) FQ (fair queuing). Introduction. - PowerPoint PPT Presentation

Transcript of CNPA B

Page 1: CNPA B

1

CNPA B

Nasser S. Abouzakhar

Queuing Disciplines

Week 8 – Lecture 216th November, 2009

Page 2: CNPA B

Content

Introduction FIFO (first-in-first-out) FQ (fair queuing)

2

Page 3: CNPA B

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:– allocating BW (which packets are transmitted), and– allocating buffer space (which packets get dropped).

It also affects the packets latency, by determining how long a packet waits to be transmitted.

The two common queuing algorithms are– FIFO and FQ (Fair Queuing)

3Source: Peterson & Davie, 2007 p 467

Page 4: CNPA B

FIFO Also known as FCFS (first-

come-first-served). The first packet that arrives

at a router is the first packet to be transmitted.

The router discards packets that arrive whilst the queue (buffer space) is full. This is sometimes called tail drop.

4Source: Peterson & Davie, 2007 p 468

(a) FIFO queuing (b) tail drop at a FIFO queue.

Page 5: CNPA B

FIFO, cont.

FIFO is a scheduling discipline. determines the order in which packet are transmitted.

Tail drop is a drop policy. determines which packets get dropped.

FIFO with tail drop is the simplest of all queuing algorithms and the most widely used in Internet routers.

5Source: Peterson & Davie, 2007 p 469

Page 6: CNPA B

FIFO, cont.

Priority queuing is a simple variation on basic FIFO queuing. Marks each packet with a priority. For example, the IP Type of Service (TOS) field.

The routers then implements multiple FIFO queues, one for each priority class.

The router always transmits packets out of the highest-priority queue.

Limitations: The high-priority queue can starve out all the other queues.

6Source: Peterson & Davie, 2007 p 469

Page 7: CNPA B

FIFO, cont.

The routers implement multiple FIFO queues, one for each class.– Packets with highest-priority are transmitted first.– However, the high-priority queue can dominate the front

lines hence the lower-priority queues don’t get served.– Therefore, there should be certain limits on how much

high-priority traffic is inserted in the queue.

7Source: Peterson & Davie, 2007 p 469

Page 8: CNPA B

Fair Queuing (FQ)

8

FIFO does not discriminate between different traffic sources.

FIFO does not separate packets according to the flow to which they belong.

FQ maintains a separate queue for each flow currently being handled by the router.

These queues are served by the router in a round-robin service.

Source: Peterson & Davie, 2007 p 470

Page 9: CNPA B

FQ, cont.

When a flow sends packets too quickly, then its queue fills up.

When a queue reaches a certain length, any additional packets are discarded.

Therefore, a given source cannot increase its share of the network’s capacity at the expense of the other queues.

9Source: Peterson & Davie, 2007 p 470

Round-robin service of four flows at a router.

Page 10: CNPA B

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:– If one router is managing 2 flows, one with 1000-byte

packets and the other with 500-byte packets.– A round-robin servicing packets from each flow’s queue

will give the 1st flow 2/3 of the link’s BW and the 2nd flow only 1/3 of its BW.

10Source: Peterson & Davie, 2007 p 471

Page 11: CNPA B

FQ, cont. FQ determines when a given packet would finish being

transmitted. The finishing time is used to sequence the packets for

transmission. Let Pi denote the length of packet i in bits.

Let Si denote the time when the router starts to transmit packet i.

Pi is expressed in terms of clock ticks to transmit packet i.

Let Fi denote the time when the router finishes transmitting packet i.

11Source: Peterson & Davie, 2007 p 471

iii PSF

Page 12: CNPA B

12Source: Peterson & Davie, 2007 p 472

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.

We treat all the Fi as timestamps, and the packet that has the lowest timestamp will be transmitted first.

iii PSF

Page 13: CNPA B

13Source: Peterson & Davie, 2007 p 472

FQ, cont.

It is possible that the router finished transmitting packet i – 1 long before i arrived.

This means that the round-robin mechanism could not send any packets from this flow during which the queue was empty.

If so, then let Ai denote the time that packet i arrives at the router, thus

iiiiiii PAFFAFS ,max ,max 11

Page 14: CNPA B

FQ, cont.

14Source: Peterson & Davie, 2007 p 472

(a) Packets with earlier finishing times are sent first.(b) Sending of a packet already in progress is completed.

If there is more than one flow, we calculate Fi as timestamps for each flow.

The packet with the lowest timestamp is transmitted first.

Page 15: CNPA B

Weighted Fair Queuing (WFQ)

allows a weight to be assigned to each flow (queue). specifies how many bits to send (BW) each time the router

services that queue.

Example:

a router has 3 flows (queues), one queue has a weight of 2, the second queue has a weight of 3, and the third queue has a weight of 1. Assuming that each flow always contains a packet waiting to be sent, what is the percentage of BW that is assigned to each flow?

15Source: Peterson & Davie, 2007 p 473

Page 16: CNPA B

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.

16Source: Peterson & Davie, 2007 p 473

Page 17: CNPA B

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.

17Source: Peterson & Davie, 2007 p 529

Page 18: CNPA B

Example, cont.

Packet Size Flow

1 200 1

2 200 1

3 160 2

4 120 2

5 160 2

6 210 3

7 150 3

8 90 3

18Source: Peterson & Davie, 2007 p 530

Table 1

Page 19: CNPA B

Solution

(a) Fi is the cumulative per-flow size.

Consider Ai = 0 as all packets are received at about the same time so there is no waiting.

19Source: Peterson & Davie, 2007 p 737

iii PFF 1

iiii PAFF ,max 1

Packet Size Flow Fi

1 200 1 200

2 200 1 400

3 160 2 160

4 120 2

5 160 2

6 210 3

7 150 3

8 90 3

Page 20: CNPA B

Solution, cont.

20

Packet Size Flow Fi

1 200 1 200

2 200 1 400

3 160 2 160

4 120 2 280

5 160 2 440

6 210 3 210

7 150 3 360

8 90 3 450

Page 21: CNPA B

Solution, cont.

So, packets are sent in increasing order of Fi: Packet 3, Packet 1, Packet 6, Packet 4, Packet 7, Packet 2, Packet 5, Packet 8.

21

Packet Size Flow Fi

1 200 1 200

2 200 1 400

3 160 2 160

4 120 2 280

5 160 2 440

6 210 3 210

7 150 3 360

8 90 3 450

Page 22: CNPA B

Solution, cont.

(b) Flow 1 has a weight of 2, so

Flow 2 has a weight of 4, so

Flow 3 has a weight of 3, so

22

1 / 2i i iF F P

1 / 4i i iF F P

1 / 3i i iF F P

Packet Size Flow Weighted Fi

1 200 1 100

2 200 1 200

3 160 2 40

4 120 2

5 160 2

6 210 3

7 150 3

8 90 3

Source: Peterson & Davie, 2007 p 737

Page 23: CNPA B

Solution, cont.

23

Packet Size Flow Weighted Fi

1 200 1 100

2 200 1 200

3 160 2 40

4 120 2 70

5 160 2 110

6 210 3 70

7 150 3 120

8 90 3 150

Page 24: CNPA B

Solution, cont.

So, packets are sent in increasing order of weighted Fi:

Packet 3, Packet 4, Packet 6, Packet 1, Packet 5, Packet 7, Packet 8, Packet 2.

24

Packet Size Flow Weighted Fi

1 200 1 100

2 200 1 200

3 160 2 40

4 120 2 70

5 160 2 110

6 210 3 70

7 150 3 120

8 90 3 150

Page 25: CNPA B

Reference

Computer Networks: A systems approach by Larry Peterson and Bruce Davie, published by Morgan Kaufmann (Fourth edition ISBN: 0 12 370548 7).

25