ECN
By dropping packets, WRED alleviates the influence of congestion on the network. However, the network resources for transmitting packets from the sender to the device which drops the packets are wasted. When congestion occurs, it is a better idea to perform the following actions:
Inform the sender of the congestion status.
Have the sender proactively slow down the packet sending rate or decrease the window size of packets.
This better utilizes the network resources.
RFC 2482 defined an end-to-end congestion notification mechanism named Explicit Congestion Notification (ECN). ECN uses the DS field in the IP header to mark the congestion status along the packet transmission path. An ECN-capable terminal can determine whether congestion occurs on the transmission path according to the packet contents. Then, it adjusts the packet sending speed to avoid deteriorating congestion. ECN defines the last two bits (ECN field) in the DS field of the IP header as follows:
Bit 6 indicates whether the sending terminal device supports ECN, and is called the ECN-Capable Transport (ECT) bit.
Bit 7 indicates whether the packet has experienced congestion along the transmission path, and is called the Congestion Experienced (CE) bit.
For more information about the DS field, see "Appendixes."
In actual applications, the following packets are considered as packets that an ECN-capable endpoint transmits:
Packets with ECT set to 1 and CE set to 0.
Packets with ECT set to 0 and CE set to 1.
After you enable ECN on a device, congestion management processes packets as follows:
When the average queue size is below the lower threshold, no packet is dropped, and the ECN fields of packets are not identified or marked.
When the average queue size is between the lower threshold and the upper threshold, the device performs the following operations:
Picks out packets to be dropped according to the drop probability.
Examines the ECN fields of these packets and determines whether to drop these packets.
If the ECN field shows that the packet is sent out of ECN-capable terminal, the device performs the following operations:
Sets both the ECT bit and the CE bit to 1.
Forwards the packet.
If both the ECT bit and the CE bit are 1 in the packet, the device forwards the packet without modifying the ECN field. The combination of ECT bit 1 and CE bit 1 indicates that the packet has experienced congestion along the transmission path.
If both the ECT bit and the CE bit is 0 in the packet, the device drops the packet.
When the average queue size exceeds the upper threshold, the device drops the packet, regardless of whether the packet is sent from an ECN-capable terminal.
The switch supports enabling ECN on a per-queue basis.