Method and equipment for counting local congestion mark setting message based on port
By setting a counter for the physical port of the network device and enabling the ECN function, filtering counting ACL table entries are generated, and the problem of counting the number of local congestion markers for the network device is solved, and the accurate measurement of physical port congestion is achieved and the user experience is optimized. .
Patent Information
- Application Number
- CN202411388321.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-09-30
AI Technical Summary
The prior art cannot accurately count the number of messages sent by network devices with ECN field 11, resulting in the inability to accurately reflect the congestion status of the network devices, and it is impossible to distinguish between local congestion and ECN tagged messages forwarded by other devices.
By setting a port counter for the physical port, the ECN function is enabled to display congestion notification, and a filter count access control ACL table entry is generated to match messages that are not congested and support ECN for counting, and the outgoing queue is performed according to the weighted random early detection strategy. Processing, ensure that only local ECN set messages are counted.
It realizes statistics on local ECN assertion messages in the physical port outbound queue, accurately judges the degree of congestion, eliminates interference from ECN tagged messages forwarded by other devices, and optimizes the user experience.
Smart Images

Figure CN119299378A_ABST
Abstract
Description
Technical Field
[0001] This application relates to communication technology, specifically a method and device for port-based statistics of local congestion flag setting messages. Background Technology
[0002] ECN (Explicit Congestion Notification) technology uses the ECN field in the IP header of data packets to mark the congestion status on the packet transmission path. This allows network devices to adjust the way outbound queue packets are sent based on the ECN field in the packet, thus preventing the congestion within the network from worsening.
[0003] If the outgoing queue length of a network device's port is less than the minimum queue length (QL_min), packets buffered in the outgoing queue of the port are forwarded directly.
[0004] When the outbound queue length of a network device's port is greater than (QL_min) but less than the queue ECN threshold, packets with an ECN field of 00 entering the outbound queue of that port (i.e., those that do not support ECN) are randomly discarded according to the WRED (Weighted Random Early Detection) policy; packets with an ECN field of 01 or 10 entering the outbound queue of that port are randomly modified to 11 according to the WRED policy; packets with an ECN field of 11 entering the outbound queue of that port are sent from the port pointed to by their destination address.
[0005] When the outbound queue length of a network device's port exceeds the queue ECN threshold, packets entering the outbound queue of that port with an ECN field of 00 are discarded; packets entering the outbound queue of that port with an ECN field of 01 or 10 are randomly modified to 11 according to the WRED policy; packets entering the outbound queue of that port with an ECN field of 11 are sent from the port pointed to by their destination address.
[0006] However, the ECN field set to 11 packets sent by network devices includes not only packets where the ECN field is set locally, but also packets where the network device receives ECN field set to 11 from other network devices; therefore, counting the number of ECN field set to 11 packets sent by network devices cannot accurately reflect the congestion status of network devices. Summary of the Invention
[0007] The purpose of this application is to provide a method and device for counting local congestion flag setting messages based on port statistics, and to count the number of messages in which the network device sets the ECN field locally before sending data packets through the physical port.
[0008] To achieve the above objectives, this application provides a method for port-based statistics of local congestion flag set packets. The method includes: setting a first port counter for a first physical port; enabling the explicit congestion notification (ECN) function of the first physical port; generating a filtering count access control (ACL) entry for the first physical port; wherein the matching item is an ECN field value indicating no congestion and supporting ECN; and the action item is packets whose ECN field is modified to indicate congestion and supporting ECN are counted by the first counter; parsing the outgoing interface information of the first packet to determine the outgoing port as the first physical port; scheduling the first packet to the corresponding outgoing queue of the first physical port based on its priority; and performing explicit congestion control processing on each outgoing queue of the first physical port according to the weighted random early detection (WRED) policy.
[0009] To achieve the above objectives, this application also provides a device based on port statistics of local congestion flag set packets. The device includes: a setting module for setting a first port counter for a first physical port; enabling the explicit congestion notification (ECN) function of the first physical port; generating a filtered counting access control (ACL) entry for the first physical port in the access control table; wherein the matching item is an ECN field value indicating no congestion and ECN support; the action item is to count packets whose ECN field has been modified to indicate congestion and ECN support via the first counter; a forwarding module for parsing the outgoing interface information of the first packet as the first physical port; and a scheduling module for scheduling the first packet to the corresponding outgoing queue of the first physical port based on its priority; and performing explicit congestion control processing on each outgoing queue of the first physical port according to the weighted random early detection (WRED) policy.
[0010] The beneficial effect of this application lies in its ability to statistically analyze the packets with local ECN flags in the outbound queue of a specified physical port to obtain the outbound congestion status of the physical port. The congestion level of a specified outbound port can be determined from the number of ECN-marked packets. This solves the problem of quantifying port congestion levels and also eliminates the interference issue of whether the ECN-marked packets received by the port are directly forwarded from other devices rather than due to congestion on the local device. This thus optimizes the user experience. Attached Figure Description
[0011] Figure 1 A flowchart illustrating an embodiment of a method for using port statistics to set local congestion flags, provided in this application;
[0012] Figure 2 A schematic diagram of the port statistics local congestion flag setting message provided in this application;
[0013] Figure 3This is a schematic diagram of a device embodiment based on port statistics local congestion flag setting messages provided in this application. Detailed Implementation
[0014] The following detailed description will be provided with reference to several examples illustrated in the accompanying figures. In this detailed description, numerous specific details are used to provide a comprehensive understanding of the present application. Known methods, steps, components, and circuits are not described in detail in the examples to avoid obscuring their meaning.
[0015] In the terminology used, the term "including" means including but not limited to; the term "containing" means including but not limited to; the terms "above," "within," and "below" include the number itself; the terms "greater than" and "less than" mean not including the number itself. The term "based on" means based on at least a portion of them.
[0016] Figure 1 A flowchart illustrating an embodiment of a method for using port statistics to set local congestion flags, provided in this application; the method includes the following steps:
[0017] Step 101: Set a port counter for the physical port;
[0018] Step 102: Enable the Display Congestion Notification (ECN) function for the physical port;
[0019] Step 103: Generate a filter counting access control ACL entry for the physical port; wherein, the matching item is an ECN field value of 01 indicating no congestion and ECN support; the action item is an ECN field being modified to 11 indicating that congested packets that support ECN are counted by this counter.
[0020] A value of 01 in the ECN field indicates no congestion and ECN is supported; a value of 11 in the ECN field indicates congestion and ECN is supported.
[0021] Step 104: Parse the outgoing interface information of the message to find the physical port;
[0022] Step 105: Based on the packet priority, schedule the packet to the corresponding outgoing queue of the physical port;
[0023] Step 106: Based on the weighted random early detection strategy, perform explicit congestion control processing on the outgoing queues of each physical port.
[0024] Figure 1 The beneficial effect of this embodiment is that it can statistically analyze the packets with the local ECN set in the outbound queue of a specified physical port to obtain the congestion status of the outbound direction of the physical port.
[0025] Figure 2 A schematic diagram of the port statistics local congestion flag setting message provided in this application;
[0026] The forwarding of packets by the switching chip in the network device is divided into two stages: ITPP (Ingress Traffic Processing Pipeline) and ETPP (Egress Traffic Processing Pipeline).
[0027] Network devices perform ECN processing during the ETPP process, as detailed below. Figure 2 The implementation process of this application will be described.
[0028] The network device's processor executes machine-executable instructions recorded on a machine-readable storage medium, and physical ports port1 and port2 initialize and configure the ECN set counters during the ETPP phase.
[0029] The processor on the network device enables the ECN function for physical port 1 by executing machine-executable instructions recorded on a machine-readable storage medium.
[0030] The network device's processor generates a filter counting access control (ACL) entry for the physical port port1 that enables ECN functionality by executing machine-executable instructions recorded on a machine-readable storage medium, and synchronizes the ACL table of the ETPP node of the forwarding chip to the ACL processing stage E1.
[0031] Since ECN is not enabled on port2 of the network device's physical port, counting and filtering ACL entries will not be set for it in the E1 part of the ACL processing stage for the time being, so as to save ACL entry resources of the switching chip.
[0032] Figure 2In this context, packets 2011-2015 include packets that have completed destination resolution during the ITPP phase and / or the ETPP phase. After completing destination resolution during the ITPP or ETPP phase, the switching chip obtains the outgoing interface (outlier) index of packets 2011-2015; then, based on the outgoing interface index, it obtains the physical port from which the packet was sent and the outer encapsulation information. This encapsulation information can be VLAN encapsulation information, VxLAN (Virtual Extensible LAN), VPLS (Virtual Private LAN Service) encapsulation information, MPLS (Multiprotocol Label Switching) encapsulation information, etc. This application does not limit the type of encapsulation information pointed to by the outgoing interface index obtained during destination resolution in the ITPP and ETPP phases.
[0033] It should be noted that after destination resolution is completed, only the outgoing interface index (outgoing interface information) can be obtained, but the sending port cannot be obtained. In addition, the outgoing packets have not yet entered the outgoing queue of the physical port; therefore, it is not possible to rely on the ECN set counter in the initialization configuration ETPP stage to directly count based on the outgoing interface index.
[0034] This application enables the ECN function of port1 and configures the filter counter ACL entry of port1 in the ACL table. It associates the filter counter of port1 configured in the ETPP stage during the initialization stage with the packets sent by port1 and whose ECN is set through the outbound queue of port. The matching item is an ECN field value of 01 or 10. The action item is a packet whose ECN field is modified to 11. The ECN set counter of port1 is counted.
[0035] The ECN field of message 2011 is 11, the ECN field of message 2012 is 01, the ECN field of message 2013 is 10, and the ECN field of messages 2021 and 2022 is 01.
[0036] In the ECN phase of ETPP, based on the outgoing interface indices oullif1, outlif2, and outlif3 of packets 2011, 2012, and 2013, the physical port port1 that was sent is identified. Packets 2011 and 2012 are scheduled to outgoing queue 0 of port1, which is pointed to by their respective priority information, and packet 2013 is scheduled to outgoing queue 7 of port1, which is pointed to by its priority information. Based on the outgoing interface indices outlif4 and outlif5 of packets 2021 and 2022, the physical port port2 is read, and packets 2021 and 2022 are scheduled to outgoing queue 0 of port2, which is pointed to by their respective priority information.
[0037] When the queue length of outgoing queues 0-7 of Port1 of the network device is greater than (QL_min) but less than the queue ECN threshold, or when the queue length of outgoing queues 0-7 of Port1 is greater than (QL_min) and greater than the queue ECN threshold, the switching chip sets the ECN field of packets with ECN field 00 or 01 according to the WRED policy.
[0038] Figure 2 In this process, the network device's switching chip, following the WRED policy, determines that the ECN field of packet 2011 entering the outbound queue 0 of port1 is 11, and does not modify the ECN field. Based on the encapsulation information of the outbound interface index outlif1, the network device's switching chip performs encapsulation on packet 2011 and forwards it from port1.
[0039] The network device's switching chip, following the WRED policy, modifies the ECN field of packet 2012 entering outbound queue 0 of port1 from 01 to 11. The port1 ECN set counter counts packets 2012 that match the port1 filtering count ACL entry. The network device's switching chip then encapsulates packet 2012 based on the encapsulation information of the outbound interface index outlif2 and forwards it from port1.
[0040] The network device's switching chip, following the WRED policy, modifies the ECN field of packet 2013 entering port1 outbound queue 7 from 10 to 11. The port1 ECN set counter counts packets 2013 that match the port1 filtering count ACL entry. The network device's switching chip then encapsulates packet 2013 based on the encapsulation information of the outbound interface index outlif3 and forwards it from port1.
[0041] When the queue length of outgoing queues 0-7 of Port2 of the network device is greater than (QL_min) but less than the queue ECN threshold, or when the queue length of outgoing queues 0-7 of Port1 is greater than (QL_min) and greater than the queue ECN threshold.
[0042] According to the WRED policy, the switching chip of the network device modifies the ECN field 01 to 11 of packets 2011 and 2012 entering the outbound queue 0 of port2. After encapsulating packets 2021 and 2022 according to the encapsulation information of the outbound interface indexes outlif4 and outlif5, respectively, the packets are forwarded from port2.
[0043] The network device has not enabled the ECN function of port2 and has not set the corresponding filter count entry in the ACL table. Therefore, even if the ECN field of packets 2021 and 202 is set in the outbound queue of port2, the ECN set counter set on port2 during initialization will not count these two packets.
[0044] This application does not change the ECN processing of the switching chip. When the ECN field of a packet scheduled to either port1 or port2 is 00, ECN processing is performed according to the queue length and WRED policy. These packets will not match the filter counting ACL entries and will not have their ECN counters set by the port1 or port2 in the ETPP phase of initialization.
[0045] As mentioned above, when the ECN field of packet 2011, which is scheduled to outbound queue 0 of port1, is 11, according to the WRED policy, packet 2011 will not match the port11 filter counting ACL entry, thus excluding packets whose ECN has been set by other devices.
[0046] In this way, network devices can distinguish the counting in the outgoing direction of the port. Messages 2011 sent from port1 that have had their ECN field set by other devices are not counted; messages 2012 and 2013 sent from port1 are counted; and messages from port2 that do not have the ECN function enabled are not counted.
[0047] The processor of the network device reads the ECN set counter value of port 1 by executing machine-executable instructions recorded on the machine-readable storage medium, based on the local congestion limit control flag statistics instructions input on the input medium. For example, 2 indicates the number of packets with local ECN set in the outbound queue of port 1.
[0048] The processor of a network device executes machine-executable instructions recorded on a machine-readable storage medium and uses a generic remote procedure call (gRPC) message to notify the console of the number of packets with the local ECN set in the outbound queue of a specified port (port1).
[0049] The processor of the network device executes machine-executable instructions recorded on a machine-readable storage medium and displays the number of packets with the local ECN set in the outbound queue of a specified port (port1) via a display medium.
[0050] In this way, network devices can provide command-line viewing or proactive reporting to the console, displaying the number of packets on a specified port whose ECN field is set to 11 due to congestion control in the outbound queue of port1. This allows for measurable and refined statistics on outbound congestion at the port. In complex network environments, this data can be used to dynamically adjust data packet forwarding paths.
[0051] Figure 3 This is a schematic diagram of a device embodiment based on port statistics local congestion flag setting messages provided in this application. The device 30 includes a processor 31, a machine-readable storage medium 32, a switching chip 33, and a network interface 34. The processor 31 executes machine-executable instructions recorded in the machine-readable storage medium 32 to execute a setting module 321 and a statistics module 322. The switching chip 33 includes at least a forwarding module 331 and a scheduling module 332.
[0052] The configuration module 321 is used to set a first port counter for the first physical port; enable the explicit congestion notification (ECN) function of the first physical port; and generate a filter counting access control ACL entry for the first physical port in the access control table. The matching item is an ECN field value indicating no congestion and support for ECN; the action item is that packets whose ECN field is modified to indicate congestion and support for ECN are counted by the first counter. The forwarding module 331 is used to parse the outgoing interface information of the first packet to identify the first physical port as the outgoing port. The scheduling module 332 is used to schedule the first packet to the corresponding outgoing queue of the first physical port based on its priority; and perform explicit congestion control processing on each outgoing queue of the first physical port according to the weighted random early detection (WRED) policy.
[0053] The setting module 321 is used to set the second port counter for the second physical port; the forwarding module 331 is used to parse the outgoing interface information of the second packet and set the outgoing port as the second physical port; the scheduling module 332 is used to schedule the second packet to the outgoing queue of the corresponding second physical port based on the priority of the second packet.
[0054] The statistics module 322 is used to read the count value of the first port counter based on the local congestion limit control flag statistics command. The statistics module 322 is also used to notify the console of the count value of the first port counter via a general remote procedure call message. The statistics module 322 is also used to output the count value of the first port counter via a display medium.
[0055] In this disclosure, a machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device used to store or contain information (such as executable instructions, data, etc.). For example, any machine-readable storage medium described herein can be any type of random access memory (RAM), volatile memory, non-volatile memory, flash memory, storage drive (such as a hard disk drive), solid-state drive, any type of optical disc (such as an optical disc, DVD, etc.), and similar devices, or combinations thereof. Furthermore, any machine-readable storage medium described herein can be a non-transitory machine-readable storage medium.
[0056] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for setting local congestion mark messages based on port statistics, characterized in that: The method comprises, Setting a first port counter for a first physical port; Enabling an explicit congestion notification (ECN) function of the first physical port; Generate a filtering count access control ACL table entry for the first physical port; wherein the matching item is that the ECN field value indicates no congestion and supports ECN; the action item is that the message whose ECN field is modified to indicate congestion and supports ECN passes through the first counter count; Parsing the outgoing port of the outgoing interface information of the first message as the first physical port; Based on the priority of the first message, scheduling the first message to the corresponding outgoing queue of the first physical port; According to the weighted random early detection (WRED) policy, explicit congestion control processing is performed on each outbound queue of the first physical port.
2. The method according to claim 1, characterized in that The method comprises, Setting a second port counter for the second physical port; The outgoing port of the outgoing interface information of the second message is parsed as the second physical port; Based on the priority of the second message, the second message is scheduled to an egress queue of the corresponding second physical port.
3. The method according to claim 1 or 2, characterized in that: The method further comprises, Based on the local congestion limit control marking statistical instruction, the count value of the first port counter is read.
4. The method according to claim 3, characterized in that The method further comprises, The count value of the first port counter is notified to the console through a general remote procedure call message.
5. The method according to claim 3, characterized in that: The method further comprises, The count value of the first port counter is outputted through a display medium.
6. A device for setting local congestion mark based on port statistics, characterized in that: The device comprises, A setting module is used to set a first port counter for a first physical port; enable an ECN function of the first physical port; generate a filter count access control ACL table entry for the first physical port in an access control table; wherein, a matching item: an ECN field value indicates that there is no congestion and that ECN is supported; an action item: a message whose ECN field is modified to indicate congestion and that ECN is supported passes through the first counter for counting; A forwarding module, which parses the outgoing port of the outgoing interface information of the first message as the first physical port; The scheduling module schedules the first message to the corresponding outgoing queue of the first physical port based on the priority of the first message; and performs explicit congestion control processing on each outgoing queue of the first physical port according to a weighted random early detection (WRED) policy.
7. The device according to claim 6, characterized in that A setting module, setting a second port counter for the second physical port; A forwarding module, which parses the outgoing port of the outgoing interface information of the second message as the second physical port; A scheduling module is used to schedule the second message to an outgoing queue of the corresponding second physical port based on the priority of the second message.
8. The device according to claim 6 or 7, characterized in that The statistics module reads the count value of the first port counter based on the local congestion limit control mark statistics instruction.
9. The device according to claim 6, characterized in that The statistical module is further used to notify the console of the count value of the first port counter through a general remote procedure call message.
10. The device according to claim 6, characterized in that The statistical module is further used to output the count value of the first port counter through a display medium.
Citation Information
Patent Citations
Congestion control method, device and equipment, and computer readable storage medium
CN112787951A
Flow congestion control method and device
CN115037688A
Method and device for reducing forwarding delay of network equipment
CN117255065A
Accurate congestion control method and device for data transmission, equipment and medium
CN118337709A
Method and apparatus for delivery of adapted media
US20100268836A1