Message forwarding method and apparatus, and communication system and related product

By distinguishing between long-distance and short-distance traffic in the messages and prioritizing the processing of long-distance traffic, the problem of high packet loss rate of long-distance traffic is solved, and the communication stability between data centers and the training efficiency of AI models are improved.

WO2026086630A1PCT designated stage Publication Date: 2026-04-30HUAWEI TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2025-10-13
Publication Date
2026-04-30

AI Technical Summary

Technical Problem

In long-distance traffic transmission between different data centers, existing technologies struggle to effectively avoid packet loss, especially in remote direct memory access protocols, where the packet loss rate is high, leading to a decline in AI model training performance.

Method used

By setting different field values ​​in the message to distinguish between long-distance and short-distance traffic, and caching them into queues of different priorities, long-distance traffic is sent first, reducing packet loss rate.

Benefits of technology

It effectively reduced packet loss rate in long-distance traffic and improved communication stability between data centers and the performance of AI model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025127403_30042026_PF_FP_ABST
    Figure CN2025127403_30042026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed are a message forwarding method and apparatus, and a communication system and a related product, which belong to the technical field of AI. In the embodiments of the present application, a first apparatus can identify, by means of the value of a first field in a message, whether the message belongs to messages in first-type traffic or messages in second-type traffic, wherein the first-type traffic is traffic exchanged between apparatuses in different data centers, that is, long-distance traffic, and the second-type traffic is traffic exchanged between apparatuses in the same data center, that is, short-distance traffic. Furthermore, a long-distance traffic message and a short-distance traffic message are cached in different queues, such that the short-distance traffic can be prevented from preempting the cache space of the long-distance traffic at the first apparatus, thereby reducing the probability of packet loss of the long-distance traffic. In addition, the priority of a first queue is higher than the priority of a second queue, such that the first apparatus preferentially schedules a message in the first queue for sending, thereby further reducing the probability of packet loss of the long-distance traffic.
Need to check novelty before this filing date? Find Prior Art

Description

Message forwarding methods, devices, communication systems and related products

[0001] This application claims priority to Chinese Patent Application No. 202411476910.7, filed on October 21, 2024, entitled "Message Forwarding Method, Apparatus, Communication System and Related Products", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of artificial intelligence (AI) technology, and in particular to a message forwarding method, apparatus, communication system and related products. Background Technology

[0003] As AI models grow in scale, their training can be completed through collaboration among multiple data centers to improve training performance. In this scenario, a switch within one data center may receive traffic from other data centers, with distances between these data centers reaching tens or even hundreds of kilometers. Ensuring no packet loss over such long distances is a current research hotspot. Summary of the Invention

[0004] This application provides a message forwarding method, apparatus, communication system, and related products, which can reduce the probability of packet loss in long-distance traffic. The technical solution is as follows:

[0005] Firstly, a message forwarding method is provided. In this method, a first device receives a first message, which includes a first field. The value of the first field in the first message is a first value, indicating that the first message belongs to a message in a first type of traffic, where the first type of traffic is traffic exchanged between devices in different data centers. The first device receives a second message, which includes a first field. The value of the first field in the second message is a second value, indicating that the second message belongs to a message in a second type of traffic, where the second type of traffic is traffic exchanged between devices within the same data center. The first device caches the first message in a first queue based on the first value and caches the second message in a second queue based on the second value. The first queue is used to cache messages of the first type of traffic, and the second queue is used to cache messages of the second type of traffic. The priority of the first queue is higher than the priority of the second queue. The first device sends the first message from the first queue and the second queue based on the priority of the first queue and the priority of the second queue. After sending the first message, the first device sends the second message.

[0006] In the packet forwarding method provided in this application embodiment, the packet received by the first device includes a first field. The first device can identify whether the packet belongs to a first type of traffic or a second type of traffic by the value of the first field in the packet. The first type of traffic is traffic exchanged between devices in different data centers, i.e., long-distance traffic; the second type of traffic is traffic exchanged between devices within the same data center, i.e., short-distance traffic. Furthermore, long-distance traffic packets and short-distance traffic packets are cached in different queues. This avoids short-distance traffic preempting the cache space of long-distance traffic at the first device, thereby reducing the probability of packet loss in long-distance traffic.

[0007] Furthermore, in this embodiment, the priority of the first queue is higher than that of the second queue. Therefore, when the first device sends messages in the first queue and the second queue, it will prioritize sending the first message in the first queue, which further reduces the probability of packet loss in long-distance traffic.

[0008] In one possible implementation, the first field includes a Differential Service Code Point (DSCP) field, with a first value being a first DSCP and a second value being a second DSCP, and the first DSCP being different from the second DSCP.

[0009] In one possible implementation, the first field includes a priority PRI field, where the first value is first PRI and the second value is second PRI, and the first PRI and the second PRI are different.

[0010] Considering that packets typically carry a Quality of Service (QoS) field, this embodiment of the application can select a QoS field as the first field, and mark the value of the first field in the first type of traffic and / or the first field in the second type of traffic, so that other devices can identify whether the packet belongs to the first type of traffic or the second type of traffic through the value of the first field.

[0011] The QoS field can be either a DSCP field or a PRI field, which further improves the application flexibility of the embodiments of this application.

[0012] In one possible implementation, the first message also includes a second field, which takes a second value. The second value of the second field is used by subsequent devices to recover the value of the first field in the first message.

[0013] In a scenario where the labeling is completed by modifying the value of the first field included in a packet of the first type of traffic, to avoid the need to reuse the original value of the first field later, the labeled packet also includes a second field, which takes the value of a second field. That is, the value of the first field included in the original packet, i.e., the second value, is carried in another second field. Therefore, the first type of traffic packets received by the first device also include a second field.

[0014] In one possible implementation, the first device is a data forwarding device at the entrance of the first data center.

[0015] In this embodiment of the application, the data forwarding device at the entrance of the first data center can achieve flexible scheduling of the two types of traffic through the solution provided in the first aspect, thereby reducing the probability of packet loss in long-distance traffic.

[0016] Secondly, a message forwarding method is provided, in which a second device receives a message; the second device marks the message to obtain a marked message, the marked message including a first field, wherein if the message belongs to a first type of traffic, the value of the first field in the marked message is a first value, the first value being used to indicate that the marked message belongs to a first type of traffic, the first type of traffic being traffic exchanged between devices in different data centers; or, if the message belongs to a second type of traffic, the value of the first field in the marked message is a second value, the second value being used to indicate that the marked message belongs to a second type of traffic, the second type of traffic being traffic exchanged between devices within the same data center; and the second device sends the marked message.

[0017] In the message forwarding method provided in this application embodiment, by marking the message through the second device, the value of the first field included in the message in the first type of traffic can be made different from the value of the first field included in the message in the second type of traffic. The first type of traffic is traffic exchanged between devices in different data centers, i.e., long-distance traffic; the second type of traffic is traffic exchanged between devices within the same data center, i.e., short-distance traffic.

[0018] In one possible implementation, the first field includes a Differential Service Code Point (DSCP) field, with a first value being a first DSCP and a second value being a second DSCP, the first DSCP being different from the second DSCP.

[0019] In one possible implementation, the first field includes a priority PRI field, where the first value is first PRI and the second value is second PRI, and the first PRI and the second PRI are different.

[0020] The implementation method of the first field in the message can be referred to the technical effect of the message forwarding method provided in the first aspect, and will not be repeated here.

[0021] In one possible implementation, the message before marking includes a first field, and the value of the first field in the message before marking is a second value; the second device marks the message as follows: if the message belongs to the first type of traffic, the value of the first field is changed from the second value to the first value.

[0022] In this embodiment of the application, only the value of the first field included in the message of the first type of traffic needs to be changed, that is, only long-distance traffic needs to be marked, which simplifies the operation of the second device.

[0023] In one possible implementation, the tagged message also includes a second field, which takes a second value. This second value is used by subsequent devices to restore the value of the first field in the tagged message.

[0024] In scenarios where the labeling is completed by modifying the value of the first field in a packet of type 1 traffic, a second field is added to the labeled packet to avoid the need to reuse the original value of the first field later. The value of the second field is a second value. In other words, the value of the first field in the original packet, which is also the second value, is carried in another second field.

[0025] In one possible implementation, the second device is a data forwarding device at the entrance of the first data center; or, the second device is a data forwarding device at the exit of the second data center.

[0026] In this embodiment, when traffic from one data center is sent to another, the traffic can be marked by the data forwarding device at the exit of the first data center. Optionally, the traffic can also be marked by the data forwarding device at the entrance of the second data center.

[0027] Thirdly, a message forwarding method is provided, in which a third device in a first data center receives a message from the first device in the first data center. The message includes a first field, the value of which is a first value, used to indicate that the message belongs to a first type of traffic, where the first type of traffic is traffic exchanged between devices in different data centers; or, the value of which is a second value, used to indicate that the message belongs to a second type of traffic, where the second type of traffic is traffic exchanged between devices within the same data center; the third device updates the value of the first field in the message to a target value; and the third device sends the updated message.

[0028] In this embodiment of the application, if the second device marks the message by changing the value of the first field, in order to prevent the marked message from being successfully recognized by the terminal device in the data center, the third device can also de-mark the message after receiving the message from the second device, thereby preventing the message from being unrecognizable by the terminal device.

[0029] In one possible implementation, the target value is the second value; the process by which the third device updates the value of the first field in the message to the target value is as follows: if the value of the first field in the message is the first value, the value of the first field is updated from the first value to the second value.

[0030] In a scenario where the value of the first field included in a packet of the first type of traffic is changed to complete the marking, since the first field included in the packet of the first type of traffic is changed from the second value to the first value, the value of the first field needs to be changed back to the original second value during the demarking operation.

[0031] In one possible implementation, the message also includes a second field, the value of which is a second value; in this method, the third device can also obtain the second value from the second field, and the second value of the second field is used by the third device to update the value of the first field in the message.

[0032] In scenarios where a second value is recorded in the message, the third device can directly obtain the second value from the message and then update the value of the first field based on the obtained second value.

[0033] In one possible implementation, a flow rate level value is configured at the third device; in this method, the third device can also determine a second value based on the flow rate level value, and then update the value of the first field based on the obtained second value.

[0034] In scenarios where the second value is not recorded in the message, the third device can determine the second value based on the configuration of the local device.

[0035] In one possible implementation, the third device is a data forwarding device that is directly connected to the terminal device in the first data center.

[0036] In this context, "direct connection between the third device and the terminal device" can be understood as follows: messages sent by the third device to the terminal device will directly reach the terminal device without needing to be forwarded by other data forwarding devices. In other words, the third device is the last-hop data forwarding device on the forwarding path of the message.

[0037] Fourthly, a message forwarding device is provided, which is applied to a first device and has the function of implementing the message forwarding method behavior described in the first aspect. The message forwarding device includes at least one module for implementing the message forwarding method provided in the first aspect.

[0038] Fifthly, another message forwarding device is provided, which is applied to the second device and has the function of implementing the message forwarding method behavior described in the second aspect. The message forwarding device includes at least one module for implementing the message forwarding method provided in the second aspect.

[0039] Sixthly, another message forwarding device is provided, which is applied to the third device and has the function of implementing the message forwarding method behavior described in the third aspect. The message forwarding device includes at least one module for implementing the message forwarding method provided in the third aspect.

[0040] A seventh aspect provides a message forwarding apparatus, including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory to cause the message forwarding apparatus to perform the method provided by the first aspect or any alternative method of the first aspect, or to perform the method provided by the second aspect or any alternative method of the second aspect, or to perform the method provided by the third aspect or any alternative method of the third aspect.

[0041] Eighthly, a message forwarding apparatus is provided, including a main control board and an interface board, the main control board and the interface board being used to implement the method provided by the first aspect or any optional method of the first aspect, or to implement the method provided by the second aspect or any optional method of the second aspect, or to execute the method provided by the third aspect or any optional method of the third aspect.

[0042] A ninth aspect provides a communication system including a first device and a second device, and may further include a third device. The first device includes the device provided as in the fourth aspect or any alternative to the fourth aspect above, the second device includes the device provided as in the fifth aspect or any alternative to the fifth aspect above, and the third device includes the device provided as in the sixth aspect or any alternative to the sixth aspect above; or, at least one of the first device, the second device, and the third device includes the device provided as in the seventh or eighth aspect above.

[0043] A tenth aspect provides another communication system, including a first device and a third device, and may further include a second device. The first device includes the device provided as in the fourth aspect or any alternative to the fourth aspect above, the second device includes the device provided as in the fifth aspect or any alternative to the fifth aspect above, and the third device includes the device provided as in the sixth aspect or any alternative to the sixth aspect above; or, at least one of the first device, the second device, and the third device includes the device provided as in the seventh or eighth aspect above.

[0044] Eleventhly, a computer-readable storage medium is provided, which stores a computer program that, when executed, implements the method provided by the first aspect or any alternative method of the first aspect, or implements the method provided by the second aspect or any alternative method of the second aspect, or performs the method provided by the third aspect or any alternative method of the third aspect.

[0045] In a twelfth aspect, a computer program product is provided, comprising a program or code that, when executed, implements the method provided by the first aspect or any alternative method of the first aspect, or implements the method provided by the second aspect or any alternative method of the second aspect, or performs the method provided by the third aspect or any alternative method of the third aspect.

[0046] In a thirteenth aspect, a chip is provided that, when operating, implements the method provided by the first aspect or any alternative method of the first aspect, or implements the method provided by the second aspect or any alternative method of the second aspect, or performs the method provided by the third aspect or any alternative method of the third aspect.

[0047] Optionally, the chip includes programmable logic circuitry and / or program instructions.

[0048] Optionally, the chip is a network processor (NP) chip.

[0049] The technical effects of the fourth to thirteenth aspects mentioned above can be referred to the technical effects of the first aspect and any optional implementation of the first aspect, as well as the technical effects of the second aspect and any optional implementation of the second aspect, and the technical effects of the third aspect and any optional implementation of the third aspect, which will not be elaborated here. Attached Figure Description

[0050] Figure 1 is a schematic diagram of the architecture of a communication system provided in an embodiment of this application;

[0051] Figure 2 is a schematic diagram of another architecture of the communication system provided in an embodiment of this application;

[0052] Figure 3 is a schematic diagram of another architecture of the communication system provided in an embodiment of this application;

[0053] Figure 4 is a schematic diagram of the architecture of a computing cluster for training AI models provided in an embodiment of this application;

[0054] Figure 5 is a flowchart of a message forwarding method provided in an embodiment of this application;

[0055] Figure 6 is a schematic diagram of the format of a message including a DSCP field provided in an embodiment of this application;

[0056] Figure 7 is a schematic diagram of the format of the reserved field included in the BTH of a message provided in an embodiment of this application;

[0057] Figure 8 is a schematic diagram of a message format including a PRI field provided in an embodiment of this application;

[0058] Figure 9 is a flowchart of another message forwarding method provided in an embodiment of this application;

[0059] Figure 10 is a flowchart of another message forwarding method provided in an embodiment of this application;

[0060] Figure 11 is a schematic diagram of a message forwarding process provided in an embodiment of this application;

[0061] Figure 12 is a schematic diagram of a message forwarding device 1200 provided in an embodiment of this application;

[0062] Figure 13 is a schematic diagram of another message forwarding device 1300 provided in an embodiment of this application;

[0063] Figure 14 is a schematic diagram of another message forwarding device 1400 provided in an embodiment of this application. Detailed Implementation

[0064] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0065] Before explaining the embodiments of this application, the technical terms and application scenarios involved in the embodiments of this application will be explained first.

[0066] A data center is a complex set of facilities used for the centralized processing, storage, transmission, exchange, and management of data. This complex set of facilities typically includes servers, storage devices, switches, routers, firewalls, and other equipment. For example, if this complex set of facilities is configured in each of several different regions, each of these regions can be called a data center. These regions could be different cities, different districts within the same city, or different buildings. Similarly, if this complex set of facilities is configured in each of several different server rooms, each of these server rooms can be called a data center. Even a single rack within the same server room can be considered a data center; different racks within the same server room are called different data centers.

[0067] Long-distance and short-distance traffic: Since the distance between different data centers is often tens or even hundreds of kilometers, the traffic between devices in different data centers can be called long-distance traffic, while the traffic between devices within the same data center can be called short-distance traffic. For example, if data center 1 includes device 1 and device 2, and data center 2 includes device 3, then the traffic between device 1 and device 3, as well as the traffic between device 2 and device 3, can be called long-distance traffic, while the traffic between device 1 and device 2 can be called short-distance traffic.

[0068] With the development of artificial intelligence technology, AI models such as large language models (LLM) have significant research and commercial value. The effectiveness of an AI model is closely related to its scale, which can include the size of the number of parameters and / or the size of the training data.

[0069] In recent years, the scale of AI models has grown rapidly, and the scale of the computing power clusters required to train these models has also increased accordingly. For example, the computing power cluster required to train an LLM (Limited Learning Model) may exceed tens of thousands or even hundreds of thousands of graphics processing units (GPUs). Currently, the computing power clusters needed to train AI models can be obtained by connecting multiple existing data centers over long distances via networks. This technology for training AI models using such computing power clusters is therefore also known as remote training technology. On the one hand, remote training technology can integrate fragmented computing power to obtain the computing power clusters needed to train AI models, which can not only improve the resource utilization of data centers but also reduce the deployment cost of computing power clusters. On the other hand, some enterprises, for security and privacy reasons, may need to use both their own computing power and rented public computing power. In this scenario, remote training technology can be used to integrate the enterprise's own computing power and rented public computing power, thereby enabling the training of large-scale AI models while protecting enterprise privacy.

[0070] In scenarios where AI models are trained using remote training techniques, the low latency and high bandwidth requirements of data centers necessitate the use of the Remote Direct Memory Access (RDMA) protocol for data transmission. However, RDMA is highly sensitive to packet loss. When the source end of the packet transmission detects packet loss, the go-back-N mechanism in RDMA is triggered, causing the source to retransmit all packets from the point of loss, resulting in significant bandwidth waste. Furthermore, when the network packet loss rate exceeds 0.1%, the effective throughput of data transmitted via RDMA drops sharply, leading to a decline in the training performance of the AI ​​model. Therefore, congestion control is needed for traffic transmitted over long-distance links across data centers in remote training techniques—that is, long-distance traffic—to avoid performance degradation caused by packet loss.

[0071] Furthermore, in scenarios involving remote training technology, the distance between data centers can reach tens or even hundreds of kilometers, resulting in round-trip latency for data center transmissions reaching millisecond levels—an order-of-magnitude increase compared to the microsecond-level latency of intra-data center transmissions. Achieving packet loss-free long-distance traffic transmission over such long distances presents a significant challenge.

[0072] In some scenarios, data center devices can use priority-based flow control (PFC) to manage congestion in the aforementioned long-distance traffic. In PFC, the device is configured with eight priorities, and a queue is maintained for each priority. Each queue buffers packets of that priority, and each queue corresponds to a PFC OFF waterline. For any queue, when the queue length exceeds the corresponding PFC OFF waterline, the device sends a backpressure signal to the upstream device, causing the upstream device to stop transmitting data. Subsequently, when the queue length falls below the corresponding PFC ON waterline, the device stops sending backpressure signals to the upstream device, allowing the upstream device to resume data transmission.

[0073] For any device within a data center, during the training process of an AI model, once the device receives traffic during the training process, regardless of whether the traffic is short-distance traffic within the same data center or long-distance traffic transmitted between different data centers, both types of traffic will be cached in the same priority queue, thereby achieving congestion control for long-distance traffic.

[0074] Specifically, during the period between when the device sends the backpressure signal and when the upstream device actually begins to reduce its transmission rate, the queue needs to be able to buffer the long-distance traffic received during this time. However, since long-distance and short-distance traffic are buffered in the same queue, short-distance traffic will preempt the buffer space of long-distance traffic in the queue. This will lead to insufficient buffer space for long-distance traffic in the queue, resulting in packet loss of long-distance traffic.

[0075] Based on this, embodiments of this application provide a packet forwarding method. In the packet forwarding method provided in this application embodiment, the packet received by the first device includes a first field. The first device can identify whether the packet belongs to a first type of traffic or a second type of traffic by the value of the first field in the packet. The first type of traffic is traffic exchanged between devices in different data centers, i.e., long-distance traffic; the second type of traffic is traffic exchanged between devices within the same data center, i.e., short-distance traffic. Furthermore, long-distance traffic packets and short-distance traffic packets are cached in different queues. This avoids short-distance traffic preempting the cache space of long-distance traffic at the first device, thereby reducing the probability of packet loss in long-distance traffic.

[0076] Furthermore, in this embodiment, the first queue has a higher priority than the second queue. In other words, when the first device sends packets from the first queue and the second queue, it will prioritize sending packets from the first queue, further reducing the probability of packet loss over long distances.

[0077] The communication system, method, and device embodiments involved in this application will be described in detail below.

[0078] Figure 1 is a schematic diagram of the architecture of a communication system provided in an embodiment of this application. As shown in Figure 1, the communication system includes a first data center 10 and a second data center 20.

[0079] As shown in Figure 1, the first data center 10 includes a data forwarding device 101 located at the boundary of the first data center 10 and a terminal device 102 located inside the first data center 10. The second data center 20 includes a data forwarding device 201 located at the boundary of the second data center and a terminal device 202 located inside the second data center 20.

[0080] Furthermore, as shown in FIG1, the first data center 10 may further include other data forwarding devices 103 for connecting the data forwarding device 101 and the terminal device 102. The second data center 20 may further include other data forwarding devices 203 for connecting the data forwarding device 201 and the terminal device 202.

[0081] For any data center, taking the first data center 10 as an example, the number of data forwarding devices 101 within the first data center 10 can be one or more. The number of data forwarding devices 103 within the first data center 10 can also be one or more. The number of terminal devices 102 within the first data center 10 can also be one or more. This application embodiment does not limit this. Figure 1 uses one data forwarding device 101, one data forwarding device 103, and one terminal device 102 as an example.

[0082] In addition, for any data center, the data forwarding device at the boundary of the data center can forward traffic from inside the data center to other data centers, or forward traffic from other data centers to the device inside the data center.

[0083] For example, the data forwarding device 101 at the boundary of the first data center 10 can forward traffic from devices inside the first data center 10 to the data forwarding device 201 at the boundary of the second data center 20, thereby forwarding traffic from the first data center 10 to the second data center 20. In this case, the data forwarding device 101 can also be referred to as the data forwarding device at the exit of the first data center 10, and the data forwarding device 201 can also be referred to as the data forwarding device at the entrance of the second data center 20.

[0084] As another example, the data forwarding device 201 at the boundary of the second data center 20 can forward traffic from devices inside the second data center 20 to the data forwarding device 101 at the boundary of the first data center 10, thereby forwarding traffic from the second data center 20 to the first data center 10. In this case, the data forwarding device 101 can also be referred to as the data forwarding device at the entrance of the first data center 10, and the data forwarding device 201 can also be referred to as the data forwarding device at the exit of the second data center 20.

[0085] In addition, the data forwarding device in Figure 1 can be any device with data forwarding function. For example, the data forwarding device is a network device such as a switch, router, gateway (GW), load balancer (LB), virtual switch (vSwitch), virtual router (vRouter), virtual load balancer (vLB), etc., or it can be a terminal device or server, etc.

[0086] In some embodiments, the function of implementing the packet forwarding method provided in the embodiments of this application on the data forwarding device can be integrated on a chip or network interface card (NIC) within the data forwarding device. For example, when the data forwarding device is a network device such as a switch, router, or gateway, the data forwarding device includes a network processor (NP) chip, and the function of implementing the packet forwarding method provided in the embodiments of this application on the data forwarding device is integrated on the NP chip within the data forwarding device. As another example, when the data forwarding device is a terminal device or server, the data forwarding device includes a NIC, and the function of implementing the packet forwarding method provided in the embodiments of this application on the data forwarding device is integrated on the NIC within the data forwarding device.

[0087] In addition, the terminal device in Figure 1 can be any device that processes business traffic. For example, the terminal device is a device that can train an AI model based on the received traffic. For example, the terminal device can be a processor such as a GPU or a central processing unit (CPU), or a server or terminal device configured with a processor.

[0088] Figure 2 is a schematic diagram of another architecture of the communication system provided in this application embodiment. As shown in Figure 2, the first data center 10 includes multiple switches located in the spine layer, multiple switches located in the leaf layer, and multiple servers. Specifically, the switches located in the spine layer of the first data center 10 are used to implement the function of the data forwarding device 101 shown in Figure 1, the switches located in the leaf layer of the first data center 10 are used to implement the function of the data forwarding device 103 shown in Figure 1, and the servers in the first data center 10 are used to implement the function of the terminal device 102 shown in Figure 1.

[0089] The second data center 20 includes multiple switches located in the spine layer, multiple switches located in the leaf layer, and multiple servers. Specifically, the switches in the spine layer of the second data center 20 implement the function of the data forwarding device 201 shown in Figure 1; the switches in the leaf layer of the second data center 20 implement the function of the data forwarding device 203 shown in Figure 1; and the servers in the second data center 20 implement the function of the terminal device 202 shown in Figure 1.

[0090] Figure 3 is a schematic diagram of another architecture of the communication system provided in an embodiment of this application. As shown in Figure 3, the first data center 10 includes at least one switch located in the core layer, multiple switches located in the spine layer, multiple switches located in the leaf layer, and multiple servers. Specifically, the switch located in the core layer of the first data center 10 implements the function of the data forwarding device 101 shown in Figure 1; the switches located in the spine and leaf layers of the first data center 10 implement the function of the data forwarding device 103 shown in Figure 1; and the servers in the first data center 10 implement the function of the terminal device 102 shown in Figure 1.

[0091] The second data center 20 includes at least one switch located in the core layer, multiple switches located in the spine layer, multiple switches located in the leaf layer, and multiple servers. Specifically, the switch located in the core layer of the second data center 20 implements the function of the data forwarding device 201 shown in Figure 1; the switches located in the spine and leaf layers of the second data center 20 implement the function of the data forwarding device 203 shown in Figure 1; and the servers in the second data center 20 implement the function of the terminal device 202 shown in Figure 1.

[0092] It should be noted that Figures 2 and 3 are example architectures of the communication system shown in Figure 1. The detailed architecture of the communication system shown in Figure 1 in this application embodiment is not limited and will not be illustrated here.

[0093] Figure 4 is a schematic diagram of the architecture of a computing power cluster for training AI models provided in an embodiment of this application. As shown in Figure 4, the computing power cluster includes multiple data centers, which are labeled as data center 1 to data center n in Figure 4.

[0094] In Figures 1 to 3, the first data center 10 and the second data center 20 can be any two data centers shown in Figure 4. For example, the first data center 10 can be data center 1, and the second data center 20 can be data center 2. Alternatively, the first data center 10 can be data center 2, and the second data center 20 can be data center 3. Another example is that the first data center 10 can be data center 1, and the second data center 20 can be data center 3. Further examples will not be provided here.

[0095] Taking the first data center 10 and the second data center 20 shown in Figure 1 as an example, suppose a terminal device in the second data center 20 sends traffic to a terminal device in the first data center 10. In this case, a data forwarding device in the first data center 10 may receive traffic from the first data center 10 and traffic from other devices in the second data center 20. Through the method provided in the embodiments of this application, the data forwarding device can identify these two types of traffic and queue and cache these two types of traffic separately to achieve flexible scheduling of these two types of traffic.

[0096] To be able to identify these two types of traffic, they need to be labeled. The following explains how to label these two types of traffic.

[0097] Figure 5 is a flowchart of a message forwarding method provided in an embodiment of this application. As shown in Figure 5, the message forwarding method includes the following steps 501 to 503.

[0098] Step 501: The second device receives the message.

[0099] Step 502: The second device marks the message to obtain a marked message. The marked message includes a first field. If the message belongs to a first type of traffic, the value of the first field in the marked message is a first value. The first value is used to indicate that the marked message belongs to a first type of traffic. The first type of traffic is traffic exchanged between devices in different data centers. Alternatively, if the message belongs to a second type of traffic, the value of the first field in the marked message is a second value. The second value is used to indicate that the marked message belongs to a second type of traffic. The second type of traffic is traffic exchanged between devices within the same data center.

[0100] In some embodiments, in the scenario where the communication system shown in Figures 1 to 3 is used to train an AI model, both the first type of traffic and the second type of traffic are AI training traffic. Optionally, in other embodiments, in the scenario where the communication system shown in Figures 1 to 3 is used to infer an AI model, both the first type of traffic and the second type of traffic are AI inference traffic.

[0101] Step 503: The second device sends the marked message.

[0102] By marking the messages using the second device, the value of the first field included in messages of the first type of traffic can be different from the value of the first field included in messages of the second type of traffic. This allows other devices, such as the first device, to identify whether a message belongs to the first type of traffic or the second type of traffic based on the value of the first field when receiving any message.

[0103] In some embodiments, packets transmitted in a data center typically carry a Quality of Service (QoS) field. Therefore, in this embodiment, a QoS field can be selected as the first field, and by marking the values ​​of the first field in the first type of traffic and / or the first field in the second type of traffic, other devices can identify whether the packet belongs to the first type of traffic or the second type of traffic based on the value of the first field.

[0104] In this scenario, since the message already includes the first field before marking, and the first field has a corresponding value, the second device can mark the received message in the following three ways.

[0105] (1) Marking method one: Assuming that the value of the first field included in the packet before marking is the second value, the value of the first field included in the packet of the first type of traffic will be changed from the second value to the first value, and the value of the first field included in the packet of the second type of traffic will not be modified, that is, it will remain as the second value.

[0106] In marking method one, only the value of the first field included in the message of the first type of traffic needs to be changed, that is, only long-distance traffic needs to be marked, which simplifies the operation of the second device.

[0107] Furthermore, in marking method one, since the value of the first field included in the message of the first type of traffic has been changed, in order to avoid the need to use the value of the first field before the change in the subsequent process, the marked message also includes a second field, and the value of the second field is a second value. That is, the value of the first field included in the message before marking, that is, the second value, is carried in another second field, and the second value of the second field is used by the subsequent device to restore the value of the first field in the marked message.

[0108] (2) Marking method two: Assuming that the value of the first field included in the packet before marking is the first value, the value of the first field included in the packet in the second type of traffic will be changed from the first value to the second value, while the value of the first field included in the packet in the first type of traffic will not be modified and will remain as the first value.

[0109] In marking method two, only the value of the first field included in the message of the second type of traffic needs to be changed, that is, only short-distance traffic needs to be marked, which simplifies the operation of the second device.

[0110] Furthermore, in marking method two, since the value of the first field included in the message of the second type of traffic has been changed, in order to avoid the need to use the value of the first field before the change in the subsequent process, the marked message also includes a second field, the value of which is the first value. That is, the value of the first field included in the message before marking, i.e., the first value, is carried in another second field, and the first value of the second field is used by the subsequent device to restore the value of the first field in the marked message.

[0111] (3) Marking method three: Assuming that the value of the first field included in the packet before marking is the third value, then the value of the first field included in the packet of the first type of traffic will be changed from the third value to the first value, and the value of the first field included in the packet of the second type of traffic will be changed from the third value to the second value.

[0112] In marking method three, the values ​​of the first field included in the packets of the first type of traffic and the first field included in the packets of the second type of traffic can be changed simultaneously, which improves the flexibility of marking packets.

[0113] Furthermore, in marking method three, since the values ​​of the first field included in the packets of the first type of traffic and the second type of traffic have been changed, in order to avoid the need to use the original value of the first field later, the marked packet also includes a second field, the value of which is a third value. That is, the value of the first field included in the packet before marking, i.e., the third value, is carried in another second field, and the third value of the second field is used by the subsequent device to restore the value of the first field in the marked packet.

[0114] The following section explains how the first field is the QoS field.

[0115] (1) The first field includes the Differentiated Services Code Point (DSCP) field.

[0116] In this scenario, the first value in step 502 is the first DSCP, and the second value is the second DSCP. The first DSCP and the second DSCP are different. That is, if the packet belongs to the first type of traffic, the DSCP field in the marked packet will be the first DSCP; or if the packet belongs to the second type of traffic, the DSCP field in the marked packet will be the second DSCP.

[0117] Figure 6 is a schematic diagram of a message format including a DSCP field provided in an embodiment of this application. It should be noted that Figure 6 is only used to illustrate the position of the DSCP field in the message and does not constitute a limitation on the format of the message received by the second device.

[0118] As shown in Figure 6, the message consists of two parts: an IP header and data. The IP header includes a Type of Service (ToS) field, which comprises 8 bits. The first six bits of the ToS field are the DSCP field, and the last two bits are reserved. For explanations of other fields in the IP message, please refer to the relevant definitions in the Request for Comments (RFC), which will not be elaborated upon here.

[0119] When the second device receives the message shown in Figure 6, it can mark the value of the DSCP field according to whether the message belongs to the first type of traffic or the second type of traffic, so that other devices can distinguish whether the message belongs to the first type of traffic or the second type of traffic based on the value of the DSCP field in the marked message.

[0120] For example, in the first marking method described above, when the second device receives a message, the message includes a DSCP field, and the value of the DSCP field is the second DSCP. When the second device identifies that the message belongs to the first type of traffic, it changes the value of the DSCP field in the message from the second DSCP to the first DSCP. When the second device identifies that the message belongs to the second type of traffic, it does not modify the value of the DSCP field in the message. Thus, among the multiple messages marked by the second device, the DSCP field values ​​of messages belonging to the first type of traffic are all the first DSCP, and the DSCP field values ​​of messages belonging to the second type of traffic are all the second DSCP.

[0121] In this scenario, if the message belongs to the first type of traffic, the value of the DSCP field included in the message before marking, that is, the second DSCP, can be further recorded in the second field of the message.

[0122] For example, in a scenario where the message received by the second device is a message transmitted based on the RDMA protocol, the message may also include a base transport header (BTH), such as the BTH in RDMA over Converged Ethernet (ROCE BTH). This field, in addition to containing key fields for intelligent traffic analysis, also includes some reserved fields. Embodiments of this application can select some of these reserved fields as the second field to record the second DSCP before marking.

[0123] Optionally, the second field can also be other reserved fields in the message, which will not be explained in detail here.

[0124] Figure 7 is a schematic diagram of the format of the reserved field included in the BTH of a message provided in an embodiment of this application. As shown in Figure 7, the BTH includes fields such as OpCode and SE, and also includes a reserved field of 15 bits. In this embodiment of the application, any 5 bits of the reserved field can be used as the second field to record the second DSCP before the marking.

[0125] Additionally, the explanations of other fields in BTH in Figure 7 can be found in relevant standards and will not be elaborated upon here. For example, Opcode can be used to indicate the type of the message. SE is an abbreviation for solicited event, indicating that the responder should generate an event. Destination QP represents the queue pair sequence number at the destination. A is an abbreviation for acknowledge request, indicating that the response to this message can be scheduled by the responder. PSN is an abbreviation for packet sequence number, indicating the detection of lost or duplicate packets.

[0126] For example, in the second marking method described above, when the second device receives a message, the message includes a DSCP field, and the value of the DSCP field is the first DSCP. When the second device identifies that the message belongs to the second type of traffic, it changes the value of the DSCP field in the message from the first DSCP to the second DSCP. When the second device identifies that the message belongs to the first type of traffic, it does not modify the value of the DSCP field in the message. Thus, among the multiple messages marked by the second device, the DSCP field values ​​of messages belonging to the first type of traffic are all the first DSCP, and the DSCP field values ​​of messages belonging to the second type of traffic are all the second DSCP.

[0127] For example, in the third marking method described above, when the second device receives a message, the message includes a DSCP field, and the value of the DSCP field is the third DSCP. When the second device identifies that the message belongs to the first type of traffic, it changes the value of the DSCP field in the message from the third DSCP to the first DSCP. When the second device identifies that the message belongs to the second type of traffic, it changes the value of the DSCP field in the message from the third DSCP to the second DSCP. In this way, among the multiple messages marked by the second device, the DSCP field values ​​of the messages belonging to the first type of traffic are all the first DSCP, and the DSCP field values ​​of the messages belonging to the second type of traffic are all the second DSCP.

[0128] (2) In the scenario where the message received by the second device is a virtual local area network (VLAN) message, the first field may also include a priority (PRI) field.

[0129] In this scenario, the first value in step 502 is the first PRI, and the second value is the second PRI. The first PRI and the second PRI are different. That is, if the packet belongs to the first type of traffic, the PRI field in the marked packet will be the first PRI; or if the packet belongs to the second type of traffic, the PRI field in the marked packet will be the second PRI.

[0130] Figure 8 is a schematic diagram of a message format including a PRI field provided in an embodiment of this application. It should be noted that Figure 8 is only used to illustrate the position of the PRI field in the message and does not constitute a limitation on the format of the message received by the second device.

[0131] As shown in Figure 8, a VLAN packet includes fields such as destination address, source address, 802.1Q, length / type, data, and frame check sequence (FCS). The 802.1Q field contains a 3-bit PRI field. The PRI field defines eight service priorities, with values ​​of 7, 6, 5, 4, 3, 2, 1, and 0 in descending order of priority.

[0132] When the second device receives the message shown in Figure 8, it can mark the value of the PRI field according to whether the message belongs to the first type of traffic or the second type of traffic, so that other devices can distinguish whether the message belongs to the first type of traffic or the second type of traffic based on the value of the PRI field in the marked message.

[0133] In scenarios where the first field includes the PRI field, the method by which the second device marks the PRI field in the message can refer to the aforementioned implementation of marking the DSCP field, and will not be repeated here.

[0134] It should be noted that the above explanation uses the DSCP and PRI fields as examples to illustrate how marking QoS fields can distinguish between Type I and Type II traffic by other devices. Optionally, the second device can also mark other types of QoS fields to distinguish between Type I and Type II traffic, which will not be illustrated here.

[0135] Furthermore, the above example uses the QoS field as the first field to explain how marking the first field enables other devices to distinguish between the first type of traffic and the second type of traffic. Optionally, the first field can also be other fields besides QoS, which will not be illustrated here.

[0136] Optionally, when the second device receives a message, the message may not include the first field before it is marked. In this scenario, the second device adds a first field to the message and sets the value of the first field to enable other devices to distinguish between the first type of traffic and the second type of traffic.

[0137] In this scenario, after receiving a message, the second device, upon identifying that the message belongs to the first type of traffic, adds a first field to the message and sets the value of the first field to a first value. Correspondingly, upon identifying that the message belongs to the second type of traffic, it adds a first field to the message and sets the value of the first field to a second value.

[0138] Optionally, the second device may add the first field only to packets belonging to the first type of traffic, and not to packets belonging to the second type of traffic. That is, after receiving a packet, if the second device identifies the packet as belonging to the first type of traffic, it adds the first field to the packet and sets the value of the first field to a first value. Conversely, if it identifies the packet as belonging to the second type of traffic, it does not add the first field to the packet. Thus, if other devices receive a packet from the second device and the packet does not include the first field, they can directly confirm that the packet belongs to the second type of traffic.

[0139] Optionally, the second device may add the first field only to packets belonging to the second type of traffic, and not to packets belonging to the first type of traffic. That is, after receiving a packet, if the second device identifies the packet as belonging to the second type of traffic, it adds the first field to the packet and sets the value of the first field to the second value. Conversely, if the second device identifies the packet as belonging to the first type of traffic, it does not add the first field to the packet. Thus, if other devices receive a packet from the second device and the packet does not include the first field, they can directly confirm that the packet belongs to the first type of traffic.

[0140] Additionally, in this embodiment, when traffic from one data center is sent to another, the traffic can be marked by the data forwarding device at the exit of the first data center. Optionally, the traffic can also be marked by the data forwarding device at the entrance of the second data center.

[0141] Examples of these two scenarios are provided below.

[0142] Scenario 1: The second device is a data forwarding device at the entrance of the first data center.

[0143] In Scenario 1, the second device acts as a data forwarding device at the entrance of the first data center. Since the interfaces connecting the second device to other devices within the first data center and to devices in other data centers are different, when the second device receives a message in step 501, it can identify whether the message belongs to the first type of traffic or the second type of traffic based on the interface through which the message was received.

[0144] Furthermore, assume that the interface receiving the message in the second device is the first interface, and the interface sending the tagged message is the second interface. Considering that the first interface may not be able to mark the first field in the message, after receiving the message, the first interface can map the internal device priority of the message based on whether the message belongs to the first type of traffic or the second type of traffic. For example, in the scenario where the message belongs to the first type of traffic, the internal device priority of the message is mapped to the first internal device priority; in the scenario where the message belongs to the second type of traffic, the internal device priority of the message is mapped to the second internal device priority, where the first internal device priority can be greater than the second internal device priority. Subsequently, the second interface identifies whether the message belongs to the first type of traffic or the second type of traffic based on the internal device priority of the message, thereby completing the marking operation of the message. In other words, the marking operation of the message is implemented by the output interface of the second device.

[0145] In Scenario 1, the second device can send the tagged message in the following way: the second device sends the tagged message to other data forwarding devices in the first data center.

[0146] For example, taking Figure 2 as an example, in scenario one, the second device can be a switch in the spine layer of the first data center 10. After marking the received packets, the switch in the spine layer of the first data center 10 forwards the marked packets to the switch in the leaf layer of the first data center 10.

[0147] For example, taking Figure 3 as an example, in scenario one, the second device can be a core layer switch of the first data center 10. After marking the received packets, the core layer switch of the first data center 10 forwards the marked packets to the spine layer and leaf layer switches of the first data center 10.

[0148] Optionally, in Scenario 1, the second device can send the tagged message by sending it to another data center, such as a device in a third data center. This will not be described in detail here.

[0149] Furthermore, in Scenario 1, since the second device can identify whether the received packet belongs to the first type of traffic or the second type of traffic based on the interface that received the packet, it can also queue and cache these two types of traffic according to their respective classifications. For example, packets of the first type of traffic are cached in the first queue, and packets of the second type of traffic are cached in the second queue. The first queue has a higher priority than the second queue, and the packet is sent from the first queue and the second queue based on their respective priorities. In this way, in addition to marking the received packets, the second device can flexibly schedule packets of these two types of traffic according to the two queues, thereby reducing the probability of packet loss in long-distance traffic at the second device.

[0150] The implementation method of the second device flexibly scheduling the packets of these two types of traffic according to two queues can be referred to in the relevant embodiments of Figure 9 below, and will not be described in detail here.

[0151] Optionally, in Scenario 1, the second device, as a data forwarding device at the entrance of the second data center, can, after identifying whether a packet belongs to the first type of traffic or the second type of traffic based on the interface of the received packet, choose not to mark the packet, but instead directly cache the packets of the two types of traffic in separate queues and schedule the transmission of packets in the two queues according to the priority of the two queues, thereby reducing the probability of packet loss in long-distance traffic at the second device.

[0152] Scenario 2: The second device is a data forwarding device at the exit of the second data center.

[0153] In Scenario 2, the second device acts as a data forwarding device at the exit of the second data center. Since the interfaces connecting to other devices within the second data center and those connecting to devices in other data centers, such as the first data center, are different, when the second device receives the message in step 501, it can identify whether the message belongs to the first type of traffic or the second type of traffic based on the interface used to send the message.

[0154] In scenario two, the second device can send the tagged message in the following ways: the second device sends the tagged message to other data forwarding devices in the second data center, or sends the tagged message to the data forwarding device at the entrance of the first data center.

[0155] For example, in the marking method one described above, the scheme shown in Figure 5 can be directly configured on the interface in the second device used to connect to other data centers. Since the packets sent by this interface belong to the first type of traffic, before sending the packets, the interface can directly change the value of the first field in the packet from the second value to the first value, and send the marked packets to other data centers, such as the data forwarding device at the entrance of the first data center.

[0156] As another example, in the second marking method described above, the scheme shown in Figure 5 can be directly configured on the interface in the second device used to connect to other devices within the second data center. Since the messages sent by this interface belong to the second type of traffic, the interface can directly change the value of the first field in the message from the first value to the second value before sending the message, and then send the marked message to other devices within the second data center.

[0157] For example, taking Figure 2 as an example, in scenario two, the second device can be a switch in the spine layer of the second data center 20. After marking the packet to be sent, the switch in the spine layer of the second data center 20 forwards the marked packet to the switch in the spine layer of the first data center 10.

[0158] For example, taking Figure 3 as an example, in scenario two, the second device can be a core layer switch of the second data center 20. After marking the packet to be sent, the core layer switch of the second data center 20 forwards the marked packet to the core layer switch of the first data center 10.

[0159] Optionally, the second device can also be other types of devices within the second data center, and this application embodiment does not limit this. For example, in the communication system shown in Figure 2, the second device can be a leaf layer switch in the second data center. In this scenario, after receiving the message, the second device can determine whether the message belongs to the first type of traffic or the second type of traffic based on the source address and / or destination address of the message, and then complete the marking operation of the message.

[0160] The second device can determine whether a message belongs to the first type of traffic or the second type of traffic based on the source address and destination address of the message. This can be achieved by configuring address conditions at the second device. These address conditions indicate the conditions that the addresses of terminal devices located in the same data center as the second device must meet. Based on this, the second device can compare the destination address with the address conditions. If the destination address meets the address conditions, the message is determined to belong to the second type of traffic. Conversely, if the destination address does not meet the address conditions, the message is determined not to belong to the second type of traffic, that is, to belong to the first type of traffic.

[0161] In this context, the address condition can be, for example, an address range. When the destination address carried by the message is an address within this address range, it indicates that the destination of the message is a terminal device in the second data center, and therefore the message belongs to the second type of traffic. Conversely, when the destination address carried by the message is not an address within this address range, it indicates that the destination of the message is not a terminal device in the second data center, and therefore the message belongs to the first type of traffic.

[0162] Optionally, the second device can determine whether a message belongs to the first type of traffic or the second type of traffic based on the source address and destination address of the message. Another implementation method is as follows: the second device is configured with a routing table of the data forwarding device at the exit of the second data center. Based on this, the second device can obtain the interface used to send the message from the routing table based on the destination address carried in the message. The routing table records whether the interface is used to connect to the data forwarding device in other data centers. Therefore, the second device can identify whether the message belongs to the first type of traffic or the second type of traffic based on the interface.

[0163] Alternatively, the second device may also use other means, such as path tracing technology, to identify whether the packet belongs to the first type of traffic or the second type of traffic, and then mark the packet. Examples will not be given here.

[0164] After the second device marks the message using the embodiment shown in Figure 5, other devices, upon receiving the message, can identify whether the message belongs to the first type of traffic or the second type of traffic based on the value of the first field in the message, thereby enabling flexible scheduling of the first type of traffic and the second type of traffic. The process will be described in detail below.

[0165] Figure 9 is a flowchart of another message forwarding method provided in an embodiment of this application. As shown in Figure 9, the message forwarding method includes the following steps 901 to 904.

[0166] Step 901: The first device receives a first message. The first message includes a first field. The value of the first field in the first message is a first value. The first value indicates that the first message belongs to a message in a first type of traffic. The first type of traffic is the traffic exchanged between devices in different data centers.

[0167] Step 902: The first device receives the second message, which includes a first field. The value of the first field in the second message is a second value, which indicates that the second message belongs to the second type of traffic. The second type of traffic is the traffic exchanged between devices within the same data center.

[0168] There is no strict execution order between steps 901 and 902. In other words, the first device may receive the first message first and then the second message, or it may receive the second message first and then the first message. This application embodiment does not limit this.

[0169] As shown in the embodiment in Figure 5, through the marking operation of the second device, the values ​​of the first field in the marked packets of the first type of traffic and the second type of traffic are different. Therefore, as shown in steps 901 and 902, the first device may receive a first packet belonging to the first type of traffic and may also receive a packet belonging to the second type of traffic.

[0170] In other words, for any received message, the first device can identify whether the message belongs to the first type of traffic or the second type of traffic based on the value of the first field included in the message.

[0171] The implementation of the first field in the first message and the second message can be referred to the embodiment shown in Figure 5, and will not be repeated here.

[0172] Furthermore, in the marking method one shown in Figure 5, where the second device changes the value of the first field in the packet of the first type of traffic from a second value to a first value, the first packet can also include a second field with a second value, so that other devices can use the value of the first field included in the packet before marking. That is, the second value of the second field is used by subsequent devices to restore the value of the first field in the first packet.

[0173] In some embodiments, the first device is a data forwarding device on a target link within a first data center, and the target link is a link from the data forwarding device at the entrance of the first data center to a terminal device within the first data center.

[0174] For example, in a scenario where the second device is a data forwarding device at the exit of a second data center, the first device is a data forwarding device at the entrance of a first data center.

[0175] For example, taking Figure 2 as an example, the second device can be a switch in the spine layer of the second data center 20, and the first device can be a switch in the spine layer of the first data center 10. After marking the received packets, the switch in the spine layer of the second data center 20 forwards the marked packets to the switch in the spine layer of the first data center 10, and the switch in the spine layer of the first data center 10 implements the scheduling scheme shown in Figure 9.

[0176] For example, taking Figure 3 as an example, the second device can be a core layer switch of the second data center 20, and the first device can be a core layer switch of the first data center 10. After marking the received packets, the core layer switch of the second data center 20 forwards the marked packets to the core layer switch of the first data center 10, and the core layer switch of the first data center 10 implements the scheduling scheme shown in Figure 9.

[0177] As another example, in a scenario where the second device is a data forwarding device at the entrance of the first data center, the first device is a data forwarding device on the target link other than the data forwarding device at the entrance of the first data center.

[0178] For example, taking Figure 2 as an example, the second device can be a switch in the spine layer of the first data center 10, and the first device can be a switch in the leaf layer of the first data center 10. After marking the received packets, the spine layer switch of the first data center 10 forwards the marked packets to the leaf layer switch of the first data center 10, and the leaf layer switch of the first data center 10 implements the scheduling scheme shown in Figure 9.

[0179] For example, taking Figure 3 as an example, the second device can be a core layer switch of the first data center 10, and the first device can be a spine layer or leaf layer switch of the first data center 10. After marking the received packets, the core layer switch of the first data center 10 forwards the marked packets to the spine layer or leaf layer switch of the first data center 10, and the spine layer or leaf layer switch of the first data center 10 implements the scheduling scheme shown in Figure 9.

[0180] Step 903: The first device caches the first message to the first queue based on the first value, and caches the second message to the second queue based on the second value. The first queue is used to cache messages of the first type of traffic, and the second queue is used to cache messages of the second type of traffic. The priority of the first queue is higher than the priority of the second queue.

[0181] In some embodiments, step 903 can be implemented as follows: if it is determined that the first packet belongs to the first type of traffic based on the value of the first field in the first packet, the device internal priority of the first packet is determined as the first priority, and the first priority is the priority of the first queue; if it is determined that the second packet belongs to the second type of traffic based on the value of the first field in the second packet, the device internal priority of the second packet is determined as the second priority, and the second priority is the priority of the second queue; the first packet is cached in the first queue based on the device internal priority of the first packet, and the second packet is cached in the second queue based on the device internal priority of the second packet.

[0182] Step 904: The first device sends a first message from the first queue and the second queue based on the priority of the first queue and the priority of the second queue, and after sending the first message, the first device sends a second message.

[0183] The first queue has a higher priority than the second queue. Therefore, when the first device sends a message from the first queue to the second queue, it prioritizes sending messages from the first queue to avoid packet loss in the first type of traffic.

[0184] In some embodiments, the first device can prioritize the scheduling of packets in the first queue according to a strict priority (SP) scheduling algorithm. The SP scheduling algorithm operates by scheduling packets in the low-priority queue only after the high-priority queue is emptied.

[0185] Optionally, in other embodiments, the first device may prioritize the scheduling of packets in the first queue according to a weighted round-robin (WRR) scheduling algorithm or a differential weighted round-robin (DWRR) scheduling algorithm. In the WRR or DWRR scheduling algorithm, the ratio between the weight of the first priority and the weight of the second priority is a reference ratio, which is greater than 1.

[0186] For example, in the WRR scheduling algorithm, the ratio between the weight of the first priority and the weight of the second priority is 9:1. Therefore, the first device will schedule 9 packets from the first queue before scheduling one packet from the second queue, thereby avoiding packet loss of the first type of traffic.

[0187] Furthermore, in the embodiment shown in Figure 5, if the second device marks the message by changing the value of the first field, in order to prevent the marked message from being successfully recognized by the terminal device in the data center, other devices can also de-mark the message after receiving it from the second device, thereby preventing the message from failing to be successfully recognized by the terminal device. This process will be described in detail below.

[0188] Figure 10 is a flowchart of another message forwarding method provided in an embodiment of this application. As shown in Figure 10, the message forwarding method includes the following steps 1001 to 1003.

[0189] Step 1001: A third device in the first data center receives a message from a first device in the first data center. The message includes a first field, and the value of the first field is a first value, which indicates that the message belongs to a first type of traffic. The first type of traffic is traffic exchanged between devices in different data centers. Alternatively, the value of the first field is a second value, which indicates that the message belongs to a second type of traffic. The second type of traffic is traffic exchanged between devices within the same data center.

[0190] In some embodiments, the third device is a data forwarding device directly connected to the terminal device in the first data center. Direct connection between the third device and the terminal device can be understood as follows: packets sent by the third device to the terminal device will directly reach the terminal device without needing to be forwarded through other data forwarding devices. In other words, the third device is the last-hop data forwarding device on the packet's forwarding path.

[0191] For example, taking Figure 2 as an example, the second device can be a spine layer switch of the second data center 20, the first device can be a spine layer switch of the first data center 10, and the third device can be a leaf layer switch of the first data center 10. The spine layer switch of the second data center 20 marks the received packets based on the scheme shown in Figure 5, and then forwards the marked packets to the spine layer switch of the first data center 10. The spine layer switch of the first data center 10 implements the scheduling scheme shown in Figure 9, and the leaf layer switch of the first data center 10 executes the scheme shown in Figure 10 after receiving the packets.

[0192] For example, taking Figure 3 as an example, the second device can be a core layer switch of the second data center 20, the first device can be a core layer and spine layer switch of the first data center 10, and the third device can be a leaf layer switch of the first data center 10. The core layer switch of the second data center 20 marks the received packets based on the scheme shown in Figure 5, and then forwards the marked packets to the core layer switch of the first data center 10. The core layer and spine layer switches of the first data center 10 implement the scheduling scheme shown in Figure 9, and the leaf layer switch of the first data center 10 executes the scheme shown in Figure 10 after receiving the packets.

[0193] Optionally, the third device may also be any data forwarding device located after the first device in the forwarding path of the message, and this application embodiment does not limit this.

[0194] Step 1002: The third device updates the value of the first field in the message to the target value.

[0195] The target value is the value of the first field included in the message before the second device marks the message in the embodiment shown in Figure 5.

[0196] In some embodiments, in the scenario where the second device in FIG5 uses marking method one to mark the message, the target value is the second value. In this scenario, the third device can update the value of the first field in the message to the target value in the following way: if the value of the first field in the message is the first value, the value of the first field is updated from the first value to the second value.

[0197] For example, the first field includes a DSCP field. If the value of the first field in the message is the first DSCP, then the value of the DSCP field will be updated from the first DSCP to the second DSCP.

[0198] For example, the first field includes the PRI field. If the value of the first field in the message is "First PRI", then the value of the PRI field will be updated from "First PRI" to "Second PRI".

[0199] In the scenario where the second device in Figure 5 uses other marking methods to mark the message, the third device can also refer to the above method to update the value of the first field in the received message, so that the value of the first field after the third device updates is the same as the value of the first field in the message before the second device marks it.

[0200] Furthermore, before updating the value of the first field in the message to the target value, the third device first obtains the target value. In some embodiments, the message also includes a second field, the value of which is a second value. This second value is used by the third device to update the value of the first field in the message. In this scenario, the third device obtains the second value from the second field. That is, in scenarios where the message records a second value, the third device can directly obtain the second value from the message and then update the value of the first field based on the second value in the second field.

[0201] Optionally, a traffic level value is configured at the third device. In this scenario, the third device can determine the second value based on the traffic level value. That is, in scenarios where the second value is not recorded in the message, the third device can determine the second value based on its local configuration, and then update the value of the first field based on the configured second value.

[0202] For example, in a scenario where the first field includes the DSCP field, the value obtained by dividing the traffic class value by 4 is the value of the DSCP field carried by the message before the message is marked in the embodiment of Figure 5.

[0203] The traffic level value configured at the third device is set by a technician. For example, when all terminal devices in a data center are used to train AI models, the traffic level value transmitted in the data center can be the same. Therefore, the technician can configure this traffic level value at the third device. This application embodiment does not elaborate on how the technician configures the traffic level value.

[0204] Optionally, if in the embodiment shown in Figure 5, the second device completes the marking by adding a first field to the message, in this scenario, the third device can also delete the first field in the message to de-mark the message.

[0205] Step 1003: The third device sends the updated message.

[0206] In some embodiments, the third device sends the updated message according to the destination address of the updated message.

[0207] It should be noted that in some other embodiments, the third device may not execute the embodiment shown in FIG10. That is, after marking the message through the embodiment shown in FIG5, the value of the first field in the message may not be changed back to the original value.

[0208] To further understand the embodiments of this application, Figure 11 is used as an example to illustrate the embodiments of this application. It should be noted that Figure 11 is an example illustration of the embodiments shown in Figures 5-10 above, and does not constitute a limitation on the embodiments shown in Figures 5-10.

[0209] As shown in Figure 11, the message forwarding process provided in this application embodiment includes the following three stages.

[0210] 1. Long-distance marking: The spine layer switch of the second data center 20 acts as a second device. The outgoing interface of this second device, used for connecting long-distance links, marks the first type of traffic sent to the first data center 10. For example, the value of the DSCP field in the packets of the first type of traffic is changed from D0 (e.g., 32) to D1 (e.g., 40). Simultaneously, D0 is recorded in the reserved field of the packet's ROCE BTH.

[0211] 2. Priority Scheduling: For any switch within the first data center, such as the Spine layer switch in data center 10, this switch acts as the first device. At the ingress interface of the first device, the value of the DSCP field in the received packet determines whether the packet belongs to type 1 or type 2 traffic. The device assigns the first-type traffic its internal priority as the first priority (e.g., af5) and the second-type traffic its internal priority as the second priority (e.g., af4), where af5 is higher than af4. At the egress interface of the second device, the two types of traffic are queued based on their internal priorities, and the WRR scheduling algorithm is used to schedule the transmission of packets in these two queues. As shown in Figure 11, type 1 traffic is cached in the first queue, and type 2 traffic is cached in the second queue. The weight of priority af5 in the first queue is in a 9:1 ratio with the weight of priority af4 in the second queue. Thus, at the egress interface of the second device, one packet from the second queue is sent after every nine packets from the first queue.

[0212] 3. De-marking: For the last-hop switch connecting the server in the first data center 10, such as the leaf layer switch of the first data center 10, this switch acts as a third device. The outgoing interface of the third device updates the value of the DSCP field of the first type of traffic back to the original value D0 so that the server can correctly identify the received packets.

[0213] In summary, in the message forwarding method provided in this application embodiment, by marking the message through the second device, the value of the first field included in the message in the first type of traffic can be different from the value of the first field included in the message in the second type of traffic. The first type of traffic is traffic exchanged between devices in different data centers, i.e., long-distance traffic; the second type of traffic is traffic exchanged between devices within the same data center, i.e., short-distance traffic.

[0214] Accordingly, the message received by the first device includes a first field. The first device can identify whether the message belongs to a first type of traffic or a second type of traffic by the value of the first field. Then, long-distance traffic messages and short-distance traffic messages are cached in different queues. This prevents short-distance traffic from preempting the cache space of long-distance traffic at the first device, thereby reducing the probability of packet loss in long-distance traffic. Furthermore, in this embodiment, the first queue has a higher priority than the second queue. In other words, when sending messages from the first and second queues, the first device will prioritize sending messages from the first queue, further reducing the probability of packet loss in long-distance traffic.

[0215] Furthermore, if the second device marks the message by changing the value of the first field, in order to prevent the marked message from being successfully recognized by the terminal device in the data center, the third device can also de-mark the message after receiving it from the second device, thereby preventing the message from being unrecognizable by the terminal device.

[0216] The message forwarding device and related products provided in the embodiments of this application will be explained below.

[0217] Figure 12 illustrates a message forwarding device 1200 provided in an embodiment of this application. The message forwarding device 1200 is applied to a data forwarding device in a data center. This data forwarding device is the first, second, or third device described in the above embodiments. For example, the message forwarding device 1200 is the first device or a functional component within the first device; or, the message forwarding device 1200 is the second device or a functional component within the second device; or, the message forwarding device 1200 is the third device or a functional component within the third device. As shown in Figure 12, the message forwarding device 1200 includes a transceiver module 1201 and a processing module 1202. The transceiver module 1201 is used to perform the transceiver operations in the message forwarding method provided in the aforementioned embodiments. Specific implementations can be found in the embodiments shown in Figures 5, 9, or 10. The processing module 1202 is used to perform operations other than the transceiver operations in the message forwarding method provided in the aforementioned embodiments. Specific implementations can also be found in the embodiments shown in Figures 5, 9, or 10.

[0218] In some embodiments, the message forwarding device shown in FIG12 can be applied to the first device. In this scenario, the functions of the transceiver module 1201 and the processing module 1202 are as follows.

[0219] The transceiver module 1201 is used to receive a first message. The first message includes a first field. The value of the first field in the first message is a first value. The first value indicates that the first message belongs to a message in a first type of traffic. The first type of traffic is the traffic exchanged between devices in different data centers. For a specific implementation method, please refer to step 901 in the embodiment of Figure 9.

[0220] The transceiver module 1201 is also used to receive a second message. The second message includes a first field, and the value of the first field in the second message is a second value. The second value indicates that the second message belongs to a message in a second type of traffic. The second type of traffic is the traffic exchanged between devices in the same data center. For a specific implementation, please refer to step 902 in the embodiment of Figure 9.

[0221] The processing module 1202 is used to cache the first packet to the first queue based on the first value and cache the second packet to the second queue based on the second value. The first queue is used to cache packets of the first type of traffic and the second queue is used to cache packets of the second type of traffic. The priority of the first queue is higher than the priority of the second queue. For a specific implementation, please refer to step 903 in the embodiment of Figure 9.

[0222] The transceiver module 1201 is further configured to send a first message from the first queue and the second queue based on the priority of the first queue and the priority of the second queue, and after sending the first message, the first device sends a second message. For a specific implementation, please refer to step 904 in the embodiment shown in Figure 9.

[0223] In one possible implementation, the first field includes a Differential Service Code Point (DSCP) field, with a first value being a first DSCP and a second value being a second DSCP, the first DSCP being different from the second DSCP.

[0224] In one possible implementation, the first field includes a priority PRI field, where the first value is first PRI and the second value is second PRI, and the first PRI and the second PRI are different.

[0225] In one possible implementation, the first message also includes a second field, which takes a second value. The second value of the second field is used by subsequent devices to recover the value of the first field in the first message.

[0226] In one possible implementation, the first device is a data forwarding device at the entrance of the first data center.

[0227] In some other embodiments, the message forwarding device shown in FIG12 can be applied to the second device. In this scenario, the functions of the transceiver module 1201 and the processing module 1202 are as follows.

[0228] The transceiver module 1201 is used to receive messages; for specific implementation, please refer to step 501 in the embodiment of Figure 5.

[0229] Processing module 1202 is used to mark the message to obtain the marked message. The marked message includes a first field. When the message belongs to the first type of traffic, the value of the first field in the marked message is a first value. The first value is used to indicate that the marked message belongs to the first type of traffic, which is traffic between devices in different data centers. Alternatively, when the message belongs to the second type of traffic, the value of the first field in the marked message is a second value. The second value is used to indicate that the marked message belongs to the second type of traffic, which is traffic between devices in the same data center. For a specific implementation, please refer to step 502 in the embodiment of Figure 5.

[0230] The transceiver module 1201 is also used to send the marked message. For a specific implementation, please refer to step 503 in the embodiment shown in Figure 5.

[0231] In one possible implementation, the first field includes a Differential Service Code Point (DSCP) field, with a first value being a first DSCP and a second value being a second DSCP, the first DSCP being different from the second DSCP.

[0232] In one possible implementation, the first field includes a priority PRI field, where the first value is first PRI and the second value is second PRI, and the first PRI and the second PRI are different.

[0233] In one possible implementation, the pre-mark message includes a first field, and the value of the first field in the pre-mark message is a second value;

[0234] Processing module 1202 is used for:

[0235] If the message belongs to the first type of traffic, change the value of the first field from the second value to the first value.

[0236] In one possible implementation, the tagged message also includes a second field, which takes a second value. This second value is used by subsequent devices to restore the value of the first field in the tagged message.

[0237] In one possible implementation, the second device is a data forwarding device at the entrance of the first data center; or...

[0238] The second device is a data forwarding device at the exit of the second data center.

[0239] In some other embodiments, the message forwarding device shown in FIG12 can be applied to a third device in a first data center. In this scenario, the transceiver module 1201 and the processing module 1202 function as follows.

[0240] The transceiver module 1201 is used to receive a message from a first device in a first data center. The message includes a first field, which takes a first value to indicate that the message belongs to a first type of traffic, which is traffic exchanged between devices in different data centers. Alternatively, the first field may take a second value to indicate that the message belongs to a second type of traffic, which is traffic exchanged between devices within the same data center. For a specific implementation, refer to step 1001 in the embodiment shown in Figure 10.

[0241] The processing module 1202 is used by the third device to update the value of the first field in the message to the target value; for specific implementation, refer to step 1002 in the embodiment shown in Figure 10.

[0242] The transceiver module 1201 is also used by the third device to send updated messages. For a specific implementation, refer to step 1003 in the embodiment shown in Figure 10.

[0243] In one possible implementation, the target value is the second value; the processing module 1202 is used for:

[0244] If the first field in the message has the first value, then update the value of the first field to the second value.

[0245] In one possible implementation, the message also includes a second field, the value of which is a second value; the processing module 1202 is used to: obtain the second value from the second field, the second value of which is used by the third device to update the value of the first field in the message.

[0246] In one possible implementation, a flow rate level value is configured at the third device; the processing module 1202 is used to: determine a second value based on the flow rate level value.

[0247] In one possible implementation, the third device is a data forwarding device that is directly connected to the terminal device in the first data center.

[0248] The message forwarding device provided in this application embodiment can also be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The message forwarding method provided in the above method embodiment can also be implemented in software. When the message forwarding method provided in the above method embodiment is implemented in software, each module in the message forwarding device can also be a software module.

[0249] Furthermore, it should be noted that the message forwarding device provided in the above embodiments is only illustrated by the division of the above functional modules when forwarding messages. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the message forwarding device and the message forwarding method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0250] In addition, this application embodiment also provides another message forwarding device, which is applied to a data forwarding device in a data center. This data forwarding device is the first, second, or third device described in the above embodiments. For example, the message forwarding device is the data forwarding device or a functional component within the data forwarding device. The message forwarding device includes a memory and a processor. The memory is used to store a computer program. The processor is used to execute the computer program stored in the memory to cause the message forwarding device to perform all or part of the steps of the message forwarding method provided in the above method embodiments.

[0251] As an example, please refer to Figure 13, which shows a schematic diagram of another packet forwarding device 1300 provided in an embodiment of this application. The packet forwarding device 1300 is applied to a data forwarding device in a data center, and this data forwarding device is the first, second, or third device in the above embodiments. This data forwarding device can be a network device such as a switch or router. The packet forwarding device 1300 can implement the method embodiments shown in Figure 5, Figure 9, or Figure 10. The packet forwarding device 1300 includes a main control board 1310, an interface board 1330, and an interface board 1340. In the case of multiple interface boards, it also includes a switching network board (not shown in Figure 13), which is used to complete data exchange between the interface boards (interface boards are also called line cards or service boards).

[0252] The main control board 1310 is used to perform functions such as system management, equipment maintenance, and protocol processing. Interface boards 1330 and 1340 provide various service interfaces and implement service forwarding, such as POS interfaces, Gigabit Ethernet (GE) interfaces, and asynchronous transfer mode (ATM) interfaces. The main control board 1310 mainly has three types of functional units: a system management control unit, a system clock unit, and a system maintenance unit. The main control board 1310, interface boards 1330, and interface boards 1340 communicate with each other via a system bus connected to the system backplane. Interface board 1330 includes one or more processors 1331. Processors 1331 control and manage interface board 1330 and communicate with the central processing unit 1312 on the main control board 1310. The memory 1332 on interface board 1330 stores forwarding table entries. Interface board 1330 includes one or more network interfaces 1333 for transmitting and receiving data. The main control board 1310 also includes a memory 1314, which is used to store system management information, protocols, etc. This application embodiment does not limit this.

[0253] As shown in Figure 13, this embodiment includes multiple interface boards and adopts a distributed forwarding mechanism. Under this mechanism, the operation on interface board 1340 is basically similar to the operation on interface board 1330. For example, interface board 1340 includes one or more network interfaces 1343 for transmitting and receiving, interface board 1340 includes a memory 1342 for storing forwarding table entries, and interface board 1340 includes a processor 1341 for controlling and managing interface board 1340 and communicating with the central processing unit 1312 on the main control board 1310.

[0254] The processors 1331 in interface board 1330 and / or 1341 in interface board 1340 in Figure 13 can be dedicated hardware or chips, such as network processors or application-specific integrated circuits (ASICs), to implement the above functions. This implementation method is commonly referred to as using dedicated hardware or chips for the forwarding plane. In another embodiment, the processors 1331 in interface board 1330 and / or 1341 in interface board 1340 can also be general-purpose processors, such as general-purpose central processing units (CPUs).

[0255] There may be one or more main control boards, including a primary and a backup main control board. There may also be one or more interface boards; the stronger the data processing capability of the transmission equipment (e.g., network equipment), the more interface boards it provides. With multiple interface boards, they can communicate through one or more switching network boards, enabling load sharing and redundancy backup. In a centralized forwarding architecture, the transmission equipment may not need a switching network board; the interface boards handle the processing of the entire system's business data. In a distributed forwarding architecture, the transmission equipment includes multiple interface boards, which can exchange data with each other through a switching network board, providing high-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of a distributed architecture transmission device are greater than those of a centralized architecture transmission device. The specific architecture adopted depends on the network deployment scenario and is not limited here.

[0256] In optional embodiments, memory 1332 and / or memory 1342 may be read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disks or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 1332 may exist independently and be connected to processor 1331 via a communication bus, or it may be integrated with processor 1331. Memory 1342 may exist independently and be connected to processor 1341 via a communication bus, or it may be integrated with processor 1341.

[0257] Memory 1332 is used to store program code (i.e., computer program) and is executed under the control of processor 1331 to perform some or all of the steps of the packet forwarding method provided in the above embodiments. Processor 1331 is used to execute the program code stored in memory 1332. The program code may include one or more software modules. These one or more software modules may be the functional modules provided in the embodiment shown in FIG12 above. Memory 1342 may also be used to store program code and is executed under the control of processor 1341 to perform some or all of the steps of the packet forwarding method provided in the above embodiments. Similarly, memory 1314 may also be used to store program code and is executed under the control of central processing unit 1312 to perform some or all of the steps of the packet forwarding method provided in the above embodiments.

[0258] Optionally, network interfaces 1333 and 1343 use transceivers or similar devices to communicate with other devices or networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.

[0259] In addition, this application embodiment also provides another message forwarding device. Figure 14 is a schematic diagram of another message forwarding device 1400 provided in this application embodiment. The message forwarding device 1400 is applied to a data forwarding device in a data center, and the data forwarding device is the first device, second device, or third device in the above embodiments. The message forwarding device 1400 can implement the method embodiment shown in Figure 5, Figure 9, or Figure 10.

[0260] As shown in Figure 14, the message forwarding device 1400 includes a processor 1402, a memory 1404, a communication interface 1406, and a bus 1408. The processor 1402, memory 1404, and communication interface 1406 are communicatively connected via the bus 1408. The connection method between the processor 1402, memory 1404, and communication interface 1406 shown in Figure 14 is merely exemplary. In implementation, the processor 1402, memory 1404, and communication interface 1406 may also be connected using connection methods other than the bus 1408. This application embodiment does not limit this.

[0261] The memory 1404 stores the computer program 14042, which may include instructions and data. The memory 1404 can be various types of storage media, such as RAM, ROM, non-volatile RAM (NVRAM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), flash memory, optical memory, and registers.

[0262] The processor 1402 can be a general-purpose processor or a dedicated processor. A general-purpose processor is a processor that performs specific steps and / or operations by reading and executing a computer program (e.g., computer program 14042) stored in memory (e.g., memory 1404). The general-purpose processor may use data stored in memory (e.g., memory 1404) during the execution of these steps and / or operations. The stored computer program can be executed to implement the relevant functions of the aforementioned processing module 1202; the general-purpose processor can be a CPU. A dedicated processor is a processor specifically designed to perform specific steps and / or operations; a dedicated processor can be a digital signal processor (DSP), ASIC, or FPGA, etc. The processor 1402 can also be a combination of multiple processors, such as a multi-core processor. The processor 1402 includes at least one circuit to perform all or part of the steps of the above method embodiments.

[0263] The communication interface 1406 includes input / output (I / O) interfaces, physical interfaces, and logical interfaces for interconnecting devices within the message forwarding device 1400, as well as interfaces for interconnecting the message forwarding device 1400 with other devices (e.g., transmission equipment). The physical interface can be a GE interface, used for interconnecting the message forwarding device 1400 with other devices. The logical interface is an internal interface of the message forwarding device 1400, used for interconnecting devices within the device. The communication interface 1406 can be used for communication between the message forwarding device 1400 and other devices, and can implement the functions of the aforementioned transceiver module 1201. The communication interface 1406 may also include a transceiver for transmitting and receiving, which can also implement the functions of the transceiver module 1201.

[0264] Bus 1408 can be any type of communication bus used to interconnect processor 1402, memory 1404, and communication interface 1406. Bus 1408 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 1408 can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used in Figure 14, but this does not indicate that there is only one bus or one type of bus.

[0265] The aforementioned devices can be disposed on separate chips, or at least partially or entirely on the same chip. Whether to dispose of the devices independently on different chips or integrate them on one or more chips often depends on the needs of the product design. This application does not limit the specific implementation of the aforementioned devices.

[0266] The message forwarding device 1400 shown in Figure 14 is merely an example. In the implementation process, the message forwarding device 1400 may also include other components, which will not be listed one by one in this article.

[0267] Based on the same inventive concept, embodiments of this application provide a communication system, which includes a first device and a second device. The communication system may further include a third device. At least one of the first, second, and third devices includes a message forwarding device as shown in any of Figures 12 to 14. For example, the communication system is shown in Figures 1 to 3.

[0268] Additionally, embodiments of this application provide another communication system, which includes a first device and a third device. The communication system may further include a second device. At least one of the first, second, and third devices includes a message forwarding device as shown in any of Figures 12 to 14. For example, this communication system is shown in Figures 1 to 3.

[0269] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed (e.g., by a message forwarding device, a transmission device, one or more processors, etc.), implements all or part of the steps of the method provided in the above method embodiments.

[0270] Based on the same inventive concept, embodiments of this application provide a computer program product, which includes a program or code. When the program or code is executed (e.g., executed by a message forwarding device, a transmission device, one or more processors, etc.), it implements all or part of the steps of the method provided in the above method embodiments.

[0271] Based on the same inventive concept, embodiments of this application provide a chip that includes programmable logic circuitry and / or program instructions. When the chip is run, it is used to implement all or part of the steps of the method provided in the above method embodiments.

[0272] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, they can be implemented, in whole or in part, as a computer program product, which includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of this application are generated, in whole or in part. The computer can be a general-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium, or a semiconductor medium (e.g., solid-state drive), etc.

[0273] In this application's embodiments, the term "traffic" is also referred to as network traffic or data traffic. Traffic refers to the data transmitted through a network at a given point in time. For example, the traffic received by a device at time T refers to all messages received by the device at time T.

[0274] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

[0275] In this application, the term "at least one" refers to one or more, and "multiple" refers to two or more. Unless otherwise stated, the symbol " / " generally signifies "or," for example, A / B can mean A or B. The term "and / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Furthermore, for clarity, the terms "first," "second," and "third" are used in this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first," "second," and "third" do not limit the quantity or order of execution.

[0276] The method embodiments and device embodiments provided in this application can be referenced from each other. The order of operations in the method embodiments provided in this application can be appropriately adjusted, and operations can be added or removed as needed. Any variations that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application.

[0277] In the corresponding embodiments provided in this application, it should be understood that the disclosed devices, etc., can be implemented through other configurations. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Units described as separate components may or may not be physically separate, and components described as units may or may not be physical units; they may be located in one place or distributed across multiple transmission devices. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0278] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any equivalent modifications or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A message forwarding method, characterized in that, The method includes: The first device receives a first message, the first message includes a first field, the value of the first field in the first message is a first value, the first value indicates that the first message belongs to a message in a first type of traffic, the first type of traffic is the traffic exchanged between devices in different data centers; The first device receives a second message, the second message including the first field, the value of the first field in the second message being a second value, the second value indicating that the second message belongs to a message in a second type of traffic, the second type of traffic being traffic exchanged between devices within the same data center; The first device caches the first packet to a first queue based on the first value and caches the second packet to a second queue based on the second value. The first queue is used to cache packets of the first type of traffic, and the second queue is used to cache packets of the second type of traffic. The priority of the first queue is higher than the priority of the second queue. The first device sends the first message from the first queue and the second queue based on the priority of the first queue and the priority of the second queue, and after sending the first message, the first device sends the second message.

2. The method as described in claim 1, characterized in that, The first field includes a Differential Service Code Point (DSCP) field, where the first value is a first DSCP and the second value is a second DSCP, and the first DSCP is different from the second DSCP.

3. The method as described in claim 1, characterized in that, The first field includes a priority PRI field, where the first value is the first PRI and the second value is the second PRI, and the first PRI and the second PRI are different.

4. The method according to any one of claims 1-3, characterized in that, The first message also includes a second field, the value of which is a second value, which is used by subsequent devices to restore the value of the first field in the first message.

5. The method according to any one of claims 1-4, characterized in that, The first device is a data forwarding device at the entrance of the first data center.

6. A message forwarding method, characterized in that, The method includes: The second device receives the message; The second device marks the message to obtain a marked message. The marked message includes a first field. If the message belongs to a first type of traffic, the value of the first field in the marked message is a first value. The first value is used to indicate that the marked message belongs to a first type of traffic, which is traffic between devices in different data centers. Alternatively, if the message belongs to a second type of traffic, the value of the first field in the marked message is a second value. The second value is used to indicate that the marked message belongs to a second type of traffic, which is traffic between devices within the same data center. The second device sends the marked message.

7. The method as described in claim 6, characterized in that, The first field includes a Differential Service Code Point (DSCP) field, where the first value is a first DSCP and the second value is a second DSCP, and the first DSCP is different from the second DSCP.

8. The method as described in claim 6, characterized in that, The first field includes a priority PRI field, where the first value is the first PRI and the second value is the second PRI, and the first PRI and the second PRI are different.

9. The method as described in any one of claims 6-8, characterized in that, The message before the mark includes the first field, and the value of the first field in the message before the mark is the second value; The second device marks the message, including: If the message belongs to the first type of traffic, the value of the first field is changed from the second value to the first value.

10. The method as described in claim 9, characterized in that, The tagged message also includes a second field, the value of which is a second value. The second value of the second field is used by subsequent devices to restore the value of the first field in the tagged message.

11. The method according to any one of claims 6-10, characterized in that, The second device is a data forwarding device at the entrance of the first data center; or, The second device is a data forwarding device at the exit of the second data center.

12. A message forwarding method, characterized in that, The method includes: A third device in a first data center receives a message from a first device in the first data center. The message includes a first field, the value of which is a first value, indicating that the message belongs to a first type of traffic, which is traffic exchanged between devices in different data centers. Alternatively, the value of the first field is a second value, indicating that the message belongs to a second type of traffic, which is traffic exchanged between devices within the same data center. The third device updates the value of the first field in the message to the target value; The third device sends the updated message.

13. The method as described in claim 12, characterized in that, The target value is the second value; The third device updates the value of the first field in the message to the target value, including: If the first field in the message is the first value, then the value of the first field is updated from the first value to the second value.

14. The method as described in claim 13, characterized in that, The message further includes a second field, the value of which is a second value; the method further includes: The second value is obtained from the second field, and the second value of the second field is used by the third device to update the value of the first field in the message.

15. The method as described in claim 13, characterized in that, The third device is equipped with a flow rate level value; the method further includes: The second value is determined based on the traffic level value.

16. The method according to any one of claims 12-15, characterized in that, The third device is a data forwarding device that is directly connected to the terminal device in the first data center.

17. A message forwarding device, characterized in that, Applied to a first device, the device comprising: A transceiver module is configured to perform the transceiver operations as described in any one of claims 1 to 5; A processing module is configured to perform operations other than the send / receive operations described in any one of claims 1 to 5.

18. A message forwarding device, characterized in that, Applied to a second device, the device comprising: The transceiver module is configured to perform the transceiver operations as described in any one of claims 6 to 11; A processing module is configured to perform operations other than the send / receive operations in the method as described in any one of claims 6 to 11.

19. A message forwarding device, characterized in that, Applied to a third device, the device comprising: A transceiver module is configured to perform the transceiver operations as described in any one of claims 12 to 16; A processing module is configured to perform operations other than the send / receive operations in the method as described in any one of claims 12 to 16.

20. A message forwarding device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to execute a computer program stored in the memory to cause the message forwarding device to perform the method as described in any one of claims 1 to 5, or the method as described in any one of claims 6 to 11, or the method as described in any one of claims 12 to 16.

21. A communication system, characterized in that, It includes a first device and a second device, wherein the first device includes the message forwarding device as described in claim 17, and the second device includes the message forwarding device as described in claim 18.

22. The communication system as described in claim 21, characterized in that, The communication system further includes a third device, which includes the message forwarding device as described in claim 19.

23. A communication system, characterized in that, It includes a first device and a third device, the first device including the message forwarding device as described in claim 17, and the third device including the message forwarding device as described in claim 19.

24. The communication system as described in claim 23, characterized in that, The communication system further includes a second device, which includes the message forwarding device as described in claim 18.

25. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the method as claimed in any one of claims 1 to 5, or the method as claimed in any one of claims 6 to 11, or the method as claimed in any one of claims 12 to 16.

26. A computer program product, characterized in that, The computer program product includes a program or code that, when executed, implements the method as claimed in any one of claims 1 to 8, or the method as claimed in any one of claims 6 to 11, or the method as claimed in any one of claims 12 to 16.

27. A chip, characterized in that, The chip, when running, implements the method as described in any one of claims 1 to 5, or the method as described in any one of claims 6 to 11, or the method as described in any one of claims 12 to 16.

Citation Information

Patent Citations

  • Data scheduling method, device, storage medium and equipment

    CN109088829A

  • Network intercommunication method, device and apparatus and medium

    CN113992577A

  • Information transmission method and control device after integration of office network and industrial network

    CN116055420A

  • Message processing method and system

    CN116132555A

  • Message scheduling method and network equipment

    CN118590452A