Detailed Description
A plurality of examples shown in the drawings will be described in detail. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the application. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the examples.
The terms "comprising" and "including" are used in the sense of including but not limited to, including the numbers "above", "within" and "below" and not including the numbers. The term "based on" means based at least in part on a portion thereof.
Fig. 1 is a flowchart of an embodiment of a method for setting a packet based on port statistics local congestion marks, where the method includes the following steps:
step 101, setting a port counter for a physical port;
step 102, enabling a display congestion notification ECN function of a physical port;
Step 103, generating a filtering count access control ACL table item for the physical port, wherein the matching item indicates that the ECN field value is 01 and is not congested and supports ECN;
An ECN field value of 01 indicates uncongested and ECN supported, and an ECN field of 11 indicates congested and ECN supported.
104, Analyzing the output port of the output interface information of the message as a physical port;
Step 105, based on the priority of the message, dispatching the message to the corresponding outgoing direction queue of the physical port;
and 106, performing display congestion control processing on each outgoing direction queue of the physical port according to the weighted random early detection strategy.
The embodiment of fig. 1 has the beneficial effects that the message set by the local ECN in the outgoing direction queue of the designated physical port is counted, and the congestion condition of the outgoing direction of the physical port is obtained.
Fig. 2 is a schematic diagram of a port statistics local congestion flag setting message provided in the present application;
The processing of the forwarding message of the switching chip in the network device is divided into an ITPP (INGRESS TRAFFIC Processing Pipeline, ingress direction traffic processing pipeline) stage and a ETPP (EGRESS TRAFFIC Processing Pipeline, egress direction traffic processing pipeline) stage.
The network device performs ECN processing at ETPP, and the implementation of the present application is described below in conjunction with fig. 2.
The processor of the network device initializes the ECN set counter (counter) at stage ETPP of configuration by executing machine-executable instructions recorded on a machine-readable storage medium for physical ports port1, port2, respectively.
A processor on a network device enables ECN functions for physical port1 by executing machine-executable instructions recorded on a machine-readable storage medium.
The processor of the network device generates a filter count access control ACL (Access Control List) entry for the physical port1 enabling ECN functions by executing machine executable instructions recorded on a machine readable storage medium, which is synchronized to the ACL table of ACL processing element E1 of ETPP node of the forwarding chip.
Because port2 of the physical port of the network device does not enable ECN, the count filtering ACL table entry is not set for the ACL processing link E1 part, and ACL table entry resources of the exchange chip are saved.
In fig. 2, the messages 2011-2015 include a message for completing destination resolution in the ITPP stage and/or a message for completing destination resolution in the ETPP stage. After the destination analysis is completed in ITPP stage or ETPP stage, the exchange chip acquires the output interface (outlif) index of the message 2011-2015, and acquires the sent physical port and the outer layer encapsulation information according to the output interface index, wherein the encapsulation information can be VLAN encapsulation information, vxLAN (Virtual Extensible LAN, virtual extensible local area network), VPLS (Virtual PRIVATE LAN SERVICE, virtual private local area network service) encapsulation information, MPLS (Multiprotocol Label Switching ) encapsulation information and the like. The application does not limit the type of the encapsulation information pointed by the obtained interface index of the destination analysis of the ITPP stage and ETPP stage.
It should be noted that, after destination analysis is completed, only the output interface index (output interface information) can be obtained, but the output port cannot be obtained, and in addition, the output direction message does not enter the output direction queue of the physical port, so that the ECN set counter in the stage ETPP of initialization configuration cannot be relied on, and direct counting based on the output interface index is not possible.
The application relates to a report which is sent out by a por1 and is set by ECN through an exit direction queue of the port by enabling an ECN function of the port1 and configuring a filtering count ACL table item of the port1 in an ACL table, wherein the filtering counter of the port1 in a ETPP stage of configuration in an initialization stage is associated with the report, the matching item is ECN field value is 01 or 10, and the action item is counted by the ECN set counter of the port1 when the message with the ECN field modified to 11.
The ECN field of the message 2011 is 11, the ECN field of the message 2012 is 01, the ECN field of the message 2013 is 10, the ECN fields of the messages 2021, 2022 are 01.
In the ECN link of ETPP, the outgoing physical port1 is identified based on the respective outgoing interface index oullif, outlif, outlif of the messages 2011, 2012, 2013, the messages 2011, 2012 are scheduled to the outgoing direction queue 0 of the port1 to which their respective priority information points, the messages 2013 are scheduled to the outgoing direction queue 7 of the port1 to which their priority information points, the physical port2 is read based on the respective outgoing interface index outlif, outlif of the messages 2021, 2022, and the messages 2021, 2022 are scheduled to the outgoing direction queue 0 of the port2 to which their respective priority information points.
When the length of the outgoing direction queue 0-7 of the Port1 of the network device is larger than (QL_min) and smaller than the queue ECN threshold value, or the length of the outgoing direction queue 0-7 of the Port1 is larger than (QL_min) and larger than the queue ECN threshold value, the exchange chip sets the ECN of the field of the message of ECN field 00 or 01 according to the WRED strategy in proportion.
In fig. 2, the switching chip of the network device determines, according to the WRED policy, that the ECN field of the packet 2011 entering the egress direction queue 0 of port1 is 11, and does not modify the ECN field. The switch chip of the network device performs encapsulation for the packet 2011 based on the encapsulation information of the output interface index outlif, and forwards the packet from port 1.
The switching chip of the network device modifies 01 of the ECN field of the message 2012 entering port 1's outbound queue 0 to 11 according to WRED policy, and the ECN set counter of port1 counts the messages 2012 matching port1 filtering count ACL entries. The switch chip of the network device, based on the encapsulation information of the outbound interface index outlif, encapsulates the message 2012 and forwards the message from port 1.
The exchange chip of the network device modifies 10 of ECN field of the message 2013 entering port1 and exiting to the queue 7 to 11 according to WRED strategy, and ECN set counter of port1 filters and counts the message 2013 of the ACL table item for matching port 1. The switch chip of the network device, based on the encapsulation information of the outbound interface index outlif, encapsulates the packet 2013 and forwards the packet from port 1.
When the queue length of the outbound queue 0-7 of the Port2 of the network device is greater than (ql_min) and less than the queue ECN threshold, or the queue length of the outbound queue 0-7 of the Port1 is greater than (ql_min) and greater than the queue ECN threshold.
The exchange chip of the network device modifies ECN field 01 of messages 2011, 2012 entering port2 and exiting from queue 0 to 11 according to WRED strategy, and after encapsulation is executed for messages 2021, 2022 according to encapsulation information of exit interface indexes outlif4, outlif5, respectively, the messages are forwarded from port 2.
The ECN function of port2 is not enabled by the network device, and the corresponding filter count table entry is not set in the ACL table, so that even if setting of the ECN fields for messages 2021, 202 is completed in the outgoing queue of port2, the ECN set counter initially set on port2 will not count these two messages.
When ECN field of any outgoing direction queue message which is scheduled to port1 and port2 is 00, ECN processing is carried out according to queue length and WRED strategy, the messages are not matched with filtering count ACL table items, and ECN setting counters of ports port1 and port2 in ETPP stages are not initialized.
As described above, when the ECN field of the packet 2011 scheduled to the outbound queue 0 of port1 is 11, the packet 2011 is processed according to WRED policy, and does not match the port11 filtering count ACL entry, excluding the ECN set packet already completed by other devices.
In this way, the network device can distinguish between counting in the outgoing direction of the port, counting no messages 2011 sent out by port1 that have been set by other devices to perform ECN field setting, counting sent messages 2012, 2013 of port1, and counting no messages for port2 of the ECN function that is not enabled.
The processor of the network device reads the count value of the ECN set counter of port1, e.g., 2, i.e., the number of messages in the outgoing queue of port1 specified by the ECN set counter based on the local congestion limit control flag statistics entered by the input medium by executing machine-executable instructions recorded on the machine-readable storage medium.
The processor of the network device, by executing machine-executable instructions recorded on a machine-readable storage medium, announces to the console the number of messages set by the local ECN in the outbound queue of the designated port1 via a generic remote procedure call gRPC message (message).
The processor of the network device, by executing machine-executable instructions recorded on the machine-readable storage medium, outputs the number of messages set by the local ECN in the outbound queue of the designated port1 via the display medium.
In this way, the network device provides a command line view or actively reports the control console, displays the number of messages with the ECN field set to 11 due to congestion control of the port1 outbound queue, and performs quantitative and refined statistics on the congestion condition of the port outbound queue. In complex network environments, the data-to-message forwarding may be used to dynamically tune the data-to-message forwarding path.
Fig. 3 is a schematic diagram of an embodiment of a device for setting a packet based on port statistics local congestion marks according to the present application. The device 30 comprises a processor 31, a machine-readable storage medium 32, a switching chip 33 and a network interface 34. The processor 31 executes the set-up module 321, the statistics module 322 by executing machine-executable instructions recorded by the machine-readable storage medium 32. The switch chip 33 at least forwards the module 331 and the scheduling module 332.
The device comprises a setting module 321, a forwarding module 331, a scheduling module 332, and a WRED policy early detection module, wherein the setting module 321 is used for setting a first port counter for a first physical port, enabling a congestion notification ECN function of the first physical port, generating a filtering count access control ACL table item for the first physical port in an access control table, wherein the ECN field value indicates that congestion is not caused and ECN is supported, the action item is used for counting messages with ECN field modified to indicate congestion and ECN is supported through the first counter, the forwarding module 331 is used for analyzing the output port of the output interface information of the first message as the first physical port, the scheduling module 332 is used for scheduling the first message to the output direction queue of the corresponding first physical port based on the priority of the first message, and performing congestion control processing on each output direction queue of the first physical port according to the weighted random early detection WRED policy.
The device comprises a setting module 321 for setting a second port counter for a second physical port, a forwarding module 331 for analyzing the output port of the output interface information of the second message as the second physical port, and a scheduling module 332 for scheduling the second message to the output direction queue of the corresponding second physical port based on the priority of the second message.
A statistics module 322, configured to read the count value of the first port counter based on the local congestion limit control flag statistics instruction. Statistics module 322 also informs the console of the count value of the first port counter via a generic remote procedure call message. The statistics module 322 is further configured to output the count value of the first port counter through the display medium.
In the present disclosure, a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that stores or contains information (e.g., executable instructions, data, etc.). For example, any machine-readable storage medium described herein may be any type of Random Access Memory (RAM), volatile memory, non-volatile memory, flash memory, a storage drive (e.g., hard drive), a solid state drive, any type of storage optical disc (e.g., optical disc, DVD, etc.), and the like, or a combination thereof. Furthermore, any machine-readable storage medium described herein may be non-transitory machine-readable storage medium.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the application.