APPARATUS AND METHOD FOR MANAGING NETWORK FLOW CONGESTION
20230269187 ยท 2023-08-24
Inventors
Cpc classification
H04L47/129
ELECTRICITY
H04L47/196
ELECTRICITY
H04L47/30
ELECTRICITY
H04L47/27
ELECTRICITY
International classification
Abstract
An apparatus and a method for managing network flow congestion are provided. The method for managing network flow congestion includes: receiving a plurality of packets; identifying whether each packet belongs to a predetermined protocol; distinguishing a plurality of connections of the packets belonged to the predetermined protocol; monitoring a buffer usage of each different connections; and performing a congestion check procedure on the currently monitored connection. In the congestion check procedure, when the buffer usage of the currently monitored connection exceeds a threshold, a congestion processing procedure is triggered.
Claims
1. A method for managing network flow congestion, comprising: receiving a plurality of packets; identifying whether each packet belongs to a predetermined protocol; distinguishing a plurality of connections of the packets belonged to the predetermined protocol; monitoring a buffer usage of each different connections; and performing a congestion check procedure on the currently monitored connection, wherein in the congestion check procedure, when the buffer usage of the currently monitored connection exceeds a threshold, a congestion processing procedure is triggered.
2. The method for managing network flow congestion according to claim 1, further comprising: determining whether to perform the congestion check procedure according to a remainder of the buffer corresponding to the currently monitored connection and a congestion indication threshold.
3. The method for managing network flow congestion according to claim 1, wherein the threshold is a mark threshold, and the congestion processing procedure is to set a CE (Congestion Experienced) code point in the packet corresponding to the currently monitored connection.
4. The method for managing network flow congestion according to claim 3, wherein an ECE flag is set to a TCP ACK packet and the TCP ACK packet is sent back to a transmit end.
5. The method for managing network flow congestion according to claim 4, wherein a size of a congestion window in the transmit end is reduced according to the ECE flag of the TCP ACK packet.
6. The method for managing network flow congestion according to claim 3, wherein the mark threshold is dynamically reduced as the number of connections increases.
7. The method for managing network flow congestion according to claim 1, wherein the threshold is a drop threshold, and the congestion processing procedure is to drop the packet corresponding to the currently monitored connection.
8. The method for managing network flow congestion according to claim 1, further comprising: checking a FIN flag and a RST flag of each of the packets, and canceling the monitoring of the buffer usage corresponding to the connection when the FIN flag or the RST flag is set.
9. The method for managing network flow congestion according to claim 1, wherein the predetermined protocol comprises a transmission control protocol (TCP).
10. The method for managing network flow congestion according to claim 1, wherein the packet, which does not belong to the predetermined protocol, is directly passed to be stored in a buffer pool to wait for output.
11. The method for managing network flow congestion according to claim 1, wherein the threshold is adjusted over a management network path.
12. An apparatus for managing network flow congestion, comprising: a receive port, configured to receive a plurality of packets; a buffer pool, configured to store the packets; a management circuit, configured to identify whether each packet belongs to a predetermined protocol, distinguish a plurality of connections of the packets belonged to the predetermined protocol, monitor a buffer usage of each different connections of the packets belonged to the predetermined protocol, and perform a congestion check procedure on the currently monitored connection, wherein in the congestion check procedure, when the buffer usage of the currently monitored connection exceeds a threshold, a congestion processing procedure is triggered; and an output port, configured to output the packets stored in the buffers.
13. The apparatus for managing network flow congestion according to claim 12, wherein the threshold is a mark threshold, and the congestion processing procedure is to set a CE (Congestion Experienced) code point in the packet corresponding to the currently monitored connection.
14. The apparatus for managing network flow congestion according to claim 13, wherein an ECE flag is set to a TCP ACK packet and the TCP ACK packet is sent back to a transmit end, and wherein the transmit end reduces a size of a congestion window according to the ECE flag of the TCP ACK packet.
15. The apparatus for managing network flow congestion according to claim 13, wherein the mark threshold is dynamically reduced as the number of connections increases.
16. The apparatus for managing network flow congestion according to claim 12, wherein the threshold is a drop threshold, and the congestion processing procedure is to drop the packet corresponding to the currently monitored connection.
17. The apparatus for managing network flow congestion according to claim 12, wherein the management circuit further determines whether to perform the congestion check procedure according to a buffer remainder corresponding to the currently monitored connection and a congestion indication threshold.
18. The apparatus for managing network flow congestion according to claim 12, wherein the management circuit further checks a FIN flag and a RST flag of each of the packets, and cancels the monitoring of the buffer usage corresponding to the connection when the FIN flag or the RST flag is set.
19. The apparatus for managing network flow congestion according to claim 12, wherein the packet, which does not belong to the predetermined protocol, is directly passed to be stored in a buffer pool to wait for output.
20. The apparatus for managing network flow congestion according to claim 12, wherein the threshold is adjusted over a management network path.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
DETAILED DESCRIPTION
[0017]
[0018] The management circuit 40 performs a method for managing network flow congestion, to manage resource allocation of the buffers in the buffer pool 30.
[0019]
[0020] The forwarding engine 41 receives a packet from the receive port 10, extracts header information of the packet, and stores the header information to a metadata block associated with the packet. The forwarding engine 41 further makes a forwarding decision according to the packet and the header information, that is, decides whether to forward the packet. If the forwarding is accepted, the packet is sent to the congestion management unit 42 along with the metadata block associated with the packet. The congestion management unit 42 is configured to perform the method for managing network flow congestion. The output manager 43 puts the packet in a transmission queue, and schedules to transmit the packet in the transmission queue to the output port 20 to send out the packet. The transmission queue is composed of the buffers in the buffer pool 30.
[0021]
[0022]
[0023] Referring to
[0024]
[0025] In step S604, a buffer usage corresponding to the flow identifier, that is, a buffer usage of the currently monitored connection, is queried from the congestion management table 44. If the buffer usage is greater than a drop threshold Td, go to step S605 to drop the packet and update the congestion management table 44. Herein, the update of the congestion management table 44 is to add one to the number of dropped packets corresponding to the flow identifier in the congestion management table 44.
[0026] If it is determined in step S604 that the buffer usage is not greater than the drop threshold Td, go to step S606. In step S606, whether the buffer usage corresponding to the flow identifier (i.e., the buffer usage of the currently monitored connection) is greater than a mark threshold Tm is determined. If yes, it indicates that the buffer usage reaches a level at which congestion may be caused, and the process goes to step S607. In step S607, an IP ECN (Explicit Congestion Notification) field in the current packet is set to CE (Congestion Experienced) code point and the congestion management table 44 is updated. In addition, since the CE code point is set, an IP header checksum of the current packet needs to be recalculated. In this way, a receive end of the packet set an ECE flag to a TCP ACK packet and sends the TCP ACK packet back to a transmit end, so that the transmit end can learn the congestion based on the ECE flag, and learn that a sending rate needs to be limited (for example, by reducing the size of a TCP congestion window). Herein, the update of the congestion management table 44 is to add one to the number of marked packets and the number of transmitted packets corresponding to the flow identifier in the congestion management table 44.
[0027] The congestion indication threshold Tc is a threshold for the number of buffers that is available, and the drop threshold Td and the mark threshold Tm are thresholds for the number of buffers that are consumed. In some embodiments, the congestion indication threshold Tc is 10% to 15% of the total number of buffers; the drop threshold Td is 85% to 90%; and the mark threshold Tm is 75% to 85%.
[0028] In some embodiments, the mark threshold Tm can be dynamically adjusted according to the number of flow identifiers in the congestion management table 44, that is, the number of connections. The adjustment manner may be to reduce the mark threshold Tm as the number of connections increases. In this way, buffer resources can be allocated more fairly.
[0029] In some embodiments, if the monitoring period length exceeds a predetermined value, the entry corresponding to the flow identifier in the congestion management table 44 can be deleted autonomously, and the monitoring of the buffer usage corresponding to the connection can be canceled, to avoid occupation of storage resources. Specifically, each entry corresponds to one persistence counter, which is decremented during the persistence duration. When the persistence counter returns to zero, the corresponding entry is deleted from the congestion management table 44. Alternatively, when the persistence counter returns to zero, the persistence counter is reset to a preset value and continues to be decremented; and after the persistence counter returns to zero for a specific number of times, the corresponding entry is deleted from the congestion management table 44. In this way, entries that remain idle (have no traffic) for a long time can be removed.
[0030]
[0031] For best TCP throughput and latency performance, the apparatus 1 according to this disclosure has the following performance characteristic:
[0032] Egress queue for each TCP flow should be short enough such that it does not impose excessive latency on traffic.
[0033] Egress queue for each TCP flow should be long enough to absorb limited bursts without excessive packet loss.
[0034] Egress queue for each TCP flow should be long enough to saturate the WAN side bandwidth capacity. The WAN port transmission capacity should be fully utilized.
[0035] Packet buffers in the system should be allocated fairly such that no one TCP flow should consume all (or most) of the available buffers, starving the other TCP flows going through the apparatus 1.
[0036] In some embodiments, the apparatus 1 for managing network flow congestion is a network device such as a gateway, a network modem, a router, or a wireless network access point.
[0037] In some embodiments, the apparatus 1 has a plurality of local area network (LAN) ports and a single wide area network (WAN) port. All internet access traffic will need to go through the WAN port which is connected to service provider (ISP) edge router. Each of the LAN ports receives an independent data flows.
[0038] To sum up, according to the apparatus 1 and the method for managing network flow congestion provided in some embodiments of the present disclosure, buffer resources can be fairly allocated to each network flow, and a transmission queue can be prevented from being excessively long, which not only can prevent the buffer resources from being occupied by network flows with heavy traffic, but also can reduce traffic delays and the number of packet retransmissions.