QoS/bandwidth control

QoS/bandwidth control

Bandwidth control refers to technology that allocates or limits bandwidth for each type of packet.

 By using CQ explained in priority control, it is possible to allocate bandwidth according to packet weight. For example, if the bandwidth of the egress interface is 100Mbps, and you assign weights of 70:20:10, you can assign 70Mbps, 20Mbps, and 10Mbps respectively.

However, as shown in the above figure, when the bandwidth of the input interface and the output interface is the same 100Mbps.

 If the input interface and output interface have the same bandwidth, there is no problem, but if the input interface is 100Mbps and the output interface is 10Mbps as shown in the figure below, a problem will occur.

The narrow bandwidth of the egress interface causes heavy congestion at the egress.

 To avoid this phenomenon, there is a function to control the amount of packets flowing in each waiting queue. This feature is called policing.

Controls how much queued packets are pushed out to avoid consuming more bandwidth than the configured limit.

 Ultimately, however, even with this policing function, the narrow bandwidth of the egress interface causes the queue to fill up quickly and overflow.

The problem with this is that packets keep piling up in the wait queue.

 If the bandwidth of the output interface is smaller than the bandwidth of the input interface, even if the policing function restricts the exit bandwidth, packets will continue to accumulate in the waiting queue.

Packets are discarded when the router can no longer store them.

This is not the only problem.

 In communication using TCP, retransmission control is performed for packets that have not been delivered to the destination, and packets flood the router again.

 On the other hand, in communication using UDP, even if packets are discarded on the way, packets are sent one-sidedly regardless, so packets will flood the router.

Falling into such a situation will cause packets to accumulate in the router no matter how long it takes, creating a vicious circle.

RED (Random Early Detection)

 To avoid such a situation, there is a technology called RED (Random Early Detection) that randomly discards packets when a certain amount of packets accumulate in the waiting queue.

 By appropriately discarding packets, TCP communication adjusts the bandwidth used for TCP connections by telling the sending terminal to send fewer packets from the other terminal.

 This TCP bandwidth adjustment is called flow control. Specifically, the amount of data flowing is controlled by communicating while adjusting the window size value in the TCP header.

 Congestion is alleviated by such flow control in TCP communication, but in the case of UDP, there is no mechanism like flow control.

UDP communication does not have flow control, so packets will continue to flood the router.

WRED (Weighted Random Early Detection)

 In priority control, there is a technology that distributes packets to waiting queues according to their priority. There is also a technology that can control the number of discarded packets for each waiting queue according to the priority of packets, even for bandwidth limitation.

This technology is called WRED (Weighted Random Early Detection).

 RED is a technology that randomly discards packets so that the waiting queue does not fill up with packets, but with WRED, packets can be discarded according to their priority. This is where WRED excels over RED.

 In WRED, even if packets are accumulated in the wait queue, the threshold should be set low so that packets are discarded from the low priority wait queue without discarding the packets from the high priority wait queue as much as possible. , you can preferentially discard packets.

 Then, if it becomes impossible to deal with only the cancellation from the low-priority wait queue, it will be discarded from the high-priority queue.

 However, even if packets are discarded by this method, the bandwidth is adjusted by notifying the terminal of the communication partner to reduce the amount of packets sent by the terminal of the communication partner in TCP communication, but in the case of UDP Since there is no flow control, packets are still flooding the router.

 In order to avoid such a situation, some routers can control packets to be discarded more finely according to TCP or UDP communication.

By discarding a large number of UDP packets that are sent in large quantities, you can avoid situations where UDP communication is advantageous.

So far we’ve talked about bandwidth control, but it’s not without its problems.

 Flow control works in TCP communication, and when congestion occurs, the window size decreases and the amount of packets sent to the router decreases. Packets will be flooded.

As a device to avoid this problem, there is a device called a band control device.

 The bandwidth control device adjusts the bandwidth by rewriting the value of the window size, which is the content of the TCP packet that passes through the router.