Layer 3 quality of service

Last Updated : May 03, 2013 |

Implementing QoS on a router is more complicated than on an Ethernet switch. Unlike Ethernet switches, routers do not just have a fixed number of queues. Instead, routers have various queuing mechanisms. For example, Cisco routers have standard first-in first-out queuing (FIFO), weighted fair queuing (WFQ), custom queuing (CQ), priority queuing (PQ), and low-latency queuing (LLQ). LLQ is a combination of priority queuing and class-based weighted fair queuing (CBWFQ), and it is the preferred queuing mechanism of Cisco for real-time applications such as IP telephony. Each queuing mechanism behaves differently, is configured differently, and has its own set of queues.

First, the desired traffic must be identified using IEEE-802.1p/Q, DSCP, IP address, TCP/UDP port, or protocol. Then the traffic must be assigned to a queue in one of the queuing mechanisms. Then the queuing mechanism must be applied to an interface.

The interface itself might also require additional modifications, independent of the queuing mechanism, to make QoS work properly. For example, Cisco requires traffic shaping on Frame Relay and ATM links to help ensure that voice traffic is allotted the committed or guaranteed bandwidth. Cisco also prefers link fragmentation and interleaving (LFI) on WAN links below 768 kbps to reduce serialization delay. Serialization delay is the delay that is incurred in encapsulating a packet and transmitting the packet out of the serial interface. Serialization delay increases with packet size but decreases with WAN link size. The concern is that large low-priority packets induce additional delay and jitter, even with QoS enabled. This is overcome by fragmenting the large low-priority packets and interleaving them with the small high-priority packets, reducing the wait time for the high-priority packets. Serialization delay matrix lists serialization delay for a variety of packet sizes and line speeds. The formula for determining serialization delay is:

serialization delay = Packet size in bits/Line speed

Table 1: Serialization delay matrix

WAN line speed

Packet size

64 bytes

128 bytes

256 bytes

512 bytes

1024 bytes

1500 bytes

56 kbps

9 ms

18 ms

36 ms

72 ms

144 ms

214 ms

64 kbps

8 ms

16 ms

32 ms

64 ms

128 ms

187 ms

128 kbps

4 ms

8 ms

16 ms

32 ms

64 ms

93 ms

256 kbps

2 ms

4 ms

8 ms

16 ms

32 ms

46 ms

512 kbps

1 ms

2 ms

4 ms

8 ms

16 ms

23 ms

768 kbps

640 µs

1.28 ms

2.56 ms

5.12 ms

10.24 ms

15 ms

Because of all these configuration variables, proper implementation of QoS on a router is an important task. However, QoS is needed most on the router because most WAN circuits terminate on routers.