Presentation on theme: "1 CNPA B Nasser S. Abouzakhar Queuing Disciplines Week 8 – Lecture 2 16 th November, 2009."— Presentation transcript:
1 CNPA B Nasser S. Abouzakhar Queuing Disciplines Week 8 – Lecture 2 16 th November, 2009
Content F Introduction F FIFO (first-in-first-out) F FQ (fair queuing) 2
Introduction F Each router must implement some queuing discipline that governs how packets are buffered while waiting to be transmitted. F The queuing algorithm can be thought of as: –allocating BW (which packets are transmitted), and –allocating buffer space (which packets get dropped). F It also affects the packets latency, by determining how long a packet waits to be transmitted. F The two common queuing algorithms are –FIFO and FQ (Fair Queuing) 3 Source: Peterson & Davie, 2007 p 467
FIFO F Also known as FCFS (first- come-first-served). F The first packet that arrives at a router is the first packet to be transmitted. F The router discards packets that arrive whilst the queue (buffer space) is full. This is sometimes called tail drop. 4 Source: Peterson & Davie, 2007 p 468 (a) FIFO queuing (b) tail drop at a FIFO queue.
FIFO, cont. F FIFO is a scheduling discipline. F determines the order in which packet are transmitted. F Tail drop is a drop policy. F determines which packets get dropped. F FIFO with tail drop is the simplest of all queuing algorithms and the most widely used in Internet routers. 5 Source: Peterson & Davie, 2007 p 469
FIFO, cont. F Priority queuing is a simple variation on basic FIFO queuing. F Marks each packet with a priority. F For example, the IP Type of Service (TOS) field. F The routers then implements multiple FIFO queues, one for each priority class. F The router always transmits packets out of the highest- priority queue. F Limitations: F The high-priority queue can starve out all the other queues. 6 Source: Peterson & Davie, 2007 p 469
FIFO, cont. F 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. 7 Source: Peterson & Davie, 2007 p 469
Fair Queuing (FQ) 8 F FIFO does not discriminate between different traffic sources. F FIFO does not separate packets according to the flow to which they belong. F FQ maintains a separate queue for each flow currently being handled by the router. F These queues are served by the router in a round-robin service. Source: Peterson & Davie, 2007 p 470
FQ, cont. F When a flow sends packets too quickly, then its queue fills up. F When a queue reaches a certain length, any additional packets are discarded. F Therefore, a given source cannot increase its share of the network’s capacity at the expense of the other queues. 9 Source: Peterson & Davie, 2007 p 470 Round-robin service of four flows at a router.
FQ, cont. F The packets being processed at a router may not have the same length. F To allocate the BW of outgoing link in a fair manner, packets length is taken into account. F 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 2 nd flow only 1/3 of its BW. 10 Source: Peterson & Davie, 2007 p 471
FQ, cont. F FQ determines when a given packet would finish being transmitted. F The finishing time is used to sequence the packets for transmission. F Let P i denote the length of packet i in bits. F Let S i denote the time when the router starts to transmit packet i. F P i is expressed in terms of clock ticks to transmit packet i. F Let F i denote the time when the router finishes transmitting packet i. 11 Source: Peterson & Davie, 2007 p 471
12 Source: Peterson & Davie, 2007 p 472 FQ, cont. F Routers often have more than one active flow i.e. has data in the queue. F We calculate F i for each packet that arrives using the above formula. F We treat all the F i as timestamps, and the packet that has the lowest timestamp will be transmitted first.
13 Source: Peterson & Davie, 2007 p 472 FQ, cont. F It is possible that the router finished transmitting packet i – 1 long before i arrived. F 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 A i denote the time that packet i arrives at the router, thus
FQ, cont. 14 Source: 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 F i as timestamps for each flow. F The packet with the lowest timestamp is transmitted first.
Weighted Fair Queuing (WFQ) F allows a weight to be assigned to each flow (queue). F specifies how many bits to send (BW) each time the router services that queue. F 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? 15 Source: Peterson & Davie, 2007 p 473
WFQ, cont. F 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 Source: Peterson & Davie, 2007 p 473
Example F 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 Source: Peterson & Davie, 2007 p 529
Solution (a) F i is the cumulative per-flow size. Consider A i = 0 as all packets are received at about the same time so there is no waiting. 19 Source: Peterson & Davie, 2007 p 737 PacketSizeFlowFiFi 12001 2 1400 31602 41202 51602 62103 71503 8903
Solution, cont. F So, packets are sent in increasing order of F i : Packet 3, Packet 1, Packet 6, Packet 4, Packet 7, Packet 2, Packet 5, Packet 8. 21 PacketSizeFlowFiFi 12001 2 1400 31602 41202280 51602440 62103 71503360 8903450
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 PacketSizeFlowWeighted F i 12001100 22001 3160240 41202 51602 62103 71503 8903 Source: Peterson & Davie, 2007 p 737
Solution, cont. 23 PacketSizeFlowWeighted F i 12001100 22001 3160240 4120270 51602110 6210370 71503120 8903150
Solution, cont. F So, packets are sent in increasing order of weighted F i : F Packet 3, Packet 4, Packet 6, Packet 1, Packet 5, Packet 7, Packet 8, Packet 2. 24 PacketSizeFlowWeighted F i 12001100 22001 3160240 4120270 51602110 6210370 71503120 8903150
Reference F Computer Networks: A systems approach by Larry Peterson and Bruce Davie, published by Morgan Kaufmann (Fourth edition ISBN: 0 12 370548 7). 25