Message processing method and network device

By introducing the sending window remaining amount logic and virtual output queue based on the destination IP address in the network device, the problem of headline blocking is solved, and the independent transmission status of packets of different destination IP addresses in the network device is realized, which slows down network congestion.

CN116155812BActive Publication Date: 2025-09-05HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111397782.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-23
Publication Date
2025-09-05
Estimated Expiration
2041-11-23

AI Technical Summary

Technical Problem

In the existing traffic control mechanism, the line head blocking phenomenon leads to a decrease in network throughput, and traditional methods cannot effectively solve the traffic impact of different congestion points.

Method used

By introducing the remaining amount of sending window logic based on the destination IP address in the network device, a sending window is set for each destination IP address, its corresponding message transmission status is determined, and a virtual output queue and an output port queue are used to isolate the message transmission of different destination IP addresses.

Benefits of technology

Effectively avoid line head blocking, slow down network congestion, improve packet transmission efficiency, and ensure that the packet transmission status of different destination IP addresses does not affect each other.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116155812B_ABST
    Figure CN116155812B_ABST
Patent Text Reader

Abstract

The present application discloses a message processing method and a network device for solving the problem of head-of-line blocking. In which, the first network device receives multiple messages, and then determines the transmission status of the message corresponding to the destination IP address according to the remaining amount of the sending window corresponding to each destination IP address. In which, the destination IP addresses of the multiple messages are not exactly the same, and the sending window remaining amounts corresponding to different destination IP addresses are different. The sending window remaining amount corresponding to each destination IP address is used to indicate the metering value of the message currently allowed to be sent to the destination IP address. Since the judgment logic of the sending window is added to the first network device, and the sending window remaining amount with the destination IP address as the granularity is set, the first network device can determine the transmission status of the message with the destination IP address based on the sending window remaining amount corresponding to each destination IP address. Therefore, head-of-line blocking can be avoided, which is conducive to alleviating network congestion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing, and in particular to a message processing method and a network device. Background Art

[0002] In a computer network, when the rate at which a sender sends messages exceeds the receiver's ability to process them, it may cause the receiver's buffer to overflow, leading to packet loss, decreased network throughput, and other problems. To address this issue, conventional technology has proposed a flow control mechanism. This flow control mechanism is a mechanism designed to prevent messages from being sent to the receiver too quickly. Specifically, in this flow control mechanism, when the receiver does not have sufficient capacity to process received messages (for example, the buffer occupancy rate is higher than a certain threshold), the receiver can send a pause frame to the sender to cause the sender to pause sending messages to the receiver. When the receiver has sufficient capacity to process received messages (for example, the buffer occupancy rate is lower than a certain threshold), the receiver sends a resume frame to the sender to cause the sender to resume sending messages to the receiver.

[0003] However, the aforementioned flow control mechanism pauses upstream traffic at a queue-level, meaning the sender pauses packets in a single queue. When traffic passing through different congestion points enters the same queue, uncongested traffic may be paused by pause frames triggered by congested traffic, resulting in head-of-line blocking (HOL blocking). A packet processing method that can address HOL blocking is urgently needed. Summary of the Invention

[0004] The present application provides a message processing method and a network device for solving the head-of-line blocking problem and alleviating congestion during message transmission.

[0005] In a first aspect, the present application provides a message processing method, wherein a first network device receives multiple messages, wherein the destination IP addresses of the multiple messages are not identical. The first network device then parses the message header of each message to obtain the destination IP address, and based on the destination IP address, obtains the remaining amount of a send window corresponding to the destination IP address. The first network device then determines the transmission status of the message corresponding to each destination IP address based on the remaining amount of the send window corresponding to the destination IP address.

[0006] Among them, different destination IP addresses correspond to different sending window remaining amounts, and the sending window remaining amount is a value stored in the first network device for measuring the aforementioned sending window, and is used to indicate the measurement value of the message currently allowed to be sent. The sending window remaining amount corresponding to each destination IP address is used to indicate the measurement value of the message currently allowed to be sent to the destination IP address. Among them, the message measurement value is a value used to measure the message. The message measurement value can be the number of bytes occupied by the message, the number of messages, or the number of transmission units of a specific size (for example, the maximum transmission unit (MTU)).

[0007] In the present application, the first network device may be a network device such as a programmable switch, a programmable router, etc. that has the capability of forwarding and processing messages.

[0008] In this embodiment, it is proposed to add a judgment logic of a sending window to the first network device, and set a sending window remaining amount with the destination IP address as the granularity, so that the first network device such as a switch and a router as an intermediate network element can determine the transmission status of the message with the destination IP address based on the sending window remaining amount corresponding to each destination IP address. Therefore, the first network device judges the message with the corresponding destination IP address based on the sending window remaining amount corresponding to each destination IP address, and can decide whether to send the message corresponding to the destination IP address based on the destination IP address. Since the first network device will not affect the transmission status of the message with one destination IP address due to the transmission status of the message with another destination IP address, it can avoid head-of-line blocking, which is conducive to alleviating network congestion.

[0009] In one possible embodiment, the transmission status of the message corresponding to the destination IP address includes: transmitting the message to a virtual output queue corresponding to the destination IP address, the virtual output queue being used to temporarily store messages; or transmitting the message corresponding to the destination IP address to an output port queue, the output port queue being used to send messages. In other words, the first network device determines the transmission status of the message corresponding to each destination IP address based on the remaining amount of the sending window corresponding to each destination IP address. This can be understood as the first network device determining whether to transmit the message to the virtual output queue corresponding to the destination IP address or to the output port queue based on the remaining amount of the sending window corresponding to each destination IP address.

[0010] Among them, transmitting the message corresponding to the destination IP address to the output port queue can be understood as the first network device transmitting the received message to the output port queue; it can also be understood as the first network device transmitting the message in the virtual output queue to the output port queue.

[0011] It can be seen from this that the message processing method proposed in this application can determine whether to send the message corresponding to the destination IP address based on the remaining amount of the sending window corresponding to the destination IP address. Since different destination IP addresses correspond to different sending window remaining amounts, the transmission status of different destination IP addresses does not affect each other. For example, the decision result of whether the first network device sends the message for destination IP address 1 does not affect the decision of the first network device whether to send the message for destination IP address 2. Therefore, the message processing method proposed in this application is conducive to avoiding head-of-line blocking and helping to alleviate network congestion.

[0012] In one possible implementation, the first network device includes multiple virtual output queues, with different destination IP addresses corresponding to different virtual output queues. That is, when the first network device determines that a portion of messages will not be sent temporarily and are temporarily stored in a virtual output queue, because the first network device has virtual output queues based on IP address granularity, messages with different destination IP addresses are temporarily stored in different virtual output queues. Therefore, messages temporarily stored in different virtual output queues are isolated from each other. For example, a message with destination IP address 1 temporarily stored in virtual output queue 1 is isolated from a message with destination IP address 2 temporarily stored in virtual output queue 2.

[0013] In this embodiment, it is proposed to isolate the messages that are temporarily not sent by the first network device according to the destination IP address through a virtual output queue based on the destination IP address granularity, which is conducive to isolating the messages that are temporarily not sent from each other in the first network device, and further helps to avoid the message of a certain destination IP address blocking the message corresponding to another destination IP address.

[0014] In one possible implementation, before the first network device determines the transmission status of the message corresponding to the destination IP address based on the remaining amount in the send window, the first network device may also first determine whether a virtual output queue has been allocated for the destination IP address in the first network device. Specifically, the first network device queries the virtual output queue corresponding to the destination IP address of each message. If the first network device does not have a virtual output queue corresponding to the destination IP address, the first network device obtains the remaining amount in the send window corresponding to the destination IP address.

[0015] Optionally, when a virtual output queue corresponding to the destination IP address exists in the first network device, the first network device transmits the message corresponding to the destination IP address to the virtual output queue corresponding to the destination IP address.

[0016] In this embodiment, since the first network device needs to determine whether each message it receives needs to be transmitted to the virtual output queue, if the first network device receives multiple messages with the same destination IP address, and has determined that the message with the destination IP address needs to be transmitted to the virtual output queue based on the first message received with the destination IP address, and has allocated a virtual output queue for the destination IP address, then when the first network device receives a message with the aforementioned destination IP address again, the first network device can directly transmit the message with the aforementioned destination IP address to the virtual output queue. In this case, the first network device can omit the step of obtaining the remaining amount of the send window corresponding to the destination IP address of the message, which is conducive to improving the efficiency of the first network device in processing messages.

[0017] In one possible implementation, the first network device determines the transmission status of the message corresponding to each destination IP address based on the sending window remaining amount corresponding to the destination IP address, including: when the sending window remaining amount corresponding to the destination IP address is greater than or equal to the metering value of the message corresponding to the destination IP address, the first network device transmits the message corresponding to the destination IP address to the egress port queue, and sends the message corresponding to the destination IP address through the egress port queue; the method also includes: the first network device calculates the difference between the sending window remaining amount corresponding to the destination IP address and the metering value of the message corresponding to the destination IP address, and obtains the updated sending window remaining amount corresponding to the destination IP address.

[0018] In this embodiment, since the remaining amount of the sending window corresponding to a certain destination IP address can reflect the degree of congestion or smoothness of the downstream network device when transmitting the message with the aforementioned destination IP address, when the remaining amount of the sending window corresponding to the destination IP address is greater than or equal to the metering value of the message corresponding to the destination IP address, it indicates that the downstream network device is relatively smooth when transmitting the message with the aforementioned destination IP address. Therefore, the first network device can transmit the message with the aforementioned destination IP address to the egress port queue, and send it to the downstream network device through the egress port queue.

[0019] In one possible implementation, the first network device determines the transmission status of the message corresponding to each destination IP address based on the remaining amount of the sending window corresponding to the destination IP address, including: when the remaining amount of the sending window corresponding to the destination IP address is less than the metering value of the message corresponding to the destination IP address, the first network device determines the virtual output queue corresponding to the destination IP address; and transmits the message corresponding to the destination IP address to the virtual output queue corresponding to the destination IP address of the message.

[0020] In this embodiment, the remaining amount of the sending window corresponding to a destination IP address can reflect the degree of congestion or smoothness of the downstream network device when transmitting the message with the aforementioned destination IP address. When the remaining amount of the sending window corresponding to the destination IP address is less than the meter value of the message corresponding to the destination IP address, it indicates that the downstream network device may have encountered congestion when transmitting the message with the aforementioned destination IP address. Therefore, the first network device will temporarily not send the message with the destination IP address, but will temporarily store the message with the destination IP address in the virtual output queue. This avoids causing further congestion of downstream traffic.

[0021] In one possible implementation, the first network device determines the virtual output queue corresponding to the destination IP address, including: the first network device assigns a virtual output queue that is not associated with an IP address to the message as the virtual output queue corresponding to the destination IP address, and stores the correspondence between the destination IP address and the virtual output queue in a first correspondence; wherein the first correspondence includes a correspondence between at least one IP address and each virtual output queue corresponding to the IP address, and the first correspondence is used to indicate that the virtual output queue corresponding to the IP address has cached a message with the destination IP address as the IP address.

[0022] In this embodiment, it is proposed that the first network device can store the virtual output queue of the temporarily stored message and the destination IP address corresponding to the message, so that when the first network device receives a message with the same destination IP address again, the first network device can determine whether to transmit the message with the same destination IP address to the virtual output queue based on the aforementioned first correspondence, which is conducive to improving the efficiency of the first network device in processing messages.

[0023] In one possible implementation, the first network device includes a first virtual output queue, which is used to temporarily store messages whose destination IP address is a first IP address; the first virtual output queue temporarily stores a first message whose destination IP address is the first IP address. The method also includes: the first network device obtains the first message in the first virtual output queue; when the first sending window remaining amount corresponding to the first IP address is greater than or equal to the metering value of the first message, the first network device transfers the first message in the first virtual queue to the egress queue and sends the first message through the egress queue; the first network device calculates the difference between the first sending window remaining amount and the metering value of the first message to obtain an updated first sending window remaining amount.

[0024] In this embodiment, it is proposed that the first network device also needs to send out the messages temporarily stored in the virtual output queue through the outbound port queue at an appropriate time, and the first network device also needs to update the remaining amount of the first sending window.

[0025] In a possible implementation, the method further includes: the first network device obtaining a queue length of the first virtual output queue, where the queue length is used to indicate the sum of measurement values ​​of messages temporarily stored in the first virtual output queue; when the queue length of the first virtual output queue is zero, the first network device deleting the correspondence between the first IP address and the first virtual output queue.

[0026] In a possible implementation, the first network device stores a second correspondence relationship, where the second correspondence relationship includes a correspondence relationship between at least one IP address and a remaining amount of a sending window corresponding to each IP address.

[0027] In one possible embodiment, the remaining amount of the sending window corresponding to each destination IP address is determined based on the measurement value of the messages sent to the destination IP address by the second network device within a preset reporting period, and the second network device is a downstream network device of the first network device. The preset reporting period includes the duration period of the preset timer or the counting period of the preset counter.

[0028] The first measurement value is a measurement value of messages sent by the second network device to the first IP address within a preset reporting period. The preset reporting period includes a preset timer duration period or a preset counter counting period. In other words, the window update message is periodically generated by the second network device based on a preset trigger event. The preset trigger event can be a timer-based trigger event or a counter-based trigger event.

[0029] Exemplarily, if the preset trigger event is a timer-based trigger event, the preset reporting period is the duration of the preset timer. In this case, the second network device is provided with a timer, and whenever the timer times out, the second network device generates a window update message, and determines the measurement value of the message sent to the destination IP address during the duration of the timer (i.e., during the operation of the timer) as the first measurement value.

[0030] Exemplarily, if the preset trigger event is a counter-based trigger event, the preset reporting period is the counting period of the preset counter. In this case, the second network device is provided with multiple counters, each corresponding to a destination IP address. Each time the second network device sends a message with a destination IP address, the counter corresponding to the destination IP address counts once until a preset value is reached. When the preset counter reaches a preset value, the second network device generates a send window update message and carries the preset value as the first measurement value in the send window update message.

[0031] In this embodiment, since the metering value of the messages sent by the second network device to the destination IP address within the preset reporting period can reflect the congestion level or smoothness level of the second network device sending messages to the destination IP address, the remaining amount of the sending window corresponding to each destination IP address in the first network device can also indirectly reflect the congestion level or smoothness level of the downstream network device sending messages to the destination IP address. Therefore, when the first network device determines the transmission status of each message based on the remaining amount of the sending window corresponding to each destination IP address in the first network device, it can take into account the situation of the downstream network device transmitting the message. Therefore, it is helpful to avoid the accumulation of messages in the case of congestion in the downstream message transmission, and further helps to avoid the head-of-line blocking phenomenon.

[0032] In a possible implementation, the method further includes: the first network device receives a window update message from the second network device, the window update message carries a first IP address, and the window update message is used to instruct the first network device to update the first sending window remaining amount corresponding to the first IP address; the first network device updates the first sending window remaining amount of the first network device according to the window update message to obtain the second sending window remaining amount.

[0033] In one possible implementation, the window update message includes a first metering value, which is the metering value of the message sent by the second network device to the first IP address within a preset reporting period; the first network device updates the first sending window remaining amount of the first network device according to the window update message to obtain the second sending window remaining amount, including: the first network device determines that the sum of the first sending window remaining amount and the first metering value is the second sending window remaining amount.

[0034] In one possible implementation, the first network device stores a preset metering value; the first network device updates the first sending window remaining amount of the first network device according to the window update message to obtain the second sending window remaining amount, including: the first network device determines that the sum of the first sending window remaining amount and the preset metering value is the second sending window remaining amount.

[0035] In a second aspect, the present application provides a first network device, comprising: a transceiver module and a processing module. The transceiver module is configured to receive multiple messages, each of which has a different destination IP address. The processing module is configured to determine the transmission status of the message corresponding to each destination IP address based on the remaining send window corresponding to the destination IP address, wherein different destination IP addresses correspond to different remaining send windows, and the remaining send window corresponding to each destination IP address is used to indicate a metered value of messages currently allowed to be sent to the destination IP address.

[0036] In one possible implementation, the transmission status of the message corresponding to the destination IP address includes: transmitting the message to a virtual output queue corresponding to the destination IP address, which is used to temporarily store the message; or transmitting the message corresponding to the destination IP address to an output port queue, which is used to send the message.

[0037] In a possible implementation, the first network device includes a plurality of the virtual output queues, and different destination IP addresses correspond to different virtual output queues.

[0038] In a possible implementation, the processing module is further configured to:

[0039] Query the virtual output queue corresponding to the destination IP address of each message;

[0040] When the virtual output queue corresponding to the destination IP address does not exist in the first network device, a remaining amount of the sending window corresponding to the destination IP address is obtained.

[0041] In a possible implementation, the processing module is further configured to, when a virtual output queue corresponding to the destination IP address exists in the first network device, transmit the message corresponding to the destination IP address to the virtual output queue corresponding to the destination IP address.

[0042] In one possible implementation, the processing module is specifically used to transmit the message corresponding to the destination IP address to the egress port queue and send the message corresponding to the destination IP address through the egress port queue when the sending window remaining amount corresponding to the destination IP address is greater than or equal to the measurement value of the message corresponding to the destination IP address; the processing module is also used to calculate the difference between the sending window remaining amount corresponding to the destination IP address and the measurement value of the message corresponding to the destination IP address, and obtain the updated sending window remaining amount corresponding to the destination IP address.

[0043] In one possible implementation, the processing module is specifically used to determine the virtual output queue corresponding to the destination IP address when the remaining amount of the sending window corresponding to the destination IP address is less than the measurement value of the message corresponding to the destination IP address; and transmit the message corresponding to the destination IP address to the virtual output queue corresponding to the destination IP address of the message.

[0044] In one possible implementation, the processing module is specifically configured to assign a virtual output queue that is not associated with an IP address to the message as the virtual output queue corresponding to the destination IP address, and store the correspondence between the destination IP address and the virtual output queue in a first correspondence; wherein the first correspondence includes a correspondence between at least one IP address and each virtual output queue corresponding to the IP address, and the first correspondence is used to indicate that the virtual output queue corresponding to the IP address has cached a message whose destination IP address is the IP address.

[0045] In one possible implementation, the first network device includes a first virtual output queue, which is used to temporarily store messages whose destination IP address is the first IP address; the first virtual output queue temporarily stores a first message whose destination IP address is the first IP address.

[0046] The processing module is further configured to obtain the first message in the first virtual output queue; when the remaining amount of the first sending window corresponding to the first IP address is greater than or equal to the metered value of the first message, transfer the first message in the first virtual queue to the egress port queue, and send the first message through the egress port queue. Furthermore, the processing module is further configured to calculate the difference between the remaining amount of the first sending window and the metered value of the first message to obtain an updated remaining amount of the first sending window.

[0047] In one possible implementation, the processing module is further used to obtain a queue length of the first virtual output queue, where the queue length is used to indicate the sum of the measurement values ​​of the messages temporarily stored in the first virtual output queue; when the queue length of the first virtual output queue is zero, the correspondence between the first IP address and the first virtual output queue is deleted.

[0048] In a possible implementation, the first network device stores a second correspondence relationship, where the second correspondence relationship includes a correspondence relationship between at least one IP address and a remaining amount of a sending window corresponding to each IP address.

[0049] In one possible embodiment, the remaining amount of the sending window corresponding to each destination IP address is determined based on the measurement value of the messages sent to the destination IP address by the second network device within a preset reporting period, and the second network device is a downstream network device of the first network device. The preset reporting period includes the duration period of the preset timer or the counting period of the preset counter.

[0050] In one possible implementation, the transceiver module is also used to receive a window update message from a second network device, where the window update message carries a first IP address, and the window update message is used to instruct the first network device to update the first sending window remaining amount corresponding to the first IP address; the first sending window remaining amount of the first network device is updated according to the window update message to obtain a second sending window remaining amount.

[0051] In one possible implementation, the window update message includes a first measurement value, where the first measurement value is a measurement value of messages sent by the second network device to the first IP address within a preset reporting period. The processing module is specifically configured to determine the sum of the first sending window remaining amount and the first measurement value as the second sending window remaining amount.

[0052] In a possible implementation, the first network device stores a preset measurement value. The processing module is specifically configured to determine the sum of the first sending window remaining amount and the preset measurement value as the second sending window remaining amount.

[0053] It should be noted that there are many other implementation methods of the embodiments of the present application. For details, please refer to the specific implementation methods and beneficial effects of the first aspect, which will not be repeated here.

[0054] In a third aspect, the present application provides a network device comprising a processor and a memory; wherein the memory stores a computer program; the processor calls the computer program to enable the network device to execute the method in the first aspect or any one of the embodiments of the first aspect.

[0055] In a fourth aspect, embodiments of the present application provide a network device, which may be a switch or router, or a chip within a switch or router. The network device may include a processing module and a transceiver module. When the network device is a switch or router, the processing module may be a processor, and the transceiver module may be a transceiver. The server or computer may further include a storage module, which may be a memory. The storage module is configured to store instructions, and the processing module executes the instructions stored in the storage module to cause the server or computer to perform the method according to the first aspect or any of the embodiments of the first aspect. When the network device is a chip within a switch or router, the processing module may be a processor, and the transceiver module may be an input / output interface, pin, or circuit, etc. The processing module executes the instructions stored in the storage module to cause the server or computer to perform the method according to the first aspect or any of the embodiments of the first aspect. The storage module may be a storage module within the chip (e.g., a register, cache, etc.), or a storage module within the server or computer located external to the chip (e.g., a read-only memory, random access memory, etc.).

[0056] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect and any one of the various embodiments of the various aspects.

[0057] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium comprising instructions, which, when executed on a computer, enable the computer to execute the method described in the first aspect and any one of the various embodiments of the various aspects.

[0058] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0059] In the present application, the first network device includes a sending window remainder based on the granularity of the destination IP address, and the first network device can use the sending window remainder corresponding to each destination IP address to determine the transmission status of the message corresponding to the destination IP address according to different destination IP addresses. In other words, the first network device determines that the judgment basis for the messages corresponding to different destination IP addresses is different, and the first network device determines that the transmission status of the message corresponding to a certain destination IP address will not affect the first network device's determination of the transmission status of the message corresponding to another destination IP address. Therefore, when congestion occurs in the message transmission of one of the destination IP addresses, it will not affect the first network device's judgment on whether the message of another destination IP address is sent. Therefore, the occurrence of head-of-line blocking linearity can be avoided, thereby alleviating the congestion phenomenon during message transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present application.

[0061] Figure 1 A system architecture diagram applicable to the message processing method proposed in this application;

[0062] Figure 2 A flow chart of the message processing method proposed in this application;

[0063] Figure 3 Another flow chart of the message processing method proposed in this application;

[0064] Figure 4 This is an example diagram of the window update message proposed in this application;

[0065] Figure 5 This is an example diagram of the message processing method in this application;

[0066] Figure 6 This is a schematic diagram of an embodiment of a network device in this application;

[0067] Figure 7 This is a schematic diagram of another embodiment of the network device in this application. DETAILED DESCRIPTION

[0068] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0069] The terms "first," "second," "third," "fourth," and the like (if any) in the specification and claims of this application and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0070] The following is an introduction to the system architecture and application scenarios involved in the message processing method proposed in this application:

[0071] like Figure 1 As shown, it is a system architecture diagram applicable to the message processing method proposed in this application. The system includes a sending end (for example, sending end 1, sending end 2, sending end 3 and sending end 4), a network device (for example, network device 1 and network device 2) and a receiving end (for example, receiving end 1 and receiving end 2). Among them, the sending end (also known as the source network device) can be a host network card that generates a message, which is used to generate a message and send the message to the network device; the network device can be an intermediate network element such as a router or a switch that has the ability to forward and process messages, which is used to look up and forward the messages received from each sending end and / or receiving end; the receiving end (also known as the destination network device) can be a host network card that processes the message, which is used to process the received message.

[0072] In a real network environment, the processing capacity of the receiving end is limited. When the receiving end's processing load is fully loaded, it can send a pause frame to the sending end, causing the sending end and other network devices along the way to pause sending messages with a specific destination IP address. For example, if the processing load of receiving end 1 in this system is fully loaded, since its IP address is IP address 1, receiving end 1 can send a pause frame to the sending end, indicating that the sending of messages with IP address 1 should be paused. In this case, the pause frame will pass through network device 2 and network device 1 in sequence before reaching the sending end. Subsequently, network devices 1 and 2 will pause sending messages with IP address 1. However, the processing load of receiving end 2 is not fully loaded. When network devices 1 and 2 pause sending messages with IP address 1, they may also block messages with IP address 2 that are in the same queue as the message with IP address 1. For example, if network device 1 suspends sending packets 1, 2, and 3 with destination IP address 1, then packets 4 and 5 with destination IP address 2 in the same queue as packet 1 are also suspended. This means that head-of-line blocking occurs in the network.

[0073] In this regard, the present application proposes a message processing method that can be applied to scenarios where head-of-line blocking may occur (for example, scenarios where multiple senders send messages to the same receiver), which can solve the head-of-line blocking problem and alleviate congestion during message transmission.

[0074] The following will be combined Figure 2 The main process of the message processing method proposed in this application is introduced. The message processing method is mainly applied to network devices such as switches and routers that have the ability to forward and process messages. The following is an introduction using the first network device as an example:

[0075] Step 201: A first network device receives multiple messages, where the destination IP addresses of the multiple messages are not completely the same.

[0076] In this embodiment, when the source network device (for example, Figure 1 After the sending end 1) generates a message and sends the message, the first network device (for example, Figure 1 The network device 1 or network device 2 in the example may receive a message from the source network device at a certain moment. When the previous hop of the first network device is the source network device, the first network device may directly receive the message from the source network device. For example, the first network device is Figure 1 The network device 1 in the source network device is Figure 1 When the previous hop of the first network device is not the source network device, the message sent by the source network device is sent to the first network device through one or more intermediate network elements. For example, the first network device is Figure 1 The network device 2 in the source network device is Figure 1 In this embodiment, the location of the first network device in the network is not limited.

[0077] It should be understood that the multiple messages received by the first network device may come from the same source network device or from different source network devices. In addition, the destination IP addresses of the multiple messages received by the first network device are not exactly the same. Exemplarily, when the aforementioned multiple messages come from the same source network device, the aforementioned multiple messages may need to be sent to different destination network devices. Therefore, the destination IP addresses of the aforementioned multiple messages are not exactly the same. When the aforementioned multiple messages come from different source network devices, the aforementioned multiple messages may also need to be sent to different destination network devices. Therefore, the destination IP addresses of the aforementioned multiple messages are not exactly the same. Specifically, this application does not limit the source of the multiple messages received by the first network device.

[0078] In step 202, the first network device determines the transmission status of the message corresponding to each destination IP address according to the remaining amount of the sending window corresponding to the destination IP address.

[0079] The send window is a logical concept used for flow control in the Transmission Control Protocol (TCP). The send window corresponds to a continuous range of bytes. It can be understood that the send window indicates the range of byte sequences that a network device is currently allowed to send. The send window remaining is a value stored in the first network device that measures the send window and indicates the number of packets currently allowed to be sent.

[0080] The message measurement value is a numerical value used to measure the message. The message measurement value can be the number of bytes occupied by the message, the number of messages, or the number of transmission units of a specific size (for example, the maximum transmission unit (MTU)). Exemplarily, when the message measurement value is the number of bytes occupied by the message, the send window remaining amount is used to indicate how many bytes of messages are currently allowed to be sent to the destination IP address. Exemplarily, when the message measurement value is the number of messages, the send window remaining amount is used to indicate how many messages are currently allowed to be sent to the destination IP address. Exemplarily, when the message measurement value is the MTU, the send window remaining amount is used to indicate how many MTUs are currently allowed to be sent to the destination IP address. This application does not limit the specific implementation method of the message measurement value. For ease of introduction, the message measurement value as the number of message bytes will be used as an example in the following description.

[0081] In the present application, the sending window remaining amount is divided based on the granularity of the destination IP address, that is, different destination IP addresses correspond to different sending window remaining amounts, and the sending window remaining amount corresponding to each destination IP address is used to indicate the metering value of the message currently allowed to be sent to the destination IP address. For example, among the multiple messages received by the first network device, there are three types of messages, namely, a message with a destination IP address of IP address 1, a message with a destination IP address of IP address 2, and a message with a destination IP address of IP address 3. At this time, the first network device will maintain three sending windows, and these three sending windows correspond to IP address 1, IP address 2, and IP address 3, respectively. If sending window 1 corresponds to IP address 1, the sending window remaining amount of sending window 1 is used to indicate the metering value of the message with a destination IP address of IP address 1 allowed to be sent. Similarly, if sending window 2 corresponds to IP address 2, the sending window remaining amount of sending window 2 is used to indicate the metering value of the message with a destination IP address of IP address 2 allowed to be sent. The details will not be listed here one by one.

[0082] In addition, the remaining amount of the sending window corresponding to each destination IP address is determined based on the measurement value of the message sent by the second network device to the destination IP address within the preset reporting period. The second network device is a downstream network device of the first network device. For example, the first network device is Figure 1 If the network device is 1, then the second network device is Figure 1 The preset reporting period is the period during which the second network device sends a window update message to the first network device to update the remaining amount of the send window. The preset reporting period includes the duration of a preset timer or the counting period of a preset counter. For details, please refer to the relevant descriptions in steps 314 and 315 below, which are not repeated here.

[0083] In this embodiment, since the metering value of the messages sent by the second network device to the destination IP address within the preset reporting period can reflect the congestion level or smoothness level of the second network device sending messages to the destination IP address, the remaining amount of the sending window corresponding to each destination IP address in the first network device can also indirectly reflect the congestion level or smoothness level of the downstream network device sending messages to the destination IP address. Therefore, when the first network device determines the transmission status of each message based on the remaining amount of the sending window corresponding to each destination IP address in the first network device, it can take into account the situation of the downstream network device transmitting the message. Therefore, it is helpful to avoid the accumulation of messages in the case of congestion in the downstream message transmission, and further helps to avoid the head-of-line blocking phenomenon.

[0084] In this embodiment, the transmission status of the message corresponding to the destination IP address includes: transmitting the message to a virtual output queue (VOQ) corresponding to the destination IP address, the virtual output queue being used to temporarily store messages; or transmitting the message corresponding to the destination IP address to an output port queue, the output port queue being used to send messages. Transmitting the message corresponding to the destination IP address to the output port queue can be understood as the first network device transmitting the received message to the output port queue; it can also be understood as the first network device transmitting the message in the virtual output queue to the output port queue.

[0085] For easier understanding, the following stages are introduced:

[0086] In this embodiment, when the first network device receives a message, the first network device can determine the transmission status of the message based on the relationship between the remaining amount of the sending window corresponding to the destination IP address of the received message and the measurement value of the message, that is, determine to transmit the message to the virtual output queue or the egress port queue.

[0087] In one possible implementation, if the remaining amount of the sending window corresponding to the destination IP address is greater than or equal to the metering value of the message corresponding to the destination IP address, then the first network device transmits the message corresponding to the destination IP address to the egress port queue and sends the message corresponding to the destination IP address through the egress port queue.

[0088] In this embodiment, since the remaining amount of the sending window corresponding to a certain destination IP address can reflect the degree of congestion or smoothness of the downstream network device when transmitting the message with the aforementioned destination IP address, when the remaining amount of the sending window corresponding to the destination IP address is greater than or equal to the metering value of the message corresponding to the destination IP address, it indicates that the downstream network device is relatively smooth when transmitting the message with the aforementioned destination IP address. Therefore, the first network device can transmit the message with the aforementioned destination IP address to the egress port queue, and send it to the downstream network device through the egress port queue.

[0089] In another possible implementation, if the remaining amount of the sending window corresponding to the destination IP address is less than the metering value of the message corresponding to the destination IP address, the first network device determines the virtual output queue corresponding to the destination IP address; and transmits the message corresponding to the destination IP address to the virtual output queue corresponding to the destination IP address of the message.

[0090] In this embodiment, the remaining amount of the sending window corresponding to a destination IP address can reflect the degree of congestion or smoothness of the downstream network device when transmitting the message with the aforementioned destination IP address. When the remaining amount of the sending window corresponding to the destination IP address is less than the meter value of the message corresponding to the destination IP address, it indicates that the downstream network device may have encountered congestion when transmitting the message with the aforementioned destination IP address. Therefore, the first network device will temporarily not send the message with the destination IP address, but will temporarily store the message with the destination IP address in the virtual output queue. This avoids causing further congestion of downstream traffic.

[0091] Thus, the message processing method proposed in this application can determine whether to send a message corresponding to a destination IP address based on the remaining amount of the send window corresponding to the destination IP address. Since different destination IP addresses correspond to different remaining amounts of the send window, the transmission states of different destination IP addresses do not affect each other. The decision result of whether the first network device sends a message for destination IP address 1 does not affect the decision of the first network device whether to send a message for destination IP address 2. Therefore, the message processing method proposed in this application is conducive to avoiding head-of-line blocking and helping to alleviate network congestion.

[0092] Optionally, the first network device includes multiple virtual output queues, with different destination IP addresses corresponding to different virtual output queues. The present application uses a virtual output queue based on the granularity of the destination IP address to isolate the messages that are temporarily not sent by the first network device according to the destination IP address, which is beneficial for isolating the messages that are temporarily not sent from each other in the first network device, thereby facilitating the prevention of messages with a certain destination IP address from blocking messages corresponding to another destination IP address.

[0093] Optionally, before the first network device determines the transmission status of the message corresponding to the destination IP address based on the remaining amount of the sending window, the first network device may also first determine whether a virtual output queue has been allocated for the destination IP address in the first network device. Specifically, the first network device queries the virtual output queue corresponding to the destination IP address of each message. When the first network device does not have a virtual output queue corresponding to the destination IP address, the first network device obtains the remaining amount of the sending window corresponding to the destination IP address. When the first network device has a virtual output queue corresponding to the destination IP address, the first network device transmits the message corresponding to the destination IP address to the virtual output queue corresponding to the destination IP address.

[0094] In this embodiment, when the first network device dequeues a message from the virtual output queue, the first network device may also determine the transmission status of the message based on the relationship between the remaining amount of the sending window corresponding to the destination IP address of the message and the meter value of the message, that is, determine whether to retain the message in the virtual output queue or transmit it to the egress port queue.

[0095] Specifically, the first network device will poll multiple virtual output queues according to certain rules to obtain the message at the head of the queue in each virtual output queue and the remaining amount of the sending window corresponding to the destination IP address of the message. If the remaining amount of the sending window corresponding to the destination IP address is greater than or equal to the metering value of the message corresponding to the destination IP address, the first network device will transfer the message corresponding to the destination IP address from the virtual output queue to the egress queue and send the message corresponding to the destination IP address through the egress queue. If the remaining amount of the sending window corresponding to the destination IP address is less than the metering value of the message corresponding to the destination IP address, the first network device will retain the message in the virtual output queue, continue to obtain the message of the next virtual output queue and the remaining amount of the sending window corresponding to the destination IP address of the message, and further determine the transmission status of the next message.

[0096] In this embodiment, it is proposed to add a judgment logic of a sending window to the first network device, and set a sending window remaining amount with the destination IP address as the granularity, so that the first network device such as a switch and a router as an intermediate network element can determine the transmission status of the message with the destination IP address based on the sending window remaining amount corresponding to each destination IP address. Therefore, the first network device judges the message with the corresponding destination IP address based on the sending window remaining amount corresponding to each destination IP address, and can decide whether to send the message corresponding to the destination IP address based on the destination IP address. Since the first network device will not affect the transmission status of the message with one destination IP address due to the transmission status of the message with another destination IP address, it can avoid head-of-line blocking, which is conducive to alleviating network congestion.

[0097] The following will be combined Figure 3 The process of the message processing method proposed in this application is further introduced. Figure 3 FIG. 1 is another flow chart of the message processing method proposed in this application. In this embodiment, the first network device receiving the first message is used as an example for description:

[0098] Step 301: A first network device receives a first message, where the destination IP address of the first message is a first IP address.

[0099] The first network device may be a programmable switch, a programmable router, or other network device with programmable capabilities and the ability to forward and process messages.

[0100] The first message can be a message received by the first network device from a source network device, or a message received by the first network device from an upstream switch or upstream router, the details of which are not limited herein. After the first network device receives the first message, it can parse the message header of the first message to obtain the destination IP address of the first message. This embodiment and subsequent embodiments are described using the example where the destination IP address of the first message is the first IP address.

[0101] Step 302: The first network device determines, based on the first IP address, whether a virtual output queue has been allocated to the first IP address.

[0102] In this embodiment, the first network device stores a first correspondence, wherein the first correspondence includes a correspondence between at least one IP address and a virtual output queue corresponding to each IP address, and the first correspondence indicates that the virtual output queue corresponding to the IP address has cached a message with the destination IP address being the IP address.

[0103] For example, the first correspondence may be as shown in Table 1-1:

[0104] Table 1-1

[0105] IP address Virtual Output Queue IP address 1 Virtual output queue 1 IP address 2 Virtual output queue 2 IP address 3 Virtual output queue 3

[0106] In the example shown in Table 1-1, the first correspondence stores IP address 1 and virtual output queue 1 corresponding to IP address 1, indicating that a packet destined for IP address 1 is temporarily stored in virtual output queue 1. Similarly, the first correspondence stores IP address 2 and virtual output queue 2 corresponding to IP address 2, indicating that a packet destined for IP address 2 is temporarily stored in virtual output queue 2.

[0107] Exemplarily, the first correspondence can be implemented in the form of an array. Each element in the array is an integer mapped to an IP address, and the subscript of each element (i.e., the order of each element in the array) represents the number of the virtual output queue. It should be understood that the example listed in Table 1-1 above is only one of many examples in this embodiment. In actual applications, other methods can also be used to represent the first correspondence. This embodiment does not limit the specific implementation of the first correspondence.

[0108] It should be understood that the first correspondence is stored by the first network device after the first network device assigns a virtual output queue to a message with a certain destination IP address. For example, if the first network device determines that the message with the destination IP address being IP address 1 is temporarily not allowed to be sent, but there is no virtual output queue corresponding to IP address 1 in the first network device, then the first network device will assign a virtual output queue with no associated IP address to IP address 1 as virtual output queue 1 corresponding to IP address 1, and store the correspondence between IP address 1 and virtual output queue 1 in the aforementioned first correspondence. Similarly, the first network device can also store other IP addresses and the virtual output queues corresponding to the IP addresses. Therefore, when the first network device receives a message with the destination IP address being IP address 1 again, the first network device can determine whether the message with the destination IP address being IP address 1 enters the virtual output queue or the output port queue based on the first correspondence and IP address 1.

[0109] In this step, the first network device determines whether there is a virtual output queue corresponding to the first IP address based on the first IP address and the aforementioned first corresponding relationship.

[0110] Specifically, the first network device searches for the first correspondence using the first IP address. When a virtual output queue corresponding to the first IP address exists in the first correspondence, the first network device determines that a virtual output queue has been assigned to the first IP address (i.e., the virtual output queue corresponding to the first IP address, hereinafter referred to as the first virtual output queue). In this case, the first network device executes step 307. When no virtual output queue corresponding to the first IP address exists in the first correspondence, the first network device determines that no virtual output queue is currently assigned to the first IP address. In this case, the first network device executes step 303.

[0111] Step 303: The first network device obtains the remaining amount of the first sending window corresponding to the first IP address.

[0112] In this embodiment, after receiving the first message, the first network device first determines whether a virtual output queue has been assigned to the first IP address based on the destination IP address of the first message (i.e., the first IP address). If the first network device determines that a virtual output queue has not been assigned to the first IP address, the first network device obtains the remaining amount of the first sending window corresponding to the first IP address and further determines whether to transmit the first message to the virtual output queue or to the egress port queue based on the remaining amount of the first sending window corresponding to the first IP address.

[0113] The remaining amount of the first sending window corresponding to the first IP address is used to indicate a measurement value of messages currently allowed to be sent to the first IP address. The measurement value may be the number of bytes occupied by the message, the number of messages, or the number of MTUs. For details, please refer to the relevant description in step 202 above and will not be repeated here.

[0114] In this embodiment, the first network device stores a second correspondence relationship, which includes a correspondence relationship between at least one IP address and a remaining amount of a sending window corresponding to each IP address. The first network device can obtain the remaining amount of a first sending window corresponding to the first IP address based on the second correspondence relationship and the first IP address.

[0115] For example, the second correspondence may be as shown in Table 2-1:

[0116] Table 2-1

[0117] IP address Send window remaining amount IP address 1 Send window remaining amount 1 IP address 2 Send window remaining amount 2 IP address 3 Send window remaining amount 3

[0118] As shown in Table 2-1, IP address 1 corresponds to a send window remaining amount of 1, indicating that the send window remaining amount of 1 is used to indicate whether to allow the sending of a message destined for IP address 1. Similarly, IP address 2 corresponds to a send window remaining amount of 2, indicating that the send window remaining amount of 2 is used to indicate whether to allow the sending of a message destined for IP address 2. If the destination IP address of a message received by the first network device is IP address 1, the first network device searches the aforementioned second correspondence and determines that the send window remaining amount of 1 is the send window remaining amount corresponding to IP address 1.

[0119] Exemplarily, in actual applications, the second correspondence can be implemented in the form of an array or a map, and the specific details are not limited here. If the second correspondence is implemented in the form of a map, each variable in the map represents the remaining amount of the sending window, and the subscript of each variable represents the IP address corresponding to the remaining amount of the sending window. If the second correspondence is implemented in the form of an array, each element in the array represents the remaining amount of the sending window, and the subscript of each element (i.e., the order of each element in the array) corresponds to an IP address. At this time, the first network device also stores the correspondence between the subscript of the array and the aforementioned IP address.

[0120] It should be understood that the example listed in Table 2-1 above is only one of many examples in this embodiment. In practical applications, other methods can also be used to express the second corresponding relationship. Specifically, this embodiment does not limit the specific implementation method of the second corresponding relationship.

[0121] Step 304: The first network device determines the relationship between the remaining amount of the first sending window and the measurement value of the first message.

[0122] In this embodiment, after obtaining the first sending window remaining amount corresponding to the first IP address, the first network device will determine whether to temporarily store the first message through a virtual output queue or send the first message through an output port queue based on the size relationship between the measurement value of the first message and the first sending window remaining amount.

[0123] Specifically, when the remaining amount of the first sending window is less than the measurement value of the first message, the first network device will execute step 307 in sequence; when the remaining amount of the first sending window is greater than or equal to the measurement value of the first message, the first network device will execute steps 305 and 306 in sequence.

[0124] In step 305 , the first network device transmits the first message to an egress port queue, and sends a message corresponding to the destination IP address through the egress port queue.

[0125] In this embodiment, if the remaining amount in the first sending window is greater than or equal to the meter value of the first message, it indicates that the downstream network device with the destination IP address being the first IP address is unobstructed in the queue for transmitting the first message to the downstream network device of the first network device, and the first network device sending the first message to the downstream network device of the first network device will not cause congestion in the downstream network device. Therefore, the first network device transmits the first message to the egress port queue and sends the message corresponding to the destination IP address through the egress port queue.

[0126] Step 306: The first network device calculates the difference between the remaining amount of the first sending window and the measurement value of the first message to obtain an updated remaining amount of the first sending window.

[0127] It should be understood that each time the first network device transmits a message whose destination IP address is the first IP address to the egress port queue, the first network device updates the first sending window remainder based on the metering value of the first message. Specifically, the first network device calculates the difference between the first sending window remainder and the metering value of the first message, and uses the difference between the first sending window remainder and the metering value of the first message as the updated first sending window remainder. When the first network device receives a message whose destination IP address is the first IP address again, the first network device uses the updated first sending window remainder to decide whether to transmit the received message whose destination IP address is the first IP address to the egress port queue.

[0128] Step 307: The first network device transmits the first message to the aforementioned virtual output queue corresponding to the first IP address.

[0129] In this embodiment, there are two situations that can trigger the first network device to transmit the first message to the virtual output queue corresponding to the first IP address.

[0130] In one possible implementation, step 307 is triggered by the determination result of step 302. Specifically, when the first network device determines in step 302 that a virtual output queue corresponding to the first IP address exists based on the first IP address (i.e., the first network device has allocated a virtual output queue for the first IP address), the first network device triggers step 307.

[0131] At this time, since the first correspondence in the first network device includes the first IP address and the virtual output queue corresponding to the first IP address, the first network device does not need to allocate other virtual output queues for the first message. The first network device directly transmits the first message to the virtual output queue corresponding to the first IP address.

[0132] In another possible implementation, step 307 is triggered by the determination result of step 304. Specifically, when the first network device determines in step 304 that the remaining amount of the first sending window is less than the measurement value of the first message, the first network device triggers step 307.

[0133] At this time, since step 304 is executed after step 303, and step 303 is triggered by the first network device determining in step 302 that no virtual output queue is assigned to the first IP address, the first network device needs to assign a virtual output queue for temporarily storing the first message to the first message. Specifically, the first network device can assign a virtual output queue that is not associated with an IP address to the first message as the virtual output queue corresponding to the first IP address (i.e., the first virtual output queue), and store the correspondence between the first IP address and the first virtual output queue in the aforementioned first correspondence.

[0134] In this embodiment, steps 301 to 307 are the enqueueing phase. Except for the aforementioned first message, the first network device processes each message received according to the methods described in steps 301 to 307. If multiple messages received by the first network device are processed in steps 301 to 307, some of them may have been sent from the egress port queue, while others may still be temporarily stored in the virtual output queue. Therefore, the first network device may need to control the dequeueing of messages in the virtual output queue using the methods described in steps 308 to 312, thereby controlling the transmission of messages in the virtual output queue to the egress port queue at the appropriate time and sending them through the egress port queue.

[0135] Step 308: The first network device obtains the first message in the first virtual output queue.

[0136] In this embodiment, the first network device has multiple virtual output queues, and different virtual output queues correspond to different destination IP addresses. The first network device will poll the multiple virtual output queues in the first network device according to certain rules. When the first network device polls the first virtual output queue, the first network device can obtain a message with the destination IP address being the first IP address. Of course, the message obtained by the first network device from the first virtual output queue can be the aforementioned first message, or it can be another message received by the first network device with the destination IP address being the first IP address. The specific details are not limited here. The following text will use the first network device obtaining the first message as an example for description.

[0137] It should be understood that when polling the virtual output queue, the first network device may adopt the RR (Round-Robin) strategy or other polling strategies, which are not specifically limited here.

[0138] Step 309: The first network device determines the relationship between the remaining amount of the first sending window and the measurement value of the first message.

[0139] In this embodiment, after the first network device obtains the first message from the first virtual output queue, the first network device will determine whether to continue to temporarily store the first message in the first virtual output queue or send the first message through the output port queue based on the size relationship between the measurement value of the first message and the remaining amount of the first sending window.

[0140] Specifically, when the remaining amount of the first sending window corresponding to the first IP address is greater than or equal to the metering value of the first message, the first network device executes step 310; when the remaining amount of the first sending window corresponding to the first IP address is less than the metering value of the first message, the first network device keeps the first message in the first virtual output queue, that is, keeps the first message temporarily in the first virtual output queue.

[0141] In step 310 , the first network device transfers the first message in the first virtual queue to an egress port queue, and sends the first message through the egress port queue.

[0142] In this embodiment, if the remaining amount in the first sending window is greater than or equal to the meter value of the first message, it indicates that the downstream network device with the destination IP address being the first IP address is unobstructed in the queue for transmitting the first message to the downstream network device of the first network device, and the first network device sending the first message to the downstream network device of the first network device will not cause congestion in the downstream network device. Therefore, the first network device transmits the first message to the egress port queue and sends the message corresponding to the destination IP address through the egress port queue.

[0143] Step 311: The first network device calculates the difference between the remaining amount of the first sending window and the measurement value of the first message to obtain an updated remaining amount of the first sending window.

[0144] It should be understood that each time the first network device transmits a message in the virtual output queue to the egress port queue, the first network device updates the first sending window remainder based on the meter value of the message (i.e., the meter value of the first message). Specifically, the first network device calculates the difference between the first sending window remainder and the meter value of the first message, and uses the difference between the first sending window remainder and the meter value of the first message as the updated first sending window remainder. When the first network device receives a message with the first IP address as the destination IP address again, the first network device uses the updated first sending window remainder to decide whether to transmit the received message with the first IP address as the destination IP address to the egress port queue.

[0145] In this embodiment, after the first network device executes step 310 , in addition to executing step 311 , the first network device further executes step 312 and step 313 .

[0146] Step 312: The first network device determines whether the queue length of the first virtual output queue is zero.

[0147] The queue length indicates the total number of messages temporarily stored in the virtual output queue, and can reflect whether there are any messages temporarily stored in the virtual output queue. Generally, when the queue length of the virtual output queue is zero, it indicates that there are no messages temporarily stored in the virtual output queue; when the queue length of the virtual output queue is greater than zero, it indicates that there are messages temporarily stored in the virtual output queue.

[0148] In this embodiment, each time the first network device sends a message from a virtual output queue through an egress port queue, the first network device needs to obtain the queue length of the virtual output queue and determine whether the queue length of the virtual output queue is zero to determine whether there are still messages temporarily stored in the virtual output queue. Therefore, after step 310, the first network device will obtain the queue length of the first virtual output queue and determine whether the queue length of the first virtual output queue is zero.

[0149] In this embodiment, when the queue length of the first virtual output queue is zero, the first network device executes step 313 .

[0150] Step 313: The first network device deletes the correspondence between the first IP address and the first virtual output queue.

[0151] Specifically, the first network device deletes the correspondence between the first IP address and the first virtual output queue from the first correspondence.

[0152] Step 314: The second network device sends a window update message to the first network device; correspondingly, the first network device receives the window update message from the second network device.

[0153] The window update message carries the destination IP address corresponding to the sending window remaining amount that needs to be updated, so as to indicate which sending window's sending window remaining amount the window update message is used to update.

[0154] In this embodiment, the second network device updates the remaining amount of the sending window corresponding to the first IP address through a window update message as an example. In this case, the window update message carries the first IP address, and the window update message is used to instruct the first network device to update the remaining amount of the first sending window corresponding to the first IP address.

[0155] It should be understood that if the aforementioned window update message is generated by a downstream switch of the first network device, then the structure of the window update message is the structure proposed in this application. If the aforementioned window update message is generated by the receiving end, then the window update message can be an acknowledgment character (ACK) message in traditional technology.

[0156] In this embodiment, the window update message includes a type field, and the type field is used to indicate that the message is a window update message, that is, to indicate that the message is used to update the remaining amount of the sending window.

[0157] Optionally, the window update message further includes a credit field, which is used to store the first measurement value.

[0158] Optionally, the window update message further includes a length field, where the length field is used to identify the bytes occupied by the message header of the window update message (usually 20 bytes).

[0159] Optionally, the window update message also includes a sequence number field, which is used to indicate the sequence number of the window update message reported by the second network device. If the sequence numbers in the sequence number fields of the multiple window update messages received by the first network device are continuous, it means that the window update message sent by the second network device to the first network device is not missing. If the sequence numbers in the sequence number fields of the multiple window update messages received by the first network device are discontinuous, it means that the window update message sent by the second network device to the first network device is missing. At this time, the first network device can send an instruction to the second network device to instruct the second network device to resend the missing window update message.

[0160] For example, the structure of the window update message can be as follows: Figure 4 As shown. In addition to the Ethernet header field, the Internet Protocol (IP) header field, the User Datagram Protocol (UDP) field, and the payload, the window update message is provided with a new field (i.e., the floodgate field). Optionally, the new field occupies 20 bytes. The floodgate field includes a type field (occupying 16 bits (0-15) in total), a length field (occupying 16 bits (16) in total), a sequence number field, and a credit field.

[0161] The credit field includes a first measurement value, which is a measurement value of messages sent by the second network device to the first IP address within a preset reporting period. The preset reporting period includes the duration of a preset timer or the counting period of a preset counter. In other words, the window update message is periodically generated by the second network device based on a preset trigger event. The preset trigger event can be a timer-based trigger event or a counter-based trigger event.

[0162] Exemplarily, if the preset trigger event is a timer-based trigger event, the preset reporting period is the duration of the preset timer. In this case, the second network device is provided with a timer, and whenever the timer times out, the second network device generates a window update message, and determines the measurement value of the message sent to the destination IP address during the duration of the timer (i.e., during the operation of the timer) as the first measurement value.

[0163] Exemplarily, if the preset trigger event is a counter-based trigger event, the preset reporting period is the counting period of the preset counter. In this case, the second network device is provided with multiple counters, each corresponding to a destination IP address. Each time the second network device sends a message with a destination IP address, the counter corresponding to the destination IP address counts once until a preset value is reached. When the preset counter reaches a preset value, the second network device generates a send window update message and carries the preset value as the first measurement value in the send window update message.

[0164] It should be understood that in actual applications, the window update message may also include other fields, which are not specifically limited here.

[0165] It should be understood that if the first network device is Figure 1 If the downstream switch is a first network device, the first network device also needs to generate the aforementioned window update message through the internal packet generator of the first network device, so that the first network device can send the window update message to the upstream switch of the first network device.

[0166] Step 315: The first network device updates the first sending window remaining amount of the first network device according to the window update message to obtain the second sending window remaining amount.

[0167] The second sending window remaining amount refers to the sending window remaining amount corresponding to the first IP address obtained by updating based on the window update message. Generally, the second sending window remaining amount is greater than the first sending window remaining amount, that is, the sending window remaining amount after being updated based on the window update message is greater than the sending window remaining amount before being updated based on the window update message.

[0168] In this embodiment, after the first network device receives the aforementioned window update message, the first network device updates the first sending window remaining amount based on the window update message. Specifically, when the content carried in the window update message received by the first network device is different, the first network device updates the first sending window remaining amount in a different manner.

[0169] In one possible implementation, if the window update message received by the first network device includes a first measurement value, the first network device determines the second sending window remaining amount based on the first measurement value and the first sending window remaining amount. Specifically, the first network device calculates the sum of the first sending window remaining amount and the first measurement value, and determines the sum of the first sending window remaining amount and the first measurement value as the second sending window remaining amount.

[0170] In another possible implementation, if the window update message received by the first network device does not include the first meter value, the first network device determines the second sending window remaining amount based on the preset meter value and the first sending window remaining amount. Specifically, the first network device calculates the sum of the first sending window remaining amount and the preset meter value, and determines the sum of the first sending window remaining amount and the preset meter value as the second sending window remaining amount.

[0171] It should be understood that there is no time sequence limitation between step 314 and step 315 and the aforementioned steps 301 to 313. Step 314 can be executed before or after any one of steps 301 to 313, and step 315 can be executed after step 314.

[0172] For ease of understanding, the following Figure 5 The example shown introduces the message processing method proposed in this application. Figure 5In the example shown, the network includes four sending ends (i.e., sending end 1, sending end 2, sending end 3, and sending end 4), two network devices (i.e., a first network device and a second network device, wherein the first network device is an upstream switch and the second network device is a downstream switch) and two receiving ends (i.e., receiving end 1 (corresponding to IP address 1) and receiving end 2 (corresponding to IP address 2)). The aforementioned four sending ends will respectively send messages to the first network device, wherein a part of the sending ends (i.e., sending end 1, sending end 2, and sending end 3) send messages with a destination IP address of IP address 1 (i.e., the unshaded box in the figure), and the other part of the sending ends (i.e., sending end 4) sends messages with a destination IP address of IP address 2 (i.e., the unshaded box in the figure). Assume that the order of the messages received by the first network device is as follows: Figure 5As shown in sequence 501 on the left, the initial value of the send window remaining amount X corresponding to IP address 1 is 3 (taking the number of messages as an example), and the initial value of the send window remaining amount Y corresponding to IP address 2 is 2 (taking the number of messages as an example). At this time, for message 1, since the first network device has not yet allocated a virtual output queue for IP address 1, the first network device determines whether to enter message 1 into the virtual output queue based on the send window remaining amount X corresponding to IP address 1. Since the value of X is 3 (i.e., 3 messages are allowed to be sent), the first network device transmits message 1 to the output port queue, and the first network device reduces the value of X by one. Similarly, the first network device can transmit message 1, message 2, and message 3 in sequence 501 to the output port queue, at which time the value of X is reduced to 0. For message 4, since the first network device has not yet allocated a virtual output queue for IP address 2, the first network device determines whether to enter message 4 into the virtual output queue based on the send window remaining amount Y corresponding to IP address 2. Since the value of Y is 2 (i.e., 2 messages are allowed to be sent), the first network device transmits message 4 to the output port queue, and the first network device reduces the value of Y by one. Next, the first network device will decide whether message 6 needs to enter the virtual output queue. Since the first network device has not yet allocated a virtual output queue for IP address 1, the first network device determines whether to enter message 6 into the virtual output queue based on the remaining amount X of the sending window corresponding to IP address 1. Since the value of X is 0 (i.e., messages are not allowed to be sent), the first network device allocates a virtual output queue for message 6, and the virtual output queue is used to temporarily store messages whose destination IP address is IP address 1. Next, the first network device will decide whether message 5 needs to enter the virtual output queue. Since the first network device has not yet allocated a virtual output queue for IP address 2, the first network device determines whether to enter message 5 into the virtual output queue based on the remaining amount Y of the sending window corresponding to IP address 2. Since the value of Y is 1 (i.e., 1 message is allowed to be sent), the first network device transmits message 5 to the output port queue, and the first network device decrements the value of Y by one. At this time, the value of Y is reduced to 0. Next, the first network device will decide whether message 7 needs to enter the virtual output queue. Since the first network device has allocated a virtual output queue for IP address 1, the first network device transmits message 7 to the virtual output queue corresponding to IP address 1. Similarly, the first network device transmits message 8 to the virtual output queue corresponding to IP address 1. By analogy, if the first network device has not received the window update message sent by the second network device, the first network device will transmit messages 9, 10, and 11 to the virtual output queue corresponding to IP address 1, and transmit messages 12, 13, and 14 to the virtual output queue corresponding to IP address 2 in accordance with the above rules.

[0173] If, after processing message 11, the first network device receives a window update message from the second network device, and determines based on the window update message that the updated send window remaining amount X corresponding to IP address 1 is 3, and the updated send window remaining amount X corresponding to IP address 2 is 2, then messages 1, 2, 3, 4, and 5 in the egress queue may have already been sent or may be in the process of being sent. The first network device will determine whether to transfer the messages in the virtual output queue to the egress queue based on the send window remaining amount X corresponding to IP address 1 and the send window remaining amount Y corresponding to IP address 2. If the first network device polls the virtual output queue corresponding to IP address 1, it can obtain message 6. Since the value of X is 3, the first network device determines to transfer message 6 to the egress queue. Similarly, the first network device can transfer messages 7 and 8 in the virtual output queue corresponding to IP address 1 to the egress queue for preparation for transmission, and transfer messages 13 and 14 in the virtual output queue corresponding to IP address 2 to the egress queue for preparation for transmission. The remaining messages are still temporarily stored in the virtual output queue. When the first network device receives the window update message again, the first network device may again dequeue the messages in the virtual output queue based on the remaining amount of the sending window corresponding to each IP address, and the cycle continues.

[0174] In this example, the first network device can transmit the message to the downstream network device (for example, the second network device) at a certain time with reference to the remaining amount of the sending window, and can also control the sending of a message of a certain destination IP address to the destination IP address with reference to the remaining amount of the sending window. Since the message processing method proposed in this application is a hop-by-hop flow control method, it can quickly identify incast traffic (i.e., messages that are congested downstream), and control the sending of incast traffic by sending the remaining amount of the sending window, and isolate the incast traffic through the virtual output queue to improve the performance of non-incast traffic (i.e., messages that are not congested downstream). At the same time, the network throughput and the performance of incast traffic will not be affected.

[0175] In this embodiment, it is proposed to add a judgment logic of a sending window to the first network device, and set a sending window remaining amount with the destination IP address as the granularity, so that the first network device such as a switch and a router as an intermediate network element can determine the transmission status of the message with the destination IP address based on the sending window remaining amount corresponding to each destination IP address. Therefore, the first network device judges the message with the corresponding destination IP address based on the sending window remaining amount corresponding to each destination IP address, and can decide whether to send the message corresponding to the destination IP address based on the destination IP address. Since the first network device will not affect the transmission status of the message with one destination IP address due to the transmission status of the message with another destination IP address, it can avoid head-of-line blocking, which is conducive to alleviating network congestion.

[0176] In addition, if Figure 6 As shown, the present application also provides a network device 60, Figure 6 The first network device may be a programmable switch, a programmable router, or other network device with programmable capabilities and the ability to forward and process messages. Figure 2 or Figure 3 The first network device or the second network device in the corresponding method embodiment can be based on the Figure 6 The structure of the network device 60 is shown.

[0177] like Figure 6 As shown, the network device 60 may include a processor 610, a memory 620, and a transceiver 630. The processor 610 is coupled to the memory 620, and the processor 610 is coupled to the transceiver 630.

[0178] The aforementioned transceiver 630 may also be referred to as a transceiver unit, a transceiver, a transceiver device, etc. Optionally, the device used to implement the receiving function in the transceiver unit may be considered a receiving unit, and the device used to implement the transmitting function in the transceiver unit may be considered a transmitting unit. That is, the transceiver unit includes a receiving unit and a transmitting unit. The receiving unit may also be referred to as a receiver, an input port, a receiving circuit, etc., and the transmitting unit may be referred to as a transmitter, a transmitter, or a transmitting circuit, etc. In this application, the transceiver 630 may receive a message from a source network device, such as the first message described above. The transceiver 630 may also receive a message from a second network device, such as the window update message described above. Please refer to the relevant description in the aforementioned embodiments for details.

[0179] The processor 610 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or any combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 610 may be a single processor or may include multiple processors, and the specifics are not limited here.

[0180] In addition, the aforementioned memory 620 is mainly used to store software programs and data. The memory 620 can exist independently and be connected to the processor 610. Optionally, the memory 620 can be integrated with the processor 610, for example, integrated into one or more chips. Among them, the memory 620 can store program codes for executing the technical solutions of the embodiments of the present application, and the execution is controlled by the processor 610. The various types of computer program codes executed can also be regarded as drivers for the processor 610. The memory 620 may include volatile memory (volatile memory), such as random-access memory (RAM); the memory may also include non-volatile memory (non-volatile memory), such as read-only memory (ROM), flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory 620 may also include a combination of the above types of memory. The memory 620 may refer to one memory or may include multiple memories. Exemplarily, the memory 620 is used to store various correspondences, for example, the aforementioned first correspondence and the second correspondence). The first correspondence includes a correspondence between at least one IP address and a virtual output queue corresponding to each IP address, and the first correspondence is used to indicate that the virtual output queue corresponding to the IP address has cached a message with the destination IP address being the IP address. The second correspondence includes a correspondence between at least one IP address and a sending window remaining amount corresponding to each IP address. In addition, the memory 620 also stores a sending window remaining amount, and different destination IP addresses correspond to different sending window remaining amounts. The sending window remaining amount corresponding to each destination IP address is determined based on a measurement value of messages sent to the destination IP address by a second network device within a preset reporting period, and the second network device is a downstream network device of the first network device. The preset reporting period includes a duration period of a preset timer or a counting period of a preset counter.

[0181] In one implementation, the memory 620 stores computer-readable instructions, which include multiple software modules, such as a receiving module 621, a processing module 622, and a sending module 623. After executing each software module, the processor 610 may perform corresponding operations according to the instructions of each software module. In this embodiment, the operation performed by a software module actually refers to the operation performed by the processor 610 according to the instructions of the software module.

[0182] Specifically, when the network device 60 is used to perform the aforementioned Figure 2In the method of the embodiment, the main functions of the receiving module 621, the processing module 622 and the sending module 623 in the network device 60 are as follows:

[0183] Receiving module 621 is configured to receive multiple messages, each of which has different destination IP addresses. Processing module 622 is configured to determine the transmission status of the message corresponding to each destination IP address based on the remaining send window amount corresponding to the destination IP address. Different destination IP addresses correspond to different remaining send windows. The remaining send window amount corresponding to each destination IP address indicates a metered value of messages currently allowed to be sent to the destination IP address.

[0184] In the present embodiment, the memory 620 includes a sending window remainder based on the granularity of the destination IP address. The processing module 622 can use the sending window remainder corresponding to each destination IP address to determine the transmission status of the message corresponding to the destination IP address according to different destination IP addresses. In other words, the judgment basis for the processing module 622 to determine the messages corresponding to different destination IP addresses is different. The processing module 622 determining the transmission status of the message corresponding to a certain destination IP address will not affect the processing module 622 determining the transmission status of the message corresponding to another destination IP address. Therefore, when the message transmission of one destination IP address is congested, it will not affect the processing module 622's judgment on whether the message of the other destination IP address is sent. Therefore, it can avoid the occurrence of head-of-line blocking linearity, and thus can slow down the congestion phenomenon during message transmission.

[0185] Optionally, the transmission status of the message corresponding to the destination IP address includes: transmitting the message to a virtual output queue corresponding to the destination IP address, which is used to temporarily store the message; or transmitting the message corresponding to the destination IP address to an output port queue, which is used to send the message.

[0186] Optionally, the first network device includes a plurality of the virtual output queues, and different destination IP addresses correspond to different virtual output queues.

[0187] In one possible implementation, the processing module 622 is further used to query the virtual output queue corresponding to the destination IP address of each message; and when there is no virtual output queue corresponding to the destination IP address in the first network device, obtain the remaining amount of the sending window corresponding to the destination IP address.

[0188] In a possible implementation, the processing module 622 is further configured to transmit the message corresponding to the destination IP address to the virtual output queue corresponding to the destination IP address when a virtual output queue corresponding to the destination IP address exists in the first network device.

[0189] In one possible implementation, the processing module 622 is specifically configured to, when the remaining amount of the sending window corresponding to the destination IP address is greater than or equal to the metered value of the message corresponding to the destination IP address, transmit the message corresponding to the destination IP address to the egress port queue, and control the sending module 623 to send the message corresponding to the destination IP address through the egress port queue. Furthermore, the processing module 622 is further configured to calculate the difference between the remaining amount of the sending window corresponding to the destination IP address and the metered value of the message corresponding to the destination IP address, to obtain an updated remaining amount of the sending window corresponding to the destination IP address.

[0190] In one possible implementation, the processing module 622 is specifically used to determine the virtual output queue corresponding to the destination IP address when the remaining amount of the sending window corresponding to the destination IP address is less than the meter value of the message corresponding to the destination IP address; and transmit the message corresponding to the destination IP address to the virtual output queue corresponding to the destination IP address of the message.

[0191] In one possible implementation, the processing module 622 is specifically used to assign a virtual output queue without an associated IP address to the message as the virtual output queue corresponding to the destination IP address, and store the correspondence between the destination IP address and the virtual output queue in a first correspondence; wherein the first correspondence includes a correspondence between at least one IP address and each virtual output queue corresponding to the IP address, and the first correspondence is used to indicate that the virtual output queue corresponding to the IP address has cached a message with the destination IP address as the IP address.

[0192] In one possible embodiment, the first network device includes a first virtual output queue, which is used to temporarily store messages whose destination IP address is a first IP address; the first virtual output queue temporarily stores a first message whose destination IP address is the first IP address. The processing module 622 is also used to obtain the first message in the first virtual output queue; when the first sending window remaining amount corresponding to the first IP address is greater than or equal to the metering value of the first message, the first message in the first virtual queue is transmitted to the egress queue, and the processing module 622 controls the sending module 623 to send the first message through the egress queue. In addition, the processing module 622 is also used to calculate the difference between the first sending window remaining amount and the metering value of the first message to obtain an updated first sending window remaining amount.

[0193] In one possible implementation, the processing module 622 is further used to obtain the queue length of the first virtual output queue, where the queue length is used to indicate the sum of the measurement values ​​of the messages temporarily stored in the first virtual output queue; when the queue length of the first virtual output queue is zero, the correspondence between the first IP address and the first virtual output queue is deleted.

[0194] In one possible embodiment, the receiving module 621 is also used to receive a window update message from a second network device, the window update message carries a first IP address, and the window update message is used to instruct the first network device to update the first sending window remaining amount corresponding to the first IP address; the processing module 622 is also used to update the first sending window remaining amount of the first network device according to the window update message to obtain the second sending window remaining amount.

[0195] Optionally, if the window update message includes a first metering value, the processing module 622 determines the sum of the first sending window remaining amount and the first metering value as the second sending window remaining amount. The first metering value is a metering value of messages sent by the second network device to the first IP address within a preset reporting period.

[0196] Optionally, if the window update message does not include the first measurement value, but the first network device stores a preset measurement value, the processing module 622 determines the sum of the first sending window remainder and the preset measurement value as the second sending window remainder.

[0197] The rest can be referenced Figure 2 or Figure 3 The method of the first network device in the corresponding embodiment will not be described again here.

[0198] For example, when the above Figure 2 or Figure 3 When the first network device in the corresponding embodiment is implemented in the form of a programmable switch, the internal structure of the first network device can be as follows: Figure 7 shown. Figure 7 The main modules inside the first network device and the connection and interaction relationship between the modules are shown when the first network device is a programmable switch.

[0199] The first network device mainly includes two parts: a control plane and a data plane. Among them, the control plane includes port management 701, VOQ configuration 702 and message forwarding 703. Among them, port management 701 is used to manage the input port 704 and output port 705 in the data plane. VOQ configuration 702 is used to manage the user's pre-configured VOQ-related information (for example, the number of VOQs, the buffer size of VOQ, etc.). Message forwarding 703 is used to provide the network information and forwarding table entries required for data plane forwarding, thereby controlling message forwarding. In addition, in addition to the aforementioned input port 704 and output port 705, the data plane also includes a VOQ selector 706, a message generator 707, a window state 708, a VOQ queue 709, a VOQ state 710, a scheduler 711 and a forwarding unit 712. They are introduced below:

[0200] The window state 708 is used to maintain the sending window with the IP address as the granularity and record the sending window remaining amount of the sending window corresponding to each destination IP address.

[0201] The VOQ selector 706 is used to determine whether the received message needs to enter the VOQ according to the remaining amount of the sending window corresponding to the destination IP address of the received message.

[0202] The VOQ queue 709 is used to temporarily store messages that the first network device is temporarily not allowed to send, such as the first message introduced above.

[0203] VOQ status 710 is used to record the VOQ usage status, for example, whether the VOQ has temporarily stored messages, the destination IP address of the messages temporarily stored by the VOQ, and other information. Optionally, VOQ status 710 can maintain a VOQ bitmap. If the VOQ is used to temporarily store messages, the destination IP address of the messages temporarily stored by the VOQ is recorded. If the VOQ is not used to temporarily store messages, the bitmap is set to 0, indicating an idle state.

[0204] The scheduler 711 is configured to schedule the dequeueing of packets in the VOQ queue according to a preset rule, for example, a Round-Robin (RR) strategy or other rule may be used to schedule the dequeueing of packets in the VOQ queue.

[0205] The message generator 707 is used to generate a window update message. Exemplarily, the message generator 707 can be an internal packet generator of a programmable switch. Optionally, the message generator 707 has a built-in counter for triggering the window update message generated based on a counting cycle. Optionally, the message generator 707 has a built-in timer for triggering the window update message generated based on a timer cycle. Specifically, the structure of the window update message can be found in the previous text. Figure 4The relevant descriptions in the corresponding embodiments are not repeated here.

[0206] The forwarding unit 712 is configured to transmit the data message to the egress port queue and forward the message through the egress port queue.

[0207] During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in a processor. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it will not be described in detail here. It should also be understood that the first, second, third, fourth and various numerical numbers involved in this article are only distinctions made for convenience of description and are not intended to limit the scope of the embodiments of the present application.

[0208] In addition, the present application provides a computer program product, which includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. For example, the aforementioned Figure 2 or Figure 4 Methods related to a network device (e.g., a first network device or a second network device) in a computer. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)).

[0209] In addition, the present application also provides a computer-readable storage medium, which stores a computer program, which is executed by a processor to implement the above Figure 2 or Figure 4 A method related to a network device (eg, a first network device or a second network device) in a.

[0210] It should be understood that the term "and / or" in this document simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the related objects are in an "or" relationship.

[0211] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0212] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0213] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A message processing method, characterized in that: include: The first network device receives multiple messages, where the destination IP addresses of the multiple messages are not completely the same; The first network device determines, according to the remaining amount of the sending window corresponding to each destination IP address, the transmission status of the message corresponding to the destination IP address, where different destination IP addresses correspond to different remaining amounts of the sending window, and the remaining amount of the sending window corresponding to each destination IP address is used to indicate a metering value of the message currently allowed to be sent to the destination IP address; The transmission status of the message corresponding to the destination IP address includes: transmitting the message to a virtual output queue corresponding to the destination IP address, the virtual output queue being used to temporarily store the message; Alternatively, the message corresponding to the destination IP address is transmitted to an output port queue, and the output port queue is used to send the message.

2. The method according to claim 1, characterized in that The first network device includes a plurality of virtual output queues, and different destination IP addresses correspond to different virtual output queues.

3. The method according to any one of claims 1 to 2, characterized in that Before the first network device determines the transmission status of the message corresponding to each destination IP address according to the remaining amount of the sending window corresponding to the destination IP address, the method further includes: The first network device queries the virtual output queue corresponding to the destination IP address of each message; When the first network device does not have a virtual output queue corresponding to the destination IP address, the first network device obtains a remaining amount of a sending window corresponding to the destination IP address.

4. The method according to claim 3, characterized in that The method further comprises: When a virtual output queue corresponding to the destination IP address exists in the first network device, the first network device transmits the message corresponding to the destination IP address to the virtual output queue corresponding to the destination IP address.

5. The method according to any one of claims 1 to 2, characterized in that The first network device determines, according to the remaining amount of the sending window corresponding to each destination IP address, a transmission status of the message corresponding to the destination IP address, including: When the remaining amount of the sending window corresponding to the destination IP address is greater than or equal to the meter value of the message corresponding to the destination IP address, the first network device transmits the message corresponding to the destination IP address to the egress port queue, and sends the message corresponding to the destination IP address through the egress port queue; The method further comprises: The first network device calculates a difference between a remaining amount of a sending window corresponding to the destination IP address and a measurement value of a message corresponding to the destination IP address to obtain an updated remaining amount of a sending window corresponding to the destination IP address.

6. The method according to any one of claims 1 to 2, characterized in that The first network device determines, according to the remaining amount of the sending window corresponding to each destination IP address, a transmission status of the message corresponding to the destination IP address, including: When the remaining amount of the sending window corresponding to the destination IP address is less than the meter value of the message corresponding to the destination IP address, the first network device determines the virtual output queue corresponding to the destination IP address; and transmits the message corresponding to the destination IP address to the virtual output queue corresponding to the destination IP address of the message.

7. The method according to claim 6, characterized in that The first network device determines a virtual output queue corresponding to the destination IP address, including: The first network device allocates a virtual output queue not associated with an IP address for the message as the virtual output queue corresponding to the destination IP address, and stores the correspondence between the destination IP address and the virtual output queue in a first correspondence; The first correspondence relationship includes a correspondence relationship between at least one IP address and a virtual output queue corresponding to each IP address, and the first correspondence relationship is used to indicate that the virtual output queue corresponding to the IP address has cached a message with the destination IP address being the IP address.

8. The method according to claim 4, characterized in that The first network device includes a first virtual output queue, and the first virtual output queue is used to temporarily store packets whose destination IP address is the first IP address; The first virtual output queue temporarily stores a first message, and the destination IP address of the first message is the first IP address; The method further comprises: The first network device obtains the first message in the first virtual output queue; When the remaining amount of the first sending window corresponding to the first IP address is greater than or equal to the meter value of the first message, the first network device transfers the first message in the first virtual output queue to the egress port queue, and sends the first message through the egress port queue; The first network device calculates a difference between the first sending window remaining amount and the measurement value of the first message to obtain an updated first sending window remaining amount.

9. The method according to claim 8, characterized in that The method further comprises: The first network device obtains a queue length of the first virtual output queue, where the queue length is used to indicate a total measurement value of packets temporarily stored in the first virtual output queue; When the queue length of the first virtual output queue is zero, the first network device deletes the correspondence between the first IP address and the first virtual output queue.

10. The method according to any one of claims 1 to 2, characterized in that The first network device stores a second correspondence relationship, where the second correspondence relationship includes a correspondence relationship between at least one IP address and a remaining amount of a sending window corresponding to each IP address.

11. The method according to any one of claims 1 to 2, characterized in that The remaining amount of the sending window corresponding to each destination IP address is determined based on the measurement value of the messages sent to the destination IP address by the second network device within a preset reporting period, the second network device is a downstream network device of the first network device, and the preset reporting period includes the duration period of the preset timer or the counting period of the preset counter.

12. The method according to any one of claims 1 to 2, characterized in that The method further comprises: The first network device receives a window update message from the second network device, where the window update message carries a first IP address, and the window update message is used to instruct the first network device to update a remaining amount of a first sending window corresponding to the first IP address; The first network device updates the first sending window remaining amount of the first network device according to the window update message to obtain a second sending window remaining amount.

13. The method according to claim 12, characterized in that The window update message includes a first measurement value, where the first measurement value is a measurement value of messages sent by the second network device to the first IP address within a preset reporting period; The first network device updates the first sending window remaining amount of the first network device according to the window update message to obtain a second sending window remaining amount, including: The first network device determines that the sum of the first sending window remaining amount and the first measurement value is the second sending window remaining amount.

14. The method according to claim 12, characterized in that The first network device stores a preset measurement value; The first network device updates the first sending window remaining amount of the first network device according to the window update message to obtain a second sending window remaining amount, including: The first network device determines that the sum of the first sending window remaining amount and the preset measurement value is the second sending window remaining amount.

15. A network device, characterized in that: including processor and memory; wherein the memory stores a computer program; The processor calls the computer program to enable the network device to perform the method according to any one of claims 1 to 14. 16 . A computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to execute the method according to claim 1 .

17. A computer program product comprising instructions which, when run on a computer, cause the computer to perform the method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Communication device, communication system, communication method and communication program

    JP2013223234A