Configuring Congestion Avoidance
Context
The switch uses tail drop to prevent congestion. When the length of a queue reaches the maximum value, all the packets last added to the queue (at the tail of the queue) are discarded. You can set the maximum number of bytes or packets to be cached in a queue to prevent traffic loss.
Before setting the maximum number of bytes or packets to be cached in a queue, run the shutdown command to shut down the interface. After the maximum number of bytes or packets to be cached in a queue is set, run the undo shutdown command to enable the interface. These operations may cause network interruption in a short period of time.
Procedure
Run:
system-view
The system view is displayed.
Run:
qos tail-drop-profile profile-name
A tail drop profile is created and its view is displayed.
Run the following commands as required.
Set the maximum number of bytes or packets to be cached in a queue.
Run:
qos queue queue-index max-buffer cell-number [ green max-buffer cell-number ]
The maximum number of bytes to be cached in a queue is set.
Run:
qos queue queue-index green max-buffer cell-number
The maximum number of bytes to be cached in a queue is set.
Run:
qos queue queue-index max-length packet-number [ green max-length packet-number ]
The maximum number of packets to be cached in a queue is set.
Run:
qos queue queue-index green max-length packet-number
The maximum number of packets to be cached in a queue is set.
If the maximum number of bytes or packets is reached, the device considers that congestion occurs and will discard subsequent packets.
Run:
quit
Return to the system view.
Run:
interface interface-type interface-number
The interface view is displayed.
Run:
shutdown
The interface is shut down.
Run:
qos tail-drop-profile profile-name
The tail drop profile is applied to the interface.
Run:
undo shutdown
The interface is restarted.
Checking the Configuration
Run the display qos configuration interface interface-type interface-number command to check all the QoS configurations on the interface.
Run the display qos queue statistics interface interface-type interface-number [ queue queue-index ] command to check the queue-based traffic statistics on the interface.