Packet forwarding method and related apparatus

By carrying node indication and behavior indication information on the forwarding path in the message, the problem of insufficient forwarding path planning in the trunking communication network is solved, and efficient and secure message forwarding is achieved.

WO2026091628A1PCT designated stage Publication Date: 2026-05-07HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2025-06-30
Publication Date
2026-05-07

AI Technical Summary

Technical Problem

In trunked communication networks, existing technologies struggle to effectively plan and control message forwarding paths, resulting in low network efficiency and insufficient security in complex environments.

Method used

By carrying node indication information and forwarding behavior indication information on the forwarding path specified by the source node in the message, the behavior of N forwarding nodes can be controlled, so that the message is forwarded along the specified path, thus achieving precise control over the forwarding path.

Benefits of technology

It improves the packet forwarding efficiency of forwarding nodes, ensures that packets accurately reach the destination node, reduces insecure forwarding behavior, and enhances network stability and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025105397_07052026_PF_FP_ABST
    Figure CN2025105397_07052026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communications, and discloses a packet forwarding method and a related apparatus. The method is applied to a first node, and comprises: acquiring a packet, wherein the packet carries node indication information and N pieces of forwarding behavior indication information, the node indication information indicates N forwarding nodes for forwarding the packet according to a source routing mode, the source routing mode indicates that a source node specifies a first forwarding path for the packet, the N pieces of forwarding behavior indication information indicate interfaces via which the N forwarding nodes use the first forwarding path to forward the packet, and N is an integer greater than or equal to 1; and if it is determined, on the basis of the node indication information, that the N forwarding nodes comprise a first node, forwarding the packet via a first interface indicated by the forwarding behavior indication information corresponding to the first node. In this way, by carrying node indication information and forwarding behavior indication information in a packet, the present application improves packet forwarding efficiency while achieving control over a packet forwarding path.
Need to check novelty before this filing date? Find Prior Art

Description

Message forwarding method and related devices

[0001] This application claims priority to Chinese Patent Application No. 202411515119.2, filed on October 28, 2024, entitled “Message Forwarding Method and Related Apparatus”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of communication technology, and in particular to a message forwarding method and related apparatus. Background Technology

[0003] For cluster communication networks, the communication paths used between computing nodes vary depending on the network topology. To ensure efficient, stable, and secure operation in complex and ever-changing environments, effective planning of traffic forwarding paths is crucial. Typically, source routing (SR) technology is used to control traffic forwarding paths, which involves carrying information about the forwarding path specified by the source node in the packet, enabling forwarding nodes in the network to forward packets to the destination node along the corresponding path. Therefore, how to carry forwarding path information in the packet becomes a critical problem to be solved. Summary of the Invention

[0004] This application provides a message forwarding method and related apparatus, which can carry forwarding behavior indication information of N forwarding nodes on a first forwarding path specified by the source node in the message, thereby controlling the forwarding behavior of the N forwarding nodes and enabling the message to be forwarded to the destination node along the first forwarding path. The technical solution is as follows:

[0005] Firstly, a message forwarding method is provided, applied to a first node, the method comprising:

[0006] A message is obtained, the message carrying node indication information and N forwarding behavior indication information; wherein, the node indication information indicates N forwarding nodes that forward the message according to the source routing mode, the source routing mode indicates that the source node specifies a first forwarding path for the message, and the N forwarding behavior indication information indicates the interface of the N forwarding nodes that forward the message using the first forwarding path, where N is an integer greater than or equal to 1; if it is determined based on the node indication information that the N forwarding nodes include the first node, then the message is forwarded through the first interface indicated by the forwarding behavior indication information corresponding to the first node.

[0007] Wherein, when the first forwarding path includes M forwarding nodes, N is an integer less than or equal to M. That is, the source node, based on the first forwarding path, limits the forwarding behavior to N forwarding nodes, which may be some or all nodes on the first forwarding path (i.e., 1≤N≤M). This application does not restrict the specific value of N.

[0008] Therefore, upon receiving a packet, the first node in the network can determine whether it is a node specified by the source node whose forwarding behavior needs to be restricted, based on the node indication information carried in the packet. If it is determined that the first node is among N forwarding nodes, meaning its forwarding behavior is restricted, it will determine the forwarding behavior indication information corresponding to the first node from the N forwarding behavior indication information and forward the packet according to the first interface indicated by that forwarding behavior indication information. Of course, if the first node determines, based on the node indication information, that it does not need to forward the packet according to the packet forwarding path specified by the source node, then it does not need to parse and obtain the content of the N forwarding behavior indication information. In this way, while controlling the packet forwarding path, the packet forwarding efficiency of the forwarding nodes is improved.

[0009] In one possible implementation, after receiving a message, the first node needs to determine whether it (i.e., the first node) is included among the N forwarding nodes based on the node indication information carried in the message. This application provides two implementation schemes for node indication information. When the content of the node indication information is different, the implementation method of the first node determining whether it is included among the N forwarding nodes based on the node indication information is also different. Next, the specific content of the two types of node indication information and the implementation process of determining whether the first node is included among the N forwarding nodes will be explained.

[0010] In the first implementation, the node indication information includes a first indication value and a second indication value;

[0011] Before forwarding the packet through the first interface indicated by the forwarding behavior indication information corresponding to the first node, the method further includes: determining at least one target bit among the P bits contained in the target data based on the first indication value; wherein the target data is the second indication value, or the target data is obtained by binary conversion of the second indication value, and P is an integer greater than or equal to 1; determining whether the N forwarding nodes include the first node based on the value of the at least one target bit.

[0012] In one possible implementation, determining at least one target bit among the P bits contained in the target data based on the first indication value includes: obtaining a first bit width, the first bit width indicating the number of bits occupied by the first node in the target data; and determining the at least one target bit among the P bits contained in the target data based on the first indication value and the first bit width.

[0013] When the first bit width is 1, the bit corresponding to the first indication value in the target data is determined as the target bit, meaning there is one target bit. In this case, if the target bit value is 1, then the first node is included among the N forwarding nodes; if the target bit value is 0, then the first node is not included among the N forwarding nodes.

[0014] When the first bit width is greater than 1, multiple target bits are determined from the second indicator value, starting from the bit corresponding to the first indicator value and using the first bit width as an offset. The number of target bits is equal to the value of the first bit width. In this case, determining whether the N forwarding nodes include the first node based on the value of the at least one target bit includes: if the lowest bit value of the at least one target bit is 1, then the N forwarding nodes include the first node; or, if the highest bit value of the at least one target bit is 1, then the N forwarding nodes include the first node; or, if all bits of the at least one target bit are 1, then the N forwarding nodes include the first node.

[0015] In one possible implementation, before forwarding the packet according to the first interface indicated by the forwarding behavior indication information corresponding to the first node, the method further includes: updating the first indication value to obtain an updated first indication value; wherein, the updated first indication value is the sum of the first indication value before the update and the first bit width corresponding to the first node.

[0016] In this case, when the source node sends a message, the initial value of the first indication value can be 0.

[0017] In one possible implementation, the message header includes a first field, a second field, and N forwarding fields; wherein the first field carries the first indication value, the second field carries the second indication value, and the N forwarding fields carry the N forwarding behavior indication information.

[0018] In the second implementation, the node indication information includes a third indication value, which indicates the target forwarding node that forwards the packet according to the source routing mode;

[0019] Before forwarding the packet through the first interface indicated by the forwarding behavior indication information corresponding to the first node, the method further includes: if the target forwarding node is the first node, then determining that the N forwarding nodes include the first node.

[0020] Therefore, in the second implementation scheme, the source node can only restrict the forwarding behavior of one forwarding node (i.e., the target forwarding node) through the information carried in the message. In other words, when the node indication information includes a third indication value, the value of N is 1, and the message only carries the forwarding behavior indication information of the target forwarding node.

[0021] In one possible implementation, before forwarding the packet through the first interface indicated by the forwarding behavior indication information corresponding to the first node, the method further includes: updating the third indication value to obtain an updated third indication value; wherein the updated third indication value is the original third indication value minus one.

[0022] In this case, when the source node sends a message, the initial value of the third indicator can be the hop number corresponding to the target forwarding node, and the initial value of the third indicator is an integer greater than or equal to 1.

[0023] In one possible implementation, the message header includes a third field and a forwarding field, wherein the third field is used to carry the third indication value, and the forwarding field is used to carry forwarding behavior indication information of the target forwarding node.

[0024] In one possible implementation, before determining at least one target bit among the P bits contained in the target data based on the first indication value, the method further includes:

[0025] If the first indication value is not greater than P, then the step of determining at least one target bit among the P bits contained in the target data based on the first indication value is performed; if the first indication value is greater than P, then it is determined that the N forwarding nodes do not include the first node.

[0026] Therefore, this application, upon obtaining the first indication value, can predict the forwarding method of the first node based on the first indication value, i.e., whether the first forwarding node forwards the message according to the technical solution provided in this application. If, based on the first indication value, it is determined that the second indication value contains the target bit corresponding to the first node, the value of the target bit is used to determine whether the first node forwards the message according to the source routing mode, i.e., whether the first node is included among the N forwarding nodes. However, if, based on the first indication value, it is determined that the second indication value does not contain the target bit corresponding to the first node, the second indication value does not contain the target bit corresponding to the first node, and naturally, it is impossible to determine whether the first node forwards the message according to the source routing mode based on the value of the target bit. In this case, the first node can directly process the message according to its own determined message processing method.

[0027] In one possible implementation, before forwarding the packet through the first interface indicated by the forwarding behavior indication information corresponding to the first node, the method further includes: obtaining the number of bits with a value of 1 from the first bit to the bit indicated by the first indication value in the target data, to obtain a target value; and determining the forwarding behavior indication information corresponding to the first node from the N forwarding behavior indication information based on the target value.

[0028] In one possible implementation, determining the forwarding behavior indication information corresponding to the first node from the N forwarding behavior indication information includes:

[0029] Based on the target value and the second bit width, the offset byte number is determined; wherein, the second bit width indicates the number of units of bits occupied by the forwarding behavior indication information, and the number of bits occupied by the N forwarding behavior indication information is an integer multiple of the second bit width, and the offset byte number indicates the number of bytes by which the position of the forwarding behavior indication information corresponding to the first node in the message is offset from the position of the second indication value in the message; based on the offset byte number and the position of the second indication value in the message, the forwarding behavior indication information corresponding to the first node is determined from the N forwarding behavior indication information.

[0030] In one possible implementation, before forwarding the packet through the first interface indicated by the forwarding behavior indication information corresponding to the first node, the method further includes:

[0031] Obtain the link status information of the first interface, which indicates whether the communication connection between the first interface and other forwarding nodes is normal; if the communication connection of the first interface is in an abnormal state, determine a second forwarding path from the first node to the destination node; based on the second forwarding path, modify the node indication information and the N forwarding behavior indication information in the packet; forward the modified packet to the destination node through the second forwarding path.

[0032] Therefore, this application can avoid packets carrying insecure forwarding behavior indication information by judging the legality of the interface, thus preventing packets from being forwarded uncontrollably to illegal destination addresses. To a certain extent, it ensures the accuracy of packet forwarding in the source routing mode, so that when packets are forwarded along the specified forwarding path, they can accurately reach the destination node corresponding to the destination address.

[0033] In one possible implementation, the message header further includes a control field for carrying routing control information; wherein the routing control information includes a first type, a second type, or a third type, the first type indicating that each of the N forwarding behavior indications occupies the same number of bits, the second type indicating that at least two of the N forwarding behavior indications occupy different numbers of bits, and the third type indicating that N is 1.

[0034] Therefore, based on the message forwarding method provided in this application, when actually forwarding messages, the source node can flexibly set the way in which node indication information and forwarding behavior indication information are carried in the message header according to the actual required message header size.

[0035] Secondly, a message forwarding method is provided, applied to a source node, the method comprising:

[0036] Obtain the first forwarding path of the packet, the first forwarding path indicating the forwarding path from the source node to the destination node; based on the first forwarding path, send the packet carrying node indication information and N forwarding behavior indication information; wherein, the node indication information indicates N forwarding nodes that forward the packet according to the source routing mode, the source routing mode indicates that the source node specifies the first forwarding path for the packet, and the N forwarding behavior indication information indicates the interface of the N forwarding nodes that forward the packet using the first forwarding path, and N is an integer greater than or equal to 1.

[0037] Therefore, after specifying the first forwarding path for the packet, the source node carries node indication information and N forwarding behavior indication information in the packet sent to the network. The node indication information indicates the N forwarding nodes on the first forwarding path that need to forward the packet according to the source routing mode, meaning that the forwarding behavior of these N forwarding nodes needs to be restricted during the forwarding process. The N forwarding behavior indication information corresponds one-to-one with the N forwarding nodes, instructing the N forwarding nodes to use the interface of the first forwarding path to forward the packet. In this way, the forwarding behavior of the N forwarding nodes on the packet forwarding path can be controlled, thereby achieving the effect of planning the packet forwarding path.

[0038] In one possible implementation, the node indication information includes a first indication value and a second indication value; wherein, the first indication value indicates at least one target bit corresponding to the first node in the P bits contained in the target data, the value of the at least one target bit indicates whether the N forwarding nodes include the first node, the first node is any forwarding node on the first forwarding path that forwards the packet, the target data is the second indication value, or the target data is obtained by binary conversion of the second indication value, where P is an integer greater than or equal to 1.

[0039] In one possible implementation, the message header includes a first field, a second field, and N forwarding fields, where N is an integer greater than 1;

[0040] Wherein, the first field is used to carry the first indication value, the second field is used to carry the second indication value, and the N forwarding fields are used to carry the N forwarding behavior indication information.

[0041] In one possible implementation, the node indication information includes a third indication value, which indicates the target forwarding node that forwards the packet according to the source routing mode, where N=1, and the forwarding behavior indication information indicates the interface through which the target forwarding node forwards the packet using the first forwarding path.

[0042] In one possible implementation, the message header includes a third field and a forwarding field; wherein the third field is used to carry the third indication value, and the forwarding field is used to carry forwarding behavior indication information of the target forwarding node.

[0043] In one possible implementation, the message header further includes a control field, which is used to carry routing control information;

[0044] The routing control information includes a first type, a second type, or a third type. The first type indicates that the number of bits occupied by each of the N forwarding behavior indication information is the same. The second type indicates that at least two of the N forwarding behavior indication information occupy different numbers of bits. The third type indicates that N is 1.

[0045] Thirdly, a message forwarding apparatus is provided, which has the function of implementing the message forwarding method behavior described in the first aspect above. The message forwarding apparatus includes at least one module, which is used to implement the message forwarding method provided in the first aspect above.

[0046] Fourthly, a message forwarding apparatus is provided, which has the function of implementing the message forwarding method behavior described in the second aspect above. The message forwarding apparatus includes at least one module for implementing the message forwarding method provided in the second aspect above.

[0047] Fifthly, a message forwarding system is provided, the system including a source node, a first node and a destination node, wherein the first node is a node on the message forwarding path from the source node to the destination node;

[0048] The source node is used to obtain the first forwarding path of the packet and, based on the first forwarding path, send the packet carrying node indication information and N forwarding behavior indication information; wherein, the first forwarding path indicates the forwarding path from the source node to the destination node, the node indication information indicates N forwarding nodes that forward the packet according to the source routing mode, the source routing mode indicates that the source node specifies the first forwarding path for the packet, and the N forwarding behavior indication information indicates the interface of the N forwarding nodes that forward the packet using the first forwarding path, where N is an integer greater than or equal to 1;

[0049] The first node is used to acquire the message. If it is determined based on the node indication information that the N forwarding nodes include the first node, then the message is forwarded through the first interface indicated by the forwarding behavior indication information corresponding to the first node.

[0050] The destination node is used to receive the message.

[0051] In a sixth aspect, a chip is provided, the chip including a processor configured to perform the steps of the packet forwarding method described in the first aspect, or the steps of the packet forwarding method described in the second aspect.

[0052] In a seventh aspect, a computer device is provided, the computer device including a processor configured to perform the message forwarding method described in the first aspect or the message forwarding method described in the second aspect.

[0053] Optionally, the computer device may further include a memory for storing a computer program that executes the packet forwarding method provided in the first aspect, or for storing a computer program that executes the packet forwarding method provided in the second aspect, such that the processor is configured to execute the computer program stored in the memory to implement the packet forwarding method described in the first aspect or the packet forwarding method described in the second aspect.

[0054] Optionally, the computer device may further include a communication bus for establishing a connection between the processor and the memory.

[0055] Eighthly, a computer-readable storage medium is provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform the message forwarding method described in the first aspect or the message forwarding method described in the second aspect.

[0056] In a ninth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, cause the computer to perform the message forwarding method described in the first aspect or the message forwarding method described in the second aspect.

[0057] Alternatively, a computer program is provided that, when run on a computer, causes the computer to execute the message forwarding method described in the first aspect above, or to execute the message forwarding method described in the second aspect above.

[0058] The technical effects achieved by the second to ninth aspects mentioned above are similar to the technical effects achieved by the corresponding technical means in the first aspect, and will not be repeated here. Attached Figure Description

[0059] Figure 1 is a schematic diagram of the basic framework of a supernode provided in an embodiment of this application;

[0060] Figure 2 is a schematic diagram of the communication path of All2All communication in a supernode provided in an embodiment of this application;

[0061] Figure 3 is a schematic diagram of a traffic forwarding control path provided in an embodiment of this application;

[0062] Figure 4 is a schematic diagram of the SRv6 message format in a related technology;

[0063] Figure 5 is a schematic diagram of the SID length in a compressed message header in a related technology;

[0064] Figure 6 is a schematic diagram of the architecture of a message forwarding system provided in an embodiment of this application;

[0065] Figure 7 is a flowchart illustrating a message forwarding method provided in an embodiment of this application;

[0066] Figure 8 is a flowchart illustrating another message forwarding method provided in an embodiment of this application;

[0067] Figure 9 is a schematic diagram of the first message header format provided in the embodiments of this application;

[0068] Figure 10 is a schematic diagram of a message forwarding path provided in an embodiment of this application;

[0069] Figure 11 is a schematic diagram of the second message header format provided in an embodiment of this application;

[0070] Figure 12 is a schematic diagram of the third message header format provided in the embodiments of this application;

[0071] Figure 13 is a schematic diagram of the fourth message header format provided in the embodiments of this application;

[0072] Figure 14 is a schematic diagram of a message forwarding device provided in an embodiment of this application;

[0073] Figure 15 is a schematic diagram of another message forwarding device provided in an embodiment of this application;

[0074] Figure 16 is a schematic diagram of the structure of a network device provided in an embodiment of this application;

[0075] Figure 17 is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0076] 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.

[0077] To facilitate understanding, before explaining the message forwarding method provided in this application, the relevant background and implementation environment of the technical solution in this application will be introduced first.

[0078] First, the relevant background of the embodiments of this application will be introduced.

[0079] The continuous advancement and convergence of data analytics, high-performance computing (HPC), and artificial intelligence (AI) technologies are leading new directions in data center design and construction. As the cornerstone supporting cutting-edge technologies such as data analytics, HPC, and AI, the core objective of data centers is to build an efficient, reliable, and scalable infrastructure environment that supports complex and ever-changing business needs with optimized hardware and software resources.

[0080] The infrastructure of a data center primarily comprises three core components: computing, storage, and networking. These three elements complement each other, forming a crucial framework supporting business operations. Computing resources, as the core of data processing and analysis, utilize high-performance servers, clusters, and even supercomputers to handle massive data computation tasks, meeting various needs from simple queries to complex model training. Storage resources are responsible for persistent data preservation. Data centers typically employ distributed storage systems, combining various storage media such as solid-state drives (SSDs) and hard disk drives (HDDs) to achieve efficient data read / write operations and disaster recovery backups, ensuring data security and availability. The network, as the bridge connecting computing and storage, plays a vital role in the data center. It not only builds high-speed, low-latency data channels between computing nodes and between computing and storage nodes but also directly affects the communication efficiency and business performance of the entire infrastructure. Therefore, the behavior and capabilities of the interconnecting network in the infrastructure for forwarding traffic are among the key aspects of the infrastructure. A well-designed and high-performance network architecture can significantly improve the speed and quality of data flow, providing strong support for business applications.

[0081] To meet the demands of large-scale business deployments, data centers often employ a supernode design approach. A supernode integrates computing, storage, and interconnect resources, achieving efficient resource utilization and flexible scheduling through a highly integrated design. This design not only enhances the processing power of individual nodes but also simplifies network architecture, reduces management complexity, and provides strong support for rapid business deployment and expansion.

[0082] As shown in Figure 1, Figure 1 is a schematic diagram of the basic framework of a supernode provided in an embodiment of this application. A supernode typically includes multiple frames (also called resource frames), and each resource frame contains multiple physical nodes / units such as compute nodes and storage nodes that provide basic functions. The interconnection network in the supernode provides interconnection and interoperability between physical nodes within a frame and between physical nodes in different frames.

[0083] The intra-frame interconnection network within a single resource frame and the inter-frame interconnection network between multiple resource frames can use different topologies (fabrication structures) based on different service traffic models. Typical topologies include Fat-tree topology, Torus topology, Full mesh topology, and Dragonfly topology. Different types of topologies have different characteristics. For example, the Fat-tree networking architecture can achieve non-blocking forwarding, the Dragonfly networking architecture has a small network diameter, and Torus and Full mesh topologies have high scalability and cost-effectiveness. Furthermore, by running a routing algorithm suitable for the network topology on the above interconnection network, the communication paths between nodes can be constructed.

[0084] Due to differences in business deployment methods and different business communication model requirements, simply using the forwarding path constructed by the Internet routing protocol to forward traffic indiscriminately and without planning cannot achieve the optimal use of the Internet bandwidth resources provided by the Internet. There may be some Internet nodes with heavy bandwidth resources, resulting in congestion on the corresponding forwarding path and affecting the communication performance between nodes; there may also be some Internet nodes with bandwidth resources that are not effectively utilized.

[0085] As an example, refer to Figure 2, which is a schematic diagram of the communication path for All2All communication in a supernode provided in an embodiment of this application. Assume an AI training task (task 1) is deployed on four compute nodes (labeled 00-03) in resource frame 0 and four compute nodes (labeled 10-13) in resource frame 1, totaling eight compute nodes. These eight compute nodes need to perform All2All communication. The compute nodes in each resource frame are interconnected using a Full mesh topology, and all compute nodes in the resource frame are directly connected to the switch (SW) within the frame. Taking resource frame 0 as an example, compute nodes 00 to 07 are connected to each other in pairs, and all compute nodes in resource frame 0 are directly connected to SW0. The interconnection between resource frames 0 to 4 is also implemented using a full mesh topology. That is, the full mesh topology of the interconnection between the frames is constructed through the interface of the SW of each resource frame. For the five resource frames shown in Figure 2, there is a direct link between each pair through the interface of the SW. The direct link between resource frames 2, 3 and 4 is not shown in Figure 2.

[0086] It should be understood that the numbering of each compute node and the labeling of the SW are merely to illustrate the position and connection relationship of the compute nodes and SWs within the supernode, and do not constitute a limitation on their product form and function. That is, all switches in Figure 2 can be of the same type or different types; the types of compute nodes within each box can be the same or different. This application embodiment does not impose such limitations.

[0087] When the four compute nodes (labeled 00-03) in resource frame 0 communicate with the four compute nodes (labeled 10-13) in resource frame 1, if only the shortest path in the inter-frame interconnection network is used, 16 traffic forwardings will all pass through the direct path between resource frames 0 and 1 (i.e., the path SW0-SW1), causing congestion on this path and severely affecting the communication performance between these eight compute nodes.

[0088] If the forwarding path of traffic can be planned, and some traffic is not used to use the shortest direct path mentioned above, but is instead forwarded through another resource frame to reach the destination resource frame (i.e., resource frame 1 shown in Figure 2), the congestion of the direct path between resource frame 0 and resource frame 1 can be greatly alleviated, and the running efficiency of task 1 can be improved.

[0089] As shown in Figure 3, a simple traffic path planning strategy is as follows: traffic from compute node 00 in resource box 0 to all nodes in resource box 1 is routed through resource box 2. That is, the All-to-All communication traffic between compute node 00 and compute nodes 10, 11, 12, and 13 is transmitted along the forwarding path SW0-SW2-SW1. Similarly, traffic from compute node 01 in resource box 0 to all nodes in resource box 1 is routed through resource box 3. That is, the All-to-All communication traffic between compute node 01 and compute nodes 10, 11, 12, and 13 is transmitted along the forwarding path SW0-SW3-SW1. Traffic from compute node 02 in resource box 0 to all nodes in resource box 1 is routed through resource box 4. That is, the All-to-All communication traffic between compute node 02 and compute nodes 10, 11, 12, and 13 is transmitted along the forwarding path SW0-SW4-SW1. For compute node 03 in resource 0, its traffic to all nodes in resource frame 1 does not detour but continues to use the shortest direct path shown in Figure 2, i.e., the forwarding path along SW0-SW1. This demonstrates that effective planning of the traffic transmission path between multiple compute nodes avoids congestion on the direct link between resource frame 0 and resource frame 1, and ensures that the available communication bandwidth between the eight compute nodes across frames is equal to the available bandwidth between the eight compute nodes within the same frame.

[0090] Based on the above description, the technical solution of this application aims to provide a technology that can specify traffic forwarding paths to guide forwarding devices in the network system to forward traffic based on the planned forwarding paths, thereby making full use of the network's forwarding capabilities.

[0091] Typical methods for controlling traffic forwarding paths include source routing (SR) based forwarding path control schemes and access control list (ACL) based forwarding path control schemes. The following sections will briefly introduce these two typical forwarding path control schemes.

[0092] 1. Forwarding path control scheme based on source routing technology

[0093] Source routing technology refers to including forwarding path information in the header of communication traffic packets. Forwarding devices in the network forward packets based on the forwarding path indicated by this information, achieving the goal of controlling different traffic using different forwarding paths. A typical protocol for packet forwarding based on source routing technology is segment routing IPv6 (SRv6), which uses the Internet Protocol version 6 (IPv6) data plane. SRv6 guides packet forwarding by dividing the packet forwarding path into different segments and inserting a segment identifier (SID) into the packet at the beginning of the path.

[0094] One of the key mechanisms for implementing SRv6 based on the IPv6 forwarding plane is to add a routing extension header called the segment routing header (SRH) to the IPv6 packet. This extension header is designed to carry explicit information about the packet forwarding path, allowing the network to follow a predefined, ordered sequence of nodes and segments when forwarding packets.

[0095] The SRH contains several key fields, the most important of which are the segment list and the remaining segments (left) fields. The segment list is an ordered list containing a series of IPv6 addresses (SIDs) that the packet needs to traverse. These addresses represent nodes or logical segments in the network. The segment list guides the hop-by-hop forwarding process of the packet, ensuring that the packet reaches its destination along the predetermined path. The segments left field is a decrementing counter that tracks how many SIDs remain to be processed. Whenever a packet arrives at an SRv6 node, that node retrieves the first SID (the current destination address) from the segment list, decrements the remaining segments by 1, and forwards the packet to the corresponding interface. In other words, the segments left field ensures that the packet progresses step-by-step along the predetermined path until all SIDs have been processed, ultimately reaching the final destination (the final receiver).

[0096] It should be noted that in SRv6, the destination address (DA) in an IPv6 packet is dynamic. In the context of SRv6, the DA of an IPv6 packet is no longer the final destination address of the receiver, but the address of the SRv6 node that needs to be forwarded. Moreover, this address will change continuously as the packet is forwarded, until the segments left decreases to 0, at which point the IPv6 DA points to the actual receiver.

[0097] Referring to Figure 4, which shows a schematic diagram of the structure of an SRv6 message. In the message format defined by SRv6, the segment list field in SRH contains multiple segment fields of size 128 bits (i.e., segment list[0]-segment list[n] shown in Figure 4). Each segment field indicates the node in the message forwarding path that needs to forward the message, as well as the instruction that the node needs to execute and the relevant parameter information of the execution instruction.

[0098] Clearly, specifying the forwarding behavior of multiple nodes along a packet forwarding path requires carrying multiple 128-bit pieces of information in the packet header, resulting in a large header length and significant overhead for data transmission, severely impacting the effective utilization of network links. Furthermore, each forwarding node along the forwarding path needs to modify the DA (Data Access Parameter) of the IPv6 packet during the forwarding process, ensuring accurate transmission to the next-hop node on the forwarding path.

[0099] It should be understood that the overhead of the message header can be represented by the ratio of the message length to the message payload. The message length is the sum of the lengths of the message header, message payload, and message trailer. The message payload is the length of the interactive data carried by the message.

[0100] In addition, regarding the other fields in the SRH extension header in Figure 4, the meaning of "next header" is: indicating the type of the next header in the packet following the SRH. This field is used to guide the further processing of the packet in the IPv6 network, specifying the header type immediately following the SRH; the meaning of "Hdr Ext Len" is: header extension length, in 32-bit words (i.e., 4 bytes), used to represent the total length of the SRH extension header (including the SRH itself and any optional TLVs); the meaning of "routing type" is: routing type. For SRv6, the value of this field is fixed at 4, indicating that this is a segment routing header; the meaning of "segments left" is: number of remaining segments, indicating how many IPv6 address segments in the SRH segment list need to be processed. This value is decremented by one each time the packet passes through an IPv6 address segment; the meaning of "last entry" is: the index of the last entry (starting from 0), used to indicate the segment... The index position of the last valid entry in the list helps to quickly locate the last segment that needs to be processed; the meaning of "fags" is: flag bits, used to provide additional control information for SRH. In SRv6, the specific use of these flag bits can be defined as needed, but not all bits may be used in the current standard; the meaning of "tag" is: tag, used to classify or mark packets as packets with a specific set of attributes. The allocation and use of tags can be done locally or globally; the meaning of "segments list" is: segment list, which contains a list of one or more IPv6 addresses that define the forwarding path of packets in the network, and the addresses in the list are arranged in the order in which the packets should pass; the meaning of "Optional TLV (variable)" is: optional type-length-value (TLV), which provides additional metadata to support the complex functions and extensions of SRv6. The TLV field can contain various types of data, depending on its type and length.

[0101] It should be understood that the meaning of each of the above fields, as well as the related information they carry, can be found in the relevant definitions and explanations in the IPv6 protocol, and will not be repeated here.

[0102] Furthermore, to address the issue of high overhead in standard SRv6 packet headers, related technologies also provide an optimization solution, namely the generalized segment routing over IPv6 (G-SRv6) technology. This technology significantly reduces the overhead of SRv6 packet headers by compressing the length of the segment field in the SRv6 packet header, thereby improving network transmission efficiency and performance.

[0103] In SRv6, SIDs are represented by 128-bit IPv6 addresses. In G-SRv6, however, by compressing the SID, its length can be reduced from 128 bits to 32 bits. Since SRv6 SIDs often contain common prefix information (such as the Locator prefix), G-SRv6, when compressing the SID, can remove this redundant prefix information, as well as optional (arguments, Arg) and padding fields, retaining only the necessary node ID and function (Func) fields (representing the SID's function or type, such as forwarding, encapsulation, decapsulation, etc.), thus achieving SID compression. Furthermore, related technologies continue to explore new compression methods for the G-SRv6 segment field, aiming to compress it to 16 bits to further reduce header overhead.

[0104] It should be understood that the Arg field is used to pass additional parameters to the operation or function specified by the Func field. In standard SRv6, these parameters might be necessary, but during the G-SRv6 compression process, if these parameters are not necessary in all scenarios, or can be passed through other means (such as network configuration, protocol extensions, etc.), this field can be removed to reduce the SID length. The Padding field is primarily used to ensure that the SID length is a fixed 128 bits. However, in G-SRv6, since the SID has been compressed to 32 bits, the Padding field is no longer used to fill blank spaces, so this field can be removed.

[0105] In SRv6, if a packet needs to carry 10 SIDs for forwarding, with each SID occupying 16 bytes (128 bits), then the total length of the segment list field in the packet header would reach 10 * 16 bytes = 160 bytes. However, in G-SRv6, if the SID is compressed to 32 bits (4 bytes), the total length of the segment list field will be reduced to 10 * 4 bytes = 40 bytes, a 75% reduction in overhead compared to SRv6.

[0106] As can be seen from the above introduction, although SRv6 and G-SRv6 technologies can effectively specify and control the forwarding path of traffic based on a predetermined message format, the overhead of the message header is relatively large. Especially in business scenarios such as computing cluster networks and memory pooling, the amount of data to be communicated (i.e., the message payload) is relatively small. In this case, even a slight increase in the overhead of the message header will have a significant impact on the effective utilization rate of the link.

[0107] 2. Forwarding path control scheme based on configured ACL

[0108] For network devices, these devices typically support ACL (Access Control List) features. ACL functionality in network devices allows network administrators to filter and control network traffic based on a set of predefined rules. ACLs are widely used in network devices such as routers, switches, and firewalls to achieve various purposes such as network security, traffic management, and quality of service (QoS) guarantees. Based on this, ACL policies can be configured on network devices. This ACL configuration can match specific traffic to execute a specified action on the matched traffic. This action can specify the forwarding of packets on a particular interface.

[0109] In one ACL configuration method, traffic matching can be performed using 5-tuples. A traffic 5-tuple can be represented as {source address, destination address, protocol type, source transport layer port number, destination transport layer port number}. ACLs can specify multiple actions for specific traffic, such as {forward to specific interface, drop, redirect to specific interface, send to the control plane of the network forwarding device}. When controlling the forwarding path of traffic, the forwarding path needs to be specified. Therefore, the ACL action is configured as "forward to specific interface," and the interface identifier (ID) of the forwarded traffic is specified, for example, "forward to specific interface, forwarding interface port12".

[0110] As an example, the configuration information specifying the ACL forwarding policy for a particular traffic forwarding interface of a network device includes at least the following two parts:

[0111] (1) Matching traffic information: {Source address: 192.168.1.1, Destination address: 192.168.2.1, Protocol type: Transmission Control Protocol (TCP), Source transport layer port number: 1689, Destination transport layer port number: 8080}

[0112] (2) Specific action to be performed on the traffic: {Forward to specific interface, forwarding interface: port12}

[0113] As described above, when it is necessary to specify the forwarding path of a certain traffic in the network, ACL forwarding policies need to be configured for all network devices on that forwarding path to achieve end-to-end forwarding path control. That is, based on the forwarding path of the traffic, the interface for each network device on that forwarding path to forward packets in that traffic is configured.

[0114] In large-scale node communication scenarios, ACL forwarding policies need to be configured on network devices for each traffic flow. This inevitably leads to the need for network devices to store and maintain a large number of rule entries. Furthermore, the use of ternary content addressable memory (TCAM) for ACL forwarding policy processing on network devices results in significant hardware resource overhead for supporting ACL forwarding, and ACL forwarding processing introduces additional latency.

[0115] In summary, this application adopts source routing technology and provides a new packet forwarding method to control the forwarding behavior of N forwarding nodes on the packet forwarding path, thereby ensuring that the packet can be transmitted to the destination node along the forwarding path specified by the source node. Here, N is an integer greater than or equal to 1, and N is less than or equal to M, where M is the total number of forwarding nodes on the packet forwarding path.

[0116] In this embodiment, the source node specifies a first forwarding path for the packet. Specifically, the packet sent to the network carries node indication information and N forwarding behavior indication information. The node indication information indicates the N forwarding nodes on the first forwarding path that need to forward the packet according to source routing mode, meaning that the forwarding behavior of these N forwarding nodes needs to be restricted during the forwarding process. The N forwarding behavior indication information corresponds one-to-one with the N forwarding nodes, instructing the N forwarding nodes to use the interface of the first forwarding path to forward the packet. Based on this, any forwarding node in the network (e.g., the first node), upon receiving a packet, can determine whether it is a node specified by the source node whose forwarding behavior needs to be restricted, based on the node indication information carried in the packet. If the node indication information determines that the N forwarding nodes include the first node, meaning its forwarding behavior is restricted, then it determines the forwarding behavior indication information corresponding to the first node from the N forwarding behavior indication information carried in the packet and forwards the packet according to the first interface indicated by that forwarding behavior indication information.

[0117] In this context, the source node is a node that encapsulates node indication information and N forwarding behavior indication information in the packet based on the first forwarding path. However, before encapsulating the node indication information and N forwarding behavior indication information, the packet can be generated by the source node itself or obtained by the source node from other nodes. In other words, the source node mentioned in this embodiment refers to the node that encapsulates node indication information and N forwarding behavior indication information in the packet, and not the node that generates the packet but does not encapsulate the node indication information and N forwarding behavior indication information.

[0118] As an example, suppose a first node needs to send certain processing data to a second node. The first node generates a message carrying this processing data according to the communication protocol. In this case, if a third node, after receiving the message from the first node, encapsulates node indication information and N forwarding behavior indications in the message based on a forwarding path from the third node to the second node, then the third node is the source node defined in this embodiment. Alternatively, if the first node, before sending the message, also encapsulates node indication information and N forwarding behavior indications in the message based on a forwarding path from the first node to the second node, then the first node is the source node defined in this embodiment.

[0119] Therefore, in this embodiment, when forwarding packets, the forwarding node can directly determine whether it needs to forward the packet according to the source node's instructions based on the node indication information. If it determines that it needs to forward the packet according to the source node's instructions, it can forward the packet through the interface indicated by the corresponding forwarding behavior indication information. If it determines that it does not need to forward the packet according to the source node's instructions, it is not necessary to parse and obtain the content of the N forwarding behavior indication information carried in the packet. In this way, while controlling the packet forwarding behavior, the packet forwarding efficiency of the forwarding node is improved.

[0120] It is worth emphasizing that, compared to other forwarding path control schemes under source routing technologies such as SRv6 and G-SRv6, the embodiments of this application do not require first determining the SID based on the segments left, then reading the corresponding content in the segment list field based on the SID, and finally determining whether it needs to forward the packet according to the packet forwarding path specified by the source node based on the read content. Furthermore, for forwarding nodes, in the process of forwarding packets, the forwarding nodes of this application do not need to care about the subsequent forwarding paths; they only need to forward the packet according to the interface indicated by the forwarding behavior indication information. Unlike SRv6 and G-SRv6 technologies, which modify the destination address (indicating the forwarding node receiving the packet at the next hop in the forwarding path) hop by hop, the destination address (indicating the final recipient of the packet) of the packet in this embodiment does not change during the packet forwarding process.

[0121] After introducing the relevant background of the embodiments of this application and the core concept of the technical solution of this application, the implementation environment of the message forwarding method provided by the embodiments of this application will be explained next.

[0122] Referring to Figure 6, which is a schematic diagram of the architecture of a terminal-network collaborative message forwarding system provided in an embodiment of this application, the cluster (i.e., the system) includes a communication node 200 and a forwarding network 300. The communication node 200 includes multiple nodes for initiating and receiving communication, such as nodes 201 and 202 shown in Figure 6. The forwarding network 300 includes multiple forwarding nodes, which are used to realize interconnection and communication between the multiple nodes in the communication node 200.

[0123] The communication node can be a physical node or chip of the type such as a central processing unit (CPU), graphics processing unit (GPU), neural processing unit (NPU), or storage, or a computer device containing one or more of the above processing units. This application embodiment does not limit the product form of the communication node. Furthermore, the communication node 200 accesses a forwarding network and relies on the forwarding network to complete the forwarding of communication data between multiple nodes within the communication node.

[0124] The forwarding network 300 is mainly used to interconnect multiple nodes in the communication node 200 and to forward communication data between the nodes. The forwarding network can be constructed from multiple forwarding nodes. These forwarding nodes can be any device with packet forwarding capabilities, such as a switch, router, virtual switch, virtual router, packet transport network (PTN), optical transport network (OTN), network interface card (NIC) in a server, or a server containing a neural processing unit (NPU) or graphics processing unit (GPU). This application embodiment does not limit the product form of the forwarding nodes.

[0125] In one possible implementation, a communication node can obtain the topological connection relationship between various communication nodes and between various forwarding nodes within the forwarding network 300, and calculate the message forwarding path from itself to any other communication node (i.e., the destination node for communication) based on communication requirements, and then send messages according to the technical solution provided in the embodiments of this application based on the calculated message forwarding path.

[0126] In some embodiments, as shown in FIG6, the message forwarding system may further include a management and control unit 100. The management and control unit 100 is responsible for task scheduling and deployment, and centralized management and control of the forwarding network. Furthermore, the management and control unit 100 holds the topological connection relationships of the entire communication system, that is, it holds the connection relationships of each communication node and each forwarding node.

[0127] As an example, the management unit 100 can be a software system deployed on a service device containing a CPU, memory, and storage, such as the management system of the aforementioned supernode cluster; the management unit 100 can also be deployed on independent hardware, such as a server or terminal in a supernode. This application does not limit the physical form and implementation of the management unit 100.

[0128] In one possible implementation, the control unit 100 can calculate the message forwarding path between the source node (e.g., node 201 shown in Figure 6) and the destination node (e.g., node 202 shown in Figure 6) based on the communication requirements between the communication nodes.

[0129] Communication node 200 can interact with management and control unit 100. For example, a communication node can obtain the topological connections between communication nodes and between forwarding nodes within forwarding network 300 from management and control unit 100, and calculate the message forwarding path from itself to any other communication node (i.e., the destination node for communication) based on communication requirements. Forwarding network 300 can also interact with management and control unit 100, which can configure and control forwarding network 300 and issue configuration information.

[0130] Therefore, for the source node and the destination node communicating, when determining the message forwarding path from the source node to the destination node, the message forwarding path can be calculated by the control unit 100 and sent to the source node; or it can be calculated by the source node itself after obtaining the topological connection relationship between each communication node and between each forwarding node in the forwarding network 300. This application embodiment does not limit this.

[0131] Based on the above message forwarding system, the message forwarding process for end-to-end network collaboration provided in this application embodiment can be as follows: The management unit 100 calculates the message forwarding path between each node in the communication node 200 based on the task deployment and interconnection network information. For the source node and destination node that need to communicate, the management unit 100 sends the message forwarding path information from the source node to the destination node to the source node. When the source node sends a message to the destination node, it carries node indication information and N forwarding behavior indication information in the message according to the message forwarding method provided in this application embodiment. After receiving the message, a forwarding node in the forwarding network 300 first determines whether it needs to forward the message according to the source node's indication based on the node indication information carried in the message. If it determines that it needs to forward the message according to the source node's indication, it forwards the message through the first interface indicated by the corresponding forwarding behavior indication information until the message is forwarded to the destination node.

[0132] It should be noted that the embodiments of this application do not limit the number or type of communication nodes 200, nor do they limit the topology of the forwarding network 300. For example, a communication node 200 can be a supernode as shown in Figure 1, which includes multiple resource frames, each of which includes multiple nodes. In this case, the forwarding network 300 includes the intra-frame interconnection network and the inter-frame interconnection network shown in Figure 1.

[0133] It should be understood that the business scenarios and system architecture described above in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0134] After introducing the relevant background and implementation environment involved in the embodiments of this application, the message forwarding method provided in the embodiments of this application will be explained in detail below.

[0135] Figure 7 is a flowchart of a message forwarding method provided in an embodiment of this application. The method is applied to a first node. The first node can be any forwarding node in the intra-frame interconnection network shown in Figure 1 (not shown in Figure 1), any forwarding node in the inter-frame interconnection network shown in Figure 2 or 3 (not shown in Figures 2 and 3), a resource switch (SW) within any resource frame in Figure 2 or 3, or any forwarding node in the forwarding network 300 shown in Figure 6. Referring to Figure 7, the method includes the following steps.

[0136] Step 701: Obtain a message carrying node indication information and N forwarding behavior indication information; wherein, the node indication information indicates the N forwarding nodes that forward the message according to the source routing mode, the source routing mode indicates that the source node specifies the first forwarding path for the message, and the N forwarding behavior indication information indicates the interface of the N forwarding nodes that forward the message using the first forwarding path, where N is an integer greater than or equal to 1.

[0137] In the case where the first forwarding path includes M forwarding nodes, the source node, based on the first forwarding path, limits the forwarding behavior to N forwarding nodes, which may be some or all of the nodes on the first forwarding path. That is, N is an integer less than or equal to M. In the case of 1≤N≤M, the specific value of N is not limited in this embodiment.

[0138] It should be understood that for the first forwarding path specified by the source node, the more nodes N whose forwarding behavior needs to be restricted, the more information is carried in the message. Therefore, if it can be guaranteed that the message is forwarded along the first forwarding path, the forwarding behavior of only some nodes on the first forwarding path can be restricted to reduce message overhead.

[0139] As an example, for a message, suppose the first forwarding path from the source node to the destination node is: Node A - Node B - Node D - Node F. If Node D is only connected to Node B and Node F, and Node B is connected to Node A, then when the source node forwards the control message according to this first forwarding path, since Node D will inevitably forward the message to Node F after receiving the message from Node B, based on the connection relationship, the source node does not need to restrict the forwarding behavior of Node D, nor does it need to carry the forwarding behavior indication information corresponding to Node D in the message.

[0140] In some embodiments, for any forwarding behavior indication information carried in the message, the forwarding behavior indication information may be used not only to indicate the interface for forwarding the message, but also to indicate instruction information for other processing of the message. These other processing may include sending the message to the CPU of the forwarding node, or mirroring the message to a traffic scrubbing device while forwarding it; this application embodiment does not impose any limitations on this.

[0141] As described in the background section above, when the forwarding path of a message needs to be restricted is the first forwarding path, the source node can insert node indication information for N forwarding nodes whose forwarding behavior needs to be restricted, as well as forwarding behavior indication information for these N forwarding nodes, into the message. Here, N can be equal to or less than the total number of nodes on the first forwarding path; that is, the source node can restrict the forwarding behavior of N forwarding nodes on the first forwarding path to ensure that the message can be forwarded along the first forwarding path. Based on this, any forwarding node receiving the message (e.g., the first node) can determine whether it is a forwarding node whose forwarding behavior is restricted by the source node based on the node indication information carried in the message; and if it determines that it is a forwarding node whose forwarding behavior is restricted by the source node, i.e., it is included among the N forwarding nodes, it forwards the message according to the method shown in step 702 below.

[0142] In other words, after receiving a message, the first node needs to determine whether it (the first node) is included among the N forwarding nodes based on the node indication information carried in the message. This application provides two implementation schemes for node indication information. When the content of the node indication information differs, the implementation method by which the first node determines whether it is included among the N forwarding nodes also differs. Next, the specific content of these two types of node indication information and the implementation process for determining whether the first node is included among the N forwarding nodes will be explained.

[0143] In the first implementation scheme, the node indication information includes a first indication value and a second indication value.

[0144] In some embodiments, based on the content of the node indication information described above, the message header of the message in step 701 includes: a first field, a second field, and N forwarding fields; wherein, the first field is used to carry a first indication value, the second field is used to carry a second indication value, and the N forwarding fields are used to carry N forwarding behavior indication information.

[0145] Based on the content of the node indication information mentioned above, in one possible implementation, the process by which the first node determines whether it includes itself among the N forwarding nodes can be as follows: based on the first indication value, determine at least one target bit among the P bits contained in the target data; based on the value of the at least one target bit, determine whether the N forwarding nodes include the first node.

[0146] Wherein, the target data is the second indication value, or the target data is obtained by converting the second indication value into binary form, where P is an integer greater than or equal to 1. That is, when the second indication value is a binary number, it is directly used as the target data, and at least one target bit is determined from it; when the second indication value is not a binary number, such as a decimal or hexadecimal number, it needs to be converted into binary form to obtain binary target data, and then at least one target bit is determined from that target data. The embodiments of this application do not limit the representation of the second indication value carried in the message.

[0147] In one possible implementation, P can be determined based on the longest end-to-end forwarding path in the entire communication system. That is, the value of P can be determined based on the number of forwarding nodes included in the longest message forwarding path from the source node to the destination node. For the first forwarding path containing M forwarding nodes, the value of P is greater than or equal to M. Considering that an end-to-end (E2E) message forwarding path contains a maximum of 12 hops, the value of P can be 12. Of course, in practical applications, the value of P can be flexibly set according to the specific communication system or the number of forwarding nodes included in the message forwarding path specified by the source node; this embodiment does not impose such limitations.

[0148] It should be noted that the number of interfaces possessed by each forwarding node in the network may vary. Some forwarding nodes have a large number of interfaces, while others have a small number. Based on this, for the N forwarding nodes whose forwarding behavior is restricted by the source node, the number of bits occupied in the target data and the length (also known as the bit width) of their corresponding forwarding behavior indication information may differ.

[0149] As an example, when a forwarding node has a large number of interfaces, the length of its corresponding forwarding behavior indication information is longer in order to describe a larger number of interfaces; conversely, when a forwarding node has a small number of interfaces, the length of the forwarding behavior indication information corresponding to that forwarding node can be shorter in order to describe a smaller number of interfaces.

[0150] In one possible implementation, the number of bits occupied by a forwarding node in the target data can be positively correlated with the bit width of its corresponding forwarding behavior indication information. Specifically, a forwarding node with a longer forwarding behavior indication information can occupy a larger number of bits in the target data, while a forwarding node with a shorter forwarding behavior indication information can occupy a smaller number of bits in the target data.

[0151] Therefore, for any forwarding node in the network, before implementing the technical solution of this application, it is necessary to configure the number of bits it occupies in the target data (referred to as the first bit width in this embodiment, with each forwarding node corresponding to one first bit width), and also to configure the number of bits occupied by its forwarding behavior indication information (referred to as the second bit width in this embodiment, with the length of the forwarding behavior indication information corresponding to each forwarding node being an integer multiple of the second bit width). Based on this, for the source node sending the packet, after specifying the first forwarding path, the source node needs to insert N forwarding behavior indication information corresponding to these N forwarding nodes into the packet based on the first bit width and the second bit width of the N forwarding nodes.

[0152] As an example, if the first bit width of the first forwarding node is 2, the number of bits occupied by its corresponding forwarding behavior indication information in the header can be 8 bits; or if the first bit width of the first forwarding node is 1, the number of bits occupied by its corresponding forwarding behavior indication information in the header can be 4 bits.

[0153] In one possible implementation, the process of determining at least one target bit among the P bits contained in the target data can be as follows: obtaining a first width, which indicates the number of bits occupied by the first node in the target data; and determining at least one target bit among the P bits contained in the target data based on the first indication value and the first width.

[0154] With different first widths, the number of at least one target bit determined from the P bits contained in the target data based on the first indication value is also different. Correspondingly, the way to determine whether the N forwarding nodes include the first node is also slightly different. This case will be explained below.

[0155] When the first bit width is 1, the bit corresponding to the first indication value in the target data is determined as the target bit, meaning there is one target bit. In this case, if the target bit value is 1, then the first node is included among the N forwarding nodes; if the target bit value is 0, then the first node is not included among the N forwarding nodes.

[0156] It should be understood that when the target data is a binary number, the value of the target bit must be either 0 or 1. Therefore, when determining whether the first node is included among the N forwarding nodes based on the value of the target bit, as shown in the above implementation, a value of 1 indicates that the first node is included among the N forwarding nodes, and vice versa; of course, a value of 0 can also indicate that the first node is included among the N forwarding nodes, and vice versa. The meaning of the target bit value in this application embodiment is not limited, as long as the value of the target bit (1 or 0) can indicate whether the first node is included among the N forwarding nodes.

[0157] When the first bit width is greater than 1, starting from the bit corresponding to the first indication value in the target data, and using the first bit width as the total number of template bits to be obtained, multiple target bits are determined from the P bits contained in the target data. The number of target bits is equal to the value of the first bit width. In this case, if the lowest bit in at least one target bit is 1, then N forwarding nodes are determined, including the first node; or, if the highest bit in at least one target bit is 1, then N forwarding nodes are determined, including the first node; or, if all bits in at least one target bit are 1, then N forwarding nodes are determined, including the first node.

[0158] In both scenarios, if the first node is included among the N forwarding nodes, then the first node needs to forward the packet in the source routing mode, i.e., the first node needs to forward the packet in the manner described in step 702 below. If the first node is not included among the N forwarding nodes, then the first node does not need to forward the packet in the source routing mode, i.e., the first node does not need to forward the packet in the manner described in step 702 below, and can determine the forwarding path to the destination node on its own.

[0159] In some embodiments, before determining at least one target bit among the P bits contained in the target data based on the first indication value, it can also be determined whether a target bit corresponding to the first node exists in the target data based on the first indication value. Since the target data is a P-bit binary number, when each forwarding node occupies 1 bit and the total number of N forwarding nodes specified by the source node is P, each forwarding node occupies exactly one bit in the target data. Therefore, the maximum value of the first indication value can be P; when its value is greater than P, the corresponding target bit cannot be found in the target data containing P bits.

[0160] In one possible implementation, if the first indication value is not greater than P, then the above-described step of determining at least one target bit among the P bits contained in the target data based on the first indication value is performed; if the first indication value is greater than P, as can be seen from the previous analysis, the corresponding target bit cannot be located in the target data, then it is determined that the first node is not included among the N forwarding nodes.

[0161] Furthermore, if the first indication value is greater than P, the target bit cannot be determined from the P bits contained in the target data. Therefore, it is also impossible to determine whether the node itself is included among the N forwarding nodes based on the value of the target bit, i.e., it is impossible to determine whether it is a node whose forwarding behavior is restricted by the source node. In this case, the first node may not perform step 702 below, nor is it necessary to forward the packet according to the source routing mode.

[0162] In one possible implementation, if the first node determines that the first indication value carried in the packet is greater than P, the first node can determine the packet processing method according to its own processing logic, without executing the packet forwarding process provided in this embodiment. For example, based on the destination address of the packet, the packet can be forwarded by looking up the routing table, trying to forward the packet to the destination node; or, if the first indication value is greater than P, the first node can perform packet loss processing, that is, consider the first indication value carried in the packet to be an invalid value, and no longer perform any forwarding processing on the packet. This embodiment does not limit the packet processing methods that the first node can perform when the first indication value is greater than P; only the above two methods are used as examples.

[0163] Therefore, in this embodiment, upon obtaining the first indication value, the method by which the first node forwards the packet can be determined based on the first indication value, i.e., whether the first forwarding node forwards the packet according to the technical solution provided in this embodiment. If, based on the first indication value, it is determined that the target data contains the target bit corresponding to the first node, then based on the value of the target bit, it is determined whether the first node forwards the packet according to the source routing mode, i.e., whether the first node is included among the N forwarding nodes. If, based on the first indication value, it is determined that the target data does not contain the target bit corresponding to the first node, it is directly determined that the first node does not need to forward the packet according to the source routing mode. In this case, the first node determines the packet processing method itself and processes the packet.

[0164] To facilitate understanding of the implementation logic of the technical solution of this application, the following example will be used to supplement the explanation of the judgment process of the first node in the first implementation scheme above, which determines whether it is included among the N forwarding nodes based on the node indication information, assuming that the second indication value carried in the message is a P-bit binary number.

[0165] As an example, in the message received by the first node, the first indication value occupies 4 bits in the message header, and the second indication value occupies 12 bits in the message header, that is, the value of P is 12. The second indication value can be presented through Table 1 below.

[0166] Table 1

[0167] Assuming the first node is configured with a first bit width of 1, if the first node parses the first indication value from the message as 0, then the first node will determine the "0" bit in the second indication value shown in Table 1 above as the target bit. Since the target bit value is 1, it means that the first node is included among the N forwarding nodes. Therefore, the first node needs to perform the following step 702 to forward the message according to the source routing mode.

[0168] Assuming the first node is configured with a first bit width of 1, if the first node parses the first indication value from the message as 1, then the first node will determine the "1" bit in the second indication value shown in Table 1 above as the target bit. Since the value of the target bit is 0, it means that the first node is not included in the N forwarding nodes. Therefore, the first node does not need to perform the following step 702.

[0169] Furthermore, if the first node does not perform step 702 below, the first node can determine the forwarding interface by querying the routing table based on the destination address in the message, and then forward the message. This application embodiment does not limit the specific implementation method.

[0170] As another example, in the message received by the first node, the first indication value occupies 4 bits in the message header, and the second indication value occupies 12 bits in the message header, that is, the value of P is 12. The second indication value can be presented by Table 2 below.

[0171] Table 2

[0172] Assuming the first node is configured with a first bit width of 2, if the first node parses the first indication value from the packet as 0, then the first node takes the "0" bit in the second indication value shown in Table 2 as the starting point, and uses the first bit width of 2 as the total number of target bits, and determines the "0" bit and "1" bit in the second indication value as the target bits. Since the values ​​of these two target bits are both 1, it means that N forwarding nodes include the first node. Therefore, the first node needs to perform the following step 702 to forward the packet according to the source routing mode.

[0173] Assuming the first node is configured with a first bit width of 2, if the first node parses the first indication value from the message as 1, based on the second indication value shown in Table 2 above, the first node takes the "1" bit as the starting point and the first bit width of 2 as the total number of target bits, and determines the "1" bit and the "2" bit in the second indication value as the target bits.

[0174] Since the values ​​of these two target bits are different, as explained above, we can determine that the first node is not included among the N forwarding nodes based on the value of the lowest bit (i.e., bit 1) of the two target bits being 0, and the first node does not need to perform step 702 below; or we can determine that the first node is included among the N forwarding nodes based on the value of the highest bit (i.e., bit 2) of the two target bits being 1, and the first node needs to perform step 702 below. When there are multiple target bits and the values ​​of the multiple target bits are different, in accordance with the system definition, we can determine whether the first node is included among the N forwarding nodes based on the values ​​of some bits among the multiple target bits, which will not be elaborated here.

[0175] It should be understood that since the second indicator value is in binary form, and binary numbers carry from the least significant bit (the bit closest to the right) to the most significant bit (the bit closest to the right), meaning the valid data in the second indicator value is arranged from right to left, the first node determines the target bit from the second indicator value in the order of reading from the least significant bit to the most significant bit.

[0176] If the first node does not perform step 702 below, the first node can determine the forwarding interface by querying the routing table based on the destination address in the message, and then forward the message. This application embodiment does not limit the specific implementation method.

[0177] It should be understood that when the bit width configured for the first node is any value greater than 1, the implementation method for the first node to determine at least one target bit in the second indication value can refer to the corresponding method in Table 2 above, and will not be illustrated one by one here.

[0178] In the second implementation, the node indication information includes a third indication value, which indicates the target forwarding node for forwarding the packet according to the source routing mode.

[0179] Based on the content of the above node indication information, in one possible implementation, the process of the first node determining whether it includes itself among the N forwarding nodes can be as follows: based on the third indication value, determine whether the target forwarding node indicated by the third indication value is the first node itself. If the target forwarding node is the first node, it means that the source node restricts the forwarding behavior of the first node, and the first node is included among the N forwarding nodes.

[0180] As an example, the third indication value can be the hop count of the target forwarding node on the first forwarding path. During packet transmission, each forwarding node decrements this third indication value by one. When the first node receives the packet, if the third indication value is 0, it determines that it is the target forwarding node whose forwarding behavior is limited by the source node. At this time, the first node needs to forward the packet according to the source routing mode.

[0181] It should be understood that in the second implementation, the information carried by the source node in the message can only restrict the forwarding behavior of one forwarding node (i.e., the target forwarding node). In other words, when the node indication information includes a third indication value, N is 1, and the message carries the forwarding behavior indication information corresponding to the target forwarding node.

[0182] In some embodiments, based on the content of the node indication information described above, the message header in step 701 includes a third field and a forwarding field, wherein the third field is used to carry a third indication value and the forwarding field is used to carry forwarding behavior indication information of the target forwarding node.

[0183] In addition, similar to the first implementation scheme, for some special third indication values, such as a specific value (denoted as Q) that is greater than the total number M of forwarding nodes on the first forwarding path, the specific value Q is used to indicate that the packet does not need to be forwarded in the source routing mode, or in other words, the specific value Q is used to indicate that the packet is in the non-source routing forwarding mode.

[0184] Based on this, if the third indicator value carried in the message is the specific value Q mentioned above, then the first node that receives the message does not need to forward the message according to the source routing mode. In this case, the first node can construct different message processing methods according to the processing logic set by the forwarding node itself, which will not be elaborated here.

[0185] In one possible implementation, when indicating a non-source routing mode, the specific value Q can be determined based on the longest end-to-end forwarding path in the entire communication system. That is, Q can be determined based on the number of forwarding nodes included in the longest message forwarding path from the source node to the destination node. For example, Q can be a value greater than the total number of forwarding nodes included in that longest message forwarding path. For the first forwarding path containing M forwarding nodes, if a third indication value is needed to indicate the non-source routing mode, the third indication value carried in the message can be a value greater than M.

[0186] It should be understood that if the third indication value is represented in binary form, then when the third indication value occupies n bits in the message, the value of Q should be a value greater than M and less than 2n.

[0187] Furthermore, when the third indication value is a special value indicating a non-source routing mode, the message does not need to carry information about the interface that the target forwarding node forwards the message. In this case, the field where the forwarding behavior indication information is located can be used to carry other information, such as load balancing information, etc. This application embodiment will not elaborate on this.

[0188] After introducing the specific implementation methods of the node indication information and N forwarding behavior indication information carried in the message, we will now provide examples of other information that can be carried in the message.

[0189] In some embodiments, the message header further includes a control field, which indicates that the message carries routing control information. The routing control information indicates that the message carries node indication information and N forwarding behavior indication information, and that forwarding nodes on the first forwarding path forward the message according to the node indication information and the N forwarding behavior indication information. That is, when parsing the message, the first node can determine whether the message conforms to the message format defined in this application based on the information in the control field, i.e., whether the message carries node indication information and N forwarding behavior indication information.

[0190] If the message is an IPv6 message, the routing control information mentioned above is carried in the routing type field in the header of the IPv6 message. That is, the control field shown in this embodiment can be the routing type field in the IPv6 message.

[0191] As an example, for IPv6 packets, when SRv6 technology is used to control the packet forwarding path, the value of the routing type field in the packet header is 4; however, when the technical solution provided in this application is used to control the packet forwarding path, the value of the routing type field in the packet header can be an unassigned value, such as 251. In this case, if the value of the routing type field in the packet header of the first node is 251, it is determined that the packet carries forwarding behavior indication information used by the technical solution of this application.

[0192] In one possible implementation, the routing control information includes a first type, a second type, or a third type. The first type indicates that each of the N forwarding behavior indications occupies the same number of bits. The second type indicates that at least two of the N forwarding behavior indications occupy different numbers of bits. The third type indicates that N is 1.

[0193] Where N is the number of forwarding nodes on the first forwarding path that forward the packet according to the source routing mode, and is also equal to the number of forwarding behavior indication messages carried in the packet. Based on this, the first type refers to N forwarding behavior indication messages in the packet having the same length, the second type refers to at least two forwarding behavior indication messages in the packet having different lengths, and the third type refers to the packet carrying only 1 forwarding behavior indication message.

[0194] Continuing with the example of an IPv6 packet, if the routing type field is 251, it indicates that the packet carries node forwarding behavior indication information as defined in this application, and the number of bits occupied by each of the N forwarding behavior indication information is the same, for example, the length of each of the N forwarding behavior indication information is 8 bits. If the routing type field is 252, it indicates that the packet carries node forwarding behavior indication information as defined in this application, and at least two of the N forwarding behavior indication information occupy different numbers of bits, for example, the packet includes one forwarding behavior indication information with a length of 8 bits and one forwarding behavior indication information with a length of 4 bits. If the routing type field is 253, it indicates that the packet carries node forwarding behavior indication information as defined in this application, and the number of forwarding behavior indication information carried is 1, and the length of the forwarding behavior indication information can be 8 bits, 5 bits, or 4 bits, etc.

[0195] It should be noted that the values ​​251-253 above are all assumed values ​​of the routing type field in the IPv6 packet when it is not assigned. Since the value of the routing type field is the actual assigned value, the value of the routing type field in the packet header in this embodiment can also be other values, but the implementation of the type of routing control information can be referred to the above example, which will not be elaborated here.

[0196] Of course, if other reserved fields exist in the IPv6 packet header, this embodiment can also use other fields to carry the type of routing control information. For example, whether the value of the routing type field in the packet header is 251 indicates whether the packet carries node forwarding behavior indication information as defined in this application. If the value of the routing type field is 251, the value of the first reserved field indicates the type of routing indication information, that is, whether the routing indication information is of the first type, the second type, or the third type. This embodiment does not impose any limitations on this.

[0197] Step 702: If N forwarding nodes are determined based on the node indication information, including the first node, then forward the packet through the first interface indicated by the forwarding behavior indication information corresponding to the first node.

[0198] In some embodiments, the implementation process of step 702 above may include the following steps:

[0199] (1) Based on the node indication information, determine the forwarding behavior indication information corresponding to the first node from N forwarding behavior indication information.

[0200] As explained above, there are two implementation schemes for node indication information, and correspondingly, there are also two implementation schemes for determining the forwarding behavior indication information corresponding to the first node. Next, we will explain the two implementation schemes for determining the forwarding behavior indication information corresponding to the first node from N forwarding behavior indication information, based on the two implementation schemes for node indication information shown above.

[0201] In the first implementation scheme, the node indication information includes a first indication value and a second indication value. In this case, the process of determining the forwarding behavior indication information corresponding to the first node can be as follows: obtain the number of bits with a value of 1 from the first bit to the bit indicated by the first indication value in the target data to obtain the target value; based on the target value, determine the forwarding behavior indication information corresponding to the first node from N forwarding behavior indication information.

[0202] As explained above, the target data is the second indicator value, or the target data is obtained by binary conversion of the second indicator value. The target data contains P bits, where P is an integer greater than or equal to 1.

[0203] As an example, suppose the first indication value parsed from the message is 5. If the target data is the second indication value shown in Table 1 above, then based on the first indication value, the number of bits with a value of 1 from the first bit (i.e., bit 0) to bit 5 in the target data is determined to be 3, that is, the target value is 3. If the target data is the second indication value shown in Table 2 above, then based on the first indication value, the number of bits with a value of 1 from the first bit (i.e., bit 0) to bit 5 in the target data is determined to be 4, that is, the target value is 4.

[0204] In one possible implementation, when N forwarding behavior indication information are arranged sequentially in the message, the process of determining the forwarding behavior indication information corresponding to the first node from the N forwarding behavior indication information based on the target value can be as follows: the forwarding behavior indication information with the number of the target value minus one among the N forwarding behavior indication information is determined as the forwarding behavior indication information corresponding to the first forwarding node.

[0205] As an example, if the target value is determined to be 3, then the forwarding behavior indication information with the number 2 among the N forwarding behavior indication information will be determined as the forwarding behavior indication information corresponding to the first forwarding node.

[0206] In another possible implementation, the process of determining the forwarding behavior indication information corresponding to the first node from N forwarding behavior indication information based on the target value can be as follows: determine the number of offset bytes based on the target value and the second bit width; determine the forwarding behavior indication information corresponding to the first node from N forwarding behavior indication information based on the number of offset bytes and the position of the second indication value in the message.

[0207] The second bit width indicates the number of bits occupied by the forwarding behavior indication information. Therefore, the number of bits occupied by each of the N forwarding behavior indication information is an integer multiple of the second bit width. For example, the number of bits occupied by one forwarding behavior indication information can be equal to the second bit width, or the number of bits occupied by one forwarding behavior indication information can be equal to twice the second bit width. This application embodiment does not impose any restrictions on this.

[0208] The offset byte count indicates the number of bytes by which the position of the forwarding behavior indication information corresponding to the first node in the message is offset relative to the position of the second indication value in the message. Knowing the position of the second indication value in the message and the offset byte count, the position of the forwarding behavior indication information corresponding to the first node in the message can be located starting from the position of the second indication value and following that position, according to the offset byte count.

[0209] Assuming the target value is denoted as count, for N forwarding nodes, when the number of bits occupied by the N forwarding behavior indication information is the same, for a forwarding node, when calculating the number of offset bytes of its corresponding forwarding behavior indication information relative to the second indication value, its corresponding offset byte number = (count-1)*1; while when the number of bits occupied by the N forwarding behavior indication information is different, it is necessary to determine the offset byte number based on the second bit width, which is (count-1)*T1, where T1 is the value of the second bit width.

[0210] That is, when the number of bits occupied by N forwarding behavior indication information is the same, the default value of its second bit width T1 is 1, and the number of offset bytes is calculated according to (count-1)*T1.

[0211] In some embodiments, when the number of bits occupied by each forwarding behavior indication information is an integer multiple of the second bit width, the value of this integer multiple can be the number of bits occupied by the corresponding forwarding node in the target data (i.e., the first bit width). That is, for a forwarding node, the number of bits occupied by it in the target data is consistent with the number of bits occupied by its corresponding forwarding behavior indication information, and the values ​​of the two can be positively correlated.

[0212] As an example, for any one of N forwarding nodes, the total number of bits occupied by its corresponding forwarding behavior indication information is equal to T1 * T2, where T1 is the value of the second bit width and T2 is the value of the first bit width. For example, with a second bit width of 4 bits, if the forwarding node occupies 1 bit in the target data, then the total number of bits occupied by its corresponding forwarding behavior indication information is 4 bits, meaning the length of the forwarding behavior indication information corresponding to the forwarding node is 4 bits; if the forwarding node occupies 2 bits in the target data, then the total number of bits occupied by its corresponding forwarding behavior indication information is 8 bits, meaning the length of the forwarding behavior indication information corresponding to the forwarding node is 8 bits.

[0213] Therefore, for each forwarding node, after configuring the number of bits it occupies in the target data (i.e., the first bit width), the number of bits occupied by its corresponding forwarding behavior indication information can be quickly determined based on the first bit width and the second bit width (fixed values).

[0214] In one possible implementation, after determining the number of offset bytes, the process of obtaining the forwarding behavior indication information corresponding to the first node based on the position of the offset byte number and the second indication value in the message can be as follows: locate the position of the second indication value in the message header, and after the field where the second indication value is located, use (count-1)*T1 as the offset byte number to first locate the starting point of the corresponding instruction field, and then obtain data of size T1*T2 bits to obtain the specific content of the forwarding behavior indication information of the first node.

[0215] As an example, for the first node, if the first node is included among N forwarding nodes, and the first node occupies 2 bits in the second indication value (i.e., the first bit width), and the N forwarding behavior indication information occupies 4 bits each (i.e., the second bit width), then it can be determined that the forwarding behavior indication information corresponding to the first node occupies 8 bits, that is, the length of the forwarding behavior indication information corresponding to the first node is 8 bits. Based on this, when obtaining the forwarding behavior indication information corresponding to the first node in the packet header, first locate the field containing the second indication value in the packet header, and then use (count-1)*4 bits as the offset bytes after that field to locate the position of the forwarding behavior indication information corresponding to the first node. Then, using this position as the starting point, read 8 bits (i.e., 2*4 bits) of data to obtain the forwarding behavior indication information corresponding to the first node.

[0216] In the second implementation scheme, the node indication information includes a third indication value, which indicates the target forwarding node for forwarding the packet according to the source routing mode. In this case, the packet only carries one forwarding node indication information, namely the node indication information of the target forwarding node.

[0217] In other words, when the node indication information is the third indication value, the first node only needs to determine that the target forwarding node indicated by the third indication value is itself, and then directly forward the message according to the first interface indicated by the forwarding behavior indication information carried in the message.

[0218] (2) Forward the message from the first interface indicated by the forwarding behavior indication information corresponding to the first node.

[0219] It should be noted that when the forwarding behavior indication information corresponding to the first node directly carries the interface identifier (e.g., interface number), the first node can determine the first interface from its multiple interfaces based on the interface identifier and send the packet from the first interface. However, when the forwarding behavior indication information corresponding to the first node does not directly carry the interface identifier, but carries other indication values ​​to indicate the first interface, the first node needs to determine the first interface through mapping based on the indication value, and then forward the packet from the first interface.

[0220] Specifically, the implementation method of the first interface indicated by the first node is determined based on the forwarding behavior indication information corresponding to the first node, and can be any of the following:

[0221] Method 1: Use the indication value carried in the forwarding behavior indication information corresponding to the first node as the key value, and query the mapping table to determine the first interface corresponding to the key value. The mapping table uses a key-value storage method, where the value corresponds to an interface on the forwarding node.

[0222] Method 2: Use the indication value carried by the forwarding behavior indication information corresponding to the first node as the target data to determine the first interface. That is, each bit in the target data corresponds to a forwarding interface. When the value of that bit in the target data is 1, the forwarding interface corresponding to that bit is determined as the first interface.

[0223] It should be understood that, when the forwarding behavior indication information of the first node indicates the first interface, the embodiments of this application are merely illustrative examples of the process of determining the first interface using the methods described above. In practical applications, other indication methods can also be used to indicate the corresponding forwarding interface, and the embodiments of this application do not impose any restrictions on this.

[0224] In some embodiments, since each forwarding node on the first forwarding path needs to determine whether it needs to forward packets according to the source routing mode based on the first indication value or the third indication value included in the node indication information, the first node needs to determine the first interface for forwarding packets in the manner described above, and also needs to update the content of the node indication information in the packet before forwarding the packet through the first interface.

[0225] In one possible implementation, the first node updates the first indication value to obtain an updated first indication value; wherein the updated first indication value is the sum of the original first indication value and the first bit width corresponding to the first node. In this case, when the source node sends the message, the initial value of the first indication value can be 0.

[0226] In another possible implementation, the first node updates the third indication value to obtain an updated third indication value; wherein the updated third indication value is the original third indication value minus one. In this case, when the source node sends a message, the initial value of the third indication value can be the hop number corresponding to the target forwarding node, and the initial value of the third indication value is an integer greater than or equal to 1.

[0227] In some embodiments, before forwarding a packet through the first interface, the first node also needs to determine the link status of the first interface and perform different forwarding operations based on different link statuses.

[0228] In one possible implementation, the first node obtains the link status information of the first interface, which indicates whether the communication connection between the first interface and other forwarding nodes is normal; if the communication connection of the first interface is in an abnormal state, a second forwarding path from the first node to the destination node is determined; based on the second forwarding path, the node indication information and N forwarding behavior indication information in the message are modified; and the modified message is forwarded to the destination node through the second forwarding path.

[0229] If the communication connection of the first interface is in a normal state, the first node can forward the message from the first interface after updating the first indication value or the third indication value in the message.

[0230] In one possible implementation, besides determining the second forwarding path and modifying the information carried in the message as described above, if the communication connection of the first interface is in an abnormal state, the first node may also choose any of the following methods to handle the message:

[0231] Method 1: Clear all bits in the second indicator value to zero. In this way, when any subsequent forwarding node uses the first indicator value to retrieve the target bit value in the corresponding second indicator value, the result will always be 0, requiring the traditional routing table lookup method to forward the packet.

[0232] Method 2: Modify the first indicator value to a value greater than P. As explained above, when the first indicator value is greater than P, subsequent forwarding nodes do not need to forward the packet according to the source routing mode; they can forward the packet using the traditional method of querying the routing table.

[0233] Method 3: Directly modify the routing control information carried in the control field of the message so that the message forwarding processing logic will not use the technical solution provided in the embodiments of this application for forwarding.

[0234] In some embodiments, before forwarding a message through the first interface, the first node may also perform a validity check on the first interface. If the first interface is determined to be a valid interface, the node may perform the operation of forwarding the message from the first interface.

[0235] In one possible implementation, if the first interface is located in the set of valid interfaces of the first forwarding node, then the packet is forwarded through the first interface indicated by the interface indication information corresponding to the first forwarding node. The set of valid interfaces includes interfaces among the multiple interfaces of the first node where traffic can reach the destination node.

[0236] As an example, the set of legal interfaces can be configured by the management unit, or it can be generated by the first node itself based on the overall connection relationship of the communication system or the routing protocol to the destination node. This application embodiment does not limit this.

[0237] Therefore, this application embodiment can avoid the situation where packets carry insecure forwarding behavior indication information by judging the legality of the interface, which would lead to the uncontrolled forwarding of packets to illegal destination addresses. To a certain extent, it ensures the accuracy of packet forwarding in the source routing mode, so that when packets are forwarded along the specified forwarding path, they can accurately reach the destination node corresponding to the destination address.

[0238] In summary, in this embodiment, after receiving a packet, the first node in the network can determine whether it is a node specified by the source node whose forwarding behavior needs to be restricted, based on the node indication information carried in the packet. If the node indication information determines that N forwarding nodes include the first node, meaning its forwarding behavior is restricted, then the first node determines the forwarding behavior indication information corresponding to the first node from the N forwarding behavior indication information and forwards the packet according to the first interface indicated by that forwarding behavior indication information. If the node indication information determines that N forwarding nodes do not include the first node, meaning it is determined that it does not need to forward the packet according to the packet forwarding path specified by the source node, then there is no need to parse and obtain the content of the N forwarding behavior indication information. In this way, while controlling the packet forwarding path, the packet forwarding efficiency of the forwarding node is improved.

[0239] Figure 8 is a flowchart of another message forwarding method provided in an embodiment of this application, which is applied to the source node. Referring to Figure 8, the method includes the following steps.

[0240] Step 801: Obtain the first forwarding path of the message. The first forwarding path indicates the forwarding path from the source node to the destination node.

[0241] As explained above, the source node can determine the packet forwarding path from the source node to the destination node on its own, or it can obtain the packet forwarding path from the source node to the destination node from the control unit. This application embodiment does not limit the implementation method of the source node obtaining the packet forwarding path.

[0242] It should be noted that when there are multiple packet forwarding paths from the source node to the destination node, the source node can choose any one of them as the first forwarding path to perform step 802 below; alternatively, it can determine the first forwarding path for sending the packet based on the congestion status of the multiple packet forwarding paths. This application embodiment does not restrict the selection strategy of the source node in determining the first forwarding path from multiple packet forwarding paths.

[0243] Step 802: Based on the first forwarding path, send a message carrying node indication information and N forwarding behavior indication information; wherein, the node indication information indicates the N forwarding nodes that forward the message according to the source routing mode, the source routing mode indicates that the source node specifies the first forwarding path for the message, and the N forwarding behavior indication information indicates the interface of the N forwarding nodes that forward the message using the first forwarding path, where N is an integer greater than or equal to 1.

[0244] In one possible implementation, the node indication information includes a first indication value and a second indication value. The second indication value is a binary number containing P bits, where P is an integer greater than or equal to 1. The first indication value indicates at least one target bit corresponding to the first node in the second indication value. The value of the at least one target bit indicates whether the N forwarding nodes include the first node. The first node is any forwarding node that forwards packets on the first forwarding path.

[0245] Based on this implementation, the message header of the above message includes a first field, a second field, and N forwarding fields, where N is an integer greater than 1; wherein, the first field is used to carry a first indication value, the second field is used to carry a second indication value, and the N forwarding fields are used to carry N forwarding behavior indication information.

[0246] In another possible implementation, the node indication information includes a third indication value, which indicates the target forwarding node that forwards the packet according to the source routing mode, N=1, and the forwarding behavior indication information indicates the interface through which the target forwarding node forwards the packet using the first forwarding path.

[0247] Based on this implementation, the message header of the above message includes a third field and a forwarding field; wherein, the third field is used to carry a third indication value, and the forwarding field is used to carry forwarding behavior indication information of the target forwarding node.

[0248] In some embodiments, the header of the above message further includes a control field, which carries routing control information. The routing control information includes a first type, a second type, or a third type. The first type indicates that each of the N forwarding behavior indications occupies the same number of bits; the second type indicates that at least two of the N forwarding behavior indications occupy different numbers of bits; and the third type indicates that N is 1.

[0249] Where N is the number of forwarding nodes on the first forwarding path that forward the packet according to the source routing mode, and is also equal to the number of forwarding behavior indication messages carried in the packet. Based on this, the first type refers to N forwarding behavior indication messages in the packet having the same length, the second type refers to at least two forwarding behavior indication messages in the packet having different lengths, and the third type refers to the packet carrying only 1 forwarding behavior indication message.

[0250] It should be noted that if the source node needs to send multiple packets along different forwarding paths, and encapsulates node indication information and N forwarding behavior indication information in multiple packets, the same type of routing control information or different types of routing control information can be used. This application embodiment does not limit this.

[0251] As an example, suppose a source node needs to send packet A via a first forwarding path, packet B via a second forwarding path, and packet C via a third forwarding path. The source node can use type 1 routing control information when sending packet A, writing a type 1 identifier value in the control field of the packet header to indicate that the N packet forwarding behavior indication messages carried in packet A have the same length. The source node can use type 2 routing control information when sending packet B, writing a type 2 identifier value in the control field of the packet header to indicate that the N packet forwarding behavior indication messages carried in packet B have different lengths, with at least two having different lengths. The source node can use type 3 routing control information when sending packet C, writing a type 3 identifier in the control field of the packet header to indicate that packet C carries only one packet forwarding behavior indication message.

[0252] Furthermore, the specific methods by which the source node inserts information into the packet can be found in the relevant descriptions of IPv6 technology. The specific implementation process of the two types of node indication information, the N forwarding behavior indication information, the specific content of the routing control information, and their roles in the entire packet forwarding process can be found in the relevant descriptions in the embodiment of Figure 7 above, and will not be repeated here.

[0253] In summary, in this embodiment, after specifying the first forwarding path of the packet, the source node carries node indication information and N forwarding behavior indication information in the packet sent to the network. The node indication information indicates the N forwarding nodes on the first forwarding path that need to forward the packet according to the source routing mode, that is, the forwarding behavior of these N forwarding nodes needs to be restricted during the forwarding process. The N forwarding behavior indication information corresponds one-to-one with the N forwarding nodes, indicating the interfaces of the N forwarding nodes to use the first forwarding path to forward the packet. In this way, the source node can control the forwarding behavior of the N forwarding nodes on the packet forwarding path, thereby achieving the effect of planning the packet forwarding path.

[0254] Based on the above method embodiments, in order to facilitate understanding of the overall implementation logic of the technical solution of this application, the technical solution of this application will be explained and illustrated again through some specific embodiments.

[0255] It should be noted that the following example uses IPv6 packets to carry node indication information and forwarding behavior indication information of N forwarding nodes to supplement the explanation of the packet forwarding method provided in the embodiments of this application.

[0256] As shown in Figure 9, node indication information and N forwarding behavior indication information can be carried in the RH information field of the IPv6 packet. Based on this, the next header field in the IPv6 packet header is used to indicate that the following information is an RH information field. Moreover, in the packet format provided in this application embodiment, the value of the newly defined routing type field is 251 (this routing type value has not been assigned), to indicate that the scheme for planning the packet forwarding path is the node indication information + forwarding behavior indication information provided in this application. That is, when the routing type value in the RH standard header is 251, it indicates that the RH information field carries a field containing node indication information and forwarding behavior indication information.

[0257] It should be noted that the meaning of the other fields in Figure 9, as well as the information they carry, can be found in the relevant content in Figure 4 above, or in the definitions in the IPv6 protocol, and will not be repeated here.

[0258] Based on the message format shown in Figure 9, the node indication information in this embodiment includes two implementation schemes: a scheme where the node indication information includes a first indication value and a second indication value, and a scheme where the node indication information includes a third indication value. Next, taking an example where the ptr field in the RH extension header carries either a first or third indication value, the bitmap field carries a second indication value (where the second indication value is a P-bit binary number), and N instruction fields corresponding to N forwarding behavior indication information, the technical solution provided in this embodiment will be further explained through the following three examples.

[0259] Example 1: Fixed-length instructions are used to carry forwarding behavior indication information, that is, the length of the N instruction fields carried in the message is the same, and the routing control information carried in the control field of the message header is of type 1.

[0260] The IPv6 address of GPU1 is 2001:da8:26d:1015::1, and the IPv6 address of GPU2 is 2001:da8:26d:1016::1. GPU1 needs to send data to GPU2, meaning the source node of the packet is GPU1, and the destination node is GPU2. The management unit or GPU1 calculates the end-to-end packet forwarding path based on the network topology information.

[0261] Referring to Figure 10, GPU1, as the source node sending the message, specifies a first forwarding path for the message to be forwarded based on the end-to-end message forwarding path: GPU1-Node 1-Node 3-Node 4-Node 5-Node 6-GPU2. On this first forwarding path, forwarding nodes 1, 4, and 6 are restricted to forwarding messages according to the technical solution provided in this application embodiment, based on the interface indicated by the forwarding behavior control information carried in the instruction field. The forwarding behavior of forwarding nodes 1, 4, and 6 can be represented as: {Node 1, needs to forward the message on interface 2}, {Node 4, needs to forward the message on interface 3}, {Node 6, needs to forward the message on interface 3}.

[0262] Referring to Figure 11, which shows the header format of a message sent by GPU1, the bitmap field carries a second indicator value consisting of 12 bits, with the values ​​of these 12 bits (from least significant bit to most significant bit) being 101010000000. Correspondingly, the message also carries multiple instruction fields. When forwarding the message according to the first forwarding path described above, since GPU1 only restricts three forwarding nodes to forward messages in source routing mode, only three instruction fields carry forwarding behavior indication information; the other instruction fields are not used in this example.

[0263] It should be noted that, while meeting the requirements for carrying information as in Example 1, the length of the ptr field carrying the first indicator value in the message header can be 4 bits, the length of the bitmap field carrying the second indicator value can be 12 bits, and the length of multiple instruction fields can be 8 bits. Furthermore, when GPU1 sends the message, the initial value of the ptr field in the message is 0.

[0264] Based on the first forwarding path shown in Figure 10, and the node indication information and three forwarding behavior indication information carried in the packet header shown in Figure 11, the process of each forwarding node forwarding packets on the first forwarding path will be explained below.

[0265] (1) Forwarding behavior of node 1: When node 1 receives a message sent by GPU1, it first obtains the value of the ptr field in the message as 0, and then obtains the value of the (0)th bit in the bitmap field based on the value of the ptr field. As shown in Figure 11, the value of the 0th bit is 1, which means that node 1 is included in the N forwarding nodes whose forwarding behavior is restricted by GPU1. Node 1 needs to use the interface indicated by its corresponding instruction field to forward the message.

[0266] Furthermore, if node 1 obtains that the number of bits with the value 1 from [0~0] in the bitmap field is 1, then it obtains the instruction value carried in instruction[1-1] (i.e. instruction[0]) after the bitmap field (as shown in Figure 11, the instruction value is 2). Then node 1 uses interface 2 indicated by the instruction value to forward the message.

[0267] Furthermore, before forwarding the packet on interface 2, node 1 needs to update the value of the ptr field in the packet, and the updated ptr field value is 1. That is, after node 1 forwards the packet, the first indication value in the packet is updated to 1.

[0268] (2) Forwarding behavior of node 3: Node 3 receives the packet forwarded by node 1. Based on the packet, node 3 first obtains the value of the ptr field in the packet as 1, and then obtains the value of the (1)th bit in the bitmap field based on the value of the ptr. As shown in Figure 11, the value of the 0th bit is 0, which means that node 3 is not included in the N forwarding nodes whose forwarding behavior is restricted by GPU1. Node 3 can use the destination IPv6 address of the packet to look up the routing table to obtain the forwarding interface. If the obtained forwarding interface is interface 2, then the packet is forwarded from interface 2.

[0269] Similarly, before forwarding the packet on interface 2, node 3 needs to update the value of the ptr field in the packet. The updated value of the ptr field is 2. That is, after node 3 forwards the packet, the first indicator value in the packet is updated to 2.

[0270] (3) Forwarding behavior of node 4: Node 4 receives the message forwarded by node 3. Based on the message, node 4 obtains the value of the ptr field in the message as 2, and then obtains the value of the (2nd) bit in the bitmap field based on the value of the ptr field. As shown in Figure 11, the value of the 2nd bit is 1, which means that node 4 is included in the N forwarding nodes whose forwarding behavior is restricted by GPU1. Node 4 needs to use the interface indicated by its corresponding instruction field to forward the message.

[0271] Furthermore, node 4 obtains that the number of bits with value 1 from bitmap[0~2] in the bitmap field is 2. Then, it obtains the instruction value carried in instruction[2-1] (i.e. instruction[1]) after the bitmap field (as shown in Figure 11, the instruction value is 3). Then, node 4 uses interface 3 indicated by the instruction value to forward the message.

[0272] Similarly, before forwarding the packet on interface 3, node 4 needs to update the value of the ptr field in the packet. The updated value of the ptr field is 3. That is, after node 4 forwards the packet, the first indicator value in the packet is updated to 3.

[0273] As explained above, nodes 5 and 6 forward the message according to the same logic, so that the message is eventually forwarded to the destination node GPU2. This will not be elaborated further here.

[0274] As can be seen from Example 1, for the N forwarding nodes on the first forwarding path whose forwarding behavior needs to be restricted, the technical solution provided by this application embodiment can use multiple independent fields to carry node indication information and forwarding behavior indication information. Compared with the method in SRv6 where multiple forwarding nodes carry information in 128 bits, the overhead of the packet header is greatly reduced.

[0275] Example 2: Variable-length instructions are used to carry forwarding behavior indication information. That is, the lengths of the N instruction fields carried in the message are different, and the routing control information carried in the control field of the message header is of type 2.

[0276] Similarly, taking the example shown in Figure 10 above, when GPU1 sends a message to GPU2, the first forwarding path specified by GPU1 for this message is GPU1-Node 1-Node 3-Node 4-Node 5-Node 6-GPU2. However, unlike Example 1 above, Nodes 1 and 8 on the first forwarding path use an 8-bit L-Ins (i.e., a longer instruction) field to carry the corresponding forwarding path indication information, while Node 4 uses a 4-bit S-Ins (i.e., a shorter instruction) field to carry the corresponding forwarding path indication information. Moreover, when GPU1 sends the message, the initial value of the ptr field in the message is 0. For the multiple forwarding nodes on the above first forwarding path, their corresponding first bit widths are different, but their corresponding second bit widths are the same, all being 4 bits.

[0277] Referring to Figure 12, which illustrates the header format of the message sent by GPU1 in Example 2, the bitmap field carries a second indicator value consisting of 12 bits, with the values ​​of these 12 bits (from least significant bit to most significant bit) being 110101100000. In Figure 12, the L-Ins=2 and L-Ins=3 fields are both 8 bits long, and the S-Ins=3 field is 4 bits long.

[0278] Based on the first forwarding path shown in Figure 10, and the node indication information and three forwarding behavior indication information carried in the packet header shown in Figure 12, the process of each forwarding node forwarding packets on the first forwarding path will be explained below.

[0279] (1) Forwarding behavior of node 1: When node 1 receives a message sent by GPU1, it first obtains the value of the ptr field in the message as 0, and then obtains the first bit width configured by node 1 as 2 bits. Based on the value of ptr and the first bit width, it obtains the value of the (0~1)th bit in the bitmap field, as shown in Figure 12. The values ​​of these two bits are both 1, which means that node 1 is included in the N forwarding nodes whose forwarding behavior is restricted by GPU1. Node 1 needs to use the interface indicated by its corresponding instruction field to forward the message.

[0280] Furthermore, Node 1 obtains the number of bits with a value of 1 from [0 to 0] in the bitmap field, which is 1. The offset is calculated as (1-1)*4bits = 0bits. Then, a field of length 2*4bits is directly obtained after the bitmap field to obtain the instruction value carried by the instruction corresponding to Node 1 (as shown in Figure 12, the instruction value is 2). Node 1 then uses interface 2 indicated by the instruction value to forward the packet.

[0281] Furthermore, before forwarding the packet on interface 2, node 1 needs to update the value of the ptr field in the packet based on its own configured first bit width (2 bits). The updated ptr field value is 2. That is, after node 1 forwards the packet, the first indicator value in the packet is updated to 2.

[0282] (2) Forwarding behavior of node 3: Node 3 receives the packet forwarded by node 1. Based on the packet, node 3 first obtains the value of the ptr field in the packet as 2, and then obtains the first bit width configured by node 3 as 1 bit. Based on the value of ptr, it obtains the value of the (2nd) bit in the bitmap field, as shown in Figure 12. The value of the 2nd bit is 0, which means that node 3 is not included in the N forwarding nodes whose forwarding behavior is restricted by GPU1. Node 3 can use the destination IPv6 address of the packet to look up the routing table to obtain the forwarding interface. If the obtained forwarding interface is interface 2, then the packet is forwarded from interface 2.

[0283] Similarly, before forwarding the packet on interface 2, node 3 needs to update the value of the ptr field in the packet based on its own configured first bit width (1 bit). The updated ptr field value is 3. That is, after node 1 forwards the packet, the first indicator value in the packet is updated to 3.

[0284] (3) Forwarding behavior of node 4: Node 4 receives the message forwarded by node 3. Based on the message, node 4 obtains the value of the ptr field in the message as 3, and then obtains the first bit width configured by node 4 as 1 bits. Based on the value of ptr, it obtains the value of the (3rd) bit in the bitmap field. As shown in Figure 12, the value of the 3rd bit is 1, which means that node 4 is included in the N forwarding nodes whose forwarding behavior is restricted by GPU1. Node 4 needs to use the interface indicated by its corresponding instruction field to forward the message.

[0285] Furthermore, node 4 obtains the number of bits with value 1 from bitmap[0~3] in the bitmap field, which is 3. The offset is calculated to be (3-1)*4bits=8bits. Then, at an offset of 8bits after the bitmap field, a field of length 1*4bits is obtained to obtain the instruction value carried by the instruction corresponding to node 4 (as shown in Figure 12, the instruction value is 3). Then, node 4 uses interface 3 indicated by the instruction value to forward the packet.

[0286] Similarly, before forwarding the packet on interface 3, node 4 needs to update the value of the ptr field in the packet based on its own configured first bit width (1 bit). The updated ptr field value is 4. That is, after node 4 forwards the packet, the first indicator value in the packet is updated to 4.

[0287] As explained above, nodes 5 and 6 forward the message according to the same logic, so that the message is eventually forwarded to the destination node GPU2. This will not be elaborated further here.

[0288] As can be seen from Example 2, for the N forwarding nodes on the first forwarding path whose forwarding behavior needs to be restricted, the technical solution provided by this application embodiment can use multiple independent fields to carry node indication information and forwarding behavior indication information, and the length values ​​of multiple forwarding behavior indication information fields can be different. Compared with the above Example 1, where multiple forwarding behavior indication information all use 8 bits, Example 2 further reduces the overhead of the packet header.

[0289] Example 3: Use a minimal instruction to carry forwarding behavior indication information, that is, the message carries only one instruction field, and the routing control information carried in the control field of the message header is of type 3.

[0290] Similarly, taking the example shown in Figure 10 above, when GPU1 sends a message to GPU2, the first forwarding path specified by GPU1 for this message is GPU1-Node 1-Node 3-Node 4-Node-5-Node 6-GPU2. However, unlike Example 1 above, GPU1 only restricts the forwarding behavior of Node 4 on the first forwarding path and uses a 5-bit instruction field to carry the corresponding forwarding path indication information.

[0291] Referring to Figure 13, which shows the header format of the message sent by GPU1 in Example 3, the header does not contain a bitmap field, but only a ptr field and an instruction field. The ptr field can be 3 bits, and its value is used to indicate the target node on the first forwarding path that needs to forward the message according to the source routing mode. The instruction field can be 5 bits, and it is used to carry the indication value of the interface of the target forwarding node to forward the message.

[0292] In one possible implementation, the value of the ptr field can be the hop count of the target forwarding node on the first forwarding path (excluding the source node GPU1). As shown in Figure 13, since GPU1 restricts the forwarding behavior of node 4, and node 4 is the third forwarding node on the first forwarding path, the initial value of the ptr field in this header is 3.

[0293] Based on the first forwarding path shown in Figure 10, and the node indication information and forwarding behavior indication information carried in the packet header shown in Figure 13, the process of each forwarding node on the first forwarding path forwarding a packet can be as follows: Based on the received packet, determine whether the value of the ptr field in the packet is 0. If it is not 0, it means that the current forwarding node is not a node whose forwarding behavior is restricted by GPU1. In this case, the packet is forwarded by querying the routing table, and the value of the ptr field is decremented by 1. If the value of the ptr field is 0, the packet is forwarded according to the interface indicated by the instruction value of the instruction field. According to the above logic, when the packet shown in Figure 13 is forwarded to node 4, its corresponding ptr value is 0, and node 4 is a node whose forwarding behavior is restricted. At this time, node 4 forwards the packet according to the interface indicated by the instruction value of the instruction field.

[0294] As can be seen from Example 3, for the target forwarding node whose forwarding behavior needs to be restricted on the first forwarding path, the technical solution provided by this application embodiment can use two independent fields to carry the node indication information and forwarding behavior indication information of the target forwarding node. The total number of bytes occupied by the node indication information and forwarding behavior indication information in the header is equivalent to the length of one forwarding behavior indication information field in Example 1 above. Compared with the solutions that restrict multiple forwarding nodes in Example 1 and Example 2 above, the header overhead of the solution shown in Example 3 is the smallest.

[0295] It should be noted that the relevant implementation details for the above three examples can be found in the relevant descriptions in the embodiments of Figure 7, and will not be repeated here.

[0296] In summary, based on the message forwarding method provided in this application embodiment, when actually forwarding messages, the source node can flexibly set the way in which node indication information and forwarding behavior indication information are carried in the message header according to the actual required message header size.

[0297] Figure 14 is a schematic diagram of a message forwarding device provided in an embodiment of this application. This message forwarding device can be implemented by software, hardware, or a combination of both as any forwarding node in the intra-frame interconnection network shown in Figure 1, or any forwarding node in the inter-frame interconnection network shown in Figure 2 or 3, or a resource switch (SW) within any resource frame in Figure 2 or 3, or part or all of any forwarding node in the forwarding network 300 shown in Figure 6. Specifically, the forwarding node can be the first node mentioned in the embodiment of Figure 7. Referring to Figure 14, the message forwarding device 1400 includes: an acquisition module 1401 and a message forwarding module 1402.

[0298] The acquisition module 1401 is used to acquire a message, which carries node indication information and N forwarding behavior indication information. The node indication information indicates the N forwarding nodes that forward the message according to the source routing mode. The source routing mode indicates that the source node specifies a first forwarding path for the message. The N forwarding behavior indication information indicates the interfaces of the N forwarding nodes that use the first forwarding path to forward the message. N is an integer greater than or equal to 1. For detailed implementation process, please refer to step 701 in the embodiment shown in Figure 7 above. It will not be repeated here.

[0299] The message forwarding module 1402 is used to forward messages through the first interface indicated by the forwarding behavior indication information corresponding to the first node if N forwarding nodes are determined based on the node indication information, including the first node. For detailed implementation process, please refer to step 702 in the embodiment shown in Figure 7 above, which will not be repeated here.

[0300] In one possible implementation, the node indication information includes a first indication value and a second indication value; the message forwarding device 1400 further includes:

[0301] The first determining module is used to determine at least one target bit in the P bits contained in the target data based on the first indication value; wherein the target data is the second indication value, or the target data is obtained by binary conversion of the second indication value, and P is an integer greater than or equal to 1;

[0302] The second determining module is used to determine whether the first node is included among the N forwarding nodes based on the value of at least one target bit.

[0303] In one possible implementation, the first determining module is specifically used for:

[0304] Get the first bit width, which indicates the number of bits occupied by the first node in the target data;

[0305] Based on the first indication value and the first bit width, at least one target bit is determined among the P bits contained in the target data.

[0306] In one possible implementation, the message forwarding module 1402 is also used for:

[0307] The first indicator value is updated to obtain the updated first indicator value; wherein the updated first indicator value is the sum of the first indicator value before the update and the first width corresponding to the first node.

[0308] In one possible implementation, the second determining module is specifically used for:

[0309] If the lowest bit in at least one target bit is 1, then the N forwarding nodes include the first node; or, if the highest bit in at least one target bit is 1, then the N forwarding nodes include the first node; or, if all bits in at least one target bit are 1, then the N forwarding nodes include the first node.

[0310] In one possible implementation, the message header includes a first field, a second field, and N forwarding fields; wherein the first field is used to carry a first indication value, the second field is used to carry a second indication value, and the N forwarding fields are used to carry N forwarding behavior indication information.

[0311] In one possible implementation, the node indication information includes a third indication value, which indicates the target forwarding node for forwarding the packet according to the source routing mode; the packet forwarding device 1400 also includes:

[0312] The third determination module is used to determine N forwarding nodes, including the first node, if the target forwarding node is the first node.

[0313] In one possible implementation, the message forwarding module 1402 is also used for:

[0314] The third indicator value is updated to obtain the updated third indicator value; where the updated third indicator value is the original third indicator value minus one.

[0315] In one possible implementation, the message header includes a third field and a forwarding field. The third field carries a third indication value, and the forwarding field carries forwarding behavior indication information of the target forwarding node.

[0316] In one possible implementation, the first determining module is further configured to:

[0317] If the first indication value is not greater than P, then perform the step of determining at least one target bit among the P bits contained in the target data based on the first indication value;

[0318] If the first indication value is greater than P, then it is determined that the N forwarding nodes do not include the first node.

[0319] In one possible implementation, the message forwarding device 1400 includes:

[0320] The fourth determining module is used to obtain the number of bits with a value of 1 in the target data from the first bit to the bit indicated by the first indicator value, and to obtain the target value;

[0321] The fourth determination module is also used to determine the forwarding behavior indication information corresponding to the first node from N forwarding behavior indication information based on the target value.

[0322] In one possible implementation, the fourth determining module is also used for:

[0323] Based on the target value and the second bit width, the offset byte number is determined; wherein, the second bit width indicates the number of units of bits occupied by the forwarding behavior indication information, and the number of bits occupied by N forwarding behavior indication information is an integer multiple of the second bit width, and the offset byte number indicates the number of bytes by which the position of the forwarding behavior indication information corresponding to the first node in the message is offset from the position of the second indication value in the message.

[0324] Based on the offset byte number and the position of the second indicator value in the message, the forwarding behavior indication information corresponding to the first node is determined from N forwarding behavior indication information.

[0325] In one possible implementation, the message forwarding module 1402 is also used for:

[0326] Obtain the link status information of the first interface, which indicates whether the communication connection between the first interface and other forwarding nodes is normal;

[0327] If the communication connection of the first interface is in an abnormal state, then determine the second forwarding path from the first node to the destination node;

[0328] Based on the second forwarding path, the node indication information and N forwarding behavior indication information in the message are modified;

[0329] The modified message is forwarded to the destination node via the second forwarding path.

[0330] In one possible implementation, the message header also includes a control field, which is used to carry routing control information;

[0331] The routing control information includes a first type, a second type, or a third type. The first type indicates that the number of bits occupied by each of the N forwarding behavior indication information is the same. The second type indicates that at least two of the N forwarding behavior indication information occupy different numbers of bits. The third type indicates that N is 1.

[0332] In this embodiment, after receiving a packet, the packet forwarding device 1400 included in the forwarding node can determine whether it is a node specified by the source node whose forwarding behavior needs to be restricted based on the node indication information carried in the packet. If the node indication information determines that N forwarding nodes include the first node, meaning its forwarding behavior is restricted, then it determines the forwarding behavior indication information corresponding to the first node from the N forwarding behavior indication information and forwards the packet according to the first interface indicated by the forwarding behavior indication information. If the node indication information determines that N forwarding nodes do not include the first node, meaning it is determined that it does not need to forward the packet according to the packet forwarding path specified by the source node, then there is no need to parse and obtain the content of the N forwarding behavior indication information. In this way, while controlling the packet forwarding path, the packet forwarding efficiency of the forwarding node is improved.

[0333] It should be noted that the message forwarding device 1400 provided in the above embodiments, when forwarding messages based on the node indication information and N forwarding behavior indication information carried in the message, is only illustrated by the division of the above functional modules. 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 1400 provided in the above embodiments and the method embodiment in Figure 7 belong to the same concept, and its specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0334] Figure 15 is a schematic diagram of another message forwarding device provided in an embodiment of this application. This message forwarding device can be implemented by software, hardware, or a combination of both as part or all of any of the source nodes mentioned in Figures 1-3 or 6-8. Referring to Figure 15, the message forwarding device 1500 includes: a path acquisition module 1501 and a message sending module 1502.

[0335] The path acquisition module 1501 is used to acquire the first forwarding path of the packet, which indicates the forwarding path from the source node to the destination node. For detailed implementation process, please refer to step 801 in the embodiment shown in Figure 8 above, which will not be repeated here.

[0336] The message sending module 1502 is used to send a message carrying node indication information and N forwarding behavior indication information based on a first forwarding path. The node indication information indicates N forwarding nodes that forward the message according to source routing mode; the source routing mode indicates that the source node specifies the first forwarding path for the message; and the N forwarding behavior indication information indicates the interfaces through which the N forwarding nodes use the first forwarding path to forward the message, where N is an integer greater than or equal to 1. For detailed implementation, please refer to step 802 in the embodiment shown in Figure 8 above; it will not be repeated here.

[0337] In one possible implementation, the node indication information includes a first indication value and a second indication value; wherein, the first indication value indicates at least one target bit corresponding to the first node in the P bits contained in the target data, the value of the at least one target bit indicates whether the N forwarding nodes include the first node, the first node is any forwarding node that forwards the packet on the first forwarding path, the target data is the second indication value, or the target data is obtained by binary conversion of the second indication value, and P is an integer greater than or equal to 1.

[0338] In one possible implementation, the message header includes a first field, a second field, and N forwarding fields, where N is an integer greater than 1;

[0339] The first field carries the first indication value, the second field carries the second indication value, and the N forwarding fields carry N forwarding behavior indication information.

[0340] In one possible implementation, the node indication information includes a third indication value, which indicates the target forwarding node that forwards the packet according to the source routing mode, where N=1. The forwarding behavior indication information indicates the interface through which the target forwarding node forwards the packet using the first forwarding path.

[0341] In one possible implementation, the message header includes a third field and a forwarding field; wherein the third field is used to carry a third indication value, and the forwarding field is used to carry forwarding behavior indication information of the target forwarding node.

[0342] In one possible implementation, the message header also includes a control field, which is used to carry routing control information;

[0343] The routing control information includes a first type, a second type, or a third type. The first type indicates that the number of bits occupied by each of the N forwarding behavior indication information is the same. The second type indicates that at least two of the N forwarding behavior indication information occupy different numbers of bits. The third type indicates that N is 1.

[0344] In this embodiment, after specifying the first forwarding path for a packet, the packet forwarding device 1500 carries node indication information and N forwarding behavior indication information in the packet sent to the network. The node indication information indicates the N forwarding nodes on the first forwarding path that need to forward the packet according to the source routing mode, that is, the forwarding behavior of these N forwarding nodes needs to be restricted during the forwarding process. The N forwarding behavior indication information corresponds one-to-one with the N forwarding nodes, indicating the interfaces of the N forwarding nodes to use the first forwarding path to forward the packet. In this way, the source node can control the forwarding behavior of the N forwarding nodes on the packet forwarding path, thereby achieving the effect of planning the packet forwarding path.

[0345] It should be noted that the message forwarding device 1500 provided in the above embodiments, when sending messages carrying node indication information and N forwarding behavior indication information, is only illustrated by the division of the above functional modules. 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 1500 provided in the above embodiments and the method embodiment in Figure 8 belong to the same concept, and its specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0346] Figure 16 shows a schematic diagram of a network device. This network device can be a switch, router, virtual switch, virtual router, PTN, OTN, network card in a server, server containing NPU or GPU, or other devices with forwarding functions. Specifically, this network device can be used as a forwarding node (e.g., the first node) in the technical solution of this application to execute the steps of the packet forwarding method corresponding to Figure 7 above.

[0347] As shown in Figure 16, the network device may include a main control board 1610, an interface board 1630, and an interface board 1640. In the case of multiple interface boards, a switching network board (not shown in Figure 16) may be included, which is used to complete the data exchange between the interface boards (interface boards are also called line cards or service boards).

[0348] The main control board 1610 performs functions such as system management, equipment maintenance, and protocol processing. Interface boards 1630 and 1640 provide various service interfaces (e.g., POS interface, GE interface, ATM interface, etc.) and implement data stream forwarding. The main control board 1610 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 1610, interface board 1630, and interface board 1640 communicate with each other via a system bus connected to the system backplane. Interface board 1630 includes one or more processors 1631. Processors 1631 control and manage the interface board, communicate with the central processing unit on the main control board, and perform data stream forwarding. The memory 1632 on interface board 1630 stores forwarding table entries; processors 1631 forward data streams by looking up the forwarding table entries (e.g., routing tables) stored in memory 1632.

[0349] The interface board 1630 includes one or more network interfaces 1633 for receiving data streams or other information sent by other devices, and processing these data streams or information according to the instructions of the processor 1631. The specific implementation process will not be described in detail here.

[0350] As shown in Figure 16, this embodiment includes multiple interface boards and employs a distributed forwarding mechanism. Under this mechanism, the operations on interface board 1640 are basically similar to those on interface board 1630, and will not be described further for simplicity. Furthermore, it is understood that the processors 1631 in interface board 1630 and / or 1641 in interface board 1640 in Figure 16 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. Of course, processors 1631 and / or 1641 can also use general-purpose processors, such as general-purpose CPUs, to implement the functions described above.

[0351] Furthermore, it should be noted that there may be one or more main control boards, including a primary main control board and a backup main control board. There may also be one or more interface boards; the stronger the data processing capability of the network device, the more interface boards it provides. With multiple interface boards, these boards can communicate through one or more switching network boards, enabling load sharing and redundancy backup. In a centralized forwarding architecture, the network device may not require a switching network board; the interface boards handle the processing of the entire system's business data. In a distributed forwarding architecture, the network device 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 network device are greater than those of a centralized architecture network device. The specific architecture adopted depends on the specific network deployment scenario, and no limitations are made here.

[0352] In some embodiments, memory 1632 may be read-only memory (ROM), random access memory (RAM), electrically erasable programmable read-only memory (EEPROM), optical discs (including compact disc read-only memory (CD-ROM), compressed optical discs, laser discs, digital versatile optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code having an instruction or data structure form and accessible by a computer, but not limited thereto. Memory 1632 may exist independently and be connected to processor 1631 via a communication bus. Memory 1632 may also be integrated with processor 1631.

[0353] In some embodiments, network interface 1633 can be a transceiver-like device used to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. Network interface 1633 includes a wired network interface and may also include a wireless network interface. The wired network interface can be, for example, an Ethernet interface. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. The wireless network interface can be a WLAN interface, a cellular network communication interface, or a combination thereof. When the network device acts as any network device within a domain, network interface 1633 is used to forward data packets to other network devices. When the network device acts as a forwarding node within a domain, network interface 1633 can also be used to communicate with other forwarding nodes, source nodes, or destination nodes, for example, forwarding packets destined for a destination node along a forwarding path specified by the source node.

[0354] In some embodiments, a network device may include multiple processors, each of which may be a single-core processor or a multi-core processor. Here, a processor may refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0355] In some embodiments, the memory 1632 is used to store a computer program that executes the scheme of this application. The processor 1631 can execute the computer program stored in the memory 1632 to cause the network device to execute the processing steps of the forwarding device in the method embodiment of FIG7. For specific implementation, please refer to the detailed description in the method embodiment, which will not be repeated here.

[0356] Figure 17 shows a schematic diagram of a computer device. This computer device can be a terminal device or a server, or other devices including hardware such as a processor. This computer device can specifically serve as the source node involved in the technical solution of this application, and be used to execute the steps of the message forwarding method corresponding to Figure 8 above.

[0357] Please refer to Figure 17. The computer device includes at least one processor 1701, a communication bus 1702, a memory 1703, and at least one communication interface 1704.

[0358] Processor 1701 can be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, or one or more integrated circuits for implementing the solutions of this application, such as application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The aforementioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.

[0359] The communication bus 1702 is used to transmit information between the aforementioned components. The communication bus 1702 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, it is represented by only one thick line in the figure, but this does not indicate that there is only one bus or one type of bus.

[0360] The memory 1703 may be a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), an optical disc (including a compact disc read-only memory (CD-ROM), a compressed optical disc, a laser disc, a digital versatile optical disc, a Blu-ray disc, etc.), a magnetic disk storage medium, or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but not limited thereto. The memory 1703 may exist independently and be connected to the processor 1701 via the communication bus 1702. The memory 1703 may also be integrated with the processor 1701.

[0361] Communication interface 1704 uses any transceiver-like device for communicating with other devices or communication networks. Communication interface 1704 includes a wired communication interface and may also include a wireless communication interface. The wired communication interface may, for example, be an Ethernet interface. The Ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless communication interface may be a wireless local area network (WLAN) interface, a cellular network communication interface, or a combination thereof.

[0362] As an example, processor 1701 may include one or more CPUs, such as CPU0 and CPU1 as shown in Figure 17.

[0363] As an example, a computer device may include multiple processors, such as processor 1701 and processor 1705 as shown in Figure 17. Each of these processors may be a single-core processor or a multi-core processor. Here, "processor" may refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0364] In some embodiments, the computer device may further include output devices and input devices. The output device communicates with the processor 1701 and can display information in various ways. For example, the output device may be a liquid crystal display (LCD), a light-emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc. The input device communicates with the processor 1701 and can receive user input in various ways. For example, the input device may be a mouse, a keyboard, a touchscreen device, or a sensing device, etc.

[0365] In some embodiments, memory 1703 is used to store program code 1710 for executing the scheme of this application, and processor 1701 can execute program code 1710 stored in memory 1703. The program code 1710 may include one or more software modules, and the computer device can implement the message forwarding method provided in the embodiment of FIG8 through processor 1701 and program code 1710 in memory 1703.

[0366] This application also provides a computer-readable storage medium storing instructions that, when executed on a processor, cause the processor to perform the message forwarding method shown in the above embodiments.

[0367] This application also provides a computer program product containing instructions that, when executed on a processor, cause the processor to perform the packet forwarding method shown in the above embodiments. Alternatively, a computer program is provided that, when executed on a processor, causes the processor to perform the packet forwarding method shown in the above embodiments.

[0368] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-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 via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer, 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 (e.g., digital versatile disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)). It is worth noting that the computer-readable storage medium mentioned in the embodiments of this application can be a non-volatile storage medium; in other words, it can be a non-transient storage medium.

[0369] It should be understood that "multiple" as mentioned herein refers to two or more. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this document 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, and B existing alone. In addition, to facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first," "second," etc., are used in the embodiments of 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," etc., do not limit the quantity or execution order, and the terms "first," "second," etc., do not necessarily imply that they are different.

[0370] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0371] The above descriptions are embodiments provided in this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A message forwarding method, characterized in that, Applied to the first node, the method includes: Obtain a message, the message carrying node indication information and N forwarding behavior indication information; wherein, the node indication information indicates N forwarding nodes that forward the message according to the source routing mode, the source routing mode indicates that the source node specifies a first forwarding path for the message, and the N forwarding behavior indication information indicates the interface of the N forwarding nodes that forwards the message using the first forwarding path, where N is an integer greater than or equal to 1. If the N forwarding nodes are determined to include the first node based on the node indication information, then the packet is forwarded through the first interface indicated by the forwarding behavior indication information corresponding to the first node.

2. The method as described in claim 1, characterized in that, The node indication information includes a first indication value and a second indication value; Before forwarding the packet through the first interface indicated by the forwarding behavior indication information corresponding to the first node, the method further includes: Based on the first indication value, at least one target bit is determined from the P bits contained in the target data; wherein the target data is the second indication value, or the target data is obtained by binary conversion of the second indication value, and P is an integer greater than or equal to 1; Based on the value of the at least one target bit, determine whether the N forwarding nodes include the first node.

3. The method as described in claim 2, characterized in that, The step of determining at least one target bit among the P bits contained in the target data based on the first indication value includes: Obtain the first bit width, which indicates the number of bits occupied by the first node in the target data; Based on the first indication value and the first bit width, at least one target bit is determined from the P bits contained in the target data.

4. The method as described in claim 3, characterized in that, Before forwarding the packet according to the first interface indicated by the forwarding behavior indication information corresponding to the first node, the method further includes: The first indication value is updated to obtain the updated first indication value; wherein the updated first indication value is the sum of the first indication value before the update and the first bit width corresponding to the first node.

5. The method according to any one of claims 2-4, characterized in that, Determining whether the first node is included among the N forwarding nodes based on the value of the at least one target bit includes: If the least one target bit has a value of 1, then the N forwarding nodes are determined to include the first node; or, If the highest bit in the at least one target bit has a value of 1, then the N forwarding nodes are determined to include the first node; or, If all bits in the at least one target bit are 1, then the N forwarding nodes are determined to include the first node.

6. The method according to any one of claims 2-5, characterized in that, The message header includes a first field, a second field, and N forwarding fields; wherein the first field is used to carry the first indication value, the second field is used to carry the second indication value, and the N forwarding fields are used to carry the N forwarding behavior indication information.

7. The method as described in claim 1, characterized in that, The node indication information includes a third indication value, which indicates the target forwarding node that forwards the packet according to the source routing mode, where N = 1; Before forwarding the packet through the first interface indicated by the forwarding behavior indication information corresponding to the first node, the method further includes: If the target forwarding node is the first node, then it is determined that the N forwarding nodes include the first node.

8. The method as described in claim 7, characterized in that, Before forwarding the packet through the first interface indicated by the forwarding behavior indication information corresponding to the first node, the method further includes: The third indication value is updated to obtain an updated third indication value; wherein the updated third indication value is the original third indication value minus one.

9. The method as described in claim 7 or 8, characterized in that, The message header includes a third field and a forwarding field. The third field is used to carry the third indication value, and the forwarding field is used to carry forwarding behavior indication information of the target forwarding node.

10. The method according to any one of claims 2-6, characterized in that, Before determining at least one target bit among the P bits contained in the target data based on the first indication value, the method further includes: If the first indication value is not greater than P, then the step of determining at least one target bit in the P bits contained in the target data based on the first indication value is performed. If the first indication value is greater than P, then it is determined that the N forwarding nodes do not include the first node.

11. The method according to any one of claims 2-6, 10, characterized in that, Before forwarding the packet through the first interface indicated by the forwarding behavior indication information corresponding to the first node, the method further includes: The number of bits with a value of 1 from the first bit to the bit indicated by the first indicator value in the target data is obtained to obtain the target value; Based on the target value, the forwarding behavior indication information corresponding to the first node is determined from the N forwarding behavior indication information.

12. The method as described in claim 11, characterized in that, The step of determining the forwarding behavior indication information corresponding to the first node from the N forwarding behavior indication information based on the target value includes: Based on the target value and the second bit width, the offset byte number is determined; wherein, the second bit width indicates the number of units of bits occupied by the forwarding behavior indication information, and the N bits occupied by the forwarding behavior indication information are an integer multiple of the second bit width, and the offset byte number indicates the number of bytes by which the position of the forwarding behavior indication information corresponding to the first node in the message is offset from the position of the second indication value in the message. Based on the offset byte count and the position of the second indication value in the message, the forwarding behavior indication information corresponding to the first node is determined from the N forwarding behavior indication information.

13. The method according to any one of claims 1-12, characterized in that, Before forwarding the packet through the first interface indicated by the forwarding behavior indication information corresponding to the first node, the method further includes: Obtain the link status information of the first interface, which indicates whether the communication connection between the first interface and other forwarding nodes is normal; If the communication connection of the first interface is in an abnormal state, then a second forwarding path from the first node to the destination node is determined; Based on the second forwarding path, the node indication information and the N forwarding behavior indication information in the message are modified; The modified message is forwarded to the destination node via the second forwarding path.

14. The method according to any one of claims 1-13, characterized in that, The message header also includes a control field, which is used to carry routing control information; The routing control information includes a first type, a second type, or a third type. The first type indicates that the number of bits occupied by each of the N forwarding behavior indication information is the same. The second type indicates that at least two of the N forwarding behavior indication information occupy different numbers of bits. The third type indicates that N is 1.

15. A message forwarding method, characterized in that, Applied to the source node, the method includes: Obtain the first forwarding path of the message, wherein the first forwarding path indicates the forwarding path from the source node to the destination node; Based on the first forwarding path, a message carrying node indication information and N forwarding behavior indication information is sent; wherein, the node indication information indicates N forwarding nodes that forward the message according to the source routing mode, the source routing mode indicates that the source node specifies the first forwarding path for the message, and the N forwarding behavior indication information indicates the interface of the N forwarding nodes that forwards the message using the first forwarding path, and N is an integer greater than or equal to 1.

16. The method as described in claim 15, characterized in that, The node indication information includes a first indication value and a second indication value; wherein, the first indication value indicates at least one target bit corresponding to the first node in the P bits contained in the target data, the value of the at least one target bit indicates whether the N forwarding nodes include the first node, the first node is any forwarding node on the first forwarding path that forwards the packet, the target data is the second indication value, or the target data is obtained by binary conversion of the second indication value, and P is an integer greater than or equal to 1.

17. The method as described in claim 16, characterized in that, The message header includes a first field, a second field, and N forwarding fields, where N is an integer greater than 1; Wherein, the first field is used to carry the first indication value, the second field is used to carry the second indication value, and the N forwarding fields are used to carry the N forwarding behavior indication information.

18. The method as described in claim 15, characterized in that, The node indication information includes a third indication value, which indicates the target forwarding node that forwards the packet according to the source routing mode. N=1, and the forwarding behavior indication information indicates the interface through which the target forwarding node forwards the packet using the first forwarding path.

19. The method as described in claim 18, characterized in that, The message header includes a third field and a forwarding field; wherein the third field is used to carry the third indication value, and the forwarding field is used to carry forwarding behavior indication information of the target forwarding node.

20. The method according to any one of claims 15-19, characterized in that, The message header also includes a control field, which is used to carry routing control information; The routing control information includes a first type, a second type, or a third type. The first type indicates that the number of bits occupied by each of the N forwarding behavior indication information is the same. The second type indicates that at least two of the N forwarding behavior indication information occupy different numbers of bits. The third type indicates that N is 1.

21. A message forwarding device, characterized in that, The apparatus is used to perform the method according to any one of claims 1-14, or to perform the method according to any one of claims 15-20.

22. A message forwarding system, characterized in that, The system includes a source node, a first node, and a destination node, wherein the first node is a node on the packet forwarding path from the source node to the destination node; The source node is used to obtain the first forwarding path of the packet and, based on the first forwarding path, send the packet carrying node indication information and N forwarding behavior indication information; wherein, the first forwarding path indicates the forwarding path from the source node to the destination node, the node indication information indicates N forwarding nodes that forward the packet according to the source routing mode, the source routing mode indicates that the source node specifies the first forwarding path for the packet, and the N forwarding behavior indication information indicates the interface of the N forwarding nodes that forward the packet using the first forwarding path, where N is an integer greater than or equal to 1; The first node is used to acquire the message. If it is determined based on the node indication information that the N forwarding nodes include the first node, then the message is forwarded through the first interface indicated by the forwarding behavior indication information corresponding to the first node. The destination node is used to receive the message.

23. A chip, characterized in that, The chip includes a processor configured to perform the method of any one of claims 1-14, or configured to perform the method of any one of claims 15-20.

24. A computer device, characterized in that, The computer device includes a processor configured to perform the method of any one of claims 1-14, or configured to perform the method of any one of claims 15-20.

25. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1-14, or the method described in any one of claims 15-20.

26. A computer program product, characterized in that, The computer program product stores computer instructions, which, when executed by a processor, implement the method described in any one of claims 1-14, or the method described in any one of claims 15-20.

Citation Information

Patent Citations

  • Route determination method and device, and network device

    CN113395206A

  • Message forwarding method, device and system

    CN114915584A

  • Message processing method, information processing method and device

    CN117792999A

  • Data transmission method, related device, and computer storage medium

    WO2023006002A1