A message transmission method, device and equipment
By rate limiting CNP packets and generating Type II CNP packets in long-distance fiber optic scenarios, the problem of the source device being unable to reduce the data transmission rate in a timely manner is solved, thereby improving the data transmission performance and bandwidth utilization efficiency of network devices.
Patent Information
- Application Number
- CN202380008519.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2043-03-28
AI Technical Summary
In long-distance fiber optic scenarios, due to the long distance between the source and destination devices, the CNP message transmission time is long, which prevents the source device from reducing the data transmission rate in time, resulting in poor data transmission performance of the network device.
By obtaining the rate limiting policy and ECN parameters of the target port, the received CNP packets are rate-limited, and a second type of CNP packet is generated to control the data transmission rate of the source device, smoothing the rate reduction process and avoiding network congestion.
In long-distance fiber optic scenarios, it smooths out the slack-down process of the source device, avoids network congestion, improves data transmission performance, and makes full use of bandwidth resources.
Smart Images

Figure CN119054269B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, in particular to a message transmission method, device and equipment. BACKGROUND
[0002] With the increase of high concurrency and low latency services, the out port of a network device (such as a switch, a router, etc.) is prone to network congestion. Network congestion refers to the phenomenon that when the traffic received by the network device through the in port is much larger than the traffic sent through the out port, a large amount of data is retained (buffered) in the out queue (the queue corresponding to the out port), which affects the network performance such as the transmission delay and throughput of the data.
[0003] In order to solve the network congestion, the network device adds a congestion mark in the data when forwarding the data to the destination device. After the destination device receives the data carrying the congestion mark, the destination device sends a CNP (Congestion Notification Packet, congestion notification packet) message to the source device. After the source device receives the CNP message, the source device reduces the data sending rate, so that the traffic received by the network device through the in port becomes smaller, and the network congestion is solved.
[0004] However, in the long-distance fiber scenario, the distance between the source device and the destination device is very far, and the network link delay is large, that is, the transmission time of the CNP message is long, so the source device cannot reduce the data sending rate in time, and the data transmission performance of the network device is poor. For example, the network device receives a large amount of data in a period of time, and there is network congestion. In another period of time, the network device receives a small amount of data, and cannot fully utilize the bandwidth resources of the out port. The above process is repeated, and the data transmission performance is poor. SUMMARY
[0005] The present application provides a message transmission method applied to a network device, the network device comprising a target port, the target port being connected with other devices through a long-distance fiber, and the method comprising:
[0006] obtaining a target rate limiting strategy and a target ECN parameter corresponding to the target port;
[0007] when sending a specified type of data in a target priority queue corresponding to the target port to a destination device, adding a congestion mark in the specified type of data based on the target ECN parameter, the congestion mark being used to make the destination device send a first type of CNP message to a source device;
[0008] limiting the first type of CNP message received by the target port based on the target rate limiting strategy, and sending the first type of CNP message remaining after the limiting to the source device;
[0009] determine a target message rate based on a first sending rate of the specified type data to which the congestion mark is added and a second sending rate of the first type of CNP message that is forwarded to the source device;
[0010] generate a second type of CNP message based on the target message rate and send the second type of CNP message to the source device, the second type of CNP message being used to control the source device to reduce the sending rate of the specified type data.
[0011] The present application provides a message transmission device, which is applied to a network device, the network device comprising a target port, the target port being connected with other devices through a long-distance optical fiber, and the device comprising:
[0012] an obtaining module, configured to obtain a target rate limiting strategy and a target ECN parameter corresponding to the target port;
[0013] a processing module, configured to add a congestion mark in the specified type data based on the target ECN parameter when sending the specified type data in a target priority queue corresponding to the target port to a destination device, the congestion mark being used to make the destination device send a first type of CNP message to a source device;
[0014] the processing module is further configured to limit the first type of CNP message received by the target port based on the target rate limiting strategy, and send the first type of CNP message remaining after the limiting to the source device;
[0015] a determining module, configured to determine a target message rate based on a first sending rate of the specified type data to which the congestion mark is added and a second sending rate of the first type of CNP message that is forwarded to the source device;
[0016] a sending module, configured to generate a second type of CNP message based on the target message rate, and send the second type of CNP message to the source device, the second type of CNP message being used to control the source device to reduce the sending rate of the specified type data.
[0017] The present application provides a network device, comprising a processor and a machine readable storage medium, the machine readable storage medium storing machine executable instructions capable of being executed by the processor; the processor is used to execute the machine executable instructions to realize the message transmission method of the above examples of the present application.
[0018] From the above technical solutions, in the long-distance optical fiber scenario, the CNP packet received by the target port can be limited in speed, so as to avoid that the source device receives a large amount of CNP packets in a short time, so that the CNP packets received by the source device are more balanced and smoother, so that the speed reduction process (i.e. the process of reducing the data transmission rate) of the source device is more smooth, and the source device is avoided to reduce speed greatly in a period of time, and reduce speed very small or not reduce speed in another period of time, so that the data transmission performance of the network device is better, avoiding that a large amount of data is received in a period of time to cause network congestion, and a small amount of data is received in another period of time to cause that the bandwidth resources cannot be fully utilized. In addition, the target packet rate can be determined based on the transmission rate of the specified type data with the added congestion mark and the transmission rate of the first type CNP packet forwarded to the source device, and the second type CNP packet is generated based on the target packet rate, and the second type CNP packet is sent to the source device, so that the network device retransmits the CNP packet, further compensates for the influence of the long-distance optical fiber, so as to better control the transmission rate of the source device for the specified type data, and the control effect is better. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the description of the embodiments of the present application or the prior art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art based on these drawings.
[0020] Figure 1 is a flowchart of a packet transmission method in an embodiment of the present application;
[0021] Figure 2 is a schematic diagram of an application scenario of data center interconnection in an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of a long-distance optical fiber scenario of data center interconnection in an embodiment of the present application;
[0023] Figure 4 is a flowchart of a test process in an embodiment of the present application;
[0024] Figure 5 is a flowchart of an application process in an embodiment of the present application;
[0025] Figure 6 is a structural diagram of a packet transmission device in an embodiment of the present application;
[0026] Figure 7 is a hardware structure diagram of a network device in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in the description of the embodiments of the present application and the claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0028] It should be understood that, although the terms first, second, third, etc. can be used herein to describe various information, the information should not be limited to these terms. These terms are only used to differentiate one piece of information from another piece of information. For example, a first information can also be referred to as a second information, and similarly, a second information can also be referred to as a first information without departing from the scope of the present application. In addition, the word "if' can be interpreted as meaning "when" or "in response to determining" depending on the context.
[0029] An embodiment of the present application proposes a packet transmission method, which can be applied to a network device (such as a router, a switch, etc.), the network device comprising a target port, and the target port being connected to other devices through a long-distance optical fiber, as shown in Figure 1 The method can comprise the following steps:
[0030] In step 101, a target rate-limiting strategy and a target ECN parameter corresponding to the target port are obtained.
[0031] In step 102, when sending specified type data in a target priority queue corresponding to the target port to a destination device, a congestion mark is added in the specified type data based on the target ECN parameter, and the congestion mark is used to make the destination device send a first type of CNP packet to a source device.
[0032] In step 103, the first type of CNP packet received by the target port is rate-limited based on the target rate-limiting strategy, and the remaining first type of CNP packet after rate-limiting is sent to the source device.
[0033] In step 104, a target packet rate is determined based on a first sending rate of the specified type data with the added congestion mark and a second sending rate of the first type of CNP packet forwarded to the source device.
[0034] In step 105, a second type of CNP packet is generated based on the target packet rate, and the second type of CNP packet is sent to the source device, the second type of CNP packet being used to control the source device to reduce the sending rate of the specified type data.
[0035] For example, determining the target message rate based on the first sending rate of the specified type of data with the congestion mark added and the second sending rate of the first type of CNP message forwarded to the source device can include, but is not limited to: counting the first number of the specified type of data with the congestion mark added in the target time period, counting the second number of the first type of CNP message forwarded to the source device in the target time period; determining the first sending rate based on the first number and the length of the target time period; determining the second sending rate based on the second number and the length of the target time period; determining the target message rate based on the first sending rate and the second sending rate.
[0036] For example, determining the target message rate based on the first sending rate of the specified type of data with the congestion mark added and the second sending rate of the first type of CNP message forwarded to the source device can include, but is not limited to: determining a candidate message rate based on the first sending rate and the second sending rate, wherein the candidate message rate can be the minimum value of the first sending rate and the second sending rate; then, determining the target message rate based on the difference between the first sending rate and the candidate message rate.
[0037] For example, generating the second type of CNP message based on the target message rate and sending the second type of CNP message to the source device can include, but is not limited to: generating a target number of second type of CNP messages matching the target message rate; if the target priority queue includes at least one data stream corresponding to a source device, for each source device, the rate proportion corresponding to the source device can be determined based on the rate of the data stream corresponding to the source device, and the number of messages corresponding to the source device can be determined based on the target number and the rate proportion corresponding to the source device, and the number of messages corresponding to the source device can be sent to the source device.
[0038] For example, obtaining the target rate limiting strategy corresponding to the target port can include, but is not limited to: determining the target scene model parameter based on the traffic scene data corresponding to the target port, the target scene model parameter at least including the optical fiber length corresponding to the long-distance optical fiber; querying the target rate limiting strategy corresponding to the target scene model parameter based on the mapping table; wherein the mapping table includes the corresponding relationship between the scene model parameter and the rate limiting strategy, and the rate limiting strategy is used to make the target port have the optimal data transmission performance under the scene model parameter.
[0039] Exemplarily, before querying the target rate-limiting strategy corresponding to the target scene model parameter based on the mapping table, a process of establishing the mapping table can be further included. Specifically, in the process of establishing the mapping table, the scene model parameter can be determined based on the traffic scene data corresponding to the target port in the test environment, and a plurality of rate-limiting strategies corresponding to the scene model parameter can be obtained. Then, for each rate-limiting strategy, the CNP packet received by the target port can be rate-limited based on the rate-limiting strategy, and the data transmission performance corresponding to the target port after rate-limiting can be counted. Based on the data transmission performance corresponding to each rate-limiting strategy, the corresponding relationship between the scene model parameter and the rate-limiting strategy corresponding to the optimal data transmission performance can be recorded in the mapping table.
[0040] Exemplarily, the target port corresponds to a plurality of priority queues, and the plurality of priority queues include a target priority queue for carrying data of a specified type. Counting the data transmission performance corresponding to the target port after rate-limiting can include but is not limited to counting the queue average bandwidth corresponding to the target priority queue and counting the round-trip delay corresponding to the data of the specified type in the target priority queue; based on the queue average bandwidth and / or the round-trip delay, the data transmission performance corresponding to the target port after rate-limiting can be determined; wherein the data transmission performance is proportional to the queue average bandwidth, and the data transmission performance is inversely proportional to the round-trip delay.
[0041] Exemplarily, the target port corresponds to a plurality of priority queues, and the plurality of priority queues include a target priority queue for carrying data of a specified type. The target scene model parameter can further include but is not limited to at least one of the following: the device type of the network device, the out-port rate of the target port, the number of in-ports corresponding to the data of the specified type in the target priority queue, and the queue level of the target priority queue. For example, the queue level of the target priority queue can be determined based on the queue average bandwidth of the target priority queue and the queue average bandwidth of other priority queues except the target priority queue.
[0042] Exemplarily, the network device can obtain a target ECN (Explicit Congestion Notification) parameter corresponding to the target port, and the target ECN parameter can include but is not limited to a target base water line, a target high water line, and a target marking probability. On this basis, adding a congestion mark in the data of the specified type based on the target ECN parameter can include but is not limited to: if the queue length of the target priority queue is greater than the target base water line and the queue length of the target priority queue is not greater than the target high water line, then adding a congestion mark in the data of the specified type based on the target marking probability; and if the queue length of the target priority queue is greater than the target high water line, then adding a congestion mark in all data of the specified type in the target priority queue.
[0043] For example, the target rate limiting strategy can include, but is not limited to, a rate limiting value for the CNP packet, and the rate limiting value represents the number of bytes of the CNP packet allowed to pass per second, or the rate limiting value represents the number of CNP packets allowed to pass per second. The specified type of data can include, but is not limited to, ROCE (RDMA over Converged Ethernet) data.
[0044] As can be seen from the above technical solutions, in the embodiment of the present application, in the long-distance optical fiber scenario, the CNP packet received by the target port can be rate limited, thereby avoiding that the source device receives a large amount of CNP packets in a short time, making the CNP packets received by the source device more balanced and smoother, and making the speed reduction process (i.e., the process of reducing the data transmission rate) of the source device more smooth, avoiding that the source device reduces speed greatly in a period of time and reduces speed very small or does not reduce speed in another period of time, so that the data transmission performance of the network device is better, avoiding that a large amount of data is received in a period of time to cause network congestion, and a small amount of data is received in another period of time to cause that the bandwidth resources cannot be fully utilized. In addition, the target packet rate can be determined based on the transmission rate of the specified type of data with the congestion mark added and the transmission rate of the first type of CNP packet forwarded to the source device, and the second type of CNP packet can be generated based on the target packet rate, and the second type of CNP packet is sent to the source device, so that the CNP packet is retransmitted by the network device, further compensating for the influence of the long-distance optical fiber, thereby better controlling the transmission rate of the source device for the specified type of data, and the control effect is better.
[0045] The packet transmission method of the embodiment of the present application will be described below in combination with a specific application scenario.
[0046] Referring to Figure 2 Fig. 1 shows a schematic diagram of an application scenario of data center interconnection. When a server in DC1 (Data Center) sends data to a server in DC2, the server in DC1 is referred to as a sending end server (also referred to as a source device), and the server in DC2 is referred to as a receiving end server (also referred to as a destination device). When a server in DC2 sends data to a server in DC1, the server in DC2 is referred to as a source device, and the server in DC1 is referred to as a destination device. For convenience of description, in the following embodiments, the server in DC1 is taken as the source device, and the server in DC2 is taken as the destination device.
[0047] There are multiple network devices (such as routers, switches, etc.) between the source device and the destination device, and the source device and the destination device are connected through multiple network devices. DeviceA (Device A) and DeviceB (Device B) are network devices located between the source device and the destination device, DeviceA and DeviceB are egress devices of data center interconnection, DeviceA is the egress device of DC1, and DeviceB is the egress device of DC2.
[0048] With the increase of high-concurrency services and low-latency services, network congestion is likely to occur at the egress port of the network device, which will affect the network performance such as transmission delay and throughput of data. In order to guarantee the high performance of the data center, a lossless Ethernet needs to be built to ensure that there is no packet loss in the network transmission process, therefore, the network congestion problem needs to be solved. In order to solve the network congestion problem, the network device adds a congestion mark in the data when forwarding the data to the destination device, and the destination device sends a CNP packet to the source device after receiving the data carrying the congestion mark, and the source device reduces the data sending rate after receiving the CNP packet, so that the traffic received by the network device through the ingress port becomes smaller, thereby solving the network congestion problem. For example, when network congestion occurs at the egress port of DeviceA, DeviceA will send data carrying a congestion mark to the receiving end server (i.e. the destination device) of DC2, and the receiving end server of DC2 will then send a CNP packet to the sending end server (i.e. the source device) of DC1, and the sending end server of DC1 will reduce the data sending rate after receiving the CNP packet, so that the traffic received by DeviceA becomes smaller, thereby solving the network congestion problem.
[0049] However, in the long-distance fiber scenario, the distance between the source device and the destination device is very far, that is, the distance between the sending end server of DC1 and the receiving end server of DC2 is very far, and the network link delay is large, resulting in a long transmission time of the CNP packet, therefore, the source device cannot timely reduce the data sending rate, and the data transmission performance of the network device (such as DeviceA, DeviceB, etc.) is poor.
[0050] For example, in the long-distance fiber scenario of data center interconnection, the length of the long-distance fiber can reach tens of kilometers or even one hundred kilometers, although the propagation rate of data on the long-distance fiber is very fast, but in this long-distance fiber scenario, there is also a long delay, such as ms-level delay, that is, the network link delay is large, resulting in a long transmission time of the CNP packet, the CNP packet has a large delay, and then the source device cannot timely reduce the data sending rate, and the data transmission performance of the network device is seriously degraded.
[0051] Reference Figure 3As shown in FIG. 1, which is a schematic diagram of a long-distance optical fiber scenario of data center interconnection, and is a simplified diagram for Figure 2 the sending end server as a source device, the receiving end server as a destination device, Device A and Device B as network devices, Device A connected with Device B through a long-distance port, and long-distance optical fiber between Device A and Device B. In the above networking environment, assuming that the long-distance optical fiber between Device A and Device B is 60KM, when the sending end server sends data at a rate of 100G to the receiving end server, and the CNP packet is enabled to solve network congestion, it is found through testing that the receiving end server can only receive 52G of traffic. If the long-distance optical fiber between Device A and Device B is replaced by a short-distance optical fiber, such as a few kilometers, when the sending end server sends data at a rate of 100G to the receiving end server, and the CNP packet is enabled to solve network congestion, it is found through testing that the receiving end server can receive more than 90G of traffic. In summary, in the long-distance optical fiber scenario, the data transmission performance is relatively poor, and the traffic rate periodically becomes smaller, such as 52G, from nearly 100G (line speed).
[0052] In view of the above finding, the embodiment of the present application proposes a packet transmission method, which can limit the speed of the CNP packet received by the target port in the long-distance optical fiber scenario, so as to avoid that the source device receives a large amount of CNP packet in a short time, so that the CNP packet received by the source device is more balanced and smoother, and the speed reduction process of the source device is more smooth, so that the data transmission performance of the network device is better.
[0053] The embodiment of the present application relates to a test process and an application process. In the test process, the corresponding relationship between the scenario model parameters and the speed limiting strategy can be obtained, and the corresponding relationship between the scenario model parameters and the speed limiting strategy is recorded in mapping table A. The corresponding relationship between the traffic scenario parameters and the ECN parameters can be obtained, and the corresponding relationship between the traffic scenario parameters and the ECN parameters is recorded in mapping table B. In the application process, the target ECN parameter can be obtained based on the mapping table B, and data can be sent based on the target ECN parameter. The target speed limiting strategy can be obtained based on the mapping table A, and the CNP packet can be speed limited based on the target speed limiting strategy.
[0054] In a possible implementation, referring to Figure 4 FIG. 1 is a flowchart of a test process.
[0055] In step 401, the network device obtains the traffic scenario data corresponding to the target port in the test environment.
[0056] For example, if a port of the network device is connected to other devices through a long-distance optical fiber, the port is recorded as a target port, i.e., the target port of the network device is connected to other devices through a long-distance optical fiber, and the long-distance optical fiber is a type of optical fiber, which indicates that the length of the optical fiber is relatively large, such as the length of the optical fiber being greater than a length threshold.
[0057] For example, the target port corresponds to a plurality of priority queues, and the plurality of priority queues include a target priority queue for carrying specified type data, which can include but is not limited to ROCE data. The target priority queue needs to enable PFC (Priority-based Flow Control) configuration, ECN configuration, etc., so that the target priority queue implements lossless forwarding.
[0058] For example, the target port can correspond to 8 priority queues, which are recorded as cos0 queue, cos1 queue, cos2 queue, cos3 queue, cos4 queue, cos5 queue, cos6 queue, and cos7 queue. The cos4 queue and / or the cos5 queue can be set as the target priority queue, and the PFC configuration, the ECN configuration, etc. are enabled for the target priority queue. Of course, other queues can also be set as the target priority queue, and no limitation is made in this regard. After the network device receives the specified type data (such as ROCE data), if the specified type data needs to be forwarded through the target port, the specified type data is stored in the target priority queue.
[0059] For example, a test environment can be constructed in advance (such as in a laboratory), and the network device obtains the traffic scenario data corresponding to the target port in the test environment. For example, test environment 1 can be constructed first, the traffic scenario data corresponding to the target port in the test environment 1 is obtained, then test environment 2 is constructed, the traffic scenario data corresponding to the target port in the test environment 2 is obtained, then test environment 3 is constructed, the traffic scenario data corresponding to the target port in the test environment 3 is obtained, and so on.
[0060] By constructing a large number of test environments, collecting traffic scenario data under different test environments, and then obtaining traffic scenario parameters and scenario model parameters under different test environments. The difference between different test environments is that: different test environments may correspond to different incast (used to represent the number of ingress ports corresponding to the target port of the specified type data in the target priority queue, that is, how many ingress ports correspond to the target port), that is, different test environments are constructed by changing the incast; the average bandwidth of the ingress port of different test environments may be different, that is, different test environments are constructed by changing the average bandwidth of the ingress port; different test environments may correspond to different lengths of long-distance optical fibers, that is, different test environments are constructed by changing the length of the long-distance optical fiber; different test environments may correspond to different egress port rates, that is, different test environments are constructed by changing the egress port rate of the target port; different test environments may correspond to different numbers of ROCE data streams, that is, different test environments are constructed by changing the number of ROCE data streams. Of course, the above is just an example, and this is not limited, a large number of different test environments can be constructed, and traffic scenario data under different test environments can be collected.
[0061] For each test environment, in order to obtain the corresponding traffic scenario data of the target port in the test environment, the specified type data (such as ROCE data) in the target priority queue can be sent to the FPGA (Field Programmable Gate Array, Field Programmable Gate Array) or CPU (Central Processing Unit, Central Processing Unit) by sampling mirroring, and the FPGA or CPU is used to count the specified type data, so as to obtain the corresponding traffic scenario data of the target port in the test environment.
[0062] For example, the traffic scenario data can include, but is not limited to, at least one of the following: the number of messages of the ROCE data stream (for example, the ROCE data stream is composed of ROCE data with the same 3-tuple, and the 3-tuple can include source IP, destination IP and destination QP, etc.), the total length of the messages of the ROCE data stream, the average length of the messages of the ROCE data stream, the traffic flow rate of the ROCE data stream, the number of lost messages of the ROCE data stream, the ingress port and the egress port of the ROCE data stream, the VXLAN (Virtual Extensible Local Area Network) encapsulation information of the ROCE data stream, and the inactivity time of the ROCE data stream. When there are multiple ROCE data streams, the traffic scenario data can include the number of messages, the total length of the messages, the average length of the messages, the traffic flow rate, the number of lost messages, the ingress port and the egress port, the VXLAN encapsulation information, and the inactivity time corresponding to each ROCE data stream.
[0063] In units of target priority queues, the ROCE data stream with the target priority queue as the dequeuing queue is selected, and the traffic scenario data can further include, but is not limited to, at least one of the following: the average bandwidth corresponding to the target priority queue, the number of ingress ports corresponding to the target priority queue (the number of ingress ports can be referred to as Incast, which is used to represent the total number of ingress ports corresponding to all ROCE data streams in the target priority queue, that is, the ingress ports of all ROCE data streams are determined, and the total number of ingress ports is counted), the number of data streams (Flow) of each ingress port corresponding to the target priority queue (that is, the number of ROCE data streams, which can be referred to as BigFlow), the average bandwidth of each ingress port corresponding to the target priority queue, the proportion of different types of ROCE data streams corresponding to the target priority queue (such as the proportion between write type ROCE data streams, read type ROCE data streams and send type ROCE data streams), and the RTT (Round Trip Time) corresponding to the target priority queue.
[0064] On the basis of the traffic scenario data (i.e. obtained based on the specified type data in the target priority queue) described above, the traffic scenario data of the network device can also be counted, such as, but not limited to, at least one of the following: the device type of the network device, the fiber length corresponding to the long-distance fiber, and the egress port rate of the target port. The device type of the network device can be, for example, XGS type, June type, Marvel type, etc., without limitation. For the fiber length corresponding to the long-distance fiber, a plurality of candidate lengths can be pre-configured, such as positive integer multiples of 10km, such as 10km, 20km, 30km, etc. When the target port is connected to other devices through a long-distance fiber, the actual length of the long-distance fiber can be counted, and the candidate length closest to the actual length is selected from all candidate lengths. This candidate length is the fiber length corresponding to the long-distance fiber. The egress port rate of the target port can be, for example, 25G, 100G, etc., without limitation.
[0065] Of course, the above are only a few examples of traffic scenario data, without limitation to the traffic scenario data.
[0066] Step 402, the network device determines the traffic scenario parameter based on the traffic scenario data corresponding to the target port.
[0067] For example, for each test environment, after obtaining the traffic scenario data corresponding to the target port in the test environment, the traffic scenario parameter corresponding to the test environment can be determined based on the traffic scenario data, i.e. the traffic scenario parameter corresponding to each test environment is obtained. The traffic scenario parameter can include, but is not limited to, at least one of the following: the device type of the network device, the egress port rate of the target port, the number of ingress ports corresponding to the specified type data in the target priority queue, and the queue level of the target priority queue. Of course, the above are only a few examples, and the traffic scenario parameter can also include other parameters, without limitation.
[0068] For the device type of the network device, since the traffic scenario data includes the device type of the network device, the device type of the network device can be directly determined based on the traffic scenario data. The device type of the network device can be, for example, XGS type, June type, Marvel type, etc., without limitation.
[0069] For the egress port rate of the target port, since the traffic scenario data includes the egress port rate of the target port, the egress port rate of the target port can be directly determined based on the traffic scenario data. The egress port rate of the target port can be, for example, 25G, 100G, etc., without limitation.
[0070] The number of ingress ports corresponding to the specified type of data in the target priority queue can be directly determined based on the traffic scenario data, since the traffic scenario data includes the number of ingress ports corresponding to the target priority queue. The number of ingress ports can be referred to as Incast, which is used to represent how many ingress ports (Input ports) correspond to the target port.
[0071] The queue level of the target priority queue (i.e., the queue range value) can be determined based on the average queue bandwidth of the target priority queue and the average queue bandwidth of other priority queues except the target priority queue. For example, the queue range value can be determined based on the average queue bandwidth of the target priority queue (determined based on the traffic scenario data), the average queue bandwidth of other priority queues except the target priority queue (determined based on the traffic scenario data), and the egress port rate of the target port (determined based on the traffic scenario data). Assuming that the average queue bandwidth of the target priority queue is 10G, the average queue bandwidth of other priority queues except the target priority queue is 5G, and the egress port rate of the target port is 25G, the queue range value can be 10 / (25-5), i.e., 0.5.
[0072] In summary, the device type of the network device, the egress port rate of the target port, the number of ingress ports, and the queue level of the target priority queue can be obtained as traffic scenario parameters. The traffic scenario parameters are used to identify the traffic scenario of the target port, and the traffic scenario parameters are combined into a parameter vector (DeviceType, PortSpeed, Incast, Range). The parameter vector is used as the basis for dividing the scenario model, i.e., different parameter vectors correspond to different scenario models. DeviceType represents the device type of the network device, PortSpeed represents the egress port rate of the target port, Incast represents the number of ingress ports, and Range represents the queue level of the target priority queue.
[0073] Step 403, the network device determines the scenario model parameters based on the traffic scenario data corresponding to the target port.
[0074] For example, for each test environment, after obtaining the corresponding traffic scenario data of the target port in the test environment, the corresponding scenario model parameters of the test environment can be determined based on the traffic scenario data, i.e., the scenario model parameters corresponding to each test environment are obtained. The scenario model parameters can include, but are not limited to, at least one of the following: the fiber length corresponding to the long-distance optical fiber (i.e., the long-distance optical fiber corresponding to the target port), the device type of the network device, the egress port rate of the target port, the number of ingress ports corresponding to the specified type data in the target priority queue, and the queue level of the target priority queue. Of course, the above are only a few examples of scenario model parameters, and scenario model parameters can also include other parameters, which are not limited.
[0075] For the fiber length corresponding to the long-distance optical fiber, since the traffic scenario data includes the fiber length corresponding to the long-distance optical fiber, the fiber length corresponding to the long-distance optical fiber can be directly determined based on the traffic scenario data. For the device type of the network device, since the traffic scenario data includes the device type of the network device, the device type of the network device is directly determined based on the traffic scenario data. For the egress port rate of the target port, since the traffic scenario data includes the egress port rate of the target port, the egress port rate of the target port is directly determined based on the traffic scenario data. For the number of ingress ports corresponding to the specified type data in the target priority queue, since the traffic scenario data includes the number of ingress ports corresponding to the target priority queue, the number of ingress ports corresponding to the specified type data in the target priority queue is directly determined based on the traffic scenario data. For the queue level (i.e., the queue range value) of the target priority queue, the queue level of the target priority queue can be determined based on the queue average bandwidth of the target priority queue (determined based on the traffic scenario data) and the queue average bandwidth of other priority queues except the target priority queue (determined based on the traffic scenario data).
[0076] As described above, the fiber length corresponding to the long-distance optical fiber, the device type of the network device, the egress port rate of the target port, the number of ingress ports, and the queue level of the target priority queue can be obtained, and the scenario model parameters are used to identify the traffic scenario of the target port. Taking the fiber length corresponding to the long-distance optical fiber, the device type of the network device, the egress port rate of the target port, and the number of ingress ports as examples, the scenario model parameters form a parameter vector (DeviceType, PortSpeed, Incast, Dist), which is used as the basis for dividing the scenario model, i.e., different parameter vectors correspond to different scenario models. DeviceType represents the device type of the network device, PortSpeed represents the egress port rate of the target port, Incast represents the number of ingress ports, and Dist represents the fiber length corresponding to the long-distance optical fiber, which can be a positive integer multiple of 10 km.
[0077] Step 404, for each traffic scenario parameter, the network device determines the ECN parameter corresponding to the traffic scenario parameter, and records the correspondence between the traffic scenario parameter and the ECN parameter in the mapping table B.
[0078] For each test environment, after obtaining the traffic scenario parameter corresponding to the test environment, the ECN parameter corresponding to the traffic scenario parameter can also be determined under the test environment, so as to select a suitable ECN parameter for the traffic scenario (i.e. the traffic scenario under the test environment). The ECN parameter selection method is not limited, and the traffic of the target priority queue can meet good performance indicators (i.e. performance indicators of data transmission performance, such as queue average bandwidth corresponding to the target priority queue, round-trip delay corresponding to the target priority queue, and other performance indicators) through the ECN parameter, that is, under the traffic scenario corresponding to the traffic scenario parameter, the traffic of the target priority queue can meet good performance indicators through the ECN parameter.
[0079] After obtaining the ECN parameter corresponding to the traffic scenario parameter, the correspondence between the traffic scenario parameter and the ECN parameter can also be recorded in the mapping table B, see Table 1 for an example of the mapping table B.
[0080] Table 1
[0081] Traffic scenario parameters ECN parameters Traffic scenario parameters a1 ECN parameters b1 Traffic scenario parameters a2 ECN parameters b2 ... ...
[0082] Step 405, for each scenario model parameter, the network device determines the rate limiting strategy corresponding to the scenario model parameter, and records the correspondence between the scenario model parameter and the rate limiting strategy in the mapping table A.
[0083] For each test environment, after obtaining the scenario model parameter corresponding to the test environment, the rate limiting strategy corresponding to the scenario model parameter can also be determined under the test environment, so as to select a suitable rate limiting strategy for the traffic scenario (i.e. the traffic scenario under the test environment). The rate limiting strategy selection method is not limited, and the traffic of the target priority queue can meet good performance indicators (i.e. performance indicators of data transmission performance, such as queue average bandwidth corresponding to the target priority queue, round-trip delay corresponding to the target priority queue, and other performance indicators) through the rate limiting strategy, that is, under the traffic scenario corresponding to the scenario model parameter, the traffic of the target priority queue can meet good performance indicators through the rate limiting strategy.
[0084] For example, for each scenario model parameter (i.e. the scenario model parameter corresponding to each test environment), taking one scenario model parameter as an example, step 405 can be implemented by the following steps:
[0085] Step 4051, obtain multiple speed limiting strategies corresponding to the scene model parameter. For example, multiple speed limiting strategies can be pre-configured, and these speed limiting strategies are all taken as the speed limiting strategies corresponding to the scene model parameter.
[0086] Step 4052, enable the ECN parameter for the target port, that is, the ECN parameter takes effect.
[0087] For example, when determining the speed limiting strategy corresponding to the scene model parameter of a certain test environment, the speed limiting strategy is determined in the test environment, and the ECN parameter corresponding to the traffic scene parameter of the test environment is known, which can be referred to in step 404. Therefore, the ECN parameter can be enabled for the target port.
[0088] For example, after enabling the ECN parameter for the target port, when sending the specified type data (such as ROCE data) in the target priority queue corresponding to the target port, the congestion mark can be added in the specified type data based on the ECN parameter, and the specified type data with the congestion mark is used to make the destination device send the CNP message to the source device, that is, the destination device can send the CNP message to the source device after receiving the specified type data with the congestion mark. The ECN parameter can include but is not limited to the base line, the high line and the marking probability, on the basis of which, if the queue length of the target priority queue is greater than the base line and the queue length of the target priority queue is not greater than the high line, the congestion mark can be added in the specified type data based on the marking probability; if the queue length of the target priority queue is greater than the high line, the congestion mark can be added in all specified type data of the target priority queue. Of course, the above is only an example of adding the congestion mark in the specified type data, and the adding mode of the congestion mark is not limited in this embodiment.
[0089] Step 4053, for each speed limiting strategy, limit the CNP message received by the target port based on the speed limiting strategy, and count the data transmission performance of the target port after limiting.
[0090] For example, after enabling the ECN parameter for the target port, the network device can receive the CNP message (that is, the CNP message sent by the destination device to the source device) through the target port, so the CNP message received by the target port can be limited based on the speed limiting strategy, which can include but is not limited to the speed limiting value for the CNP message, and the speed limiting value represents the number of bytes of the CNP message allowed to pass per second, or the speed limiting value represents the number of CNP messages allowed to pass per second.
[0091] Exemplarily, after the CNP packet received by the target port is limited based on the rate limiting strategy, the network device can count the data transmission performance corresponding to the target port after the rate limiting. For example, the queue average bandwidth corresponding to the target priority queue can be counted, and the round-trip delay corresponding to the specified type data in the target priority queue can be counted, and the data transmission performance corresponding to the target port after the rate limiting can be determined based on the queue average bandwidth and / or the round-trip delay. For example, the data transmission performance corresponding to the target port after the rate limiting can be determined based on the queue average bandwidth and the round-trip delay. The data transmission performance can be proportional to the queue average bandwidth, and the data transmission performance can be inversely proportional to the round-trip delay.
[0092] The queue average bandwidth can be a Throughput performance index, and the queue average bandwidth corresponding to the target priority queue can be counted after the CNP packet received by the target port is limited.
[0093] The round-trip delay can be a Latency performance index, and the round-trip delay corresponding to the specified type data in the target priority queue can be counted after the CNP packet received by the target port is limited. For example, the sending time corresponding to the specified type data and the receiving time corresponding to the specified type data can be determined, i.e. the sending time and the receiving time corresponding to the same data, the sending time indicating the sending time of the specified type data by the network device, and the receiving time indicating the receiving time of the response data of the specified type data by the network device, and the difference between the receiving time and the sending time is used to determine the round-trip delay.
[0094] After the queue average bandwidth and the round-trip delay are obtained, the data transmission performance corresponding to the target port can be determined based on the queue average bandwidth and the round-trip delay. For example, the queue average bandwidth and the round-trip delay can be normalized to the same numerical level, and then weighted operation is performed to obtain the data transmission performance. The weight coefficient corresponding to the queue average bandwidth can be greater than the weight coefficient corresponding to the round-trip delay, the weight coefficient corresponding to the queue average bandwidth can be equal to the weight coefficient corresponding to the round-trip delay, and the weight coefficient corresponding to the queue average bandwidth can be less than the weight coefficient corresponding to the round-trip delay. Of course, the above is only an example, which is not limited.
[0095] When the data transmission performance corresponding to the target port is determined based on the queue average bandwidth and the round-trip delay, the data transmission performance is proportional to the queue average bandwidth, i.e. the greater the queue average bandwidth, the better the data transmission performance, and the smaller the queue average bandwidth, the worse the data transmission performance. The data transmission performance is inversely proportional to the round-trip delay, i.e. the greater the round-trip delay, the worse the data transmission performance, and the smaller the round-trip delay, the better the data transmission performance.
[0096] In summary, for each rate limiting strategy, after the CNP packet received by the target port is rate limited based on the rate limiting strategy, the data transmission performance corresponding to the rate limiting strategy can be obtained.
[0097] Step 4054, selecting the rate limiting strategy corresponding to the optimal data transmission performance (i.e., the maximum data transmission performance) from all rate limiting strategies based on the data transmission performance corresponding to each rate limiting strategy.
[0098] Step 4055, recording the corresponding relationship between the scenario model parameter and the rate limiting strategy corresponding to the optimal data transmission performance in the mapping table A. For example, after obtaining the rate limiting strategy corresponding to the optimal data transmission performance, the rate limiting strategy is used as the rate limiting strategy matched by the scenario model parameter, and the corresponding relationship between the scenario model parameter and the rate limiting strategy is recorded in the mapping table A. See Table 2 for an example of the mapping table A.
[0099] Table 2
[0100]
[0101]
[0102] Obviously, since the rate limiting strategy is the rate limiting strategy corresponding to the optimal data transmission performance, in the traffic scenario corresponding to the scenario model parameter, the traffic of the target priority queue can meet good performance indicators, such as good Throughput performance indicators and Latency performance indicators, through the rate limiting strategy.
[0103] For example, since the rate limiting is performed on the CNP packet received by the target port, the above rate limiting process can also be called as issuing a CNP-based CAR strategy in the incoming direction of the target port. The CAR strategy is the rate limiting strategy, that is, the CNP packet passing through the target port is rate limited, which can make the CNP packet sent by the destination device smooth and greatly improve the Throughput performance of the system.
[0104] The rate limiting strategy can be a rate limiting value for the CNP packet, which can be pps, indicating the number of bytes of CNP packets allowed to pass per second, or Bps, indicating the number of CNP packets allowed to pass per second.
[0105] Thus, the test process is completed, and the mapping table A and the mapping table B are obtained. The mapping table A includes the corresponding relationship between the scenario model parameter and the rate limiting strategy, and the mapping table B includes the corresponding relationship between the traffic scenario parameter and the ECN parameter.
[0106] In one possible implementation, see Figure 5 for a flowchart of the application process.
[0107] Step 501, the network device acquires the traffic scenario data corresponding to the target port.
[0108] For example, the target port of the network device is connected to other devices through a long-distance optical fiber, and the length of the long-distance optical fiber is greater than a length threshold. The target port corresponds to a plurality of priority queues, and the plurality of priority queues include a target priority queue for carrying data of a specified type, and the data of the specified type is ROCE data.
[0109] For example, in the actual operation of the network device, the network device can acquire the traffic scenario data corresponding to the target port. For example, the network device can periodically acquire the traffic scenario data corresponding to the target port, and after obtaining the traffic scenario data each time, the subsequent steps can be used to implement packet transmission.
[0110] For the acquisition method of the traffic scenario data, refer to step 401, which will not be repeated here.
[0111] Step 502, the network device determines the target traffic scenario parameter based on the traffic scenario data corresponding to the target port. For example, after obtaining the traffic scenario data corresponding to the target port, the target traffic scenario parameter can be determined based on the traffic scenario data. The target traffic scenario parameter can include but is not limited to at least one of the following: device type of the network device, out-port rate of the target port, number of in-ports corresponding to data of a specified type in the target priority queue, and queue level of the target priority queue. For example, the target traffic scenario parameter is used to identify the traffic scenario of the target port, and the target traffic scenario parameter is composed of a parameter vector (DeviceType, PortSpeed, Incast, Range). The parameter vector is used as a basis for dividing the scenario model.
[0112] Step 503, the network device determines the target scenario model parameter based on the traffic scenario data corresponding to the target port. For example, after obtaining the traffic scenario data corresponding to the target port, the target scenario model parameter can be determined based on the traffic scenario data. The target scenario model parameter can include but is not limited to at least one of the following: fiber length corresponding to the long-distance optical fiber (i.e., the long-distance optical fiber corresponding to the target port), device type of the network device, out-port rate of the target port, number of in-ports corresponding to data of a specified type in the target priority queue, and queue level of the target priority queue. For example, the scenario model parameter is composed of a parameter vector (DeviceType, PortSpeed, Incast, Dist), and the parameter vector is used as a basis for dividing the scenario model.
[0113] At step 504, the network device queries the target ECN parameter corresponding to the target traffic scenario parameter based on the mapping table B. For example, since the mapping table B includes the corresponding relationship between the traffic scenario parameter and the ECN parameter, as shown in Table 1, after obtaining the target traffic scenario parameter, the target ECN parameter corresponding to the target traffic scenario parameter can be obtained by querying the mapping table B with the target traffic scenario parameter.
[0114] At step 505, the network device enables the target ECN parameter for the target port, that is, the target ECN parameter takes effect.
[0115] For example, after enabling the target ECN parameter for the target port, when the network device sends the specified type data (such as ROCE data) in the target priority queue corresponding to the target port to the destination device, the network device can add a congestion mark in the specified type data based on the target ECN parameter, and the congestion mark is used to make the destination device send the first type of CNP message to the source device, that is, after receiving the specified type data with the congestion mark, the destination device can send the first type of CNP message to the source device.
[0116] For the process of adding the congestion mark in the specified type data based on the target ECN parameter, the target ECN parameter can include but is not limited to the target base water line, the target high water line, and the target marking probability. On this basis, if the queue length of the target priority queue is greater than the target base water line and the queue length of the target priority queue is not greater than the target high water line, the congestion mark can be added in the specified type data based on the target marking probability; if the queue length of the target priority queue is greater than the target high water line, the congestion mark can be added in all specified type data of the target priority queue. Of course, the above is only an example of adding the congestion mark in the specified type data, and the adding method of the congestion mark is not limited in this embodiment.
[0117] At step 506, the network device queries the target rate limiting strategy corresponding to the target scenario model parameter based on the mapping table A. For example, since the mapping table A can include the corresponding relationship between the scenario model parameter and the rate limiting strategy, the rate limiting strategy is used to make the target port have optimal data transmission performance under the scenario model parameter, as shown in Table 2, after obtaining the target scenario model parameter, the target rate limiting strategy corresponding to the target scenario model parameter can be obtained by querying the mapping table A with the target scenario model parameter.
[0118] Of course, other ways can also be used to obtain the target rate limiting strategy, for example, a rate limiting strategy can be configured as the target rate limiting strategy according to experience, and the obtaining method of the target rate limiting strategy is not limited.
[0119] In step 507, the network device limits the first type of CNP packet received by the target port based on the target rate limiting policy, and sends the first type of CNP packet remaining after rate limiting to the source device. The first type of CNP packet is used to control the source device to reduce the sending rate of the specified type of data.
[0120] For example, after enabling the target ECN parameter for the target port, the network device can receive the first type of CNP packet through the target port, and thus can limit the first type of CNP packet received by the target port based on the target rate limiting policy. The target rate limiting policy can include, but is not limited to, a rate limiting value for the first type of CNP packet, and the rate limiting value indicates the number of bytes of the first type of CNP packet allowed to pass per second, or the rate limiting value indicates the number of packets of the first type of CNP packet allowed to pass per second.
[0121] Taking the number of packets of the first type of CNP packet allowed to pass per second as an example, assuming that the network device receives 100 first type of CNP packets per second through the target port, and the target rate limiting policy is 40, then the network device filters out 60 first type of CNP packets, and sends the remaining 40 first type of CNP packets to the source device.
[0122] As can be seen from the above, in this embodiment, by identifying the scene change, the ECN parameter and the rate limiting policy (Car parameter) can be dynamically adjusted, that is, the network device can periodically obtain the traffic scene data corresponding to the target port, and after obtaining the traffic scene data each time, the ECN parameter and the rate limiting policy can be dynamically adjusted, so that the traffic of the target priority queue of the target port reaches a good performance index.
[0123] For example, in the running process of the network device, the traffic scene data is continuously collected, the scene change is identified according to the traffic scene data, the appropriate ECN parameter is selected and sent to the network device, and the appropriate rate limiting policy is selected and sent to the network device. In this way, the traffic scene change can be intelligently detected and identified, and the influence of long-distance optical fiber can be minimized by adjusting the ECN parameter and the rate limiting policy.
[0124] In step 508, the network device determines the target packet rate based on the first sending rate of the specified type of data with the added congestion mark and the second sending rate of the first type of CNP packet forwarded to the source device.
[0125] For example, a first number of the specified type of data to which the congestion mark is added in the target time period can be counted, and a first sending rate can be determined based on the first number and the length of the target time period. The first sending rate can also be referred to as an ECN_marked_rate. For example, when the network device needs to resend the CNP packet, a plurality of time periods in which the CNP packet needs to be resent can be divided, and these time periods are recorded as target time periods. The length of the target time period can be configured according to experience, such as 1 ms, 2 ms, and the like. When the network device sends the specified type of data to the destination device, the congestion mark can be added to the specified type of data based on the target ECN parameter, and a first number of the specified type of data to which the congestion mark is added in the target time period can be counted. After the first number is obtained, the ECN_marked_rate can be determined based on the quotient between the first number and the length of the target time period, such as taking the quotient as the ECN_marked_rate.
[0126] For example, a second number of the first type of CNP packet forwarded to the source device in the target time period can be counted, and a second sending rate can be determined based on the second number and the length of the target time period. The second sending rate can also be referred to as a CNP_green_rate. For example, after the network device limits the first type of CNP packet received by the target port based on the target rate limiting strategy, the first type of CNP packet remaining after the limiting can be referred to as a green CNP packet, and the filtered first type of CNP packet is not a green CNP packet. In this way, the network device can count a second number of the first type of CNP packet forwarded to the source device in the target time period (i.e., the number of green CNP packets), and determine the CNP_green_rate based on the quotient between the second number and the length of the target time period, such as taking the quotient as the CNP_green_rate.
[0127] For example, after obtaining the ECN_marked_rate and the CNP_green_rate, the target packet rate can be determined based on the ECN_marked_rate and the CNP_green_rate. For example, the target packet rate Cpu_Ipcc_rate can be determined by using the following formula: Cpu_Ipcc_rate = ECN_marked_rate - min(ECN_marked_rate, CNP_green_rate). In the above formula, min(ECN_marked_rate, CNP_green_rate) represents a candidate packet rate, and the candidate packet rate can be the minimum value of the ECN_marked_rate and the CNP_green_rate. As shown in the above formula, the target packet rate Cpu_Ipcc_rate can be determined based on the difference between the ECN_marked_rate and the candidate packet rate.
[0128] The ECN_marked_rate represents the sending rate of the specified type of data with added congestion marks, and the sending rate can be used to approximate the rate CNP_server_rate of the first type of CNP packet sent by the destination device. Therefore, the ECN_marked_rate in the above formula can be replaced by the CNP_server_rate.
[0129] In step 509, the network device generates the second type of CNP packet based on the target packet rate, and sends the second type of CNP packet to the source device. The second type of CNP packet is used to control the source device to reduce the sending rate of the specified type of data.
[0130] For example, the network device can periodically obtain the first sending rate and the second sending rate, and then determine the target packet rate, and send the second type of CNP packet to the source device based on the target packet rate. For example, the target packet rate can be determined for each target time period, and the second type of CNP packet can be sent to the source device based on the target packet rate in the target time period. For example, the target time period can be 1 ms, and the target packet rate can be used to represent the number of second type of CNP packets to be sent in 1 ms.
[0131] For example, the network device generates a target number of second type of CNP packets matching the target packet rate. For example, the target number can be determined based on the product of the target packet rate and the length of the target time period, and the target number of second type of CNP packets can be generated based on the target number.
[0132] For example, if the target priority queue includes at least one data stream corresponding to a source device, and the data of the specified type is ROCE data, the ROCE data with the same 3-tuple forms a ROCE data stream, and each data stream corresponds to a source device, for each source device, the rate proportion of the source device corresponding to the data stream corresponding to the source device can be determined based on the rate of the data stream corresponding to the source device, and the number of messages corresponding to the source device can be determined based on the target number and the rate proportion of the source device corresponding to the data stream.
[0133] For example, assuming that the target priority queue includes data stream a1, data stream a2, and data stream a3, the rate of data stream a1 is 100 / ms (indicating that 100 ROCE data are received per millisecond in the target time period), the rate of data stream a2 is 200 / ms, and the rate of data stream a3 is 300 / ms, the rate proportion of source device b1 corresponding to data stream a1 is 1 / 6, the rate proportion of source device b2 corresponding to data stream a2 is 2 / 6, and the rate proportion of source device b3 corresponding to data stream a3 is 3 / 6, and based on this, the number of messages corresponding to source device b1 can be target number*1 / 6, the number of messages corresponding to source device b2 can be target number*2 / 6, and the number of messages corresponding to source device b3 can be target number*3 / 6.
[0134] For example, for each source device, after obtaining the number of messages corresponding to the source device, the network device can send the number of second CNP messages to the source device. As can be seen from the above, the greater the rate (bandwidth) of the data stream, the greater the number of second CNP messages sent to the source device.
[0135] For example, in order to improve the sending efficiency of the second CNP message, the DPDK (Data Plane Development Kit) method can be used to send the second CNP message to the source device. The DPDK bypasses the processing of the Linux kernel protocol stack on the data packet, and implements a set of data plane in the user space to receive and process the data packet, which can greatly improve the data processing performance and throughput, and improve the working efficiency of the data plane application program. Therefore, the DPDK method can be used to send the second CNP message to the source device. Alternatively, the FPGA can be used to send the second CNP message to the source device. The FPGA constructs a CNP message template in advance, and the CPU notifies the FPGA of the CNP message parameters (such as the address of the source device) to be sent and the number of sending, and the FPGA sends the second CNP message to the source device.
[0136] In summary, the network device can send the second type of CNP packet to the source device, so that the source device can timely reduce the sending rate of the specified type of data, not only solving the problem of long congestion feedback path, but also accurately controlling the number of sent CNP packets, which can not only ensure timely speed reduction during congestion, but also avoid excessive speed reduction when the congestion has been alleviated. The network device actively sends the second type of CNP packet to replace the back pressure effect of ECN, thereby avoiding the influence of signal delay introduced by the long-distance link.
[0137] From the above technical solutions, in the long-distance optical fiber scenario, the CNP packet received by the target port can be limited in speed, so as to avoid that the source device receives a large amount of CNP packets in a short time, so that the CNP packets received by the source device are more balanced and smoother, and the speed reduction process (i.e., the process of reducing the data transmission rate) of the source device is more smooth, avoiding that the source device reduces speed greatly in a period of time, and reduces speed very small or does not reduce speed in another period of time, so that the data transmission performance of the network device is better, avoiding that a large amount of data is received in a period of time to cause network congestion, and a small amount of data is received in another period of time to cause that bandwidth resources cannot be fully utilized. The CNP packet received by the target port can also be limited in speed based on the target speed limiting strategy corresponding to the target scene model parameter (i.e., the actual scene model parameter) of the network device. The target speed limiting strategy matches the actual scene of the network device, the speed limiting effect of the target speed limiting strategy is better, and the target scene model parameter at least includes the optical fiber length corresponding to the long-distance optical fiber, so that the target speed limiting strategy is related to the optical fiber length, that is, the target speed limiting strategy most matched with the optical fiber length is found, further improving the forwarding performance of the target port, and the data transmission performance of the network device reaches the optimum. In the embodiment, an implementation scheme for optimizing the forwarding performance of the long-distance port through the speed limiting strategy is proposed. The CNP-based speed limiting strategy is issued in the incoming direction of the long-distance port (i.e., the target port), and the CNP packet passing through the target port is limited in speed. This speed limiting makes the CNP packet sent by the destination device smooth, and improves the Throughput performance of the system. The ECN parameter and the speed limiting strategy are combined to minimize the impact of the long-distance port as much as possible, and ensure that the traffic of the target priority queue of the target port reaches a good performance index, which can adapt to various network scenes, and well solves the problem of forwarding performance degradation caused by network delay in the long-distance optical fiber scenario of the data center. The target packet rate can be determined based on the sending rate of the specified type of data with added congestion mark and the sending rate of the first type of CNP packet forwarded to the source device, and the second type of CNP packet is generated based on the target packet rate, and the second type of CNP packet is sent to the source device, so that the network device retransmits the CNP packet, further compensates for the impact of the long-distance optical fiber, and better controls the sending rate of the source device for the specified type of data. The ECN parameter, the speed limiting strategy and the CNP packet retransmission process are organically combined, the ECN parameter is beneficial to obtain better forwarding performance, the speed limiting strategy plays a role in smoothing the back pressure effect, the ECN parameter and the speed limiting strategy greatly reduce the number of CNP packets that need to be retransmitted, and the CNP packet retransmission process further compensates for the impact of the long-distance link. The scheme has the advantages of simple implementation, small CPU load, good test effect, and can adapt to various network scenes, and the actual effect of the scheme is good, for example, in a 60km long-distance environment, the 52G traffic can be improved to 92G, and the Throughput performance is greatly improved.
[0138] Based on the same application concept as the above method, an embodiment of the present application proposes a packet transmission device, applied to a network device, the network device comprising a target port, the target port being connected with other devices through a long-distance optical fiber, as shown in Figure 6 The device comprises:
[0139] The acquisition module 61 is configured to acquire a target rate-limiting strategy and a target ECN parameter corresponding to the target port.
[0140] The processing module 62 is configured to, when sending data of a specified type in a target priority queue corresponding to the target port to a destination device, add a congestion mark in the data of the specified type based on the target ECN parameter, the congestion mark being used to make the destination device send a first type of CNP packet to a source device.
[0141] The processing module 62 is further configured to limit the rate of the first type of CNP packet received by the target port based on the target rate-limiting strategy, and send the first type of CNP packet remaining after the rate limiting to the source device.
[0142] The determination module 63 is configured to determine a target packet rate based on a first sending rate of the data of the specified type having the congestion mark added and a second sending rate of the first type of CNP packet forwarded to the source device, and the sending module 64 is configured to generate a second type of CNP packet based on the target packet rate, and send the second type of CNP packet to the source device, the second type of CNP packet being used to control the source device to reduce the sending rate of the data of the specified type.
[0143] For example, when the determination module 63 determines the target packet rate based on the first sending rate of the data of the specified type having the congestion mark added and the second sending rate of the first type of CNP packet forwarded to the source device, it is specifically configured to: count a first number of the data of the specified type having the congestion mark added within a target time period, and count a second number of the first type of CNP packet forwarded to the source device within the target time period; determine the first sending rate based on the first number and a time length of the target time period; determine the second sending rate based on the second number and the time length of the target time period; and determine the target packet rate based on the first sending rate and the second sending rate.
[0144] Specifically, the determining module 63 determines the target message rate based on the first sending rate of the specified type of data added with the congestion mark and the second sending rate of the first type of CNP message forwarded to the source device, specifically: determining a candidate message rate based on the first sending rate and the second sending rate, the candidate message rate being the minimum of the first sending rate and the second sending rate; determining the target message rate based on the difference between the first sending rate and the candidate message rate.
[0145] Specifically, the sending module 64 generates the second type of CNP message based on the target message rate, and sends the second type of CNP message to the source device, specifically: generating a target number of second type of CNP messages matching the target message rate; if the target priority queue includes at least one data stream corresponding to a source device, for each source device, determining a rate ratio corresponding to the source device based on the rate of the data stream corresponding to the source device; determining the number of messages corresponding to the source device based on the target number and the rate ratio corresponding to the source device, and sending the number of messages corresponding to the source device to the source device.
[0146] Specifically, the obtaining module 61 obtains the target rate limiting strategy corresponding to the target port, specifically: determining a target scene model parameter based on the traffic scene data corresponding to the target port, the target scene model parameter including at least the fiber length corresponding to the long-distance optical fiber; querying the target rate limiting strategy corresponding to the target scene model parameter (i.e. the target rate limiting strategy corresponding to the target port) based on a mapping table; wherein the mapping table includes the correspondence between the scene model parameter and the rate limiting strategy, and the rate limiting strategy is used to make the target port have optimal data transmission performance under the scene model parameter.
[0147] Specifically, before querying the target rate limiting strategy corresponding to the target scene model parameter based on the mapping table, the obtaining module 61 is further configured to: determine a scene model parameter based on the traffic scene data corresponding to the target port in a test environment, and obtain a plurality of rate limiting strategies corresponding to the scene model parameter; for each rate limiting strategy, limit the CNP message received by the target port based on the rate limiting strategy, and count the data transmission performance corresponding to the target port after rate limiting; record the correspondence between the scene model parameter and the rate limiting strategy corresponding to the optimal data transmission performance in the mapping table based on the data transmission performance corresponding to each rate limiting strategy, thereby establishing the mapping table.
[0148] For example, the target ECN parameter can include a target base waterline, a target high waterline and a target marking probability, and the processing module 62 is specifically configured to add congestion marks in the specified type of data based on the target ECN parameter, if the queue length of the target priority queue is greater than the target base waterline and is not greater than the target high waterline, add congestion marks in the specified type of data based on the target marking probability; if the queue length of the target priority queue is greater than the target high waterline, add congestion marks in all the specified type of data of the target priority queue.
[0149] Based on the same application concept as the above method, an embodiment of the present application provides a network device, as shown in Figure 7 The network device includes a processor 71 and a machine readable storage medium 72, and the machine readable storage medium 72 stores machine executable instructions that can be executed by the processor 71; and the processor 71 is configured to execute the machine executable instructions to implement the packet transmission method disclosed in the above examples of the present application.
[0150] Based on the same application concept as the above method, an embodiment of the present application further provides a machine readable storage medium, and the machine readable storage medium stores a plurality of computer instructions, and the computer instructions can implement the packet transmission method disclosed in the above examples of the present application when executed by a processor.
[0151] The machine readable storage medium can be any electronic, magnetic, optical, or other physical storage device, and can contain or store information such as executable instructions, data, and the like. For example, the machine readable storage medium can be a RAM (Random Access Memory), a volatile memory, a non-volatile memory, a flash memory, a storage drive (such as a hard disk drive), a solid state drive, any type of storage disk (such as an optical disk, a DVD, etc.), or similar storage medium, or a combination thereof.
[0152] The system, device, module or unit illustrated in the above embodiments can be implemented by a computer entity or a product with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0153] For the convenience of description, the above device is described as various units by function. Of course, the functions of the units can be implemented in the same or more software and / or hardware in the implementation of the present application.
[0154] Those skilled in the art will appreciate that embodiments of the application can be devised for a method, a system, or a computer program product. Accordingly, the present application can be embodied in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, and the like) embodying computer readable program code.
[0155] The present application is described in reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure One one or more functions specified in the flowchart illustrations and / or block diagrams. Figure One one or more functions specified in the flowchart illustrations and / or block diagrams.
[0156] Also, these computer program instructions can be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the functions specified in the flowchart illustrations and / or block diagrams. Figure One one or more functions specified in the flowchart illustrations and / or block diagrams. Figure One one or more functions specified in the flowchart illustrations and / or block diagrams.
[0157] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure One one or more functions specified in the flowchart illustrations and / or block diagrams. Figure One one or more functions specified in the flowchart illustrations and / or block diagrams.
[0158] The embodiments of the present application described above are merely given as examples of the application only. Various modifications and changes can be devised by those skilled in the art who practice the principle of the application. It is intended that the embodiments of the present application encompass all such modifications and changes and so that the application be understood to extend to all equivalents thereof.
Claims
1. A method of transmitting a packet, characterized by, The method is applied to a network device, the network device comprises a target port, the target port is connected with other devices through a long-distance optical fiber, and the method comprises the following steps: obtaining a target rate-limiting strategy and a target Explicit Congestion Notification (ECN) parameter corresponding to the target port; when sending specified type data in a target priority queue corresponding to the target port to a destination device, adding a congestion mark in the specified type data based on the target ECN parameter, the congestion mark is used to make the destination device send a first type of Congestion Notification Packet (CNP) message to a source device; limiting the first type of CNP message received by the target port based on the target rate-limiting strategy, and sending the first type of CNP message remaining after the limiting to the source device; determining a target message rate based on a first sending rate of the specified type data having the congestion mark added and a second sending rate of the first type of CNP message forwarded to the source device; generating a second type of CNP message based on the target message rate, and sending the second type of CNP message to the source device, the second type of CNP message is used to control the source device to reduce the sending rate of the specified type data.
2. The method of claim 1, wherein the determining the target message rate based on the first sending rate of the specified type data having the congestion mark added and the second sending rate of the first type of CNP message forwarded to the source device comprises: counting a first number of the specified type data having the congestion mark added in a target time period, and counting a second number of the first type of CNP message forwarded to the source device in the target time period; determining the first sending rate based on the first number and a time length of the target time period; determining the second sending rate based on the second number and the time length of the target time period; determining the target message rate based on the first sending rate and the second sending rate.
3. The method of claim 1 or 2, wherein the determining the target message rate based on the first sending rate of the specified type data having the congestion mark added and the second sending rate of the first type of CNP message forwarded to the source device comprises: determining a candidate message rate based on the first sending rate and the second sending rate, the candidate message rate being the minimum value of the first sending rate and the second sending rate; determining the target message rate based on a difference between the first sending rate and the candidate message rate. The generating the second type of CNP message based on the target message rate, and sending the second type of CNP message to the source device comprises: generating a target number of the second type of CNP message matching the target message rate; 4. The method of claim 1, wherein, if the target priority queue comprises at least one data flow corresponding to a source device, for each source device, determining a rate proportion corresponding to the source device based on a rate of a data flow corresponding to the source device; determining a message number corresponding to the source device based on the target number and the rate proportion corresponding to the source device, and sending the message number of the second type of CNP message to the source device.
5. The method of claim 1, wherein The obtaining the target rate limiting strategy corresponding to the target port comprises: determining a target scene model parameter based on the traffic scene data corresponding to the target port, the target scene model parameter at least including a fiber length corresponding to the long-distance optical fiber; querying the target rate limiting strategy corresponding to the target scene model parameter based on a mapping table; The mapping table includes a corresponding relationship between a scene model parameter and a rate limiting strategy, and the rate limiting strategy is used to make the target port have optimal data transmission performance under the scene model parameter.
6. The method of claim 5, wherein, Before the querying the target rate limiting strategy corresponding to the target scene model parameter based on the mapping table, the method further comprises: determining a scene model parameter based on the traffic scene data corresponding to the target port in a test environment, and obtaining a plurality of rate limiting strategies corresponding to the scene model parameter; for each rate limiting strategy, limiting the CNP packet received by the target port based on the rate limiting strategy, and counting the data transmission performance corresponding to the target port after the rate limiting; based on the data transmission performance corresponding to each rate limiting strategy, recording the corresponding relationship between the scene model parameter and the rate limiting strategy corresponding to the optimal data transmission performance in the mapping table.
7. The method of claim 1, wherein the target ECN parameter includes a target base waterline, a target high waterline, and a target marking probability, and the adding a congestion mark in the specified type data based on the target ECN parameter comprises: if the queue length of the target priority queue is greater than the target base waterline and not greater than the target high waterline, adding a congestion mark in the specified type data based on the target marking probability; if the queue length of the target priority queue is greater than the target high waterline, adding a congestion mark in all specified type data of the target priority queue. The network device comprises a target port connected to other devices through a long-distance optical fiber, and the device comprises:
8. A packet transmission apparatus characterized by comprising: an acquisition module configured to acquire a target rate limiting strategy and a target ECN parameter corresponding to the target port; a processing module configured to add a congestion mark in the specified type data based on the target ECN parameter when transmitting the specified type data in the target priority queue corresponding to the target port to a destination device, the congestion mark being used to make the destination device transmit a first type CNP packet to a source device; the processing module is further configured to limit the first type CNP packet received by the target port based on the target rate limiting strategy, and transmit the first type CNP packet remaining after the limiting to the source device; a determination module configured to determine a target packet rate based on a first transmission rate of the specified type data having the added congestion mark and a second transmission rate of the first type CNP packet forwarded to the source device; a transmission module configured to generate a second type CNP packet based on the target packet rate, and transmit the second type CNP packet to the source device, the second type CNP packet being used to control the source device to reduce the transmission rate of the specified type data. 9. The apparatus of claim 8, wherein, The determining module is specifically configured to determine the target message rate based on a first sending rate of the specified type data to which the congestion mark is added and a second sending rate of the first type CNP message forwarded to the source device. The determining module is specifically configured to determine the target message rate based on a first sending rate of the specified type data to which the congestion mark is added and a second sending rate of the first type CNP message forwarded to the source device. The determining module is specifically configured to determine the target message rate based on a first sending rate of the specified type data to which the congestion mark is added and a second sending rate of the first type CNP message forwarded to the source device. The determining module is specifically configured to determine the target message rate based on a first sending rate of the specified type data to which the congestion mark is added and a second sending rate of the first type CNP message forwarded to the source device. The determining module is specifically configured to determine the target message rate based on a first sending rate of the specified type data to which the congestion mark is added and a second sending rate of the first type CNP message forwarded to the source device.
10. The apparatus of claim 8 or 9, wherein, The sending module is specifically configured to generate the second type CNP message based on the target message rate and send the second type CNP message to the source device. The sending module is specifically configured to generate the second type CNP message based on the target message rate and send the second type CNP message to the source device.
12. The apparatus of claim 8, wherein 11. The apparatus of claim 8, wherein, The obtaining module is specifically configured to obtain the target rate limiting strategy corresponding to the target port by: determining a target scene model parameter based on the traffic scene data corresponding to the target port, the target scene model parameter at least including a fiber length corresponding to the long-distance optical fiber; querying the target rate limiting strategy corresponding to the target scene model parameter based on a mapping table; wherein the mapping table includes a corresponding relationship between a scene model parameter and a rate limiting strategy, and the rate limiting strategy is used to make the target port have an optimal data transmission performance under the scene model parameter. Before the obtaining module queries the target rate limiting strategy corresponding to the target scene model parameter based on the mapping table, the obtaining module is further configured to: determine a scene model parameter based on the traffic scene data corresponding to the target port in a test environment, and obtain a plurality of rate limiting strategies corresponding to the scene model parameter; for each rate limiting strategy, limit the CNP message received by the target port based on the rate limiting strategy, and count the data transmission performance corresponding to the target port after the rate limiting; record, in the mapping table, a corresponding relationship between the scene model parameter and the rate limiting strategy corresponding to the optimal data transmission performance. 13. The apparatus of claim 12, wherein, 14. The apparatus of claim 8, wherein the target ECN parameters comprise a target base water mark, a target high water mark, and a target marking probability, and the processing module is specifically configured to: add a congestion mark in the specified type of data based on the target marking probability, if the queue length of the target priority queue is greater than the target base water mark and is not greater than the target high water mark; and add a congestion mark in all of the specified type of data in the target priority queue, if the queue length of the target priority queue is greater than the target high water mark. comprise:
15. A network device, comprising: a processor and a machine readable storage medium storing machine executable instructions executable by the processor; the processor is configured to execute the machine executable instructions to implement the method of any one of claims 1-7.
Citation Information
Patent Citations
Transmission rate adjusting method and device applied to long-distance communication network scene
CN116055416A