Packet scheduling method and network device

By carrying instruction information in packets, network equipment can directly identify and distinguish large flows and small flows, solving the problems of high resource consumption and identification omissions in the existing technology, and improving packet transmission efficiency and accuracy.

WO2024179013A1PCT designated stage expired Publication Date: 2024-09-06HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Patent Information

Application Number
PCT/CN2023/127810
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-27
Filing Date
2023-10-30
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing technologies have problems such as high resource consumption, identification omissions, and queue congestion when identifying and scheduling large and small flows in network devices, resulting in low packet transmission efficiency.

Method used

By carrying indication information in each packet, network equipment can directly identify the type of service flow to which the packet belongs, avoiding consuming resources for identification, reducing flow table specifications and processing capacity requirements, and achieving accurate differentiated scheduling of large and small flows.

Benefits of technology

It improves the efficiency of packet transmission, ensures the accuracy of type identification of the business flows to which multiple packets belong, and avoids queue disorder and waste of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023127810_06092024_PF_FP
    Figure CN2023127810_06092024_PF_FP
Patent Text Reader

Abstract

The present application provides a packet scheduling method and a network device. The method comprises: a network device acquires a plurality of packets; according to indication information carried in a first packet, stores the first packet to a first queue corresponding to a traffic flow to which the first packet belongs; according to indication information carried in a second packet, stores the second packet to a second queue corresponding to a traffic flow to which the second packet belongs; and then schedules the packets in the first queue and the second queue according to a scheduling policy of the first queue and a scheduling policy of the second queue. Therefore, according to the method, by carrying in each packet indication information used for indicating the type of a traffic flow to which the packet belongs, a network device can directly and effectively learn about the type of the traffic flow to which the packet belongs, and the network device does not need to consume a large number of resources to identify the type of the traffic flow to which the packet belongs, thereby effectively improving the packet transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Message scheduling method and network device

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on February 27, 2023, with application number 202310171602.2 and application name “A Message Scheduling Method and Network Device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of cloud computing technology, and in particular to a message scheduling method and network device. Background Art

[0004] With the rapid development of data centers, services such as artificial intelligence, distributed storage, and high-performance computing have also been widely adopted. The resulting expansion of service scale and high-performance requirements also place higher demands on networks. Different services have different performance requirements. For example, latency-sensitive services typically have small flows consisting of a very small number of data packets. On the other hand, throughput-sensitive services (such as storage) typically have large flows, with a single flow size exceeding 1MB or even in the GB range. However, due to the diverse traffic types within data centers and the widespread adoption of a many-to-one traffic forwarding model during network forwarding, large flows can accumulate in queues, leading to queue congestion. This increases latency for small flows and may even cause packet loss in queues, severely impacting service performance.

[0005] One solution to the above problem is that after receiving a message from a server, the collection and processing module in a network device (such as a switch or forwarding chip) can determine whether the service flow to which the message belongs is a new flow. If the service flow to which the message belongs is not a new flow, the network device can update the flow table time of the service flow to which the message belongs in the flow table. If the service flow to which the message belongs is a new flow, the network device can establish the flow table information of the new flow in the flow table based on the five-tuple information of the message, and can also count the total number of bytes or rate of the new flow in the flow table over a period of time. When the total number of bytes or rate of the new flow within a period of time is greater than the set threshold, the network device can determine that the new flow is a large flow, and can adjust the internal priority or queue of the message belonging to the large flow (referred to as the large flow message), such as adjusting the large flow message to a designated large flow queue, wherein the quality of service (Quality of Service, QOS) priority of the large flow queue is lower than the QOS priority before adjustment, so that the large flow message and the message belonging to the small flow (referred to as the small flow message) that originally belonged to the same QOS priority are scheduled separately, thereby achieving the scheduling of the large flow message no longer affecting the forwarding performance of the small flow message that originally belonged to the same QOS priority.

[0006] However, the above scheme has the following problems: (1) After receiving a message, the network device can copy or sample the message and send it to the collection and processing module, which requires a very large channel bandwidth. If there is a capacity bottleneck in the sending channel, it cannot collect all the data, so the identification of large flows will be missed. (2) The network device needs to establish a flow table for the new flow, which places very high requirements on the flow table specifications of the network device. If the flow table specifications are insufficient, the network device may not be able to identify all large flows, so the identification of large flows will be missed. (3) If the processing performance of the network device is not high, the network device may not be able to quickly and effectively identify large flows, resulting in a reduction in the effect of distinguishing and scheduling large and small flows. It is even possible that the identified large flow is dynamically identified as a small flow and restored to the original queue, resulting in disorder of large and small flows. (4) The implementation process of the network device establishing a flow table and judging whether the flow to which the received message belongs is a large flow, as well as the implementation process of continuously maintaining the flow table and executing actions, consumes a lot of resources of the network device.

[0007] Obviously, the above traditional solution may reduce the transmission efficiency of the message.

[0008] Summary of the Invention

[0009] The embodiments of the present application provide a message scheduling method and a network device to effectively improve the transmission efficiency of messages.

[0010] In a first aspect, an embodiment of the present application provides a message scheduling method, which can be executed by a network device or a component (such as a chip system or circuit, etc.) that can support the network device to implement the functions required by the method. Optionally, taking the network device executing the message scheduling method as an example, in this method, after obtaining multiple messages, the network device can, for each message, obtain the type of business flow to which the message belongs through the indication information carried by the message. Optionally, the network device can store the first message in a first queue corresponding to the business flow to which the first message belongs based on the indication information carried by the first message, and the network device can store the second message in a second queue corresponding to the business flow to which the second message belongs based on the indication information carried by the second message. Then, the network device can schedule the messages in the first queue and the second queue according to the scheduling policy of the first queue and the scheduling policy of the second queue, wherein the QOS priority of the first queue is different from the QOS priority of the second queue.

[0011] In the above design, by carrying indication information for indicating the type of business flow to which the message belongs in each message, the network device can directly and effectively know the type of business flow to which the first message belongs, without the network device consuming more resources to identify the type of business flow to which the first message belongs, which helps to effectively reduce the resources consumed by identifying the type of business flow, and can effectively avoid the situation where the network device cannot accurately identify the type of business flow to which the message belongs due to limited flow table specifications or processing capabilities, thereby effectively improving the transmission efficiency of the message. In addition, since multiple messages belonging to the same business flow will carry indication information for indicating the type of business flow, it can ensure that the message behavior of multiple messages belonging to the same business flow is unified and not disordered, so that the network device can accurately and completely know the type of business flow to which the multiple messages belong.

[0012] In one possible design, when the indication information carried by each message may include first information for indicating the data volume of the business flow to which the message belongs, if the first information indicates that the data volume of the business flow to which the message belongs is within a first numerical range, the network device can determine that the business flow to which the message belongs is a first-class business flow. For example, taking the first message as an example, when the first information indicates that the data volume of the business flow to which the first message belongs is within a first numerical range, the network device can determine that the business flow to which the first message belongs is a first-class business flow, and then the network device can store the first message in the first queue corresponding to the first-class business flow. If the first information indicates that the data volume of the business flow to which the message belongs is within a second numerical range, the network device can determine that the business flow to which the message belongs is a second-class business flow. For example, taking the second message as an example, when the first information indicates that the data volume of the business flow to which the second message belongs is within a second numerical range, the network device can determine that the business flow to which the second message belongs is a second-class business flow, and then the network device can store the second message in the second queue corresponding to the second-class business flow.

[0013] In the above design, different types of business flows can be accurately distinguished according to the amount of data (such as the number of bytes or bits) possessed by different types of business flows. For example, the amount of data possessed by the first type of business flow is different from the amount of data possessed by the second type of business flow. Therefore, the first information for indicating the amount of data of the business flow to which the message belongs is configured in each message, so that the network device can accurately know the type of business flow to which each message belongs, thereby enabling the network device to perform differentiated scheduling for messages belonging to different types of business flows.

[0014] In one possible design, when the indication information carried by each message may include second information for indicating the service type of the service flow to which the message belongs, if the second information indicates that the service type of the service flow to which the message belongs is throughput-sensitive, the network device can determine that the service flow to which the message belongs is a first-class service flow. For example, taking the first message as an example, when the second information indicates that the service type of the service flow to which the first message belongs is throughput-sensitive, the network device can determine that the service flow to which the first message belongs is a first-class service flow, and then the network device can store the first message in the first queue corresponding to the first-class service flow. If the second information indicates that the service type of the service flow to which the message belongs is delay-sensitive, the network device can determine that the service flow to which the message belongs is a second-class service flow. For example, taking the second message as an example, when the second information indicates that the service type of the service flow to which the second message belongs is delay-sensitive, the network device can determine that the service flow to which the second message belongs is a second-class service flow, and then the network device can store the second message in the second queue corresponding to the second-class service flow.

[0015] In the above design, different types of business flows can be accurately distinguished according to their business types (such as throughput-sensitive or delay-sensitive). For example, the business type of the first type of business flow is different from the business type of the second type of business flow. Therefore, the second information for indicating the business type of the business flow to which the message belongs is configured in each message, so that the network device can accurately know the type of business flow to which each message belongs, thereby enabling the network device to perform differentiated scheduling for messages belonging to different types.

[0016] In one possible design, the first type of business flow is a business flow with a traffic volume greater than a first threshold, and the second type of business flow is a business flow with a traffic volume less than or equal to the first threshold. At this time, the QOS priority of the first queue corresponding to the first type of business flow is lower than the QOS priority of the second queue corresponding to the second type of business flow.

[0017] Optionally, when the second type of business flow is a business flow with a traffic greater than the first threshold, and the first type of business flow is a business flow with a traffic less than or equal to the first threshold, the QOS priority of the second queue corresponding to the second type of business flow is lower than the QOS priority of the first queue corresponding to the first type of business flow.

[0018] In one possible design, the indication information carried by each message is carried in a setting field included in the message.

[0019] In the above design, by carrying indication information for indicating the type of business flow to which the message belongs in the setting field included in each message, the impact of the business flow on the network can be carried in the message in a quantified form, and can enter the network together with the message, so that the network device can accurately know the type of business flow to which the message belongs, and can assist the network device to perform targeted scheduling of messages belonging to different business flow types. For example, the network device can differentiate and schedule messages belonging to different business flow types, or can also perform differential management or differential control of business flows of different types.

[0020] In one possible design, the setting field included in each message may also include QOS priority indication information, where the QOS priority indication information is used to indicate the original QOS priority of the service flow to which the message belongs.

[0021] In the above design, the network device can accurately determine the original QOS priority of the service flow to which the message belongs based on the QOS priority indication information contained in the setting field included in each message, so that subsequent network devices can accurately store messages belonging to different service flow types in different queues, which helps to accurately schedule messages belonging to different service flow types.

[0022] In one possible design, the network device can pre-configure different queue cache thresholds for the first queue and the second queue so that the first queue can effectively store messages belonging to the first category of business flows to a certain extent, or so that the second queue can effectively store messages belonging to the second category of business flows to a certain extent.

[0023] In an example, taking the business flow to which the first message belongs as a first-class business flow and the first message stored in the first queue corresponding to the first-class business flow as an example, when the cache occupancy value of the first queue is less than the queue cache threshold of the first queue, the network device can store the first message in the first queue.

[0024] In another example, taking the case where the business flow to which the second message belongs is a second-class business flow and the second message is stored in the second queue corresponding to the second-class business flow, when the cache occupancy value of the second queue is less than the queue cache threshold of the second queue, the network device can store the second message in the second queue.

[0025] In the above design, by configuring different queue buffer thresholds for different queues, different queues can effectively store arriving messages to a certain extent based on the actual conditions of the messages to be stored, thereby achieving effective management of the cache of the network device.

[0026] In one possible design, the network device can pre-configure different packet loss thresholds for the first queue and the second queue so that the network device can specifically discard packets arriving at the first queue or packets arriving at the second queue, and promptly and effectively discard packets arriving at the first queue or packets in the first queue, or, facilitate the network device to specifically discard packets in the first queue or packets in the second queue, which helps to effectively avoid network congestion or port congestion of the network device.

[0027] In one example, taking the case where the service flow to which the first message belongs is a first-class service flow and the first message is stored in the first queue corresponding to the first-class service flow, when the buffer occupancy value of the first queue is less than the packet loss threshold value of the first queue, the network device can store the first message in the first queue. When the buffer occupancy value of the first queue is greater than or equal to the packet loss threshold value of the first queue and less than or equal to the first set threshold value of the first queue, the network device can selectively discard messages arriving at the first queue or located in the first queue. When the buffer occupancy value of the first queue is greater than the first set threshold value of the first queue, the network device can discard all messages arriving at the first queue, or can choose to discard one or more messages located in the first queue.

[0028] In another example, taking the case where the service flow to which the second message belongs is a second-class service flow and the second message is stored in the second queue corresponding to the second-class service flow, when the buffer occupancy value of the second queue is less than the packet loss threshold value of the second queue, the network device may store the second message in the second queue. When the buffer occupancy value of the second queue is greater than or equal to the packet loss threshold value of the second queue and less than or equal to the second set threshold value of the second queue, the network device may selectively discard messages arriving at the second queue or located in the second queue. When the buffer occupancy value of the second queue is greater than the second set threshold value of the second queue, the network device may discard all messages arriving at the second queue, or may choose to discard one or more messages located in the second queue.

[0029] In the above design, by setting different packet loss thresholds for different queues, the network device can promptly and accurately discard packets arriving at the queue or discard packets in the queue, thereby effectively avoiding network congestion or port congestion of the network device.

[0030] In one possible design, after the network device stores the first message in the first queue corresponding to the service flow to which the first message belongs, the network device can perform corresponding congestion notification processing on the first queue based on the cache occupancy of the first queue, so that the message sending server can timely and accurately understand the congestion situation of the message in the first queue (or the message congestion situation in the network). For example, when the cache occupancy value of the first queue is greater than the congestion notification threshold value of the first queue, the network device can add a first congestion notification identifier to the first message, so that after receiving the message with the first congestion notification identifier added, the message receiving server can learn from the message with the first congestion notification identifier that there is message congestion in the first queue of the network device, and can send a congestion notification message to the message sending server, so that the message sending server can timely and accurately learn that there is congestion in the message during network forwarding.

[0031] Optionally, after the network device stores the second message in the second queue corresponding to the service flow to which the second message belongs, it can perform corresponding congestion notification processing on the second queue based on the cache occupancy of the second queue, so that the message sending server can timely and accurately understand the congestion situation of the message in the second queue (or the message congestion situation in the network). For example, when the cache occupancy value of the second queue is greater than the congestion notification threshold value of the second queue, the network device can add a second congestion notification identifier to the second message, so that after receiving the message with the second congestion notification identifier added, the message receiving server can learn that the message is congested during the network forwarding process through the second congestion notification identifier added to the message, and can send a congestion notification message to the message sending server, so that the message sending server can timely and accurately learn that the message is congested during the network forwarding process.

[0032] Among them, the first congestion notification identifier is used to indicate that the business flow (such as the first type of business flow) to which the first message belongs is congested during the network forwarding process, and the second congestion notification identifier is used to indicate that the business flow (such as the second type of business flow) to which the second message belongs is congested during the network forwarding process.

[0033] In a second aspect, embodiments of the present application provide a possible network device. The beneficial effects can be found in the description of the first aspect and are not further elaborated here. The network device has the functionality to implement the actions described in the method example of the first aspect. The functionality can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functionality. In one possible design, the network device includes a transceiver module, a processing module, and a scheduling module. The transceiver module is configured to obtain multiple messages, each message carrying indication information indicating the type of service flow to which the message belongs. The processing module is configured to, based on the indication information carried by the first message, store the first message in a first queue corresponding to the service flow to which the first message belongs. The processing module is further configured to, based on the indication information carried by the second message, store the second message in a second queue corresponding to the service flow to which the second message belongs. The scheduling module is configured to schedule messages in the first queue and the second queue according to the scheduling policy of the first queue and the scheduling policy of the second queue. The QoS priority of the first queue is different from the QoS priority of the second queue. These modules can perform the corresponding functions in any possible design of the first aspect mentioned above. Please refer to the detailed description in the method example for details, which will not be repeated here.

[0034] In a third aspect, embodiments of the present application provide a possible network device, comprising a communication interface and a processor. Optionally, the network device further comprises a memory. The memory is configured to store computer programs or instructions, and the processor is coupled to the memory and the communication interface. When the processor executes the computer program or instructions, the network device performs the method of any possible design of the first aspect described above.

[0035] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the computer executes the method in any possible design of the first aspect above.

[0036] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed by a computer, the computer executes the method in any possible design of the first aspect above.

[0037] In a sixth aspect, an embodiment of the present application further provides a chip, which is coupled to a memory, and is used to read a computer program stored in the memory and execute a method in any possible design of the first aspect above.

[0038] Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] FIG1 exemplarily shows a schematic diagram of a possible application scenario provided by an embodiment of the present application;

[0040] FIG2 exemplarily shows a flow chart of a message scheduling method provided in an embodiment of the present application;

[0041] FIG3a exemplarily shows a schematic diagram of a message header structure provided in an embodiment of the present application;

[0042] FIG3b exemplarily shows a schematic diagram of a message header carrying indication information provided by an embodiment of the present application;

[0043] FIG4 exemplarily shows a schematic diagram of message differentiation scheduling provided by an embodiment of the present application;

[0044] FIG5 exemplarily shows another schematic diagram of message differentiation scheduling provided in an embodiment of the present application;

[0045] FIG6 exemplarily shows a schematic structural diagram of a possible network device provided in an embodiment of the present application;

[0046] FIG7 exemplarily shows a structural diagram of a possible network device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] Before introducing the technical solution provided by this application, some of the terms involved in this application are first explained to facilitate understanding by those skilled in the art.

[0048] (1) Network devices are entities on the network side that have the function of sending and receiving signals. For example, a network device can be a device with IP (Internet Protocol) forwarding function, such as a router or switch.

[0049] Illustratively, the network device may be used to convert received air frames into network protocol packets and vice versa, and may act as a router between the terminal device and the rest of the access network, where the rest of the access network may include an IP network.

[0050] In an embodiment of the present application, the device for implementing the function of the network device may be a network device, or a device that can support the network device to implement the function, such as a chip system, which may be installed in the network device.

[0051] (2) Server: This server has the functions of information processing and forwarding, and is a device that can provide data connectivity services. Moreover, since the server can respond to service requests from terminal devices and process them, generally speaking, the server needs to have the ability to undertake and guarantee services.

[0052] In this application, the server may be a server located in a data network (DN), such as a common server or a server in a cloud platform; or a multi-access edge computing (MEC) server located in a core network. For example, the data network may include, but is not limited to, a data center network or a cloud data center network.

[0053] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0054] FIG1 exemplarily illustrates a possible application scenario applicable to an embodiment of the present application. In this application scenario, a network device is used as a switch as an example. Optionally, the switch may include an access switch located at the access layer, an aggregation switch located at the aggregation layer, and a core switch located at the core layer.

[0055] Optionally, access switches are usually located at the top of the rack, so they are sometimes also called ToR (Top of Rack) switches. They have low cost and high port density and are used to directly connect to servers, such as one or more servers.

[0056] Aggregation switches serve as the convergence point for multiple access switches, processing all traffic from the access switches and providing uplinks to the core layer. Optionally, aggregation switches can provide services including, but not limited to, firewalls, Secure Sockets Layer (SSL) protocol offload, intrusion detection, or network analysis.

[0057] Core switches are used to rapidly forward data from aggregation switches, providing a fast and reliable network architecture. For example, core switches can be Layer 3 switches with network management capabilities. Generally speaking, core switches have a large number of ports and high bandwidth, offering higher reliability, redundancy, throughput, and relatively low latency compared to access and aggregation switches.

[0058] For example, a server connects to one or more access switches via a network card. After successfully connecting to one or more access switches, the server can send packets to the one or more access switches. After receiving the packets, the one or more access switches then forward them to one or more aggregation switches. The one or more aggregation switches then process the packets and send the processed packets to one or more core switches, which then forward the processed packets.

[0059] It should be noted that Figure 1 only schematically provides a possible application scenario, and this schematic application scenario is for the purpose of more clearly illustrating the technical solution of the embodiment of the present application, and does not constitute a limitation on the application scenario of the message scheduling method provided in the present application. In addition, the form and quantity of each device in the application scenario shown in Figure 1 above are only used for example and do not constitute a limitation on the present application. Furthermore, the name of each device in the application scenario shown in Figure 1 is only an example, and the name of each device in the specific implementation may also be other names, and the present application does not make specific limitations on this. In addition, it is known to those skilled in the art that with the evolution of the application scenario, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.

[0060] As described in the background technology, in existing solutions, network devices consume considerable time and resources when identifying whether a received message belongs to a large or small service flow. Furthermore, existing solutions often miss large flows, resulting in poor performance in distinguishing and scheduling large and small flows, and thus relatively low message transmission efficiency. Therefore, the present application provides a message scheduling method to effectively improve message transmission efficiency.

[0061] The following is a detailed introduction to the specific implementation of the message scheduling method in the embodiment of the present application based on the application scenario shown in Figure 1.

[0062] FIG2 exemplarily illustrates a flow diagram of a message scheduling method provided by an embodiment of the present application. The method is applicable to a network device. For example, the network device may be the switch shown in FIG1 or a component (such as a chip or integrated circuit) that can support the switch to implement the functions required by the method. To facilitate the introduction of the technical solution provided by the embodiment of the present application, the following is an example of the process of a network device executing the message scheduling method. As shown in FIG2 , the method includes:

[0063] Step 201: The network device obtains multiple messages.

[0064] Optionally, the network device may obtain a message from a server, or may also obtain a message from other devices (such as a terminal device or other network devices).

[0065] Optionally, for each of the multiple messages obtained by the network device, the message may carry indication information, where the indication information is used to indicate the type of service flow to which the message belongs.

[0066] Exemplarily, the types of service flows may include first-type service flows and second-type service flows, etc. Optionally, the type corresponding to the second-type service flows is different from the type corresponding to the first-type service flows.

[0067] Optionally, in one example, the first type of business flow is used to represent business flows with a flow rate greater than a first threshold (or may be called a large flow), and the second type of business flow is used to represent business flows with a flow rate less than or equal to the first threshold (or may be called a small flow). In another example, the first type of business flow is used to represent business flows with a flow rate greater than or equal to a second threshold (or may be called a large flow), and the second type of business flow is used to represent business flows with a flow rate less than or equal to a third threshold (or may be called a small flow), where the second threshold is greater than the third threshold.

[0068] Optionally, the type of the service flow can be characterized by the flow characteristics of the service flow. For example, the flow characteristics of the service flow can include but are not limited to the data volume of the service flow (such as the number of bytes or the number of bits), or the service type of the service flow (such as delay-sensitive or throughput-sensitive). For example, taking the flow characteristic of the service flow as the number of bytes of the service flow as an example, when the number of bytes of the service flow is within a certain numerical range (such as (0,1MB]), the service flow is a second-class service flow, and when the number of bytes of the service flow is within another numerical range (such as (1,50MB]), the service flow is a first-class service flow. For another example, taking the flow characteristic of the service flow as the service type of the service flow as an example, when the service type of the service flow is throughput-sensitive, the service flow is a first-class service flow, and when the service type of the service flow is delay-sensitive, the service flow is a second-class service flow.

[0069] In one example, the indication information may be an indication value, for example, an indication value of 0 may be set to indicate a second-category business flow, and an indication value of 1 may be set to indicate a first-category business flow. For example, an indication value of 1 may be used to indicate that the number of bytes of a business flow is within a numerical interval (for example, (1,50MB]), which means that the business flow is a first-category business flow; an indication value of 0 may be used to indicate that the number of bytes of a business flow is within a numerical interval (for example, (0,1MB]), which means that the business flow is a second-category business flow. For another example, an indication value of 1 may be used to indicate that the business type of a business flow is throughput-sensitive, which means that the business flow is a first-category business flow; an indication value of 0 may be used to indicate that the business type of a business flow is delay-sensitive, which means that the business flow is a second-category business flow.

[0070] In another example, the indication information may be an identifier for indicating a type, for example, identifier A may be set to indicate a first type of business flow, and identifier B may be set to indicate a second type of business flow. For example, identifier A may be used to indicate that the number of bytes of a business flow is within a numerical interval (for example, (1,50MB]), which means that the business flow is a first type of business flow; identifier B may be used to indicate that the number of bytes of a business flow is within a numerical interval (for example, (0,1MB]), which means that the business flow is a second type of business flow. For another example, identifier A may be used to indicate that the business type of a business flow is throughput-sensitive, which means that the business flow is a first type of business flow; identifier B may be used to indicate that the business type of a business flow is delay-sensitive, which means that the business flow is a second type of business flow.

[0071] Optionally, the indication information can be carried in a setting field contained in each message. For example, taking the first message contained in the multiple messages obtained by the network device as an example, the indication information can be carried in the setting field of the basic header of the first message. For example, taking the first message as an IPv6 (Internet Protocol Version 6) message as an example, the indication information can be carried in the Differentiated Services Code Point (DSCP) field of the basic header of the IPv6 message, or, taking the first message as an IPv4 (Internet Protocol Version 4) message as an example, the indication information can be carried in the DSCP field of the basic header of the IPv4 message. Optionally, the indication information can also be carried in the option field or other fields of the IP header, or can also be carried in the option field or other fields of the Transmission Control Protocol (TCP) layer 4 header. Optionally, the indication information can also be carried in part of the field of the Base Transport Header (BTH) of the Remote Direct Memory Access (RDMA) network.

[0072] Optionally, each message may further include a setting field containing QOS priority indication information, and the QOS priority indication information may be used to indicate the original QOS priority of the service flow to which the message belongs. For example, taking a message (such as a first message) obtained by a network device as an example, in one example, when the service flow to which the first message belongs is a large flow, the storage queue corresponding to the original QOS priority of the service flow to which the first message belongs can be adjusted. For example, the network device may select a queue with a QOS priority lower than the original QOS priority from multiple queues, and use the queue to store messages belonging to the large flow, for example, the network device may store the first message in the queue. In another example, the original QOS priority of the first service flow to which the first message belongs can be adjusted. For example, the network device may select a QOS priority lower than the original QOS priority as the current QOS priority of the service flow to which the first message belongs, and then the network device may store the first message in the first queue corresponding to the current QOS priority of the first service flow to which the first message belongs. Optionally, the network device may also set up a queue specifically for storing messages belonging to a large flow. For example, the network device may set a low QOS priority as the QOS priority of the queue, or after the network determines the current QOS priority of the first service flow to which the first message belongs, the current QOS priority of the first service flow to which the first message belongs may be used as the QOS priority of the queue. In another example, when the service flow to which the first message belongs is a small flow, the original QOS priority of the service flow to which the first message belongs may not be adjusted. In this way, the network device may store the first message in a queue that matches the original QOS priority.

[0073] In one example, the QOS priority indication information may be an indication value (such as a field value of a DSCP field), where different indication values ​​are used to indicate different QOS priorities, such as an indication value of 0 for indicating that the QOS priority is level 0, an indication value of 1 for indicating that the QOS priority is level 1, and an indication value of 2 for indicating that the QOS priority is level 2. In another example, the indication information may be an identifier for indicating the QOS priority, such as an identifier a for indicating that the QOS priority is level 0, an identifier b for indicating that the QOS priority is level 1, and an identifier c for indicating that the QOS priority is level 2.

[0074] For example, taking a message obtained by a network device as an IPv4 message as an example, FIG3a exemplarily shows a schematic diagram of a message header structure provided by an embodiment of the present application. As shown in FIG3a, the DSCP field can be located in the 8-bit Type of Service (TOS) field in the basic header of the IPv4 message, occupying 6 bits. Optionally, the DSCP field can contain 64 field values, namely 0 to 63. For example, in a cloud data center network, since the network device needs to assign a QOS priority to the message when forwarding the message, so as to forward the message more promptly and efficiently, a part of the field values ​​of the DSCP field can be selected to represent the QOS priority of the message. For example, the QOS priority of the message is usually 8. Therefore, only a part of the 64 field values ​​contained in the DSCP field are selected to represent the QOS priority of the message, such as field values ​​0, 1, 2, 3, 4, 5, 6, 7, and 8 are respectively used to represent the QOS priority of the message. The mapping relationship between the field value of the DSCP field and the QOS priority of the message can be seen in Table 1.

[0075] Table 1

[0076] It should be noted that Table 1 is only a simple example for the purpose of illustrating the technical solutions in the embodiments of the present application, and does not constitute a limitation on the technical solutions in the embodiments of the present application.

[0077] For example, taking the case where a network device receives a message (such as a first message) from a server as an example, before sending the first message, the server needs to cut the application message corresponding to the first message into a length that the network allows for forwarding and encapsulate the message headers of the transport layer and the network layer to form a message that can be forwarded in the network. When the server forwards the first message, it can configure or add indication information for indicating the type of business flow to which the first message belongs in the setting field of the basic header of the first message, so that the receiving device of the first message (such as a network device) can promptly and accurately know the type of business flow to which the first message belongs, thereby reducing the pressure on the receiving device to identify the type of business flow to which the message belongs, helping to reduce the amount of resources consumed by the receiving device when identifying the type of business flow to which the message belongs, and effectively ensuring the accuracy of identifying the type of business flow to which the message belongs, helping to avoid omissions in large flow identification. Optionally, the indication information can be configured by the server based on the protocol stack or added to the setting field of the basic header of the first message, or it can be configured by the server based on the network card or added to the setting field of the basic header of the first message.

[0078] Optionally, since not all of the 64 field values ​​contained in the DSCP field are used to characterize the QOS priority of the message, at least a portion of the space in the area where the DSCP field is located can be reused to carry indication information that can indicate the type of business flow to which the message belongs, that is, the DSCP field can be used to indicate both the type of business flow to which the message belongs and the original QOS priority of the business flow to which the message belongs. For example, continuing to take a message obtained by a network device as an IPv4 message as an example, FIG3b exemplifies a schematic diagram of a message header carrying indication information provided by an embodiment of the present application. As shown in FIG3b , the DSCP field occupies 6 bits, and the server can reuse 1 bit of the 6 bits to carry indication information that can indicate the type of business flow to which the message belongs, and reserve 5 bits for carrying QOS priority indication information that can characterize the QOS priority of the message. Optionally, if there are many types, the server can expand to 3 bits of the 6 bits occupied by the reused DSCP field to carry indication information that can indicate the type of service flow to which the message belongs, and reserve 3 bits to carry QOS priority indication information that can characterize the QOS priority of the message.

[0079] Optionally, to ensure that the priority mapping result of the packet in the network device is not affected when the DSCP field is reused, the QOS priority mapping table on the network device needs to be updated. The updated QOS priority mapping table can be seen in Table 2.

[0080] Table 2

[0081] It should be noted that Table 2 is only a simple example for the purpose of illustrating the technical solutions in the embodiments of the present application, and does not constitute a limitation on the technical solutions in the embodiments of the present application.

[0082] For example, a message obtained by a network device is an IPv4 message, and the indication information used to indicate the type of service flow is an indication value (such as 0 or 1), and the indication value is filled in the highest bit of the 6 bits occupied by the DSCP field. In one example, when the QOS priority of the IPv4 message is level 0, the field value of the DSCP field contained in the IPv4 message is 0, and the binary value corresponding to the field value 0 of the DSCP field is 000000. If the service flow to which the IPv4 message belongs is a Class II service flow, the server can adjust the value of the highest bit position of the 6 bits occupied by the DSCP field contained in the IPv4 message to 0. When the value of the highest bit position is 0, it indicates that the service flow to which the IPv4 message belongs is a Class II service flow (i.e., a small flow). For example, since the value of the highest bit in the binary value 000000 corresponding to the field value 0 of the DSCP field is 0, the server does not need to adjust the value 0 of the highest bit in the binary value 000000 corresponding to the field value 0 of the DSCP field. Therefore, the field value of the DSCP field remains 0, and the QOS priority of the IPv4 packet is still level 0.

[0083] If the service flow to which the IPv4 packet belongs is a Class I service flow, the server can adjust the value of the highest bit position of the 6 bits occupied by the DSCP field contained in the IPv4 packet to 1. For example, the server can adjust the value 0 of the highest bit position of the binary value 000000 corresponding to the field value 0 of the DSCP field to 1. The updated binary value is 100000, and the field value of the DSCP field becomes 32. Optionally, when the value of the highest bit position is 1, it indicates that the service flow to which the IPv4 packet belongs is a Class I service flow (i.e., a large flow). Although the field value of the DSCP field becomes 32, the QOS priority of the IPv4 packet is still level 0, so it can be ensured that the priority mapping result of the packet in the network device is not affected when the DSCP field is reused.

[0084] In another example, when the QOS priority of an IPv4 message is level 1, the field value of the DSCP field contained in the IPv4 message is 1, and the binary value corresponding to the field value 1 of the DSCP field is 000001. If the service flow to which the IPv4 message belongs is a Class II service flow, the server can adjust the value of the highest bit position of the 6 bits occupied by the DSCP field contained in the IPv4 message to 0. When the value of the highest bit position is 0, it indicates that the service flow to which the IPv4 message belongs is a Class II service flow (i.e., a small flow). For example, since the value of the highest bit position of the binary value 000001 corresponding to the field value 1 of the DSCP field is 0, the server does not need to adjust the value 0 of the highest bit position of the binary value 000001 corresponding to the field value 1 of the DSCP field, so the field value of the DSCP field remains 1, and the QOS priority of the IPv4 message is still level 1.

[0085] If the service flow to which the IPv4 message belongs is a Class I service flow, the server can adjust the value of the highest bit position of the 6 bits occupied by the DSCP field contained in the IPv4 message to 1. For example, the server can adjust the value 0 of the highest bit position in the binary value 000001 corresponding to the field value 1 of the DSCP field to 1. The updated binary value is 100001, and the field value of the DSCP field becomes 33. Optionally, when the value of the highest bit position is 1, it indicates that the service flow to which the IPv4 message belongs is a Class I service flow (i.e., a large flow). Although the field value of the DSCP field becomes 33, the QOS priority of the IPv4 message is still level 1, thus ensuring that the priority mapping result of the message in the network device is not affected when the DSCP field is reused.

[0086] Optionally, when forwarding an IPv4 message, the server may configure or add a corresponding indicator value in the DSCP field contained in the IPv4 message based on the type of service flow to which the IPv4 message belongs, so that the network device can promptly and accurately learn the type of service flow to which the IPv4 message belongs. The server may then send the IPv4 message to the network device. Upon receiving the IPv4 message, the network device may determine the QOS priority corresponding to the field value of the DSCP field contained in the IPv4 message according to a pre-configured QOS priority mapping table. This QOS priority is used as the priority for scheduling the IPv4 message.

[0087] It should be noted that configuring or adding the corresponding indicator value is intended to facilitate network devices to promptly and accurately determine the type of service flow to which an IPv4 packet belongs, and does not affect the priority mapping results of the packet within the network device. For example, if the DSCP field value contained in an IPv4 packet is 2, the binary value corresponding to the DSCP field value of 2 is 000010. Therefore, the QoS priority of the IPv4 packet corresponding to the DSCP field value of 2 is Level 2. If the service flow to which the IPv4 packet belongs is a Class 1 service flow, the server can adjust the value of the highest bit position in the binary value 000010 corresponding to the DSCP field value of 1 from 0 to 1. The updated binary value is 100010, and the DSCP field value becomes 34. Optionally, when the value of the highest bit position is 1, it indicates that the service flow to which the IPv4 packet belongs is a Class 1 service flow (i.e., a large flow). Although the DSCP field value changes to 34, the QoS priority of the IPv4 packet remains Level 2. If the service flow to which the IPv4 packet belongs is a Class II service flow, the server can adjust the value 0 at the highest bit position in the binary value 000010 corresponding to the field value 1 of the DSCP field to 0. When the value at the highest bit position is 0, it indicates that the service flow to which the IPv4 packet belongs is a Class II service flow (i.e., a low-volume flow). However, since the value at the highest bit position in the binary value 000010 corresponding to the field value 2 of the DSCP field is 0, the server does not need to adjust the value 0 at the highest bit position in the binary value 000010 corresponding to the field value 2 of the DSCP field. Therefore, the field value of the DSCP field remains 2, and the QOS priority of the IPv4 packet remains at Level 2.

[0088] Step 202: The network device stores the first message in a first queue corresponding to the service flow to which the first message belongs according to the indication information carried by the first message.

[0089] Step 203: The network device stores the second message in a second queue corresponding to the service flow to which the second message belongs according to the indication information carried in the second message.

[0090] Optionally, after obtaining a message, the network device may determine the type of service flow to which the message belongs based on the indication information carried in the message. In one example, taking a first message included in multiple messages obtained by the network device as an example, after obtaining the first message, the network device may parse the first message and obtain indication information indicating the type of service flow to which the first message belongs. When the indication information indicates a first-class service flow, the network device may store the first message in a first queue corresponding to the first-class service flow. When the indication information indicates a second-class service flow, the network device may store the first message in a second queue corresponding to the second-class service flow. In another example, taking a second message included in multiple messages obtained by the network device as an example, after obtaining the second message, the network device may parse the second message and obtain indication information indicating the type of service flow to which the second message belongs. When the indication information indicates a second-class service flow, the network device may store the second message in a second queue corresponding to the second-class service flow. When the indication information indicates a first-class service flow, the network device may store the second message in a first queue corresponding to the first-class service flow. Optionally, the QOS priority of the first queue may be lower than the QOS priority of the second queue. Optionally, in one possible implementation, when the first type of business flow is a business flow with a traffic volume greater than a first threshold, and the second type of business flow is a business flow with a traffic volume less than or equal to the first threshold, the QOS priority of the first queue may be lower than the QOS priority of the second queue. In another possible implementation, when the second type of business flow is a business flow with a traffic volume greater than the first threshold, and the first type of business flow is a business flow with a traffic volume less than or equal to the first threshold, the QOS priority of the first queue may be higher than the QOS priority of the second queue.

[0091] For example, based on the above content, taking the above first message as an example, the following several possible implementation methods are used to introduce the implementation process of the network device storing the message in the queue corresponding to the business flow to which the message belongs according to the indication information carried by each message.

[0092] Method 1: When the indication information carried by the first message includes first information indicating the data volume of the service flow to which the first message belongs, if the first information indicates that the data volume of the service flow to which the first message belongs is within a first numerical range, the network device may determine that the service flow to which the first message belongs is a first-class service flow. The network device may then store the first message in a first queue corresponding to the first-class service flow. Optionally, the first queue may be a queue specifically configured by the network device to store first-class service flows, or it may be any queue selected from multiple preconfigured queues by the network device that has a lower QOS priority than the original QOS priority of the service flow. The multiple queues are respectively configured to store messages of different QOS priorities, each queue being configured to store messages of a corresponding QOS priority, and the QOS priority of each queue corresponding to the QOS priority of the messages stored in that queue. For example, queue 0 is configured to store messages with a QOS priority of level 0, queue 1 is configured to store messages with a QOS priority of level 1, and queue 2 is configured to store messages with a QOS priority of level 2.

[0093] If the first information indicates that the data volume of the business flow to which the first message belongs is within the second numerical range, the network device can determine that the business flow to which the first message belongs is a second-class business flow, and then the network device can store the first message in the second queue corresponding to the second-class business flow. The QOS priority of the second queue corresponds to the QOS priority of the second-class business flow, that is, the QOS priority of the second queue corresponds to the QOS priority of the message stored in the second queue. For example, assuming that the QOS priority of the first message is level 2, and assuming that the network device is configured with three queues, namely queue 0, queue 1 and queue 2, wherein queue 0 is used to store messages with a QOS priority of level 0, queue 1 is used to store messages with a QOS priority of level 1, and queue 2 is used to store messages with a QOS priority of level 2. When the business flow to which the first message belongs is a second-class business flow, the network device can store the first message in queue 2. Optionally, any value within the first numerical range can be greater than any value within the second numerical range.

[0094] Optionally, the second queue may be a queue specifically configured by the network device for storing the second type of service flow, or may be a queue selected by the network device from among multiple pre-configured queues that matches the original QoS priority of the service flow. The multiple queues are respectively configured to store packets with different QoS priorities, each queue is configured to store packets with a corresponding QoS priority, and the QoS priority of each queue corresponds to the QoS priority of the packets stored in the queue.

[0095] For example, the indication information carried by the first message includes the first information for indicating the data volume of the business flow as an indication value of 0 or 1, wherein the indication value 1 is used to indicate that the data volume of the business flow is within a first numerical range (for example, (1, 50MB]), and the indication value 0 is used to indicate that the data volume of the business flow is within a second numerical range (for example, (0, 1MB]). When the indication information carried by the first message includes the indication value 1, the network device can determine that the business flow to which the first message belongs is a first-class business flow, and then the network device can store the first message in the first queue corresponding to the first-class business flow. When the indication information carried by the first message includes the indication value 0, the network device can determine that the business flow to which the first message belongs is a second-class business flow, and then the network device can store the first message in the second queue corresponding to the second-class business flow.

[0096] By way of example, the following describes an implementation process of a network device performing differentiated scheduling on acquired messages belonging to different types.

[0097] FIG4 exemplarily shows a schematic diagram of message differentiation scheduling provided by an embodiment of the present application. As shown in FIG4 , the original QOS priority of the message belonging to business flow a is the same as the original QOS priority of the message belonging to business flow b, business flow a is a large flow, and business flow b is a small flow. When the message scheduling method provided by the present application is not adopted, since the original QOS priority of the message belonging to business flow a is the same as the original QOS priority of the message belonging to business flow b, the network device stores the messages a1, a2, a3, and a4 belonging to business flow a and the messages b1 and b2 belonging to business flow b in queue x. In this way, the network device can schedule the messages in queue x in sequence according to the first-in-first-out scheduling rule of the queue. When the message scheduling method provided in the present application is adopted, after the network device obtains message a1, if the network device knows through the indication information carried by message a1 that the business flow a to which message a1 belongs is a large flow, then message a1 can be stored in queue y; after the network device obtains message a2, if the network device knows through the indication information carried by message a2 that the business flow a to which message a2 belongs is a large flow, then message a2 can be stored in queue y; after the network device obtains message a3, if the network device knows through the indication information carried by message a3 that the business flow a to which message a3 belongs is a large flow, then message a3 can be stored in queue y; after the network device obtains message a4, if the network device knows through the indication information carried by message a4 that the business flow a to which message a4 belongs is a large flow, then message a4 can be stored in queue y. In addition, after the network device obtains message b1, if the network device knows through the indication information carried by message b1 that the service flow b to which message b1 belongs is a small flow, then message b1 can be stored in queue x; after the network device obtains message b2, if the network device knows through the indication information carried by message b2 that the service flow b to which message b2 belongs is a small flow, then message b2 can be stored in queue x.

[0098] Optionally, when the network device determines that the service flow to which a certain acquired message (such as message a1) belongs is a large flow, and the network device can obtain the original QOS priority of message a1 through the QOS priority indication information carried in message a1, the message storage queue corresponding to the original QOS priority of message a1 is queue x. In order to facilitate the network device to perform differentiated scheduling of service flows belonging to different types, the network device can select a queue (such as queue y) with a priority lower than the original QOS priority of message a1 from multiple queues of the network device to store message a1, that is, to store messages belonging to service flow a. Optionally, the network device can also pre-set a large flow queue (such as queue y), which is used to store messages belonging to a large flow (such as message a1) belonging to a large flow, and the QOS priority of queue y is lower than the QOS priority of queue x.

[0099] Method 2: When the indication information carried by the first message includes second information indicating the service type of the service flow to which the first message belongs, if the second information indicates that the service type of the service flow to which the first message belongs is throughput-sensitive, the network device may determine that the service flow to which the first message belongs is a first-class service flow, and then the network device may store the first message in the first queue corresponding to the first-class service flow. If the second information indicates that the service type of the service flow to which the first message belongs is latency-sensitive, the network device may determine that the service flow to which the first message belongs is a second-class service flow, and then the network device may store the first message in the second queue corresponding to the second-class service flow.

[0100] For example, taking the case where the indication information carried by the first message includes the second information for indicating the service type of the service flow as identifier A or identifier B, identifier A is used to indicate that the service type of the service flow is throughput-sensitive, and identifier B is used to indicate that the service type of the service flow is delay-sensitive. When the indication information carried by the first message includes identifier A, the network device can determine that the service flow to which the first message belongs is a first-class service flow, and then the network device can store the first message in the first queue corresponding to the first-class service flow. When the indication information carried by the first message includes identifier B, the network device can determine that the service flow to which the first message belongs is a second-class service flow, and then the network device can store the first message in the second queue corresponding to the second-class service flow.

[0101] It should be noted that the network device can determine whether a service flow is a large flow or a small flow based on the first message obtained from a service flow. Therefore, there will be no situation where a portion of the messages of a service flow is stored in one queue, and then stored in another queue after the large flow is identified. Therefore, no matter how the queue scheduling algorithm (or scheduling policy) is set, the large and small flows will not be out of order, thereby providing a fully flexible configuration policy for the queue used to store messages belonging to the large flow. Optionally, the queue used to store messages belonging to the large flow can be flexibly configured in terms of scheduling algorithm based on specific needs. For example, in terms of message scheduling, the network device can configure the scheduling algorithm for the queue used to store messages belonging to the small flow as the Strict Priority (SP) algorithm, and the scheduling algorithm for the queue used to store messages belonging to the large flow as the Weighted Round Robin (WRR) algorithm, and assign corresponding weights. Alternatively, the scheduling algorithm for the queue used to store messages belonging to the large flow can be configured as the Differential Round Robin (DRR) algorithm, and assign corresponding weights. For another example, in packet scheduling, the network device configures the DRR algorithm as the scheduling algorithm for the queue used to store packets belonging to small flows, and configures a weight of 50. Then the scheduling algorithm configured for the queue used to store packets belonging to large flows is also the DRR algorithm, and is configured with a weight of 10.

[0102] For example, the following takes a network device as a switch and two servers forwarding messages to the switch as an example to introduce the implementation process of the switch performing differentiated scheduling on obtained messages of different types.

[0103] Figure 5 exemplarily illustrates another packet differentiation scheduling diagram provided by an embodiment of the present application. As shown in Figure 5 , port 2 of switch A is configured with multiple queues for storing packets, such as queue 0, queue 1, queue 2, queue 3, queue 4, and queue 5. Among them, switch A pre-sets queue 2 for storing messages belonging to large flows. Assume that server 1 has three messages to be forwarded, namely, message 10, message 11, and message 12, among which the business flows to which messages 10, message 11, and message 12 belong are all small flows, and the indication values ​​contained in the indication information carried by messages 10, message 11, and message 12 are all 0. Assume that server 2 has five messages to be forwarded, namely, message 20, message 21, message 22, message 23, and message 24, among which the business flows to which messages 20, message 21, message 22, and message 23 belong are all large flows, and the indication values ​​contained in the indication information carried by messages 20, message 21, message 22, and message 23 are all 1. The business flow to which message 24 belongs is a small flow, and the indication value contained in the indication information carried by message 24 is 0. Among them, the original QOS priorities corresponding to message 10, message 11, message 12, message 20, message 21, message 22, message 23, and message 24 are the same. For example, when the message scheduling method provided by the present application is not adopted, the network device stores message 10, message 11, message 12, message 20, message 21, message 22, message 23, and message 24 in queue 4. For example, in Figure 4, the QOS priority of queue 0 is less than the QOS priority of queue 1, less than the QOS priority of queue 2, less than the QOS priority of queue 3, less than the QOS priority of queue 4, and less than the QOS priority of queue 5.

[0104] Optionally, when switch A receives a message from server 1 (e.g., message 10), switch A can learn the type of service flow to which message 10 belongs based on the indication information carried in message 10. If the service flow to which message 10 belongs is a low-volume flow, switch A can store message 10 in queue 4 that matches the original QoS priority of message 10. When switch A receives a message from server 2 (e.g., message 20), switch A can learn the type of service flow to which message 20 belongs based on the indication information carried in message 20. If the service flow to which message 20 belongs is a high-volume flow, switch A can store message 20 in queue 2. In this way, the network device can store messages 10, 11, and 12 from server 1 and message 24 from server 2 in queue 4, and can store messages 20, 21, 22, and 23 from server 2 in queue 2.

[0105] Optionally, when storing each message in a queue corresponding to the service flow to which the message belongs, the network device needs to perform storage based on the buffer occupancy of the queue. By way of example, the following uses a first message and a second message as examples to describe several possible implementations of how the network device stores each message based on the acquired buffer occupancy of the storage queue corresponding to the message.

[0106] Implementation Method 1: From a cache management perspective, the network device pre-configures different queue cache thresholds for the first and second queues. For example, the network device can configure a queue cache threshold of half the available cache for the first queue and a queue cache threshold of 10MB for the second queue. When the cache occupancy of the first queue reaches half the available cache, the network device can begin discarding packets arriving in the first queue. When the cache occupancy of the second queue reaches 10MB, the network device can begin discarding packets arriving in the second queue.

[0107] For example, if the service flow to which a first message belongs is a first-class service flow and the first message is stored in a first queue corresponding to the first-class service flow, when the buffer occupancy value of the first queue is less than the queue buffer threshold of the first queue, the network device may store the first message in the first queue. When the buffer occupancy value of the first queue is greater than or equal to the queue buffer threshold of the first queue, the network device discards the first message because it cannot store the first message in the first queue.

[0108] For another example, if the service flow to which the second message belongs is a second-class service flow and the second message is stored in a second queue corresponding to the second-class service flow, when the buffer occupancy value of the second queue is less than the queue buffer threshold of the second queue, the network device may store the second message in the second queue. When the buffer occupancy value of the second queue is greater than or equal to the queue buffer threshold of the second queue, the network device discards the second message because it cannot store the second message in the second queue.

[0109] Implementation method 2: From the perspective of congestion avoidance, the network device pre-configures different packet loss thresholds for the first queue and the second queue.

[0110] For example, continuing to take the case where the business flow to which the first message belongs is the first type of business flow, and the first message is stored in the first queue corresponding to the first type of business flow, when the buffer occupancy value of the first queue is less than the packet loss threshold value of the first queue, the network device can store the first message in the first queue. When the buffer occupancy value of the first queue is greater than or equal to the packet loss threshold value of the first queue and less than or equal to the first set threshold value of the first queue, the network device can selectively discard one or more messages to be stored in the first queue, or can selectively discard one or more messages in the first queue. When the buffer occupancy value of the first queue is greater than the first set threshold value of the first queue, the network device can discard all one or more messages to be stored in the first queue, or can selectively discard one or more messages in the first queue. Among them, the first set threshold value of the first queue is greater than the packet loss threshold value of the first queue.

[0111] For another example, continuing with the example of the business flow to which the second message belongs being a second-class business flow, and the second message being stored in the second queue corresponding to the second-class business flow, when the cache occupancy value of the second queue is less than the packet loss threshold value of the second queue, the network device can store the second message in the second queue. When the cache occupancy value of the second queue is greater than or equal to the packet loss threshold value of the second queue and less than or equal to the second set threshold value of the second queue, the network device can selectively discard one or more messages to be stored in the second queue, or can selectively discard one or more messages in the second queue. When the cache occupancy value of the second queue is greater than the second set threshold value of the second queue, the network device can discard all one or more messages to be stored in the second queue, or can selectively discard one or more messages in the second queue. Among them, the second set threshold value of the second queue is greater than the packet loss threshold value of the second queue.

[0112] Based on the above implementation method 2, the following takes the case where a network device discards packets using a Weighted Random Early Detection (WRED) mechanism as an example to exemplify the implementation scenario where a network device discards packets.

[0113] Because network devices have limited memory resources, traditional processing methods discard all packets arriving in a queue when it reaches its maximum length. For TCP packets, if a large number of packets are discarded by the network device, TCP will time out, triggering TCP's slow start and congestion avoidance mechanisms, causing TCP to reduce packet transmission. When a queue simultaneously discards packets from multiple TCP connections, these connections simultaneously enter slow start and congestion avoidance, a process known as TCP global synchronization. Consequently, the number of packets sent to the queue across multiple TCP connections decreases simultaneously, causing the number of packets arriving in the queue to fall short of the line's transmission rate, thereby reducing line bandwidth utilization. Furthermore, because the number of packets arriving in the queue fluctuates constantly, the number of packets on the network line fluctuates between extremely low and full.

[0114] To address the above issues, network devices can effectively improve overall network performance and avoid port congestion by using the WRED mechanism to discard packets. Optionally, after receiving a packet (e.g., packet a), the network device can use priority mapping to assign a unique identifier to packet a within the network device: a Quality of Service (QOS) priority and a discard priority. The network device can formulate different discard policies based on different discard priorities, whether the packet is TCP, and other factors. Each discard policy can include three parameters: a lower threshold, an upper threshold, and a maximum discard probability. Different QOS priorities are mapped to different queues. This allows users to configure the discard probability for packets stored in queues with lower QOS priorities to be higher than that for packets stored in queues with higher QOS priorities. Thus, the network device can implement different discard policies for queues with different QOS priorities. For example, taking a queue (e.g., queue 2) used to store packets belonging to a large flow, the discard policy adopted by queue 2 is: lower threshold = 150KB, upper threshold = 1MB, and maximum discard probability = 60%. When the buffer occupancy value of queue 2 is less than 150KB, the network device will not discard packets in queue 2 or packets about to arrive at queue 2. When the buffer occupancy value of queue 2 is greater than 1MB, the network device may discard all packets about to arrive at queue 2. When the buffer occupancy value of queue 2 is greater than or equal to 150KB and less than or equal to 1MB, the network device may discard packets about to arrive at queue 2 according to a certain ratio (e.g., a value between 0% and 60%), or may discard packets in queue 2 according to a certain ratio (e.g., a value between 0% and 60%).

[0115] Furthermore, after the network device stores each message in a queue corresponding to the service flow to which the message belongs, it is necessary to perform congestion notification processing for the queue based on the buffer occupancy of the queue in order to enable the message sending server to promptly and accurately understand the congestion status of the messages in the queue (or the message congestion status in the network). For example, the following uses a first message and a second message as examples to describe the implementation process of the network device performing congestion notification processing for each queue based on the buffer occupancy of the queue through the following possible examples.

[0116] Example 1: Taking the service flow to which the first message belongs as the first type of service flow, and the first message being stored in the first queue corresponding to the first type of service flow as an example, after the network device stores the first message in the first queue, when the buffer occupancy value of the first queue is greater than the congestion notification threshold value of the first queue, the network device may add a first congestion notification identifier to the first message. When the buffer occupancy value of the first queue is greater than or equal to a third set threshold value (such as the lower threshold value set in the queue congestion notification policy) and less than or equal to the congestion notification threshold value of the first queue (such as the upper threshold value set in the queue congestion notification policy), the network device may selectively add the first congestion notification identifier to the message that is about to arrive at the first queue, or may selectively add the first congestion notification identifier to the message in the first queue. When the buffer occupancy value of the first queue is less than the third set threshold value, the network device may not add the first congestion notification identifier to the message in the first queue, or may not add the first congestion notification identifier to the message that is about to arrive at the first queue. The third set threshold is smaller than the congestion notification threshold of the first queue, and the first congestion notification flag is used to indicate that congestion exists in the first type of service flow during network forwarding.

[0117] Example 2: Taking the case where the service flow to which the second message belongs is a second-class service flow, and the second message is stored in the second queue corresponding to the second-class service flow as an example, after the network device stores the second message in the second queue, when the buffer occupancy value of the second queue is greater than the congestion notification threshold value of the second queue, the network device may add a second congestion notification identifier to the second message. When the buffer occupancy value of the second queue is greater than or equal to a fourth set threshold value (such as the lower threshold value set in the queue congestion notification policy) and less than or equal to the congestion notification threshold value of the second queue (such as the upper threshold value set in the queue congestion notification policy), the network device may selectively add a second congestion notification identifier to the message that is about to arrive at the second queue, or may selectively add a second congestion notification identifier to the message in the second queue. When the buffer occupancy value of the second queue is less than the fourth set threshold value, the network device may not add the second congestion notification identifier to the message in the second queue, or may not add the second congestion notification identifier to the message that is about to arrive at the second queue. The fourth set threshold is smaller than the congestion notification threshold of the second queue, and the second congestion notification flag is used to indicate that congestion exists in the second type of service flow during network forwarding.

[0118] For example, taking a queue (such as Queue 2) used to store packets belonging to a large flow as an example, the congestion notification policy adopted by Queue 2 is: lower threshold = 250KB, upper threshold = 2MB, maximum marking probability is 70% or the packet forwarding delay threshold is 1.5us. When the buffer occupancy value of Queue 2 is less than 250KB, the network device will not perform congestion notification (Explicit Congestion Notification, ECN) on packets in Queue 2, or will not perform congestion notification marking on packets about to arrive at Queue 2. When the buffer occupancy value of Queue 2 is greater than 2MB, the network device may perform congestion notification marking on all packets about to arrive at Queue 2, or may also perform congestion notification marking on all packets in Queue 2. When the buffer occupancy value of queue 2 is greater than or equal to 250KB and less than or equal to 2MB, the network device can perform congestion notification marking on packets arriving at queue 2 according to a certain ratio (e.g., a value between 0% and 70%), or it can perform congestion notification marking on packets in queue 2 according to a certain ratio (e.g., a value between 0% and 70%). When the buffer occupancy value of queue 2 is greater than or equal to 250KB and less than or equal to 2MB, the network device can also perform congestion notification marking on packets arriving at queue 2 when the packet forwarding delay exceeds the packet forwarding delay threshold of 1.5us.

[0119] For example, taking the example of a network device marking a message (such as message b) that is about to arrive at queue 2 with a congestion notification, the network device can forward the marked message b to a message receiving device (such as a message receiving server) after adding the congestion notification mark to message b. After receiving the marked message b, the message receiving server will make a corresponding response. For example, the message receiving server can send a congestion notification packet (CNP) to the message sending server. The CNP is forwarded to the message sending server by the network device. The CNP is used to notify the sending server to reduce the rate at which messages are sent, thereby alleviating congestion. After receiving the CNP, the message sending server parses the CNP message to obtain the congestion notification mark, and uses the corresponding rate adjustment algorithm based on the congestion notification mark to adjust the message sending rate.

[0120] In one example, after receiving a message, a network device can use the indication information carried by the message to determine the type of service flow to which the message belongs. If the service flow to which the message belongs is a large flow, the network device can configure a traffic policing (Commit Access Rate, CAR) policy for the message. If the service flow to which the message belongs is a small flow, the network device may not configure the CAR policy for the message. The CAR policy is used to monitor the rate at which different traffic flows enter the network and discard traffic that exceeds the rate, so that the actual forwarded traffic bandwidth is limited to a reasonable range, thereby making better use of limited network resources.

[0121] For example, if a packet belongs to a high-volume service flow, the network device configures the CAR policy for the packet with the following configuration: Committed Information Rate (CIR) = 1 Gbps, Peak Information Rate (PIR) = 2 Gbps. If the network device detects that the rate of the high-volume packet entering the port is greater than 2 Gbps, the network device may discard the high-volume packet entering the port. If the network device detects that the rate of the high-volume packet entering the port is less than 2 Gbps, the network device may allow the high-volume packet to pass normally at the original rate.

[0122] In another example, after storing packets belonging to a large flow in a large flow queue and storing packets belonging to a small flow in a small flow queue, the network device can configure corresponding priority-based flow control (PFC) policies for the large flow queue and the small flow queue based on the QoS priority of the large flow queue and the QoS priority of the small flow queue. Optionally, back pressure configuration parameters of the PFC policy may include but are not limited to: xoff or xon.

[0123] For example, take the forwarding of messages between two network devices (e.g., device A and device B) as an example. For example, take the forwarding of message 1 between device A and device B as an example. Device A forwards message 1 from its egress port (e.g., port 0). Message 1 enters the ingress port (e.g., port 1) of device B and is then forwarded from the egress port (e.g., port 2) of device B. Assume that port 0 of device A is configured with two queues, queue 1 and queue 2, where the QOS priority of queue 2 (e.g., level 2) is higher than the QOS priority of queue 1 (e.g., level 1). Assume that port 2 of device B is configured with two queues, queue 3 and queue 4, where the QOS priority of queue 4 (e.g., level 2) is higher than the QOS priority of queue 3 (e.g., level 1). Optionally, taking device A as an example, after obtaining a certain message (such as message 1), device A can determine that the QOS priority of message 1 is level 2 according to the QOS priority mapping table, and can obtain the type of business flow to which message 1 belongs through the indication information carried by message 1. When the business flow to which message 1 belongs is a large flow, message 1 can be stored in a queue with a QOS priority lower than level 2 (such as queue 1 that matches level 1), so that message 1 can be scheduled in queue 1. Optionally, continuing to take device A as an example, after obtaining another message (such as message 2), device A can determine that the QOS priority of message 2 is level 2 according to the QOS priority mapping table, and can obtain the type of business flow to which message 2 belongs through the indication information carried by message 2. When the business flow to which message 2 belongs is a small flow, message 2 can be stored in queue 2 that matches level 2, so that message 2 can be scheduled in queue 2.

[0124] For example, taking device B as an example, device B can configure a PFC backpressure policy for a specific original QOS priority (e.g., level 2) on port 1. For example, the PFC backpressure policy configured by device B for level 2 is: the xoff parameter is set to 1MB, and the xon parameter is set to 990KB. When a high-flow queue (e.g., queue 3, which corresponds to level 1 and is used to store packets with an original QOS priority of level 2, and at this time, a backlog of high-flow packets) becomes congested, and the cache statistics for the original QOS priority of level 2 on port 1 of device B are greater than 1MB, device B can send a PFC backpressure frame to device A through port 1. After receiving the PFC backpressure frame through port 0, device A will stop sending packets with an original QOS priority of level 2 to port 1 of device B. This prevents packets received by device B from device A from being continuously accumulated in the queue of the egress port (e.g., port 2) and being discarded when the tail drop threshold of the queue is reached. When queue 3 is not congested and the cache statistics value of the original QOS priority level 2 on port 1 of device B is less than or equal to 990 KB, device B can send an XON frame to device A through port 1. The XON frame is used to indicate that the PFC back pressure is canceled. In this way, device A can resume sending packets with the original QOS priority level 2 to device B normally.

[0125] Step 204: The network device schedules the messages in the first queue and the second queue according to the scheduling policy of the first queue and the scheduling policy of the second queue.

[0126] Optionally, the network device may pre-configure a scheduling policy for each queue. For example, the network device configures scheduling policy 1 for the first queue and scheduling policy 2 for the second queue. Optionally, in one example, scheduling policy 1 and scheduling policy 2 may be the same; in another example, scheduling policy 1 and scheduling policy 2 may be different.

[0127] Optionally, the network device can store the messages that need to be stored in the first queue in the first queue (for example, the network device stores the messages belonging to the first type of business flow in the first queue), and stores the messages that need to be stored in the second queue in the second queue (for example, the network device stores the messages belonging to the second type of business flow in the second queue), and then schedule the messages in the first queue or the second queue according to the scheduling policy of the first queue and the scheduling policy of the second queue.

[0128] Exemplarily, the scheduling policy may include priority scheduling (such as the SP algorithm) or weight scheduling (such as the WRR algorithm). In one example, taking the priority scheduling as an example, assume that there are three queues, namely queue 1, queue 2, and queue 3, wherein the QOS priority of queue 1 is less than the QOS priority of queue 2 and less than the QOS priority of queue 3. The scheduling policies adopted by queues 1 and 2 are both the SP algorithm, and the scheduling policy adopted by queue 3 is the normal priority algorithm. Since queues 1 and 2 are configured with the SP algorithm, and queue 3 is configured with the normal priority algorithm, the scheduling of packets in queue 1 or queue 2 takes precedence over the scheduling of packets in queue 3. In addition, since the QOS priority of queue 1 is less than the QOS priority of queue 2, the network device can prioritize the scheduling of packets in queue 2, and after determining that all packets in queue 2 have been scheduled, it will start scheduling packets in queue 1. Then, after the network device completes scheduling of all packets in queue 1, it will schedule packets in queue 3.

[0129] In another example, taking the scheduling policy as weight scheduling as an example, assuming there are three queues, namely queue 1, queue 2 and queue 3, where the QOS priority of queue 1 is less than the QOS priority of queue 2 and less than the QOS priority of queue 3, and the scheduling policies adopted by queues 1, queue 2 and queue 3 are all WRR algorithms, where the scheduling weight configured for queue 1 is 30%, the scheduling weight configured for queue 2 is 20%, and the scheduling weight configured for queue 3 is 50%. For example, taking the scheduling weights configured for queues 1, queue 2 and queue 3 as time scheduling weights as an example, the network device performs a message scheduling within a set time (such as 10s), such as using 3s to schedule messages in queue 1, using 2s to schedule messages in queue 2, and using 5s to schedule messages in queue 3. Exemplarily, the network device can first use 3s to schedule messages in queue 1, and after determining that the scheduling of messages in queue 1 meets 3s, it can use 2s to schedule messages in queue 2. Then, after the network device determines that the scheduling of the message in queue 2 meets 2s, it can use 5s to schedule the message in queue 3. Optionally, the network device can also first use 5s to schedule the message in queue 3, and after determining that the scheduling of the message in queue 3 meets 5s, it can use 2s to schedule the message in queue 2. Then, after the network device determines that the scheduling of the message in queue 2 meets 2s, it can use 3s to schedule the message in queue 1. In addition, it should be understood that based on the above implementation, the network device can also use other scheduling orders to schedule the messages in queue 1, queue 2, or queue 3, and the embodiments of the present application will not list them one by one.

[0130] For example, taking the message-differentiated scheduling illustrated in FIG. 4 as an example, when employing the message scheduling method provided herein, in one example, assuming that the QoS priority of queue y is lower than that of queue x, and assuming that both queue x and queue y employ the SP algorithm, since the QoS priority of queue y is lower than that of queue x, the network device may first schedule the messages in queue x, and after scheduling the messages in queue x, schedule the messages in queue y. For example, the network device may sequentially schedule messages b1 and b2 in queue x according to the queue's first-in-first-out scheduling rule. Then, after scheduling messages b1 and b2 in queue x, the network device may schedule messages in queue y. For example, the network device may sequentially schedule messages a1, a2, a3, and a4 in queue y according to the queue's first-in-first-out scheduling rule.

[0131] In another example, assume that the QOS priority of queue y is lower than the QOS priority of queue x, and assume that the scheduling policies adopted by queue x and queue y are both WRR algorithms, wherein the scheduling weight configured for queue x is 70%, and the scheduling weight configured for queue y is 30%. For example, taking the time scheduling weight as an example for the scheduling weights configured for queue x and queue y, the network device performs message scheduling once within a set time (such as 10s), for example, using 7s to schedule messages in queue x and using 3s to schedule messages in queue y. For another example, taking the data volume scheduling weight as an example for the scheduling weights configured for queue x and queue y, the network device schedules messages with a total data volume of m (such as 10) each time it performs message scheduling. Optionally, the network device may first schedule one or more packets with a total data volume of 7 in queue x, and then schedule one or more packets with a total data volume of 3 in queue y, or the network device may first schedule one or more packets with a total data volume of 3 in queue y, and then schedule one or more packets with a total data volume of 7 in queue x. For another example, taking the scheduling weights configured for queue x and queue y as the packet quantity scheduling weight as an example, the network device schedules packets with a number of n (for example, 10) each time it performs packet scheduling. Optionally, the network device may first schedule 7 packets in queue x, and then schedule 3 packets in queue y, or the network device may first schedule 3 packets in queue y, and then schedule 7 packets in queue x.

[0132] For example, taking the message-differentiated scheduling illustrated in FIG5 as an example, when the message scheduling method provided by the present application is employed, in one example, assuming that the QOS priority of queue 4 is higher than the QOS priority of queue 2, and assuming that the scheduling policies adopted by queue 4 and queue 2 are both the SP algorithm, since the QOS priority of queue 4 is higher than the QOS priority of queue 2, the network device may first schedule the messages in queue 4, and after scheduling the messages in queue 4, schedule the messages in queue 2. For example, the network device may schedule messages 10, 11, 12, and 24 in queue 4 in sequence according to the first-in-first-out scheduling rule of the queue. Then, after scheduling messages 10, 11, 12, and 24 in queue 4, the network device may schedule messages 20, 21, 22, and 23 in queue 2 in sequence.

[0133] In another example, assume that the QOS priority of queue 4 is higher than that of queue 2, and assume that both queue 4 and queue 2 use the WRR algorithm for scheduling, where the scheduling weight configured for queue 4 is 70% and the scheduling weight configured for queue 2 is 30%. For example, assuming that the scheduling weights configured for queue 4 and queue 2 are time scheduling weights, the network device performs packet scheduling within a set time (e.g., 10 seconds), for example, using 7 seconds to schedule packets in queue 4 and 3 seconds to schedule packets in queue 2. For another example, assuming that the scheduling weights configured for queue 4 and queue 2 are data volume scheduling weights, the network device schedules packets with a total data volume of m (e.g., 10) each time it performs packet scheduling. The network device may schedule one or more packets with a total data volume of 7 in queue 4 before scheduling one or more packets with a total data volume of 3 in queue 2. Alternatively, the network device may schedule one or more packets with a total data volume of 3 in queue 2 before scheduling one or more packets with a total data volume of 7 in queue 4. For another example, if the scheduling weights configured for queue 4 and queue 2 are packet number scheduling weights, the network device schedules n packets (e.g., 10) each time it schedules packets. Alternatively, the network device may schedule the 7 packets in queue 4 before scheduling the 3 packets in queue 2, or the network device may schedule the 7 packets in queue 2 before scheduling the 7 packets in queue 4.

[0134] It should be noted that in the description of this application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, "at least one of A, B and C" includes A, B, C, AB, AC, BC or ABC. And, unless otherwise specified, the ordinal numbers such as "first", "second", and "third" mentioned in the embodiments of this application are used to distinguish multiple objects and are not used to limit the order, timing, priority or importance of multiple objects. In addition, the terms "including", "comprising", "having" and their variations appearing in this application all mean "including but not limited to" unless otherwise specifically emphasized.

[0135] In addition, it should be noted that each step involved in the above embodiments can be performed by a corresponding device, or by a component such as a chip, processor, or chip system within the device, and the embodiments of the present application do not limit this. The above embodiments are described only as examples of execution by corresponding devices.

[0136] It should be noted that in each of the above embodiments, some steps may be selected for implementation, and the order of the steps in the diagrams may be adjusted for implementation, and this application does not limit this. It should be understood that executing some of the steps in the diagrams, adjusting the order of the steps, or combining them for specific implementation all fall within the scope of protection of this application.

[0137] It is understandable that in order to implement the functions in the above embodiments, the various devices involved in the above embodiments include hardware structures and / or software modules corresponding to the execution of each function. It should be readily apparent to those skilled in the art that, in combination with the units and method steps of the various examples described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.

[0138] It should be noted that the "steps" in the embodiments of this application are merely illustrative and serve as a method of expression for a better understanding of the embodiments. They do not constitute a substantial limitation on the execution of the solutions of this application. For example, the "steps" can also be understood as "features." Furthermore, the steps do not constitute any limitation on the execution order of the solutions of this application. Any changes to the order of steps, or any operations such as step merging or splitting that do not affect the implementation of the overall solution, resulting in new technical solutions, are also within the scope of this application.

[0139] Based on the same concept, an embodiment of the present application also provides a possible network device, which is suitable for the application scenario illustrated in Figure 1. The network device is used to implement the message scheduling method provided in the above embodiment, or the module (such as a chip) of the network device is used to implement the message scheduling method provided in the above embodiment, thereby also achieving the beneficial effects of the above embodiment. In an embodiment of the present application, the network device can be a switch as illustrated in Figure 1.

[0140] 6 , the network device 600 includes a transceiver module 601 , a processing module 602 , a scheduling module 603 and multiple queues (eg, a first queue and a second queue).

[0141] The transceiver module 601 is configured to obtain multiple messages, each message carrying indication information indicating the type of service flow to which the message belongs. The specific implementation of the transceiver module 601 obtaining the multiple messages can be found in the detailed description of the network device obtaining the multiple messages in step 201 above, and will not be repeated here.

[0142] The processing module 602 is configured to store the first message in a first queue corresponding to the service flow to which the first message belongs, based on the indication information carried by the first message. Optionally, the specific implementation of the processing module 602 storing the first message in the first queue corresponding to the service flow to which the first message belongs, based on the indication information carried by the first message, can be found in the detailed description of the network device storing the first message in the first queue corresponding to the service flow to which the first message belongs, based on the indication information carried by the first message, in step 202 above, and will not be further described here.

[0143] The processing module 602 is further configured to store the second message in a second queue corresponding to the service flow to which the second message belongs, based on the indication information carried by the second message. Optionally, the specific implementation of the processing module 602 storing the second message in the second queue corresponding to the service flow to which the second message belongs, based on the indication information carried by the second message, can be found in the detailed description of the network device storing the second message in the second queue corresponding to the service flow to which the second message belongs, based on the indication information carried by the second message, in step 203 above, and will not be further described here.

[0144] The scheduling module 603 is configured to schedule the messages in the first queue and the second queue according to the scheduling policy of the first queue and the scheduling policy of the second queue. The QoS priority of the first queue is different from the QoS priority of the second queue. Optionally, the specific implementation of the scheduling module 603 scheduling the messages in the first queue and the second queue according to the scheduling policy of the first queue and the scheduling policy of the second queue can be found in the detailed description of the network device scheduling the messages in the first queue and the second queue according to the scheduling policy of the first queue and the scheduling policy of the second queue in step 204 above, which will not be repeated here.

[0145] Optionally, the transceiver module 601, processing module 602, and scheduling module 603 shown in FIG6 can all be implemented via software or hardware. Exemplarily, the implementation of processing module 602 will be described below using processing module 602 as an example. Similarly, the implementation of transceiver module 601 and scheduling module 603 can refer to the implementation of processing module 602 and will not be further described here.

[0146] When implemented by software, the module is an example of a software functional unit, and the processing module 602 can be an application or code block running on a computer device. The computer device can be at least one of a physical host, a virtual machine, a container and other computing devices. Furthermore, the above-mentioned computer device can be one or more. For example, the processing module 602 can be an application running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the application can be distributed in the same availability zone (AZ) or in different AZs. The multiple hosts / virtual machines / containers used to run the application can be distributed in the same region or in different regions. Generally, a region can include multiple AZs.

[0147] Similarly, multiple hosts / virtual machines / containers used to run the application can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Typically, a region can include multiple VPCs, and a VPC can include multiple AZs.

[0148] When implemented in hardware, a module is used as an example of a hardware functional unit, and processing module 602 may include at least one computing device, such as a server. Alternatively, processing module 602 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0149] The multiple computing devices included in processing module 602 can be distributed in the same AZ or in different AZs. The multiple computing devices included in processing module 602 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in processing module 602 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.

[0150] It should be noted that, in other embodiments, the transceiver module 601 can also be used to execute any step of the network device in the message scheduling method shown in Figure 2, and the processing module 602 and the scheduling module 603 can also be used to execute any step of the network device in the message scheduling method shown in Figure 2. The steps that the transceiver module 601, the processing module 602 and the scheduling module 603 are responsible for implementing can be specified as needed. The transceiver module 601, the processing module 602 and the scheduling module 603 respectively implement different execution steps of the network device in the message scheduling method shown in Figure 2 to realize all the functions of the network device 600.

[0151] In addition, it should be noted that the division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. The functional modules in the embodiments of the present application can be integrated into one module, or each module can exist physically separately, or two or more modules can be integrated into one module, for example, the first receiving module and the second receiving module are integrated into one module, or the first receiving module and the second receiving module are the same module. Similarly, the first determining module and the second determining module are integrated into one module, or the first determining module and the second determining module are the same module. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0152] Based on the same concept, an embodiment of the present application also provides a possible network device, which is suitable for the application scenario shown in Figure 1. The network device is used to implement the message scheduling method provided in the above embodiment, and therefore can also achieve the beneficial effects of the above method embodiment. Referring to Figure 7, the network device 700 includes: a bus 701, a processor 702, a memory 703 and a communication interface 704. The processor 702, the memory 703 and the communication interface 704 communicate with each other through the bus 701. The network device 700 can be a switch, a router or a forwarding chip. It should be understood that the present application does not limit the number of processors and memories in the network device 700.

[0153] Bus 701 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG7 shows only one line, but this does not imply that there is only one bus or only one type of bus. Bus 701 may include a path for transmitting information between various components of network device 700 (e.g., memory 703, processor 702, and communication interface 704).

[0154] The processor 702 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0155] The memory 703 may include a volatile memory, such as a random access memory (RAM). The processor 702 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0156] The memory 703 stores executable program code, and the processor 702 executes the executable program code to respectively implement the functions of the aforementioned transceiver module 601, processing module 602, and scheduling module 603, thereby implementing the message scheduling method. In other words, the memory 703 stores computer program instructions for the network device 700 to execute the message scheduling method provided in this application.

[0157] The communication interface 704 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the network device 700 and other devices or communication networks.

[0158] Based on the same concept, an embodiment of the present application further provides a computer program product comprising instructions. The computer program product may be software or a program product comprising instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the message scheduling method provided in the present application.

[0159] Based on the same concept, an embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the message scheduling method provided in this application.

[0160] Based on the same concept, an embodiment of the present application further provides a chip, which is coupled to a memory and is used to read a computer program stored in the memory to implement the message scheduling method provided in the above embodiment.

[0161] Finally, it should be noted that 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 protection scope of the technical solutions of the embodiments of the present application.

Claims

1. A message scheduling method, characterized in that: include: The network device obtains multiple messages, each of which carries indication information for indicating the type of service flow to which the message belongs; The network device stores the first message in a first queue corresponding to the service flow to which the first message belongs according to the indication information carried by the first message; The network device stores the second message in a second queue corresponding to the service flow to which the second message belongs according to the indication information carried by the second message; The network device schedules the messages in the first queue and the second queue according to the scheduling policy of the first queue and the scheduling policy of the second queue; The quality of service (QOS) priority of the first queue is different from the quality of service (QOS) priority of the second queue.

2. The method according to claim 1, characterized in that The indication information carried in each message includes first information for indicating the amount of data of the service flow to which the message belongs; the method further includes: When the first information indicates that the data volume of the service flow to which the message belongs is within a first numerical range, the network device determines that the service flow to which the message belongs is a first type of service flow; or When the first information indicates that the data volume of the service flow to which the message belongs is within a second numerical range, the network device determines that the service flow to which the message belongs is a second type of service flow; Among them, any value in the first numerical range is greater than any value in the second numerical range.

3. The method according to claim 1 or 2, characterized in that The indication information carried in each message includes second information for indicating the service type of the service flow to which the message belongs; the method further includes: When the second information indicates that the service type of the service flow to which the message belongs is throughput-sensitive, the network device determines that the service flow to which the message belongs is a first-class service flow; or When the second information indicates that the service type of the service flow to which the message belongs is delay-sensitive, the network device determines that the service flow to which the message belongs is a second-type service flow.

4. The method according to claim 2 or 3, characterized in that The first type of business flow is a business flow with a flow rate greater than a first threshold, and the second type of business flow is a business flow with a flow rate less than or equal to the first threshold.

5. The method according to any one of claims 1 to 4, characterized in that: The indication information carried in each message is carried in a setting field of the message.

6. The method according to claim 5, characterized in that The setting field also includes QOS priority indication information, and the QOS priority indication information is used to indicate the original QOS priority of the service flow to which the message belongs.

7. The method according to any one of claims 1 to 6, characterized in that: Storing the first message in a first queue corresponding to a service flow to which the first message belongs includes: When the buffer occupancy value of the first queue is less than the queue buffer threshold of the first queue, the network device stores the first message in the first queue; Storing the second message in a second queue corresponding to the service flow to which the second message belongs includes: When the buffer occupancy value of the second queue is less than the queue buffer threshold of the second queue, the network device stores the second message in the second queue.

8. The method according to any one of claims 1 to 6, characterized in that: Storing the first message in a first queue corresponding to a service flow to which the first message belongs includes: When the buffer occupancy value of the first queue is less than the packet loss threshold value of the first queue, the network device stores the first message in the first queue; Storing the second message in a second queue corresponding to the service flow to which the second message belongs includes: When the buffer occupancy value of the second queue is less than the packet loss threshold value of the second queue, the network device stores the second message in the second queue.

9. The method according to any one of claims 1 to 8, characterized in that After storing the first message in a first queue corresponding to a service flow to which the first message belongs, the method further includes: When the buffer occupancy value of the first queue is greater than the congestion notification threshold value of the first queue, the network device responds to the first report The first congestion notification indicator is added to the document; After storing the second message in a second queue corresponding to the service flow to which the second message belongs, the method further includes: When the buffer occupancy value of the second queue is greater than the congestion notification threshold value of the second queue, the network device adds a second congestion notification identifier to the second message; The first congestion notification identifier is used to indicate that the service flow to which the first message belongs is congested during network forwarding, and the second congestion notification identifier is used to indicate that the service flow to which the second message belongs is congested during network forwarding.

10. A network device, characterized in that: include: A transceiver module, used to obtain multiple messages, each message carrying indication information for indicating the type of service flow to which the message belongs; a processing module, configured to store the first message in a first queue corresponding to a service flow to which the first message belongs according to indication information carried by the first message; and store the second message in a second queue corresponding to a service flow to which the second message belongs according to indication information carried by the second message; A scheduling module, used to schedule the messages in the first queue and the second queue according to the scheduling policy of the first queue and the scheduling policy of the second queue; wherein the quality of service QOS priority of the first queue is different from the QOS priority of the second queue.

11. The network device according to claim 10, characterized in that: The indication information carried in each message includes first information for indicating the data volume of the service flow to which the message belongs; The processing module is also used for: When the first information indicates that the data volume of the service flow to which the message belongs is within a first value range, determining that the service flow to which the message belongs is a first-category service flow; or When the first information indicates that the data volume of the service flow to which the message belongs is within a second numerical range, determining that the service flow to which the message belongs is a second-category service flow; Among them, any value in the first numerical range is greater than any value in the second numerical range.

12. The network device according to claim 10 or 11, characterized in that: The indication information carried in each message includes second information for indicating the service type of the service flow to which the message belongs; The processing module is also used for: When the second information indicates that the service type of the service flow to which the message belongs is throughput-sensitive, determining that the service flow to which the message belongs is a first-class service flow; or When the second information indicates that the service type of the service flow to which the message belongs is delay-sensitive, it is determined that the service flow to which the message belongs is a second-type service flow.

13. The network device according to any one of claims 10 to 12, characterized in that: When the processing module stores the first message in the first queue corresponding to the service flow to which the first message belongs, the processing module is specifically configured to: When the buffer occupancy value of the first queue is less than the queue buffer threshold of the first queue, storing the first message in the first queue; When the processing module stores the second message in the second queue corresponding to the service flow to which the second message belongs, the processing module is specifically configured to: When the buffer occupancy value of the second queue is less than the queue buffer threshold of the second queue, the second message is stored in the second queue.

14. The network device according to any one of claims 10 to 12, characterized in that: When the processing module stores the first message in the first queue corresponding to the service flow to which the first message belongs, the processing module is specifically configured to: When the buffer occupancy value of the first queue is less than the packet loss threshold value of the first queue, storing the first message in the first queue; When the processing module stores the second message in the second queue corresponding to the service flow to which the second message belongs, the processing module is specifically configured to: When the buffer occupancy value of the second queue is less than the packet loss threshold value of the second queue, the second message is stored in the second queue.

15. The network device according to any one of claims 10 to 14, characterized in that: After storing the first message in the first queue corresponding to the service flow to which the first message belongs, the processing module is further configured to: When the buffer occupancy value of the first queue is greater than the congestion notification threshold value of the first queue, adding a first congestion notification identifier to the first message; After storing the second message in the second queue corresponding to the service flow to which the second message belongs, the processing module is further configured to: When the buffer occupancy value of the second queue is greater than the congestion notification threshold value of the second queue, adding a second congestion notification identifier to the second message; The first congestion notification identifier is used to indicate that the service flow to which the first message belongs is congested during network forwarding, and the second congestion notification identifier is used to indicate that the service flow to which the second message belongs is congested during network forwarding.

16. A network device, characterized in that: include: Communication interface, used to receive and send data; Memory for storing computer program instructions and data; A processor is used to execute and call the computer program instructions and data in the memory so that the network device executes the method as described in any one of claims 1-9.

17. A computer program product comprising instructions, characterized in that When the instruction is executed by a network device, the network device executes the method according to any one of claims 1 to 9.

18. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a network device, the network device performs the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Service scheduling method and service scheduling device based on Layer 2 Virtual Private Networks (L2VPN)

    CN102546395A

  • Service flow transmission method and network device

    CN105847176A

  • Method and device for controlling flow in packet network

    CN110166367A

  • Scheduled transmission of data

    US20140269270A1

Cited By

  • RDMA message congestion control method and network card

    CN122601572A