Mechanism of QoS and priority control

QoS/priority control mechanism/PQ

The basic mechanism of priority control is a simple mechanism that outputs packets with higher priority first.

 Packets arriving at the input interface are sorted into queues according to priority, and are output from each queue in descending order of priority.

PQ is a method of performing priority control and delivery with such a simple mechanism.

PQ (Priority Queuing)

PQ is the simplest method of priority control, and many routers have it as standard.

The waiting queues generally prepared in PQ are “top priority”, “priority”, and “other”, and packets are distributed to these queues.

 When packets are sent out from the output interface, they are searched from the queue with the highest priority, and are sent out in order from the highest priority. Doing so ensures that higher priority packets are sent out first.

However, there are drawbacks.

The problem is that packets with low priority are not sent out easily.

Low priority packets are not sent out until high priority packets have left the queue.

 If a low-priority packet is not sent for a long time, the connection will be cut even if it is TCP communication.

If even a small amount of low-priority packets are sent out, the chances of the connection dropping are low.

 Therefore, a technology called weighted queue (CQ), which has a priority control function designed to send out low-priority packets at a constant rate, has been developed.

QoS/priority control mechanism/CQ

 In PQ, low priority packets may not be sent out for a long time, and the communication connection may be disconnected. A technology called CQ, which has a priority control function designed to send low-priority packets at a constant rate, has been developed.

What is CQ (Custom Queuing)?

In CQ, queue priority is replaced with “weight” and processed. Specifically, the packets are processed as follows.

 In CQ, as with PQ, packets arriving at the input interface are sorted into queues according to their priority. At this time, the reference number (SN: sequence number) is calculated and attached to the packet.

The reference number is calculated using the formula below.

[How to calculate reference number]

(Packet length) ÷ (Priority) + (Last packet number waiting in the same queue)

*If there is no packet waiting, the reference number of the packet being processed

 For example, if the serial number of the packet currently being processed is 100 and a 1,500-byte packet arrives at a queue with a priority of 50, the serial number will be 130, which is 1,500 divided by 50 and 100 added to 30.

 After that, when a 1,300-byte packet arrives in a queue with a priority of 50, the last packet waiting in the same queue, 130, plus 26, will be the sequence number of 156.

 When sending to the output interface, the packets are taken out from each queue in ascending order of serial number. By doing so, packets with low priority will be sent out little by little.

 However, this process is complicated and places a heavy burden on the router, so some vendors’ routers are implemented with a more simplified process.

 For example, set an upper limit for each queue, and when that value is reached, send out all the packets in that queue, or simply send out packets according to the weight of priority without considering the length of the packet. There are ways to adjust the amount.

 In the case of these methods, the expected QoS effect may not be obtained unless the adjusted values ​​are set through trial and error.