Configuring Priority Queuing network

Implementing priority queuing on an interface requires three steps:
1. Create a priority list that the processor will use to determine packet priority.
2. Adjust the size of the queues if desired.
3. Apply the priority list to the desired interfaces.
Let’s go over how to build a priority list by using the following commands:
priority-list list-number protocol protocol-name] {high | medium | normal | low}
queue-keyword keyword-value
priority-list list-number interface interface-type {high | medium | normal | low}
The list-number parameter identifies the specific priority list, and the valid values are
1 through 16. The protocol parameter directs the router to assign packets to the appropriate
queue based on the protocol, and protocol-name defines which protocol to match.
The queue-keyword and keyword-value parameters enable packets to be classified by
their byte count, access list, protocol port number, or name and fragmentation. With the
interface parameter, any traffic coming from the interface is assigned to the specified
queue. Next, after specifying the protocol or interface, the type of queue needs to be
defined—high, medium, normal, or low.
priority-list list-number default queue-number
The same priority-list command can be used to configure a default queue for traffic that
doesn’t match the protocols or interfaces defined in the priority list.
priority-list list-number queue-limit [high-limit [medium-limit [normal-limit
[low-limit]]]]
The queue-limit parameter is used to specify the maximum number of packets allowed
in each of the priority queues. The configuration of the queue size must be handled carefully,
because if a packet is forwarded to the appropriate queue but the queue is full, the packet will
be discarded—even if bandwidth is available. This means that enabling priority queuing on an
interface can be useless (even destructive) if queues aren’t accurately configured to respond to
actual network needs. It’s important to make the queues large enough to accommodate congestion
so that the influx of packets can be accepted and stored until they can be forwarded.
After creating the priority list, you can apply that list to an interface in interface configuration
mode with the following command:
priority-group list
The list parameter is the priority list number, from 1 to 16, to use on this interface. After
the list is applied to the interface, it is implicitly applied to outbound traffic. All packets will be
checked against the priority list before entering their corresponding queue. The ones that don’t
match will be placed in the default queue. Here’s an example:
Router_C#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router_C(config)#priority-list 1 protocol ip high gt 1000
Router_C(config)#priority-list 1 protocol ip low lt 256
Router_C(config)#priority-list 1 protocol ip normal
Router_C(config)#priority-list 1 interface serial 1 normal
Router_C(config)#priority-list 1 interface ethernet 0 high
Router_C(config)#priority-list 1 default normal
Router_C(config)#priority-list 1 queue-limit 40 80 120 160
Router_C(config)#interface serial 0
Router_C(config-if)#priority-group 1
Router_C(config-if)#^Z
Router_C#
The first line of the priority list assigns high priority to all IP traffic with a packet size greater
than (gt) 1,000 bytes. The second line assigns low priority to IP traffic with a packet size less
than (lt) 256 bytes. The third line assigns all remaining IP traffic to the normal queue. The
fourth line assigns all incoming traffic on serial 1 to the normal queue also. All incoming traffic
on Ethernet 0 is assigned a high priority, and any remaining traffic will be assigned normal priority.
The size of each queue is defined by the queue-limit parameter, and the numbers follow
the order of high, medium, normal, and low queue sizes.
Following is an example of what the interface configuration looks like. The priority list has
been assigned to the interface with the priority-group command. You can see the final form
of the applied priority list in the following configuration snippet:
!
interface Serial0
ip address 172.16.40.6 255.255.255.252
priority-group 1
!
priority-list 1 protocol ip high gt 1000
priority-list 1 protocol ip low lt 256
priority-list 1 protocol ip normal
priority-list 1 interface Serial1 normal
priority-list 1 interface Ethernet0 high
priority-list 1 queue-limit 40 80 120 160
As with access control lists, the order of a matching packet is important. A 1,500-byte packet
on Serial 0 would match the first and fourth lines, but would only be queued by the first instruction,
placing it in the high-priority queue.