A method and device for setting a packet based on local congestion marking of port statistics

By setting counters and filtering count ACL entries for the physical ports of network devices, the problem of network devices being unable to accurately count packets with an ECN field of 11 was solved. This enabled precise quantification and optimization of local congestion, eliminated external interference, and improved the congestion control effect of network devices.

CN119299378BActive Publication Date: 2025-11-07NEW H3C TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411388321.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-11-07
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

In existing technologies, network devices cannot accurately count the number of packets with ECN field 11 sent through their physical ports, which makes it impossible to accurately reflect the local congestion status of the device, and may be interfered with by ECN-marked packets forwarded by other devices.

Method used

Configure port counters for the physical ports of network devices, generate filtering count access control ACL entries, match packets whose ECN field is not congested and supports ECN, and modify the ECN field to indicate that packets that are congested and support ECN are counted by the counter, and perform congestion control processing based on a weighted random early detection strategy.

Benefits of technology

It enables accurate statistics of local ECN-set packets in the outbound queue of a specified physical port, eliminating interference from packets forwarded by other devices, and optimizing the quantification of congestion and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299378B_ABST
    Figure CN119299378B_ABST
Patent Text Reader

Abstract

The application provides a method and device for setting a local congestion mark packet based on port statistics. The method comprises: setting a port counter for a physical port; enabling an explicit congestion notification (ECN) function of the physical port; generating a filtering counting access control (ACL) table item for the physical port; wherein a matching item is an ECN field value indicating no congestion and supporting ECN; an action item is that a packet with the ECN field modified to indicate congestion and supporting ECN is counted by the counter; an out port of the out interface information of the packet is the physical port; based on a priority of the packet, the packet is dispatched to an out direction queue of the corresponding physical port; and according to a weighted random early detection (WRED) strategy, each out direction queue of the physical port is subjected to an explicit congestion control processing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the communication technology, and in particular to a method and device for setting a local congestion marking packet based on port statistics. BACKGROUND

[0002] The ECN (Explicit Congestion Notification) technology uses the ECN field in the IP packet header of a data packet to mark the congestion state on the packet transmission path, so that the network device can adjust the sending mode of the queue packet in the port out direction based on the ECN field in the packet, to avoid the network congestion from being aggravated.

[0003] When the queue length of the queue in the port out direction of the network device is less than the minimum queue length (QL_min), the packets in the queue buffer of the port out direction are directly forwarded.

[0004] When the queue length of the queue in the port out direction of the network device is greater than the (QL_min) but less than the queue ECN threshold, the packets in the queue of the port out direction and with the ECN field of 00 (i.e. not supporting the ECN function) are randomly discarded according to the WRED (Weighted Random Early Detection) strategy; the packets in the queue of the port out direction and with the ECN field of 01 or 10 are randomly modified to 11 according to the WRED strategy; and the packets in the queue of the port out direction and with the ECN field of 11 are sent from the port pointed by the destination address.

[0005] When the queue length of the queue in the port out direction of the network device is greater than the queue ECN threshold, the packets in the queue of the port out direction and with the ECN field of 00 are discarded; the packets in the queue of the port out direction and with the ECN field of 01 or 10 are randomly modified to 11 according to the WRED strategy; and the packets in the queue of the port out direction and with the ECN field of 11 are sent from the port pointed by the destination address.

[0006] However, the packets with the ECN field of 11 sent by the network device include not only the packets with the ECN field of 11 locally marked by the network device, but also the packets with the ECN field of 11 received from other network devices; and the number of the packets with the ECN field of 11 sent by the network device cannot accurately reflect the congestion state of the network device. SUMMARY

[0007] The present application aims to provide a method and device for setting a local congestion marking packet based on port statistics, to count the number of the packets with the ECN field locally marked by the network device before sending the data packets through the physical port.

[0008] To achieve the above object, the application provides a method for setting a packet of local congestion mark based on port statistics, which comprises: setting a first port counter for a first physical port; enabling an Explicit Congestion Notification (ECN) function of the first physical port; generating a filter counting Access Control List (ACL) entry for the first physical port; wherein a matching item is that an ECN field value indicates no congestion and supports ECN; an action item is that a packet with the modified ECN field indicating congestion and supporting ECN is counted by the first counter; an egress port of egress interface information of a first packet is the first physical port; the first packet is dispatched to an egress direction queue of the corresponding first physical port based on a priority of the first packet; and each egress direction queue of the first physical port is subjected to an Explicit Congestion Control (ECC) processing according to a Weighted Random Early Detection (WRED) strategy.

[0009] To achieve the above object, the application further provides a device for setting a packet of local congestion mark based on port statistics, which comprises: a setting module, configured to set a first port counter for a first physical port; enable an Explicit Congestion Notification (ECN) function of the first physical port; and generate a filter counting Access Control List (ACL) entry for the first physical port in an access control table; wherein a matching item is that an ECN field value indicates no congestion and supports ECN; an action item is that a packet with the modified ECN field indicating congestion and supporting ECN is counted by the first counter; a forwarding module, configured to analyze an egress port of egress interface information of a first packet; a scheduling module, configured to dispatch the first packet to an egress direction queue of the corresponding first physical port based on a priority of the first packet; and a processing module, configured to subject each egress direction queue of the first physical port to an Explicit Congestion Control (ECC) processing according to a Weighted Random Early Detection (WRED) strategy.

[0010] The application has the beneficial effect that the packets of local ECN setting in the egress direction queue of the specified physical port are counted to obtain the congestion condition of the egress direction of the physical port. The congestion degree of the specified egress port can be determined from the number of ECN marked packets. The problem that the congestion degree of the port cannot be quantified is solved; meanwhile, the interference problem that whether the ECN marked packet received by the port is directly forwarded from another device or caused by the congestion of the device is excluded. Thus, the user experience is optimized. BRIEF DESCRIPTION OF DRAWINGS

[0011] Figure 1 A flowchart of a method for setting a packet of local congestion mark based on port statistics provided by the application is provided.

[0012] Figure 2 A schematic diagram of the packet of local congestion mark based on port statistics provided by the application is provided.

[0013] Figure 3A schematic diagram of an embodiment of a device for setting a local congestion mark packet based on port statistics is provided. DETAILED DESCRIPTION

[0014] Examples will be described in detail with reference to the accompanying drawings. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the application. Known methods, procedures, components, and circuits have not been described in detail since such are well understood to those of ordinary skill in the art.

[0015] In the use of terms, the term "includes" means includes but not limited to; the term "contains" means includes but not limited to; the term "above", "within" and "below" include the number; the term "greater than", "less than" means not including the number. The term "based on" means at least based on part of it.

[0016] Figure 1 A flow chart of an embodiment of a method for setting a local congestion mark packet based on port statistics is provided; the method comprises the following steps:

[0017] Step 101, setting a port counter for a physical port;

[0018] Step 102, enabling the Explicit Congestion Notification (ECN) function of the physical port;

[0019] Step 103, generating a filter counting Access Control List (ACL) entry for the physical port; wherein the matching item is the ECN field value indicating no congestion and supporting ECN; the action item is the ECN field modified to 11 indicating the packet of congestion and supporting ECN passing through the counter;

[0020] The ECN field value of 01 indicates no congestion and supporting ECN; the ECN field of 11 indicates congestion and supporting ECN.

[0021] Step 104, parsing the egress port of the physical port as the egress interface information of the packet;

[0022] Step 105, scheduling the packet to the corresponding egress direction queue of the physical port based on the priority of the packet;

[0023] Step 106, performing the Explicit Congestion Control (ECC) processing on each egress direction queue of the physical port according to the Weighted Random Early Detection (WRED) strategy.

[0024] Figure 1 The beneficial effect of the embodiment is to count the packets with local ECN set in the egress direction queue of the specified physical port, and obtain the congestion condition of the egress direction of the physical port.

[0025] Figure 2 A schematic diagram of a device for setting a local congestion mark packet based on port statistics is provided;

[0026] The processing of the forwarding message of the switching chip in the network device is divided into ITPP (Ingress Traffic Processing Pipeline) stage and ETPP (Egress Traffic Processing Pipeline) stage.

[0027] The network device performs ECN processing at the ETPP stage. The following is combined with the description of the network device Figure 2 The implementation process of the present application is described.

[0028] The processor of the network device initializes the ECN setting counter of the ETPP stage by executing the machine executable instructions recorded in the machine readable storage medium, and the physical ports port1 and port2 are respectively initialized.

[0029] The processor on the network device enables the ECN function for the physical port port1 by executing the machine executable instructions recorded in the machine readable storage medium.

[0030] The processor of the network device generates a filtering counting access control ACL (Access Control List) table item for the physical port port1 which enables the ECN function, and synchronizes the ACL table of the ACL processing link E1 of the ETPP node of the forwarding chip.

[0031] Since the physical port port2 of the network device does not enable the ECN, the counting filtering ACL table item is not set in the ACL processing link E1 part, and the ACL table item resource of the switching chip is saved.

[0032] Figure 2In the embodiment, the packets 2011-2015 include packets for which destination resolution in the ITPP stage is completed and / or packets for which destination resolution in the ETPP stage is completed. After the switch chip completes destination resolution in the ITPP stage or the ETPP stage, the out interface (outlif) index of the packets 2011-2015 is obtained; then, the physical port from which the packets are sent and the outer encapsulation information are obtained according to the out interface index; the encapsulation information can be VLAN encapsulation information, VxLAN (Virtual Extensible LAN) encapsulation information, VPLS (Virtual Private LAN Service) encapsulation information, MPLS (Multiprotocol Label Switching) encapsulation information, and the like. The type of encapsulation information to which the out interface index obtained by destination resolution in the ITPP stage and the ETPP stage points is not limited in the present application.

[0033] It should be noted that after destination resolution is completed, only the out interface index (out interface information) can be obtained, and the sending out port cannot be obtained, and in addition, the out direction packet has not entered the out direction queue of the physical port; therefore, the ECN setting counter in the ETPP stage cannot be initialized and configured, and the out interface index is directly counted.

[0034] In the present application, by enabling the ECN function of the port 1 and configuring the filter counting ACL table item of the port 1 in the ACL table, the filter counter of the port 1 in the ETPP stage configured in the initialization stage is associated with the packet sent by the port 1 and subjected to ECN setting in the out direction queue of the port; wherein, the matching item is that the ECN field value is 01 or 10; and the action item is that the packet in which the ECN field is modified to 11 is counted by the ECN setting counter of the port 1.

[0035] The ECN field of the packet 2011 is 11, the ECN field of the packet 2012 is 01, the ECN field of the packet 2013 is 10, the ECN field of the packet 2021 is 01, and the ECN field of the packet 2022 is 01.

[0036] In the ECN link of the ETPP, the outgoing physical port port1 is identified based on the outgoing interface indexes oullif1, outlif2 and outlif3 of the packets 2011, 2012 and 2013 respectively, the packets 2011 and 2012 are dispatched to the outgoing direction queue 0 of port1 to which the priority information of the packets points respectively, and the packet 2013 is dispatched to the outgoing direction queue 7 of port1 to which the priority information of the packet points; the outgoing physical port port2 is read based on the outgoing interface indexes outlif4 and outlif5 of the packets 2021 and 2022 respectively, and the packets 2021 and 2022 are dispatched to the outgoing direction queue 0 of port2 to which the priority information of the packets points respectively.

[0037] When the queue length of the outgoing direction queues 0-7 of Port1 of the network device is greater than (QL_min) and less than the queue ECN threshold value, or the queue length of the outgoing direction queues 0-7 of Port1 is greater than (QL_min) and greater than the queue ECN threshold value, the switch chip sets the ECN field of the packet with the ECN field of 00 or 01 according to the proportion according to the WRED strategy.

[0038] Figure 2 In the ECN link of the ETPP, the outgoing physical port port1 is identified based on the outgoing interface indexes oullif1, outlif2 and outlif3 of the packets 2011, 2012 and 2013 respectively, the packets 2011 and 2012 are dispatched to the outgoing direction queue 0 of port1 to which the priority information of the packets points respectively, and the packet 2013 is dispatched to the outgoing direction queue 7 of port1 to which the priority information of the packet points; the outgoing physical port port2 is read based on the outgoing interface indexes outlif4 and outlif5 of the packets 2021 and 2022 respectively, and the packets 2021 and 2022 are dispatched to the outgoing direction queue 0 of port2 to which the priority information of the packets points respectively.

[0039] The ECN field of the packet 2012 entering the outgoing direction queue 0 of port1 is modified from 01 to 11 according to the WRED strategy of the switch chip of the network device, and the ECN set counter of port1 counts the packet 2012 matching the filter counting ACL table item of port1. The packet 2012 is encapsulated based on the encapsulation information of the outgoing interface index outlif2 of the network device, and then forwarded from port1.

[0040] The ECN field of the packet 2013 entering the outgoing direction queue 7 of port1 is modified from 10 to 11 according to the WRED strategy of the switch chip of the network device, and the ECN set counter of port1 counts the packet 2013 matching the filter counting ACL table item of port1. The packet 2013 is encapsulated based on the encapsulation information of the outgoing interface index outlif3 of the network device, and then forwarded from port1.

[0041] The queue length of the outgoing direction queue 0-queue 7 of Port2 of the network device is greater than (QL_min) and less than the queue ECN threshold value, or the queue length of the outgoing direction queue 0-queue 7 of Port1 is greater than (QL_min) and greater than the queue ECN threshold value.

[0042] The switching chip of the network device modifies the ECN field 01 of the messages 2011, 2012 entering the outgoing direction queue 0 of port2 to 11 according to the WRED strategy, performs encapsulation on the messages 2021, 2022 according to the encapsulation information of the outgoing interface indexes outlif4, outlif5 respectively, and then forwards the messages from port2.

[0043] The network device does not enable the ECN function of port2, and does not set the corresponding filter counting table item in the ACL table, so that even in the outgoing direction queue of port2, the ECN field of the messages 2021, 2022 is set, the ECN set counting counter initialized and set on port2 will not count the two messages.

[0044] The application does not change the ECN processing of the switching chip, and when the ECN field of any outgoing direction queue message of port1 or port2 is 00, the ECN processing is performed according to the queue length and the WRED strategy, and these messages will not match the filter counting ACL table item, and will not be counted by the ECN set counting counter of the initialized and set ETPP stage port1 or port2.

[0045] As described above, when the ECN field of the message 2011 scheduled to the outgoing direction queue 0 of port1 is 11, the message 2011 will not match the port11 filter counting ACL table item, and is excluded from the message whose ECN setting has been completed by other devices.

[0046] In this way, the network device can distinguish the counting in the outgoing direction of the port, and does not count the message 2011 whose ECN field has been set by other devices for port1; counts the messages 2012, 2013 sent by port1, and does not count the messages for the port2 whose ECN function is not enabled.

[0047] The processor of the network device reads the counting value of the ECN set counting counter of port1, such as 2, by executing the machine executable instructions recorded in the machine readable storage medium based on the local congestion limit control mark statistical instruction input by the input medium, which specifies the number of messages whose ECN is set locally in the outgoing direction queue of port1.

[0048] The processor of the network device, by executing the machine executable instructions recorded by the machine readable storage medium, notifies the console of the number of packets with local ECN set in the out direction queue of the specified port port1 through a general remote procedure call gRPC message.

[0049] The processor of the network device, by executing the machine executable instructions recorded by the machine readable storage medium, outputs and displays the number of packets with local ECN set in the out direction queue of the specified port port1 through a display medium.

[0050] In this way, the network device provides command line viewing or actively reports the console to display the number of packets with ECN field set to 11 due to congestion control in the out direction queue of the specified port port1, and the port out direction congestion situation is quantifiable and refined. In a complex network environment, the data can be used for dynamic adjustment of data packet forwarding path.

[0051] Figure 3 A schematic diagram of a device embodiment for setting a packet with local congestion marking based on port statistics is provided for the present application. The device 30 includes a processor 31, a machine readable storage medium 32, a switch chip 33, and a network interface 34. The processor 31 executes the machine executable instructions recorded by the machine readable storage medium 32 to execute a setting module 321 and a statistics module 322. The switch chip 33 includes at least a forwarding module 331 and a scheduling module 332.

[0052] The setting module 321 is configured to set a first port counter for a first physical port, enable display congestion notification ECN function for the first physical port, and generate a filter counting access control ACL entry for the first physical port in an access control table. The matching item indicates that the ECN field value indicates no congestion and supports ECN, and the action item is to count the packets with ECN field modified to indicate congestion and support ECN through the first counter. The forwarding module 331 is configured to parse the out interface information of the first packet to determine that the out port is the first physical port. The scheduling module 332 is configured to schedule the first packet to the out direction queue of the corresponding first physical port based on the priority of the first packet, and perform display congestion control processing on each out direction queue of the first physical port according to a weighted random early detection WRED strategy.

[0053] The setting module 321 is configured to set a second port counter for a second physical port. The forwarding module 331 is configured to parse the out interface information of the second packet to determine that the out port is the second physical port. The scheduling module 332 is configured to schedule the second packet to the out direction queue of the corresponding second physical port based on the priority of the second packet.

[0054] The statistics module 322 is configured to read the count value of the first port counter based on the local congestion limit control marking statistics instruction. The statistics module 322 is further configured to notify the console of the count value of the first port counter through a general remote procedure call message. The statistics module 322 is further configured to output the count value of the first port counter through a display medium.

[0055] In this disclosure, a machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage apparatus used to store or transmit information (e.g., executable instructions, data, etc.). For example, any of the machine-readable storage media described herein can be random access memory (RAM), volatile memory, non-volatile memory, flash memory, a storage drive (e.g., a hard disk drive), a solid state drive, any type of storage media, or the like, or a combination thereof. Moreover, any of the machine-readable storage media described herein can be non-transitory machine-readable storage media.

[0056] The preferred embodiments of the present application have been described above with the assistance of drawings. Of course, the application is not limited to the above examples and any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall fall within the scope of the present application.

Claims

1. A method for statistically analyzing local congestion flag setting 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; generating a filter counting Access Control List (ACL) entry for the first physical port; wherein the matching item indicates that the ECN field value indicates no congestion and supports ECN; and the action item is that the packet whose ECN field is modified to indicate congestion and supports ECN is counted by the first port counter; analyzing an out port of out interface information of a first packet as the first physical port; scheduling the first packet to a corresponding out direction queue of the first physical port according to a priority of the first packet; and performing explicit congestion control processing on each out direction queue of the first physical port according to a Weighted Random Early Detection (WRED) strategy.

2. The method of claim 1, wherein, The method comprises, setting a second port counter for a second physical port; analyzing an out port of out interface information of a second packet as the second physical port; scheduling the second packet to a corresponding out direction queue of the second physical port according to a priority of the second packet.

3. The method according to claim 1 or 2, characterized in that, The method further comprises, reading a counting value of the first port counter based on a local congestion limit control marking statistical instruction.

4. The method of claim 3, wherein, The method further comprises, announcing the counting value of the first port counter to a console through a general remote procedure call message.

5. The method of claim 3, wherein, The method further comprises, outputting the counting value of the first port counter through a display medium.

6. An apparatus for setting a packet with a local congestion mark based on port statistics, the apparatus comprising: The device comprises, a setting module configured to set a first port counter for a first physical port, enable an Explicit Congestion Notification (ECN) function of the first physical port, and generate a filter counting Access Control List (ACL) entry for the first physical port in an access control list; wherein, the matching item indicates that the ECN field value indicates no congestion and supports ECN; and the action item is that the packet whose ECN field is modified to indicate congestion and supports ECN is counted by the first port counter; a forwarding module configured to analyze an out port of out interface information of a first packet as the first physical port; a scheduling module configured to schedule the first packet to a corresponding out direction queue of the first physical port according to a priority of the first packet, and perform explicit congestion control processing on each out direction queue of the first physical port according to a Weighted Random Early Detection (WRED) strategy.

7. The device according to claim 6, wherein, the setting module is configured to set a second port counter for a second physical port; the forwarding module is configured to analyze an out port of out interface information of a second packet as the second physical port; the scheduling module is configured to schedule the second packet to a corresponding out direction queue of the second physical port according to a priority of the second packet.

8. The device according to claim 6 or 7, wherein, a statistical module is configured to read a counting value of the first port counter based on a local congestion limit control marking statistical instruction.

9. The device according to claim 8, wherein, the statistical module is further configured to announce the counting value of the first port counter to a console through a general remote procedure call message.

10. The device according to claim 8, wherein, The statistical module is further configured to output the count value of the first port counter through a display medium.

Citation Information

Patent Citations

  • Flow congestion control method and device

    CN115037688A

  • Method and apparatus for delivery of adapted media

    US20100268836A1