Method and apparatus for determining ecn waterline
By automatically adjusting the ECN waterline upon receiving sample data packets during the training period, the problem of low efficiency in ECN waterline determination in existing technologies is solved, achieving more efficient ECN waterline determination and improved data packet transmission stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- RUIJIE NETWORKS CO LTD
- Filing Date
- 2024-12-26
- Publication Date
- 2026-06-26
AI Technical Summary
In existing technologies, the determination efficiency of ECN waterlines is low, making it difficult for switches to adjust accurately during congestion, which affects the stability of data packet transmission and bandwidth utilization.
By receiving multiple sample data packets during the training period, and utilizing the initial ECN waterline of the switch and the sample data packets, the target ECN waterline is automatically adjusted, simplifying the process of determining the ECN waterline and reducing the reliance on manual intervention.
It improves the efficiency of ECN waterline determination, simplifies the adjustment process, reduces the difficulty for parameter tuning personnel, shortens the time, and improves the stability of data packet transmission and bandwidth utilization.
Smart Images

Figure CN122293552A_ABST
Abstract
Description
Technical Field
[0001] This application relates to fields such as artificial intelligence, communications, and switches, and in particular to a method and apparatus for determining ECN waterlines. Background Technology
[0002] Currently, switches can forward data packets from the sending end to the receiving end. During the process of forwarding data packets, congestion may occur, leading to data packet loss.
[0003] To prevent packet loss due to congestion, an Explicit Congestion Notification (ECN) mechanism is proposed. The current ECN mechanism works by marking packets with ECN when the number of buffer units occupied by packets forwarded by the switch in the outgoing port queue exceeds the target ECN threshold. When the receiving end receives a packet with the ECN mark, it notifies the sending end to reduce the rate at which packets are sent, thereby preventing packet loss.
[0004] In related technologies, the ECN waterline is usually calculated first based on theoretical calculation formulas, and then the calculated ECN waterline is adjusted by the parameter tuning personnel to obtain the target ECN waterline, which results in low efficiency in obtaining the target ECN waterline. Summary of the Invention
[0005] This application provides a method and apparatus for determining ECN waterlines, which can improve the efficiency of obtaining target ECN waterlines.
[0006] In a first aspect, embodiments of this application provide a method for determining the ECN waterline, including:
[0007] Obtain the training duration and receive multiple sample data packets within the training duration;
[0008] Based on the initial ECN waterline of the switch and the multiple sample data packets, the target ECN waterline of the switch is determined. The target ECN waterline is used by the switch to forward data packets received from the sending end.
[0009] In one possible implementation, the training duration includes at least two sub-durations; determining the target ECN waterline of the switch based on the initial ECN waterline of the switch and the plurality of sample data packets includes:
[0010] Based on the (n-1)th ECN waterline, the preset packet loss probability of the switch, and the preset priority-based flow control (PFC) waterline, multiple first data packets are trained for forwarding to obtain the nth forwarding result; and based on the nth forwarding result and the (n-1)th ECN waterline, the nth ECN waterline is determined; n is incremented by 1, and the forwarding training process is repeated until n equals N; wherein, the multiple first data packets are the data packets received in the nth sub-time period among the multiple sample data packets;
[0011] Initially, n equals 1, and the (n-1)th ECN waterline is the initial ECN waterline;
[0012] At the end, n equals the total number of the at least two sub-durations, and the nth ECN waterline is the target ECN waterline.
[0013] In one possible implementation, the nth forwarding result includes: the number of ECN tags, the number of PFC backpressure frames, the maximum number of buffer units occupied by the plurality of first data packets, and the maximum occupancy rate of the header buffer by the switch during the training process of forwarding the plurality of first data packets;
[0014] The step of determining the nth ECN waterline based on the nth forwarding result and the (n-1)th ECN waterline includes:
[0015] The waterline adjustment weight is determined based on the number of ECN tags, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate.
[0016] Adjust the weight of the waterline and adjust the (n-1)th ECN waterline to obtain the nth ECN waterline.
[0017] In one possible implementation, determining the waterline adjustment weight based on the number of ECN tags, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate includes:
[0018] When the occupancy rate is greater than or equal to the occupancy rate threshold, a first weight is determined based on the number of ECN tags, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate. The first weight is used to adjust the high waterline value in the (n-1)th ECN waterline.
[0019] When the maximum number is greater than or equal to the number threshold, the magnitude corresponding to the number of ECN tags is obtained; based on the magnitude, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate, a second weight is determined, and the second weight is used to adjust the low waterline value in the (n-1)th ECN waterline;
[0020] The waterline adjustment weight includes the first weight and the second weight.
[0021] In one possible implementation, the (n-1)th ECN waterline is adjusted according to the waterline adjustment weight to obtain the nth ECN waterline, including:
[0022] Based on the first weight, adjust the high water value in the (n-1)th ECN water line to obtain the high water value in the nth ECN water line;
[0023] Based on the second weight, the low water value in the (n-1)th ECN water line is adjusted to obtain the low water value in the nth ECN water line.
[0024] In one possible implementation, the method further includes:
[0025] Determine the difference between the packet forwarding rate in the (n-1)th forwarding result and the packet forwarding rate in the nth forwarding result;
[0026] When the difference in the rates is greater than or equal to the rate threshold, the nth ECN waterline is determined again.
[0027] In one possible implementation, the method further includes:
[0028] The nth forwarding result is stored and sent to the user equipment; and / or, the nth training status information is obtained, stored, and sent to the user equipment; wherein the nth forwarding result and / or the nth training status information are used for display by the user equipment;
[0029] The nth ECN status information includes one or more of the following:
[0030] The state of the switch is either training state, training not started state, or training ended state.
[0031] The remaining training time is the difference between the training time and the current completion time, where the current completion time is the sum of the previous n sub-times.
[0032] The current training progress is the ratio of the current completion time to the total training time.
[0033] In one possible implementation, the method further includes:
[0034] Store the time information of the nth forwarding result, and / or send the time information to the user equipment.
[0035] In one possible implementation, receiving multiple sample data packets includes:
[0036] The server receives the plurality of sample data packets, which are data packets generated by the traffic service model in the server.
[0037] Secondly, embodiments of this application provide an apparatus for determining an ECN waterline, comprising:
[0038] The processing module is used to obtain the training duration;
[0039] The transceiver module is used to receive multiple sample data packets within the training duration;
[0040] The processing module is further configured to determine the target ECN waterline of the switch based on the initial ECN waterline of the switch and the plurality of sample data packets, wherein the target ECN waterline is used by the switch to forward data packets received from the sending end.
[0041] In one possible implementation, the training duration includes at least two sub-durations; the processing module is specifically used for:
[0042] Based on the (n-1)th ECN waterline, the preset packet loss probability of the switch, and the preset priority-based flow control (PFC) waterline, multiple first data packets are trained for forwarding to obtain the nth forwarding result; and based on the nth forwarding result and the (n-1)th ECN waterline, the nth ECN waterline is determined; n is incremented by 1, and the forwarding training process is repeated until n equals N; wherein, the multiple first data packets are the data packets received in the nth sub-time period among the multiple sample data packets;
[0043] Initially, n equals 1, and the (n-1)th ECN waterline is the initial ECN waterline;
[0044] At the end, n equals the total number of the at least two sub-durations, and the nth ECN waterline is the target ECN waterline.
[0045] In one possible implementation, the nth forwarding result includes: the number of ECN tags, the number of PFC backpressure frames, the maximum number of buffer units occupied by the plurality of first data packets, and the maximum occupancy rate of the header buffer by the switch during the training process of forwarding the plurality of first data packets; the processing module is specifically used for:
[0046] The waterline adjustment weight is determined based on the number of ECN tags, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate.
[0047] Adjust the weight of the waterline and adjust the (n-1)th ECN waterline to obtain the nth ECN waterline.
[0048] In one possible implementation, the processing module is specifically used for:
[0049] When the occupancy rate is greater than or equal to the occupancy rate threshold, a first weight is determined based on the number of ECN tags, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate. The first weight is used to adjust the high waterline value in the (n-1)th ECN waterline.
[0050] When the maximum number is greater than or equal to the number threshold, the magnitude corresponding to the number of ECN tags is obtained; based on the magnitude, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate, a second weight is determined, and the second weight is used to adjust the low waterline value in the (n-1)th ECN waterline;
[0051] The waterline adjustment weight includes the first weight and the second weight.
[0052] In one possible implementation, the processing module is specifically used for:
[0053] Based on the first weight, adjust the high water value in the (n-1)th ECN water line to obtain the high water value in the nth ECN water line;
[0054] Based on the second weight, the low water value in the (n-1)th ECN water line is adjusted to obtain the low water value in the nth ECN water line.
[0055] In one possible implementation, the processing module is further configured to:
[0056] Determine the difference between the packet forwarding rate in the (n-1)th forwarding result and the packet forwarding rate in the nth forwarding result;
[0057] When the difference in the rates is greater than or equal to the rate threshold, the nth ECN waterline is determined again.
[0058] In one possible implementation, the processing module is further configured to:
[0059] The nth forwarding result is stored and sent to the user equipment; and / or, the nth training status information is obtained, stored, and sent to the user equipment; wherein the nth forwarding result and / or the nth training status information are used for display by the user equipment;
[0060] The nth ECN status information includes one or more of the following:
[0061] The state of the switch is either training state, training not started state, or training ended state.
[0062] The remaining training time is the difference between the training time and the current completion time, where the current completion time is the sum of the previous n sub-times.
[0063] The current training progress is the ratio of the current completion time to the total training time.
[0064] In one possible implementation, the processing module is further configured to:
[0065] Store the time information of the nth forwarding result, and / or send the time information to the user equipment.
[0066] In one possible implementation, the transceiver module is specifically used for:
[0067] The server receives the plurality of sample data packets, which are data packets generated by the traffic service model in the server.
[0068] Thirdly, embodiments of this application provide a switch, including: a memory and a processor;
[0069] The memory stores computer-executed instructions;
[0070] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0071] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0072] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0073] The method and apparatus for determining the ECN waterline provided in this application embodiment allow the switch to receive multiple sample data packets during the training period and determine the target ECN waterline based on the initial ECN waterline and the multiple sample data packets. This method requires no manual intervention and can intelligently determine the accurate target ECN waterline, greatly simplifying the ECN waterline adjustment process, reducing the difficulty for parameter tuners to adjust the ECN waterline, and shortening the time required to obtain the ECN waterline. Attached Figure Description
[0074] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0075] Figure 1 A schematic diagram of an ECN waterline and labeling rate provided for an embodiment of this application;
[0076] Figure 2 A schematic diagram of the structure of an ECN waterline determination system provided in this application embodiment;
[0077] Figure 3 One of the flowcharts illustrating the method for determining the ECN waterline provided in this application embodiment;
[0078] Figure 4 A second schematic flowchart illustrating the method for determining the ECN waterline provided in this application embodiment;
[0079] Figure 5 The third flowchart illustrating the method for determining the ECN waterline provided in this application embodiment;
[0080] Figure 6 A schematic diagram of the structure of an ECN waterline determination device provided in an embodiment of this application;
[0081] Figure 7 This is a schematic diagram of the structure of a switch provided in an embodiment of this application.
[0082] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0083] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0084] The following explains the relevant terms in the embodiments of this application:
[0085] A buffer cell, located within a switch, is used to temporarily store data packets that the switch cannot forward in a timely manner. When the number of data packets that need to be forwarded by the switch exceeds its forwarding capacity, the excess packets are temporarily stored in a buffer cell, waiting for a suitable opportunity to be forwarded.
[0086] The ECN waterline, also known as the flow control threshold, refers to the threshold used to trigger ECN marking when congestion occurs in the outgoing port queue of a switch. When the number of buffer units occupied by packets forwarded by the switch in the outgoing port queue exceeds this threshold, the switch marks the packets with ECN to indicate that congestion has occurred. The ECN waterline includes a low waterline value and a high waterline value. When the number of buffer units occupied by packets forwarded by the switch is greater than the low waterline value but less than the high waterline value, the switch probabilistically marks the packets with ECN. When the number of buffer units occupied by packets forwarded by the switch is greater than or equal to the high waterline value, the switch marks all packets with ECN. The low waterline value aims to provide early warning of potential congestion, while the high waterline value aims to ensure rapid triggering of ECN marking in cases of severe congestion.
[0087] The number of available buffer units in the switch's output port queue.
[0088] The ECN tag is a specific field set in the IP header of data packets forwarded by a switch to indicate the congestion status of the switch's outgoing port queue. When a switch detects congestion in its outgoing port queue, it changes this specific field in the IP header of the data packet to the ECN field, which indicates that the switch is congested. When the receiving end receives a data packet with the ECN field, it knows that the switch is congested.
[0089] A PFC backpressure frame (PFC PAUSE frame) is a key signal frame in the Priority-based Flow Control (PFC) mechanism. When a switch receives data packets, it places them into the corresponding queue according to their priority. If the queue length for a certain priority exceeds a preset threshold (i.e., congestion occurs), the switch generates and sends a PFC PAUSE frame to the sender of the data packets. Upon receiving the PFC PAUSE frame, the sender stops sending data packets of that priority.
[0090] The Headroom Buffer is used to store data packets received during the period from when a PFC PAUSE frame is sent until the sender stops sending data packets.
[0091] The traffic service model is mainly used to describe the basic characteristics of the data packets sent by the server to the switch, such as the arrival interval of the data packets, the proportion or distribution of the data packets of different sizes, the transmission rate of the data packets, etc.
[0092] In the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and effects. For example, the first value and the second value are only used to distinguish different values, and do not limit their sequence. Those skilled in the art can understand that the terms such as "first" and "second" do not limit the quantity and execution order, and the terms such as "first" and "second" do not necessarily limit being different.
[0093] It should be noted that in the embodiments of the present application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplarily" or "for example" in the present application should not be construed as being more preferred or more advantageous than other embodiments or design solutions. Exactly speaking, using words such as "exemplarily" or "for example" aims to present relevant concepts in a specific way.
[0094] In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally represents that the front and rear associated objects are in an "or" relationship. "At least one (item)" or its similar expression refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b, or c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, c can be single or multiple.
[0095] Figure 1 This is a schematic diagram of the ECN waterline and marking rate provided for the embodiments of the present application, as Figure 1 shown, the vertical axis in the coordinate system is the marking rate, representing the probability that the data packet is marked by ECN; the horizontal axis in the coordinate system is the number of buffer units, representing the number of buffer units occupied by the data packets forwarded by the switch in the switch output port queue.
[0096] When the number of buffer units is less than or equal to the low waterline value, the switch does not perform ECN marking on the data packets, that is, the marking rate is 0%.
[0097] When the number of buffer units is greater than the low waterline value and less than the high waterline value, the switch performs ECN marking on the data packets at a certain marking rate. As Figure 1As shown, the switch marks packets with ECN at a gradually increasing marking rate, which increases linearly with the number of buffer units until the maximum marking rate shown in the figure.
[0098] When the number of buffer units is greater than or equal to the high watermark value, the switch will definitely mark the data packets with ECN, that is, the marking rate is 100%.
[0099] When the number of buffer units exceeds the number of outgoing water lines, the switch generates a PFC backpressure frame.
[0100] In current AIGC (Generative Artificial Intelligence Generated Content) application scenarios, AIGC networking architectures are primarily built based on two schemes: one is based on InfiniBand (IB) technology, and the other is based on Remote Direct Memory Access over Converged Ethernet (ROCE) networks. Due to the closed nature of IB technology, ROCE networks have become the preferred solution for building AIGC networking architectures in many AIGC application scenarios. However, ROCE networks are extremely sensitive to packet loss. Even a 1% packet loss rate on the switches in the network architecture can cause the ROCE network performance to drop by more than 90%, posing a serious challenge to the stability and efficiency of the ROCE network. To address the sensitivity of ROCE networks to packet loss, when building an AIGC networking architecture based on ROCE networks, the switches in the network architecture need to support Priority Flow Control (PFC) and ECN mechanisms to prevent packet loss.
[0101] The core of the ECN mechanism is configuring the target ECN waterline. If the target ECN waterline is too high, the ECN mechanism may only be triggered when the switch is severely congested, failing to alleviate the congestion in time and leading to packet loss. If the target ECN waterline is too low, the ECN mechanism may be triggered even when the switch is not congested, resulting in low bandwidth utilization. Therefore, an accurate target ECN waterline can prevent packet loss and ensure a lossless ROCE network, while also avoiding frequent backpressure and the resulting low bandwidth utilization.
[0102] Currently, the ECN waterline is usually calculated based on theoretical formulas. However, the calculated ECN waterline may be inaccurate. Therefore, experienced parameter tuning personnel are needed to adjust the calculated ECN waterline to obtain the target ECN waterline.
[0103] However, tuning personnel face numerous difficulties when adjusting ECN waterlines. Firstly, some lack the technical background to accurately adjust ECN waterlines. Even experienced tuners require at least five days to find a suitable ECN waterline. Therefore, adjusting ECN waterlines is difficult, time-consuming, and labor-intensive. Furthermore, the found ECN waterline may be inaccurate, leading to poor ROCE network performance, and excessively long adjustment times can even cause the final product launch to be delayed. Secondly, different traffic service models require different optimal ECN waterlines. When traffic service models change, tuners need to readjust ECN waterlines, significantly increasing the time and wasting manpower.
[0104] In view of this, this application proposes a method for determining the ECN waterline. In this method, multiple sample data packets are received during the training period, and the target ECN waterline is determined based on the initial ECN waterline and the multiple sample data packets. No manual intervention is required, which simplifies the process of obtaining the target ECN waterline, reduces the dependence on parameter tuning personnel, simplifies the difficulty of adjusting the ECN waterline, and improves the efficiency of obtaining the target ECN waterline.
[0105] Figure 2 This application provides a schematic diagram of the structure of an ECN waterline determination system, as shown in the embodiments of this application. Figure 2 As shown, the system includes: user equipment, server, and switch. Both the user equipment and the server can communicate with the switch.
[0106] User equipment is used to send training duration to the switch.
[0107] The server generates multiple sample data packets and sends them to the switch. These sample data packets are used for switch training.
[0108] A switch is used to receive multiple sample data packets during the training period and determine the target ECN waterline based on the initial ECN waterline and the multiple sample data packets.
[0109] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0110] Figure 3 This is one of the flowcharts illustrating the method for determining the ECN waterline provided in the embodiments of this application, such as... Figure 3 As shown, the method includes:
[0111] S301, Obtain training duration.
[0112] Optionally, the execution entity in this application embodiment is a switch, or it can be an ECN waterline determination device installed in the switch. The ECN waterline determination device can be implemented through a combination of software and / or hardware. The ECN waterline determination device includes, but is not limited to, […]. Figure 5 The modules, memory, and registers shown.
[0113] Optionally, obtaining the training duration includes: the switch receiving configuration information sent by the user equipment and parsing the configuration information to obtain the training duration.
[0114] Optionally, the user equipment may send configuration information to the switch using either method 1 or method 2.
[0115] Method 1: The user equipment includes an operation and maintenance platform. The user equipment responds to the configuration operation performed by the user in the operation and maintenance platform, obtains the configuration information, and sends the configuration information to the switch based on the Network Configuration Protocol (Netconf).
[0116] Method 2: The user equipment can display a command line interface (CLI). The user equipment responds to the CLI commands entered by the user and sends configuration information to the switch.
[0117] Optionally, the training duration can be, for example, 1 hour, 2 hours, 4 hours, 24 hours, etc.
[0118] Optionally, after parsing the configuration information, if the training duration is not obtained, the preset training duration is read from memory or the ECN register, and the preset training duration is determined as the training duration obtained in S301.
[0119] Optionally, the preset training duration can be set to, for example, 1 hour, 2 hours, etc.
[0120] S302, Receive multiple sample data packets within the training duration.
[0121] Optionally, multiple sample data packets can be sent from the server to the switch. The server can start sending sample data packets to the switch before or after S301 (when the switch obtains the training duration).
[0122] For example, if the switch obtains the training duration at 11:10, and the server sends sample data packets to the switch before S301, this start time can be 11:00. Furthermore, when the training duration is 30 minutes, the switch can receive sample data packets sent by the server between 11:10 and 11:40 to obtain multiple sample data packets in S302.
[0123] For example, if the switch obtains the training duration at 11:10, and the server starts sending sample data packets to the switch after S302, that start time can be 11:30. Furthermore, when the training duration is 30 minutes, the switch can receive sample data packets sent by the server between 11:30 and 12:00 to obtain multiple sample data packets in S302.
[0124] Optionally, after parsing the configuration information, the switch can also obtain enable indication information. This enable indication information is used to indicate whether training has started or stopped.
[0125] For example, when the enable indicator is 1, training is initiated; when the enable indicator is 0, training is stopped.
[0126] When the enable instruction indicates that training has started, multiple sample data packets are received during the training duration.
[0127] S303. Based on the initial ECN waterline and multiple sample data packets, determine the target ECN waterline. The target ECN waterline is used by the switch to forward data packets received from the sending end.
[0128] In some embodiments, S303 includes: performing forwarding training on multiple sample data packets based on the initial ECN waterline, the switch's preset packet loss probability, and the switch's preset PFC waterline to obtain the target forwarding result; and obtaining the target ECN waterline based on the target forwarding result and the initial ECN waterline.
[0129] Optionally, after parsing the configuration information, the switch may also obtain the initial ECN waterline, the switch's preset packet loss probability, and the switch's preset PFC waterline.
[0130] Optionally, after parsing the configuration information, if the switch does not obtain the initial ECN waterline, the switch's preset packet loss probability, and the switch's preset PFC waterline, it can read the initial ECN waterline, the switch's preset packet loss probability, and the switch's preset PFC waterline from the switch's memory. The initial ECN waterline may be the target ECN waterline obtained in the previous training.
[0131] Optionally, the switch can store the initial ECN waterline, the switch's preset packet loss probability, and the switch's preset PFC waterline in the ECN register.
[0132] In some embodiments, the target forwarding result includes: the number of ECN tags, the number of PFC backpressure frames, the maximum number of buffer units occupied by multiple sample packets, and the maximum occupancy rate of the header buffer during the training process of forwarding multiple sample packets by the switch.
[0133] The initial ECN waterline includes: high waterline value and low waterline value.
[0134] The target ECN waterline includes: high waterline value and low waterline value.
[0135] In some embodiments, obtaining the target ECN waterline based on the target forwarding result and the initial ECN waterline includes: when the maximum occupancy rate is greater than or equal to an occupancy rate threshold, determining a first weight based on the number of ECN tags, the number of PFC backpressure frames, the maximum number, and the maximum occupancy rate, wherein the first weight is used to adjust the high waterline value in the initial ECN waterline; adjusting the high waterline value in the initial ECN waterline based on the first weight to obtain the high waterline value of the target ECN waterline; when the maximum number is greater than or equal to a number threshold, obtaining the magnitude corresponding to the number of ECN tags; determining a second weight based on the magnitude, the number of PFC backpressure frames, the maximum number, and the maximum occupancy rate, wherein the second weight is used to adjust the low waterline value in the initial ECN waterline; and adjusting the low waterline value in the initial ECN waterline based on the second weight to obtain the low waterline value in the target ECN waterline.
[0136] Optionally, the product of the first weight and the high waterline value in the initial ECN waterline is determined as the high waterline value of the target ECN waterline; the product of the second weight and the low waterline value in the initial ECN waterline is determined as the low waterline value of the target ECN waterline.
[0137] In the method for determining the ECN waterline provided in this application embodiment, the switch receives multiple sample data packets during the training period and determines the target ECN waterline based on the initial ECN waterline and the multiple sample data packets. This method does not require manual intervention, reduces the difficulty of adjusting the ECN waterline, and reduces the time spent adjusting the ECN waterline.
[0138] In some embodiments, the training duration includes multiple sub-durations, and the switch can perform forwarding training within each sub-duration to obtain the target ECN waterline. The following combines... Figure 4 This embodiment will be described.
[0139] Figure 4 This is a second schematic flowchart illustrating the method for determining the ECN waterline provided in this application embodiment. Figure 4 As shown, the method includes:
[0140] S401. Obtain the training duration, which includes N sub-durations, where N is an integer greater than or equal to 2.
[0141] Optionally, the switch can also obtain sub-durations by parsing the configuration information. Sub-durations can also be called observation times, such as 1 minute, 30 minutes, or 1 hour.
[0142] Optionally, the switch divides the training duration by the sub-duration to obtain N.
[0143] S402. Receive multiple first data packets from the server within the nth sub-duration. Initially, n equals 1.
[0144] It should be understood that the multiple first data packets received within the nth sub-duration are data packets from the multiple sample data packets mentioned in S302 above. Optionally, the multiple sample data packets are data packets generated by the traffic service model in the server.
[0145] S403. Based on the (n-1)th ECN waterline, the switch's preset packet loss probability, and the switch's preset PFC waterline, perform forwarding training on multiple first data packets to obtain the nth forwarding result.
[0146] Initially, n equals 1, and the (n-1)th ECN waterline is the initial ECN waterline.
[0147] The (n-1)th ECN waterline includes: high waterline value and low waterline value.
[0148] In some embodiments, the nth forwarding result includes: the number of ECN tags, the number of PFC backpressure frames, the maximum number of buffer units occupied by multiple first packets, and the maximum occupancy rate of the header buffer during the training process of forwarding multiple first packets by the switch.
[0149] The number of ECN tags refers to the number of data packets carrying ECN tags.
[0150] S404. Determine the nth ECN waterline based on the nth forwarding result and the (n-1)th ECN waterline.
[0151] In some embodiments, S404 includes: determining the waterline adjustment weight based on the number of ECN tags, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate; adjusting the (n-1)th ECN waterline based on the waterline adjustment weight to obtain the nth ECN waterline.
[0152] In some embodiments, the waterline adjustment weights include a first weight and a second weight, wherein the first weight is used to adjust the high waterline value in the (n-1)th ECN waterline, and the second weight is used to adjust the low waterline value in the (n-1)th ECN waterline.
[0153] In some embodiments, the waterline adjustment weight is determined as follows: when the occupancy rate is greater than or equal to the occupancy rate threshold, a first weight is determined based on the number of ECN tags, the number of PFC backpressure frames, the maximum number, and the maximum occupancy rate; when the maximum number is greater than or equal to the number threshold, the magnitude corresponding to the number of ECN tags is obtained; and a second weight is determined based on the magnitude, the number of PFC backpressure frames, the maximum number, and the maximum occupancy rate.
[0154] Optionally, the number of ECN tags, the number of PFC anti-pressure frames, the maximum number, the maximum occupancy rate, and the first weight satisfy the first correspondence relationship.
[0155] For example, the first correspondence is shown in Table 1 below.
[0156] Table 1 First Correspondence Relationship
[0157] Number of ECN tags Number of PFC reverse compression frames Maximum quantity Maximum utilization rate First weight 10 2 50 80% 0.4 20 5 100 60% 0.6 30 6 150 40% 0.8 ... ... ... ... ...
[0158] Optionally, the number of ECN tags and their corresponding magnitudes satisfy a second correspondence.
[0159] For example, the second correspondence is shown in Table 2 below.
[0160] Table 2 Second Correspondence
[0161] Number of ECN tags Magnitude 0-10 1 11-50 2 51-100 3 More than 100 4
[0162] Optionally, the magnitude, the number of PFC anti-pressure frames, the maximum number, the maximum occupancy rate, and the second weight satisfy the third correspondence.
[0163] For example, the third correspondence is shown in Table 3 below.
[0164] Table 3 Third Correspondence Relationship
[0165] Magnitude Number of PFC reverse compression frames Maximum quantity Maximum utilization rate First weight 1 2 50 80% 0.4 2 5 100 60% 0.6 3 6 150 40% 0.8 ... ... ... ... ...
[0166] In some embodiments, adjusting the (n-1)th ECN waterline according to the waterline adjustment weight to obtain the nth ECN waterline includes: adjusting the high waterline value in the (n-1)th ECN waterline according to the first weight to obtain the high waterline value in the nth ECN waterline; and adjusting the low waterline value in the (n-1)th ECN waterline according to the second weight to obtain the low waterline value in the nth ECN waterline.
[0167] Optionally, the product of the first weight and the high waterline value in the (n-1)th ECN waterline is determined as the high waterline value of the nth ECN waterline; the product of the second weight and the low waterline value in the (n-1)th ECN waterline is determined as the low waterline value of the nth ECN waterline.
[0168] S405. Determine if n is less than N. If yes, execute S406; otherwise, execute 407.
[0169] In some embodiments, the nth forwarding result may also include: packet forwarding rate.
[0170] In some embodiments, S405 further includes: determining the difference between the packet forwarding rate in the (n-1)th forwarding result and the packet forwarding rate in the nth forwarding result; and determining the nth ECN waterline again when the difference in rates is greater than or equal to a rate threshold.
[0171] Optionally, first determine whether the difference in rates is greater than or equal to the rate threshold. If so, continue executing S402 to S404; otherwise, execute S405.
[0172] Alternatively, packet forwarding rate can also be referred to as bandwidth utilization.
[0173] Optionally, the rate threshold is, for example, 10%, 11%, or 15%.
[0174] S406. Increment n by 1, and continue executing S402 to S405.
[0175] S407. Determine the nth ECN waterline as the target ECN waterline.
[0176] At the end, n equals N, and the nth ECN waterline is the target ECN waterline.
[0177] In the ECN waterline determination method provided in this application embodiment, the switch performs forwarding training on the first data packet generated by the traffic service model received in each sub-time period. After multiple forwarding trainings, the target ECN waterline is determined. Since the target ECN waterline is obtained based on multiple forwarding trainings, and the first data packet of the forwarding training directly comes from the data packet that conforms to the traffic service model, the target ECN waterline is highly matched with the traffic service model, which can more accurately reflect the congestion situation of the switch, effectively avoid unnecessary packet loss, and thus improve the bandwidth utilization.
[0178] Figure 5 This is the third flowchart illustrating the method for determining the ECN waterline provided in this application embodiment. Figure 5 As shown, the method includes:
[0179] S501, User equipment sends configuration information to the switch.
[0180] In some embodiments, the switch includes a QoS-CLI parsing module, memory, an ECN adaptive module, an ECN register, and a statistics module.
[0181] Configuration information is used to configure the relevant parameters required by the switch during forwarding training, such as enable indication information, training duration, and sub-duration.
[0182] The S502 switch's Quality of Service Command Line Interface (QoS-CLI) parsing module parses the configuration information to obtain enable indication information, training duration, and sub-duration.
[0183] The S503 and QoS-CLI parsing modules store enable indication information, training duration, and sub-duration in the switch's memory.
[0184] S504: The ECN adaptive module in the switch reads the enable indication information, training duration, and sub-duration from the memory.
[0185] The S505 and ECN adaptive modules can also store enable indication information in the ECN register.
[0186] The enable indication information stored in the ECN register can be modified. For example, when the enable indication information is 1, it can be modified to 0.
[0187] S506, ECN adaptive module determines the enable indication information to indicate the start of training.
[0188] S507: The server generates multiple sample data packets based on the traffic service model and sends these sample data packets to the switch.
[0189] S508 and the ECN adaptive module perform forwarding training on multiple first data packets received from the server within the nth sub-duration based on the (n-1)th ECN waterline, the preset packet loss probability, and the preset PFC waterline, to obtain the nth forwarding result. The multiple sample data packets include multiple first data packets.
[0190] Optionally, the ECN adaptive module can obtain at least one of the following from memory or the ECN register: the (n-1)th ECN watermark, the preset packet loss probability, and the preset PFC watermark.
[0191] S509, the ECN adaptive module determines the nth ECN waterline based on the nth forwarding result and the (n-1)th ECN waterline.
[0192] S510, ECN adaptive module obtains the nth ECN status information.
[0193] In some embodiments, the nth ECN status information includes one or more of the following: the status of the switch, the remaining training time, and the current training progress.
[0194] The switch status is recorded by the ECN adaptive module. The switch status can be training, training not started, or training completed. The training status indicates that the ECN adaptive module is performing forwarding training. The training not started status indicates that the ECN adaptive module has not started training.
[0195] The training completion status indicates that the ECN adaptive module has finished forwarding training. This training completion status can also be called the stable operating state. When the switch is in a stable operating state, it can forward packets from the sender according to the target ECN watermark.
[0196] It should be noted that when the switch is in the training state, the nth ECN status information may also include the remaining training time and / or the current training progress.
[0197] The remaining training time can be the difference between the total training time and the current completion time, where the current completion time is the sum of the previous n sub-times. Optionally, the ECN adaptive module determines the current completion time by multiplying n by the sub-times. For example, if the total training time is 24 hours, n is 2, and the sub-time is 1 hour, then the current completion time is determined to be 2 hours, and the remaining training time is determined to be 22 hours.
[0198] The current training progress is the ratio of the current completion time to the total training time. For example, if the training time is 24 hours, n is 4, and the sub-time is 1 hour, then the current completion time is determined to be 4 hours, and the training progress is determined to be 4 / 24.
[0199] Optionally, the ECN adaptive module can read the enable indication information in memory or the ECN register; determine the number N of sub-durations included in the training duration based on the sub-duration and the training duration; and determine the state of the switch based on the enable indication information, n, and N.
[0200] When the enable indicator message indicates training has started and n is less than N, the switch is determined to be in the training state. When the enable indicator message indicates training has started and n is not less than N, the switch is determined to be in the training end state. When the enable indicator message indicates training has stopped and n is less than N, the switch is determined to be in the training not started state. When the enable indicator message indicates training has stopped and n is not less than N, the switch is determined to be in the training end state.
[0201] The S511a ECN adaptive module stores the nth forwarding result, the nth ECN watermark, and the nth ECN status information in memory.
[0202] Optionally, the ECN adaptive module may also store at least one of the nth forwarding result, the nth ECN watermark, and the nth ECN status information in the ECN register.
[0203] Optionally, the ECN adaptive module stores a portion of the nth forwarding result, the nth ECN watermark, and the nth ECN status information in memory, and stores the remainder in the ECN register.
[0204] In this embodiment of the application, the nth forwarding result, the nth ECN waterline, and the nth ECN status information are stored in memory. The user equipment can respond to the CLI command entered by the user in the CLI to view one or more of the nth forwarding result, the nth ECN waterline, and the nth ECN status information in the switch's memory and / or ECN register. The CLI command is, for example, the show command.
[0205] The S511b ECN adaptive module sends the nth forwarding result, the nth ECN watermark, and the nth ECN status information to the user equipment.
[0206] In some embodiments, after S510 is executed, S511a and S511b can be executed in a different order or simultaneously.
[0207] In some embodiments, S511a and S511b are optional, and one or more of these steps may be omitted in different embodiments.
[0208] Optionally, the ECN adaptive module can also send training duration, sub-duration, preset packet loss probability, and preset PFC waterline to the user device.
[0209] In some embodiments, the nth forwarding result and / or the nth ECN status information are used for display via user equipment.
[0210] Optionally, the switch sends the nth forwarding result, the nth ECN waterline, and the nth ECN status information to the user equipment, including the operation and maintenance platform, through a preset protocol, so that the user equipment, including the operation and maintenance platform, can display one or more of the nth forwarding result, the nth ECN waterline, and the nth ECN status information. The preset protocol is, for example, the Google Remote Procedure Call (GRPC) protocol.
[0211] In this embodiment of the application, the user equipment can display the nth forwarding result, the nth ECN watermark, and the nth ECN status information, so that the user can clearly see the forwarding status of the data packets in the switch through the user equipment, and can better delineate and locate the problem.
[0212] The S512 ECN adaptive module sends the nth forwarding result to the statistics module in the switch.
[0213] Optionally, the statistics module can also retrieve the nth forwarding result from a register or memory.
[0214] S513a The statistics module stores the time information of the nth forwarding result in memory.
[0215] Optionally, the time information of the nth forwarding result can be obtained by the following method: when the statistics module receives the nth forwarding result, it generates a corresponding timestamp based on the time of receiving the nth forwarding result; based on the timestamp, the nth forwarding result is marked to obtain the time information of the nth forwarding result.
[0216] In this embodiment, since the time information of the nth forwarding result is stored in the memory, when the user equipment responds to the CLI command entered by the user in the CLI, the user equipment can view the nth forwarding result for a specific time period based on the time information.
[0217] S513b: The statistics module sends the time information of the nth forwarding result to the user equipment.
[0218] In some embodiments, after S512 is executed, S513a and S513b can be executed in an interchangeable order or simultaneously.
[0219] In some embodiments, steps S512, S513a, and S513b are optional, and one or more of these steps may be omitted in different embodiments.
[0220] Optionally, the switch sends the time information of the nth forwarding result to user equipment, including the operation and maintenance platform, through a preset protocol.
[0221] Optionally, the operation and maintenance platform in the user equipment can visualize the time information of the nth forwarding result, so that users can see the changes in the congestion status of the switch's forwarding more quickly and intuitively, improve the user experience, and quickly locate the problem.
[0222] Optionally, the statistics module may also record and count the number of packets carrying ECN tags in each queue of the switch's outgoing port (Transmit, TX) queue, and / or record and count the number of packets carrying ECN tags in each queue of the switch's incoming port (Receive, RX) queue, when the ECN adaptive module performs forwarding training processing.
[0223] Optionally, after the statistics module completes the counting of the number of data packets carrying ECN tags in the queue, it generates a corresponding timestamp based on the time when the counting of the number of data packets carrying ECN tags in the queue is completed; based on the timestamp, it marks the number of data packets carrying ECN tags in the queue to obtain the time information of the number of data packets carrying ECN tags in the queue.
[0224] Optionally, the statistics module stores the time information of the number of data packets carrying ECN tags in the queue in memory, or the statistics module sends the time information of the number of data packets carrying ECN tags in the queue to the user equipment.
[0225] Optionally, user equipment can view the number of packets carrying ECN tags in the queue for a specific time period based on time information.
[0226] In this embodiment, the number of packets carrying ECN tags in each queue of the switch's outgoing and incoming port queues is counted, achieving higher-granularity data statistics, improving the accuracy and diversity of data statistics, and making it easier for users to better understand and respond to the congestion state of the switch during the forwarding training process.
[0227] Furthermore, after executing S513b, S405 to 407 mentioned above can also be executed.
[0228] Optionally, the Nth ECN waterline stored in the ECN register is the target ECN waterline, and the switch forwards data packets from the sender according to the target ECN waterline in the ECN register.
[0229] In some embodiments, when the traffic service model in the server changes, the server generates multiple sample data packets based on the new traffic service model. The switch takes the target ECN waterline obtained before the traffic service model changes as the initial ECN waterline, and executes S502 to S513 again based on the multiple sample data packets generated by the new traffic service model to obtain a target ECN waterline that matches the new traffic service model.
[0230] The method for determining the ECN waterline provided in this application embodiment allows the switch to enable or disable training based on the enable instruction information sent by the user equipment, eliminating the need for parameter tuning personnel, simplifying the operation process for adjusting the ECN waterline, greatly reducing the difficulty of adjustment, and significantly reducing the time spent adjusting the ECN waterline.
[0231] In current technologies, switches can only provide real-time values or cumulative statistics for the current point in time, and cannot display statistics for a specific time period. For example, a switch can only provide the number of packets carrying ECN tags at the current point in time or the cumulative number of packets with ECN tags, but cannot display the number of packets carrying ECN tags for a specific time period. Therefore, users need to upload the real-time values and / or cumulative statistics for the current point in time to a designated analysis device (also known as a server) through an operations and maintenance platform. Only after the analysis device processes the real-time values and / or cumulative statistics for the current point in time can the statistics for a specific time period be viewed. Since many users lack the operational and maintenance capabilities to process the real-time values and / or cumulative statistics for the current point in time through the operations and maintenance platform and analysis device, they cannot view the statistics for a specific time period. In this case, it is difficult to pinpoint or locate the problem when the switch malfunctions using the real-time values or cumulative statistics provided by the device.
[0232] In this embodiment, the nth forwarding result has time information. Users (parameter adjusters) can also view the nth forwarding result of the switch for a specific time period based on the time information through the user equipment's operation and maintenance platform or by using CLI commands. This eliminates the need to rely on additional analysis equipment, significantly reducing equipment costs and the complexity of viewing forwarding results.
[0233] In some embodiments, when the server restarts, the target ECN waterline before the server restart can be used as the initial ECN waterline, and any of the aforementioned method embodiments can be re-executed to obtain the target ECN waterline of the switch after the server restarts.
[0234] In some embodiments, when the business scenario changes, the target ECN waterline before the business scenario change can be used as the initial ECN waterline after the business scenario change, and any of the aforementioned method embodiments can be re-executed to obtain the target ECN waterline after the business scenario change.
[0235] Optionally, changes in business scenarios may include: changing from a single server sending data packets to the switch to multiple servers sending data packets to the switch simultaneously; changing from low-traffic periods to high-traffic periods (e.g., from low-usage periods at night to peak working hours during the day); and changing from routine data transmission to large-scale data backup or migration operations.
[0236] In the embodiments of this application, when the traffic service model, server status or service scenario in the server changes, the user can flexibly re-execute any of the aforementioned method embodiments, thereby improving the adaptability and diversity of the ECN determination method.
[0237] The embodiments described in this application are not exhaustive, but merely illustrative of some embodiments, and are not intended to limit the specific scope of protection of this application. Optionally, where there is no contradiction, Figure 5 The steps in the embodiments can be combined arbitrarily. Figure 5 The optional implementations in the embodiments can also be combined arbitrarily.
[0238] Alternatively, without contradiction, it can be removed. Figure 5 Some steps in the embodiments. For example, in Figure 5 The solution of removing S512, S513a, and S513b in the embodiment can also be implemented as an independent embodiment.
[0239] Alternatively, adjustments can be made without contradiction. Figure 5 The order of the steps in the embodiments. For example, in Figure 5 In this embodiment, S507 is executed first, followed by S501 to S506, and then S508 and the steps following S508.
[0240] Figure 6 This is a schematic diagram of the structure of an ECN waterline determination device provided in an embodiment of this application, as shown below. Figure 6 As shown, the ECN waterline determination device 60 provided in this embodiment includes:
[0241] Processing module 601 is used to obtain the training duration;
[0242] Transceiver module 602 is used to receive multiple sample data packets within the training duration;
[0243] The processing module 601 is further configured to determine the target ECN waterline of the switch based on the initial ECN waterline of the switch and the plurality of sample data packets, wherein the target ECN waterline is used by the switch to forward data packets received from the sending end.
[0244] It should be noted that the ECN waterline determination device 60 provided in this application embodiment can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.
[0245] In one possible implementation, the training duration includes at least two sub-durations; the processing module 601 is specifically used for:
[0246] Based on the (n-1)th ECN waterline, the preset packet loss probability of the switch, and the preset priority-based flow control (PFC) waterline, multiple first data packets are trained for forwarding to obtain the nth forwarding result; and based on the nth forwarding result and the (n-1)th ECN waterline, the nth ECN waterline is determined; n is incremented by 1, and the forwarding training process is repeated until n equals N; wherein, the multiple first data packets are the data packets received in the nth sub-time period among the multiple sample data packets;
[0247] Initially, n equals 1, and the (n-1)th ECN waterline is the initial ECN waterline;
[0248] At the end, n equals the total number of the at least two sub-durations, and the nth ECN waterline is the target ECN waterline.
[0249] In one possible implementation, the nth forwarding result includes: the number of ECN tags, the number of PFC backpressure frames, the maximum number of buffer units occupied by the plurality of first data packets, and the maximum occupancy rate of the header buffer by the switch during the training process of forwarding the plurality of first data packets; the processing module 601 is specifically used for:
[0250] The waterline adjustment weight is determined based on the number of ECN tags, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate.
[0251] Adjust the weight of the waterline and adjust the (n-1)th ECN waterline to obtain the nth ECN waterline.
[0252] In one possible implementation, the processing module 601 is specifically used for:
[0253] When the occupancy rate is greater than or equal to the occupancy rate threshold, a first weight is determined based on the number of ECN tags, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate. The first weight is used to adjust the high waterline value in the (n-1)th ECN waterline.
[0254] When the maximum number is greater than or equal to the number threshold, the magnitude corresponding to the number of ECN tags is obtained; based on the magnitude, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate, a second weight is determined, and the second weight is used to adjust the low waterline value in the (n-1)th ECN waterline;
[0255] The waterline adjustment weight includes the first weight and the second weight.
[0256] In one possible implementation, the processing module 601 is specifically used for:
[0257] Based on the first weight, adjust the high water value in the (n-1)th ECN water line to obtain the high water value in the nth ECN water line;
[0258] Based on the second weight, the low water value in the (n-1)th ECN water line is adjusted to obtain the low water value in the nth ECN water line.
[0259] In one possible implementation, the processing module 601 is further configured to:
[0260] Determine the difference between the packet forwarding rate in the (n-1)th forwarding result and the packet forwarding rate in the nth forwarding result;
[0261] When the difference in the rates is greater than or equal to the rate threshold, the nth ECN waterline is determined again.
[0262] In one possible implementation, the processing module 601 is further configured to:
[0263] The nth forwarding result is stored and sent to the user equipment; and / or, the nth training status information is obtained, stored, and sent to the user equipment; wherein the nth forwarding result and / or the nth training status information are used for display by the user equipment;
[0264] The nth ECN status information includes one or more of the following:
[0265] The state of the switch is either training state, training not started state, or training ended state.
[0266] The remaining training time is the difference between the training time and the current completion time, where the current completion time is the sum of the previous n sub-times.
[0267] The current training progress is the ratio of the current completion time to the total training time.
[0268] In one possible implementation, the processing module 601 is further configured to:
[0269] Store the time information of the nth forwarding result, and / or send the time information to the user equipment.
[0270] In one possible implementation, the transceiver module 602 is specifically used for:
[0271] The server receives the plurality of sample data packets, which are data packets generated by the traffic service model in the server.
[0272] It should be noted that the ECN waterline determination device 60 provided in this application embodiment can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.
[0273] It should be understood that the aforementioned ECN waterline determination device 60 is embodied in the form of a functional module. The term "module" here may refer to application-specific integrated circuits (ASICs), electronic circuits, processors (e.g., shared processors, proprietary processors, or group processors) and memories for executing one or more software or firmware programs, combined logic circuits, and / or other suitable components that support the described functions.
[0274] Figure 7 This is a schematic diagram of a switch provided in an embodiment of this application. The switch can be replaced with other devices that perform the above-described method embodiments. Figure 7 As shown, the switch 70 provided in this embodiment includes at least one processor 701 and a memory 702. Optionally, the device 70 also includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus 704.
[0275] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described method.
[0276] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0277] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0278] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0279] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0280] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0281] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0282] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0283] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0284] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0285] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0286] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0287] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0288] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0289] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for determining the ECN (Electronic Congestion Notification) waterline, characterized in that, Applied to a switch, the method includes: Obtain the training duration and receive multiple sample data packets within the training duration; Based on the initial ECN waterline of the switch and the multiple sample data packets, the target ECN waterline of the switch is determined. The target ECN waterline is used by the switch to forward data packets received from the sending end.
2. The method according to claim 1, characterized in that, The training duration includes at least two sub-durations; determining the target ECN waterline of the switch based on the initial ECN waterline and the multiple sample data packets includes: Based on the (n-1)th ECN waterline, the preset packet loss probability of the switch, and the preset priority-based flow control (PFC) waterline, multiple first data packets are trained for forwarding to obtain the nth forwarding result; and based on the nth forwarding result and the (n-1)th ECN waterline, the nth ECN waterline is determined; n is incremented by 1, and the forwarding training process is repeated until n equals N; wherein, the multiple first data packets are the data packets received in the nth sub-time period among the multiple sample data packets; Initially, n equals 1, and the (n-1)th ECN waterline is the initial ECN waterline; At the end, n equals the total number of the at least two sub-durations, and the nth ECN waterline is the target ECN waterline.
3. The method according to claim 2, characterized in that, The nth forwarding result includes: the number of ECN tags, the number of PFC anti-pressure frames, the maximum number of buffer units occupied by the plurality of first data packets, and the maximum occupancy rate of the header buffer by the switch during the training process of forwarding the plurality of first data packets; The step of determining the nth ECN waterline based on the nth forwarding result and the (n-1)th ECN waterline includes: The waterline adjustment weight is determined based on the number of ECN tags, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate. Adjust the weight of the waterline and adjust the (n-1)th ECN waterline to obtain the nth ECN waterline.
4. The method according to claim 3, characterized in that, The step of determining the waterline adjustment weight based on the number of ECN tags, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate includes: When the occupancy rate is greater than or equal to the occupancy rate threshold, a first weight is determined based on the number of ECN tags, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate. The first weight is used to adjust the high waterline value in the (n-1)th ECN waterline. When the maximum number is greater than or equal to the number threshold, the magnitude corresponding to the number of ECN tags is obtained; based on the magnitude, the number of PFC anti-pressure frames, the maximum number, and the maximum occupancy rate, a second weight is determined, and the second weight is used to adjust the low waterline value in the (n-1)th ECN waterline; The waterline adjustment weight includes the first weight and the second weight.
5. The method according to claim 4, characterized in that, Adjusting the weights of the waterline to adjust the (n-1)th ECN waterline, resulting in the nth ECN waterline, includes: Based on the first weight, adjust the high water value in the (n-1)th ECN water line to obtain the high water value in the nth ECN water line; Based on the second weight, the low water value in the (n-1)th ECN water line is adjusted to obtain the low water value in the nth ECN water line.
6. The method according to any one of claims 2 to 5, characterized in that, The method further includes: Determine the difference between the packet forwarding rate in the (n-1)th forwarding result and the packet forwarding rate in the nth forwarding result; When the difference in the rates is greater than or equal to the rate threshold, the nth ECN waterline is determined again.
7. The method according to any one of claims 2 to 5, characterized in that, The method further includes: The nth forwarding result is stored and sent to the user equipment; and / or, the nth training status information is obtained, stored, and sent to the user equipment; wherein the nth forwarding result and / or the nth training status information are used for display by the user equipment; The nth ECN status information includes one or more of the following: The state of the switch is either training state, training not started state, or training ended state. The remaining training time is the difference between the training time and the current completion time, where the current completion time is the sum of the previous n sub-times. The current training progress is the ratio of the current completion time to the total training time.
8. The method according to claim 2, characterized in that, The method further includes: Store the time information of the nth forwarding result, and / or send the time information to the user equipment.
9. The method according to claim 1 or 2, characterized in that, The receiving of multiple sample data packets includes: The server receives the plurality of sample data packets, which are data packets generated by the traffic service model in the server.
10. A device for determining the congestion notification (ECN) waterline, characterized in that, Applied to a switch, the device includes: The processing module is used to obtain the training duration; The transceiver module is used to receive multiple sample data packets within the training duration; The processing module is further configured to determine the target ECN waterline of the switch based on the initial ECN waterline of the switch and the plurality of sample data packets, wherein the target ECN waterline is used by the switch to forward data packets received from the sending end.
11. A switch, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-9.
13. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-9.