Message forwarding method and device

By using node depth and ID to identify nodes in the sub-networks of the campus network, the problem of low forwarding efficiency in irregular network structures is solved, and fast and accurate message forwarding is achieved.

CN116266821BActive Publication Date: 2025-10-03HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111542266.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-16
Publication Date
2025-10-03
Estimated Expiration
2041-12-16

AI Technical Summary

Technical Problem

In campus networks, when using distance vector diagram-based packet forwarding technology with irregular network structures (such as single-link or loop structures), forwarding nodes need to process a large amount of node information, resulting in low forwarding efficiency.

Method used

By using node depth and subnetwork ID to uniquely identify nodes in the subnetwork of the campus network, and determining the next hop node based on the nearest node information of the target terminal device in the positioning information carried by the message, the number of nodes in the positioning information is reduced and the computing efficiency is improved.

Benefits of technology

This reduces the computational resource consumption of nodes when determining the next-hop node, improves message forwarding efficiency, and implements forwarding along the shortest path to the target terminal device in the loop structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116266821B_ABST
    Figure CN116266821B_ABST
Patent Text Reader

Abstract

The present application discloses a message forwarding method and device, which relate to the field of communication technology. The method can improve the forwarding efficiency of nodes in a campus network. The method is applied to a first node in the campus network. Here, the first node is any node in a subnetwork with a preset network structure in the campus network, and the depth of the first node in the subnetwork is a first depth. The method includes: receiving a first message carrying first positioning information; if the first depth and the second depth corresponding to the first identification number ID in the first positioning information are different, determining the next hop node based on the first depth and the second depth; and forwarding the first message to the next hop node. The first positioning information carried by the first message is used to determine the next hop node that receives the first message, and the first positioning information includes a first ID for identifying a node in the subnetwork.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a message forwarding method and device. Background Art

[0002] A campus network, with a tree-like network structure centered around the core layer, typically consists of an access layer, an aggregation layer, and a core layer. The access layer serves end devices and connects them to the network. The aggregation layer connects the access layer and the core layer and primarily forwards packets within the campus network. The core layer connects the aggregation layer with the campus network's data center and egress areas, serving as the core of data exchange within the campus network.

[0003] When a terminal device in a campus network communicates with another terminal device in the same campus network (or a terminal device in another campus network), message forwarding technology based on a distance vector (DV) graph can be used to achieve message forwarding. When using DV-graph-based message forwarding technology, the campus network's control device can generate locator information for each terminal device in the campus network. This locator information includes node information for all forwarding nodes within the campus network that can reach each terminal device, excluding core layer nodes. In this way, when forwarding a message, the forwarding node in the campus network can determine the next-hop forwarding node based on the locator information carried in the message and its own neighbor table, thereby achieving message forwarding.

[0004] However, when using DV graph-based message forwarding technology to forward messages within a campus network or between campus networks, when there are other irregular network structures (such as single-link network structures or loop network structures) in the campus network in addition to the tree-type network structure with the core layer as the "root" , the control device of the campus network generates the location information of the target terminal device based on the DV graph, including too much node information of the forwarding nodes, resulting in low efficiency of the forwarding node in determining the next-hop forwarding node based on the location information carried in the message and its own neighbor table, that is, the forwarding efficiency of the forwarding node in forwarding messages is low. Summary of the Invention

[0005] The present application provides a message forwarding method and device, which can improve the forwarding efficiency of nodes in a campus network.

[0006] To achieve the above objectives, this application provides the following technical solutions:

[0007] In a first aspect, the present application provides a message forwarding method, which is applied to a first node in a campus network, wherein the first node is any node in a subnetwork having a preset network structure in the campus network, and the depth of the first node in the subnetwork is a first depth. The method includes: receiving a first message carrying first positioning information. If the first depth and the second depth corresponding to the first identification number (identity document, ID) in the first positioning information are different, the next hop node is determined based on the first depth and the second depth. The first message is forwarded to the next hop node. The first positioning information carried by the first message is used to determine the next hop node for receiving the first message, and the first positioning information includes a first ID for identifying a node in the subnetwork.

[0008] In this way, when forwarding a message using the method provided by the present application, when all nodes in the campus network that can reach the destination terminal device for receiving the message include multiple nodes in a sub-network with a preset network structure in the campus network, the node information in the positioning information carried in the message only needs to include the node information (i.e., the ID of the sub-network where the node is located and the depth in the sub-network) of the node that is closest to the target terminal device (i.e., the least number of hops) among the multiple nodes in the sub-network that can reach the target terminal device. Compared to traditional positioning information that needs to include the node information of all nodes in the campus network that can reach the destination terminal device for receiving the message, the method provided by the present application greatly reduces the amount of node information carried in the positioning information. In this way, when the nodes in the campus network determine the next hop node by comparing the node information in the positioning information with the neighbor table configured by themselves, the computing resources consumed will be greatly reduced, and the next hop node can be quickly determined based on the comparison result, thereby improving the forwarding efficiency of the message.

[0009] In one possible design, the depth of the node in the above sub-network is used to indicate the position of the node relative to the starting node in the sub-network, and the depth of the node in the sub-network increases or decreases in sequence along the direction from the starting node to the ending node in the sub-network.

[0010] In this way, through this possible design, a node in a subnetwork can be uniquely identified by the depth of the node in the subnetwork and the ID of the subnetwork.

[0011] In another possible design, the aforementioned preset network structure includes a single-link structure or a loop structure.

[0012] In another possible design method, if the above-mentioned preset network structure is a single-link structure, then the above-mentioned determination of the next hop node based on the first depth and the second depth includes: determining the neighbor node of the first node in the subnetwork in the direction from the first depth to the second depth as the next hop node.

[0013] In another possible design, if the preset network structure is a loop structure, determining the next hop node based on the first depth and the second depth includes: determining a depth difference between the first depth and the second depth; and determining the next hop node based on the depth difference between the first depth and the second depth.

[0014] Through the above-mentioned possible implementation methods, the message forwarding device can determine the next hop node based on the first depth in the first positioning information and the second depth corresponding to the first ID. Therefore, when all the nodes in the campus network that can reach the destination terminal device for receiving the message include multiple nodes in the sub-network with a preset network structure in the campus network, the node information in the positioning information carried in the message only needs to include the node information (i.e., the first ID and the second depth) of the node that is closest to the target terminal device (i.e., the least number of hops) among the multiple nodes in the sub-network that can reach the target terminal device. In this way, when the nodes in the campus network determine the next hop node by comparing the node information in the positioning information with the neighbor table configured by themselves, the computing resources consumed will be greatly reduced, and the next hop node can be quickly determined based on the comparison results, thereby improving the forwarding efficiency of the message.

[0015] In another possible design, determining the next-hop node based on the depth difference between the first depth and the second depth includes: determining a forwarding direction of the first message based on the depth difference between the first depth and the second depth. Determining a neighboring node of the first node located in the forwarding direction as the next-hop node. The path along which the first node forwards the first message to the node corresponding to the second depth in the forwarding direction is shorter than the path along which the first node forwards the first message to the node corresponding to the second depth in a direction opposite to the forwarding direction.

[0016] Through this possible implementation, the first message is forwarded through the path with the shortest distance (ie, number of hops) to the target terminal device in the sub-network with a loop structure, thereby further improving the message forwarding efficiency.

[0017] In another possible design, when a link failure between the first node and the next-hop node is determined, the method further includes: updating the first ID used to identify the node in the subnetwork to a second ID having a one-to-one correspondence with the first ID, the second ID being used to instruct the first node to determine a new next-hop node based on a reverse rule. Based on the reverse rule indicated by the second ID, a neighboring node of the first node located in a direction opposite to the forwarding direction is determined as the new next-hop node.

[0018] In another possible design, the reverse rule is further used to indicate that the neighboring node that sends the first message to the first node is not allowed to be determined as a new next-hop node.

[0019] In another possible design, the method further includes: receiving a second message carrying second positioning information. Determining a first ID in the second positioning information that has a one-to-one correspondence with the second ID. If the first depth and the third depth corresponding to the first ID in the second positioning information are different, then: when the node that sends the second message to the first node is not a neighboring node in the subnet, according to the reverse rule, the neighboring node of the first node in the subnet that is located in the opposite direction of the forwarding direction is determined as the next hop node for receiving the second message; or, when the node that sends the second message to the first node is a node in the subnet, according to the reverse rule, the neighboring node in the subnet other than the neighboring node that sends the second message to the first node is determined as the next hop node for receiving the second message. Forwarding the second message to the next hop node for receiving the second message.

[0020] Through the above-mentioned possible implementation methods, while improving the message forwarding efficiency, it is also possible to implement the switching of the failed forwarding path when the nodes in the sub-network forward messages, thereby ensuring the transmission of the message.

[0021] In another possible design, the method further includes: if the first depth and the second depth are the same, determining a next hop node according to the neighbor table of the first node and the first positioning information.

[0022] In a second aspect, the present application provides a message forwarding device.

[0023] In one possible design, the message forwarding device is used to execute any one of the methods provided in the first aspect above. The present application can divide the message forwarding device into functional modules according to any one of the methods provided in the first aspect above. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. Exemplarily, the present application can divide the message forwarding device into a receiving unit, a determining unit, and a sending unit, etc. according to the function. The description of the possible technical solutions and beneficial effects executed by the above-mentioned divided functional modules can refer to the technical solutions provided by the first aspect or its corresponding possible design, and will not be repeated here.

[0024] In another possible design, the message forwarding device includes: a memory, a network interface and one or more processors, which receive or send data through the network interface, and the one or more processors are configured to read program instructions stored in the memory to execute any method provided by the first aspect and any possible design thereof.

[0025] In a third aspect, the present application provides a computer-readable storage medium comprising program instructions, which, when executed on a computer or processor, enables the computer or processor to execute any method provided by any possible implementation of the first aspect.

[0026] In a fourth aspect, the present application provides a computer program product, which, when running on a message forwarding device, enables any method provided by any possible implementation in the first aspect to be executed.

[0027] In a fifth aspect, the present application provides a chip system comprising a memory and a processor, wherein the memory is configured to store computer instructions, and the processor is configured to retrieve and execute the computer instructions from the memory to execute the method of the first aspect and any possible implementation thereof.

[0028] It can be understood that any of the devices, computer storage media, computer program products or chip systems provided above can be applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods and will not be repeated here.

[0029] In this application, the names of the message forwarding devices and systems do not limit the devices or functional modules themselves. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of this application, they fall within the scope of the claims of this application and their equivalents. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of the network architecture of a campus network provided in an embodiment of the present application;

[0031] Figure 2 A schematic diagram of another campus network architecture provided in an embodiment of the present application;

[0032] Figure 3 A schematic diagram of the hardware structure of a message forwarding device provided in an embodiment of the present application;

[0033] Figure 4 A flowchart of a message forwarding method provided in an embodiment of the present application;

[0034] Figure 5 A schematic diagram of another campus network architecture provided in an embodiment of the present application;

[0035] Figure 6 A flowchart of another message forwarding method provided in an embodiment of the present application;

[0036] Figure 7A flowchart of another message forwarding method provided in an embodiment of the present application;

[0037] Figure 8 A schematic structural diagram of a message forwarding device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to better understand the embodiments of the present application, some of the terms or technologies involved in the embodiments of the present application are explained below:

[0039] 1) Campus Network

[0040] A campus network refers to a network within a campus. This includes large campuses consisting of multiple buildings, such as hospitals and schools. It also includes smaller campuses consisting of a single building, a single floor, or a few rooms within a building, but is not limited to these.

[0041] Campus networks typically adopt a multi-layered architecture. When the campus network architecture is a tree-like structure with the core layer as the "root," the campus network typically includes an access layer network, an aggregation layer network, and a core layer network (hereinafter referred to as the access layer, aggregation layer, and core layer).

[0042] The access layer is oriented towards terminal devices and is used to connect terminal devices in the campus to the network through wired or wireless connections. Terminal devices include, but are not limited to, general-purpose computers, laptops, tablets, printers, Internet Protocol (IP) phones, mobile phones, and cameras.

[0043] Typically, the access layer consists of access switches. These switches connect and communicate with end devices, enabling them to access the network. In some scenarios, if the end devices are wireless, the access layer includes wireless access points (APs), which connect wireless end devices to the network.

[0044] The aggregation layer, located between the access layer and the core layer, primarily forwards packets within the campus network. For example, the aggregation layer can forward packets between end devices (referred to as "horizontal" traffic), or it can forward packets between end devices and the core layer (referred to as "vertical" traffic). As can be seen, the aggregation layer can serve as the switching core within departments or regions within the campus, enabling connections between end devices and departmental or regional servers.

[0045] Typically, the aggregation layer consists of aggregation switches, which are not specifically defined here. Since the access layer is typically composed of simple access switches, a Layer 2 networking protocol is used between the access and aggregation layers.

[0046] The core layer is the heart of campus data exchange. In addition to connecting to the aggregation layer, the core layer also connects to other components of the campus network, such as the campus network's data center and egress zone. This allows the core layer to achieve high-speed interconnection within the entire campus network through communication with the aggregation layer and data center. Furthermore, the core layer can achieve high-speed interconnection between the campus network and external networks through communication with the aggregation layer and egress zone. The campus network's egress zone typically includes the campus's firewalls and gateway devices (such as routing devices).

[0047] Typically, the core layer consists of core switches, which are not specifically defined here. In some scenarios, when APs are present in the campus network, the core layer also includes a wireless access point controller (WAC). This allows the WAC to manage the APs using the Control and Provisioning of Wireless Access Points (CAPWAP) protocol.

[0048] In addition, a three-layer routing protocol, such as the Interior Gateway Protocol (IGP), runs between the core layer and the aggregation layer.

[0049] refer to Figure 1 , Figure 1 FIG. 1 shows a schematic diagram of a network architecture of a campus network 10 provided in an embodiment of the present application. Figure 1 As shown, the network architecture of the campus network 10 is a tree-type network structure with the core layer as the "root". The network architecture of the campus network 10 includes an access layer, a convergence layer, and a core layer.

[0050] exist Figure 1 The access layer of the campus network 10 shown in FIG. 1 includes access switch 101, access switch 102, access switch 103, access switch 104, access switch 105, and wireless access point 106. Taking access switch 101 as an example, Figure 1 As shown, the access switch 101 is used to connect to the terminal 1, ..., terminal n (n is a positive integer) to enable the terminal 1, ..., terminal n to access the campus network 10.

[0051] exist Figure 1The aggregation layer of campus network 10 shown includes aggregation switches 111, 112, and 113. Aggregation switch 111 connects core switch 121 (or core switch 122) and access switch 101 (or access switch 102, access switch 103, or access switch 104). Aggregation switch 112 connects core switch 121 (or core switch 122) and access switch 101 (or access switch 102, access switch 103, or access switch 104). Aggregation switch 113 connects core switch 121 (or core switch 122) and access switch 105 (or access switch 106).

[0052] exist Figure 1 The core layer of the campus network 10 shown includes a core switch 121 and a core switch 122. The core switch 121 is used to connect the egress area devices, aggregation switch 111, and aggregation switch 112 of the campus network 10. The core switch 122 is used to connect the egress area devices, aggregation switch 112, and aggregation switch 113 of the campus network 10. Figure 1 The egress zone devices of the campus network 10 shown include routing devices, firewall devices, etc. The devices in the egress zone of the campus network 10 are used to connect the core switches 121 and 122 to the external network.

[0053] 2) Other terms

[0054] In the embodiments of this application, words such as "exemplary," "as an example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "as an example," or "for example" in the embodiments of this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Rather, the use of words such as "exemplary," "as an example," or "for example" is intended to present the relevant concepts in a concrete manner.

[0055] In this application, the term "at least one" means one or more, and the term "plurality" means two or more. For example, a plurality of nodes refers to two or more nodes.

[0056] In the embodiments of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0057] It should be understood that in the various embodiments of this application, the order of execution of each process does not necessarily imply a specific order of execution. The order of execution of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation of the embodiments of this application. It should also be understood that determining B based on A does not mean determining B based solely on A; B can also be determined based on A and / or other information.

[0058] For ease of description, in the embodiments of the present application, the access switches and / or APs at the access layer, the aggregation switches at the aggregation layer, and the core switches and / or WACs at the core layer in the campus network are collectively referred to as nodes.

[0059] In a campus network, in addition to forwarding packets through routing tables maintained by each node, packets can also be forwarded based on a DV graph. A DV graph is a vector diagram of the distances between each node in the campus network and the root node (i.e., core layer node) or terminal devices. It is understood that the distance from a node to another node or device can be represented by the number of hops required to reach that node or device.

[0060] Each node in the campus network is configured with a neighbor table derived from the DV graph. For any node in the campus network, the neighbor table includes the identity documents (IDs) of all of its neighboring nodes and the distance from each neighboring node to the root node. For simplicity, in this embodiment of the present application, the distance from a node to the root node is referred to as the node's root distance. Furthermore, the control device in the campus network can generate positioning information for each terminal device based on the DV graph, used to locate the terminal device. For any terminal device in the campus network, the positioning information includes the terminal device's ID and the node information of all nodes on the campus network's downstream path that can reach the terminal device, excluding the root node. For example, taking node 1 on the campus network's downstream path that can reach the terminal device, excluding the root node, the node information of node 1 includes node 1's ID and the distance from node 1 to the terminal device. Here, the downstream path is the forwarding path from the core layer node, through the aggregation layer node, and then to the access layer node. Correspondingly, the forwarding path from the access layer node, through the aggregation layer node, and then to the core layer node is referred to as the upstream path.

[0061] by Figure 1 Assume that the campus network 10 shown in the figure is Figure 1 The number of each node shown in is the ID of each node. For the terminal 1, the positioning information 1 generated by the control device of the campus network 10 for positioning the terminal 1 can be:

[0062] LOG: 111(2), 112(2), 101(1)

[0063] ID: 1

[0064] Among them, the "ID" item in the positioning information 1 indicates that the ID of terminal 1 is 1, and the "LOG" item indicates the node information of all nodes on the downlink path of campus network 10 (including 3 nodes, namely aggregation switch 111, aggregation switch 112 and access switch 101) that can reach terminal 1 except the root node. Among them, the value outside the brackets in the "LOG" item represents the ID of the node, and the value inside the brackets represents the distance from the node to terminal 1. Specifically, the node information of aggregation switch 111 is "111(2)". Among them, the "111" in "111(2)" indicates that the ID of aggregation switch 111 is 111, and the (2) in "111(2)" indicates that the number of hops required to reach terminal 1 from aggregation switch 111 is 2 hops. The node information of aggregation switch 112 is "112(2)", where "112" in "112(2)" indicates that the ID of aggregation switch 112 is 112, and (2) in "112(2)" indicates that the number of hops required to reach terminal 1 from aggregation switch 112 is 2. The node information of access switch 101 is "101(1)", where "101" in "101(1)" indicates that the ID of access switch 101 is 101, and (1) in "101(1)" indicates that the number of hops required to reach terminal 1 from access switch 101 is 1.

[0065] In this way, when a node in the campus network forwards a message to a terminal device, the node can match its own neighbor table with the node information in the location information carried by the message to be forwarded, which is used to locate the terminal device, to determine the next hop node for receiving the message to be forwarded, thereby forwarding the message to be forwarded. Specifically, the node can determine whether the node ID in the location information carried by the message to be forwarded exists in its own neighbor table by comparing the node information in the location information carried by the message to be forwarded with the node information in its own neighbor table.

[0066] If a node determines that the node ID in the location information carried in the message to be forwarded does not exist in its neighbor table, it indicates that the message to be forwarded must be forwarded via the upstream path. Therefore, the node identifies the neighbor node with the shortest root distance in its neighbor table as the next hop node and forwards the message to that next hop node.

[0067] When a node determines that the node ID in the positioning information carried by the message to be forwarded exists in its neighbor table, it indicates that the message to be forwarded is currently being forwarded on the downlink path. Specifically, when a node determines that a node ID in the positioning information carried by the message to be forwarded exists in its neighbor table, the neighbor node identified by this node ID is determined as the next-hop node. When a node determines that multiple node IDs in the positioning information carried by the message to be forwarded exist in its neighbor table, the neighbor node closest to Terminal 1 among the neighbor nodes identified by these multiple node IDs is determined as the next-hop node, and the message to be forwarded is forwarded to this next-hop node.

[0068] However, when there is an irregularly structured network (such as a single-link structured network or a loop structured network, etc.) in a campus network with a tree structure, the above-mentioned positioning information will include node information of a large number of nodes, so that the node needs to consume more computing resources to determine the next hop node when matching the node information in the neighbor table and the positioning information carried by the forwarded message, thereby reducing the forwarding efficiency of the node.

[0069] As an example, refer to Figure 2 , Figure 2 The following is a schematic diagram showing another campus network architecture provided by an embodiment of the present application. Figure 2 In the campus network shown, nodes 1 and 2 are located at the core layer, nodes 3, 4, 5, and 6 are located at the aggregation layer, and nodes 7, 8, 9, and 10 are located at the access layer.

[0070] like Figure 2 As shown, there is a single-link network between the access layer node 7 and the terminal 1000, which includes the node 7, the node 11, the node 12, the node 13 and the node 14. Here, the network with a single-link structure can be regarded as Figure 2 A subnetwork in the campus network shown (i.e. Figure 2 The sub-network 21 shown is a single-input single-output network.

[0071] like Figure 2 As shown, there is a network with a loop structure between the access layer node 10 and the terminal 2000, which includes nodes 10, 15, 16, 17, 18, 19 and 20. Here, the network with a loop structure can be regarded as Figure 2 Another subnetwork in the campus network shown (i.e. Figure 2 Subnetwork 22 shown).

[0072] In this way, when Figure 2 The IDs of the nodes shown are the numbers of the nodes. When forwarding messages based on the DV diagram described above:

[0073] Figure 2 The positioning information 2 generated by the control device in the campus network for the terminal 1000 is:

[0074] LOG: 3(6), 4(6), 7(5), 11(4), 12(3), 13(2), 14(1)

[0075] ID: 1000

[0076] Among them, the "ID" item in the positioning information 2 indicates that the ID of the terminal 1000 is 1000, and the "LOG" item indicates Figure 2 The node information of all nodes on the campus network downlink path that can reach the terminal 1000 except the root node is shown. Figure 2 As shown, the total number of nodes includes seven nodes, namely, node 3, node 4, node 7, node 11, node 12, node 13, and node 14. In other words, location information 2 includes node information for seven nodes. A detailed description of the node information for these seven nodes can be found in the description of the node information in location information 1 above, and will not be repeated here.

[0077] Figure 2 The positioning information 3 generated by the control device in the campus network for the terminal 2000 is:

[0078] LOG: 5(5), 6(5), 10(4), 15(4), 16(3), 17(2), 18(3), 19(2), 20(1)

[0079] ID: 2000

[0080] Among them, the "ID" item in the positioning information is the ID of terminal 2000, which is 2000, and the "LOG" item indicates Figure 2 The node information of all nodes on the campus network downlink path that can reach terminal 2000 except the root node is shown. Figure 2 As shown, the total number of nodes includes nine nodes, namely, node 5, node 6, node 10, node 15, node 16, node 17, node 18, node 19, and node 20. In other words, location information 3 includes node information for nine nodes. A detailed description of the node information for these nine nodes can be found in the description of the node information in location information 1 above, and will not be repeated here.

[0081] It can be seen that the amount of node information in Location Information 2 and Location Information 3 is much greater than the amount of node information in Location Information 1. In other words, when a single-link or loop network exists between the access layer and the terminal devices in a campus network, the location information generated by the campus network's control device for the terminal devices will include a large amount of node information. This will cause the node to consume more computing resources when matching the neighbor table with the node information in the location information carried by the forwarded message to determine the next hop node, thereby reducing the node's forwarding efficiency.

[0082] Based on this, an embodiment of the present application provides a message forwarding method, which is applied to a campus network, and the campus network includes a subnetwork with a preset network structure, and the method is executed by any node (for example, a first node) in the subnetwork. Among them, the nodes in the subnetwork with a preset network structure are uniquely identified by the same ID and the depth of each node in the subnetwork. Here, the depth of the node in the subnetwork is used to indicate the position of the node in the subnetwork. In this way, the method provided by the embodiment of the present application can forward messages based on the relative position relationship indicated by the depth of the node in the subnetwork for receiving messages (for example, the first depth) and the depth of the node in the subnetwork closest to the target terminal device in the positioning information carried by the message (that is, the second depth).

[0083] In this case, when all nodes in the campus network's downlink path that can reach the target terminal device, excluding the root node, include multiple nodes within a subnetwork, the positioning information used to locate the target terminal device only needs to include the node information of the node closest to the target terminal device among the multiple nodes within the subnetwork that can reach the target terminal device. Therefore, the method provided by the embodiments of the present application can significantly reduce the amount of node information in the positioning information, thereby improving the forwarding efficiency of messages in scenarios where the campus network includes subnetworks with a preset network structure.

[0084] The control device may be an independent computing device in the campus network, such as a control server, etc. Alternatively, the control device may be a functional module in any network device in the campus network, which is not limited in the embodiments of the present application.

[0085] The above-mentioned preset network structure includes a single-link structure or a loop structure, but is certainly not limited thereto.

[0086] The embodiment of the present application also provides a campus network, which includes a sub-network with a preset network structure. As an example, the campus network can be Figure 2 The campus network shown in Figure 1 is as follows. Figure 2 As shown, a sub-network with a preset network structure (eg Figure 2Subnetworks 21 and 22 are shown as being deployed between the access layer and the terminal devices. It should be understood that the subnetworks with a preset network architecture described in the embodiments of the present application may also be deployed between the aggregation layer and the access layer, or between the aggregation layer and the core layer. The embodiments of the present application do not specifically limit the deployment location of the subnetworks with a preset network architecture within the campus network.

[0087] The present application also provides a message forwarding device, which can be any computing device with computing processing capabilities, or a functional module in a computing device, and the present application is not limited thereto. The computing device can be, for example, a general-purpose computer, a server, a switch, etc., but is not limited thereto.

[0088] refer to Figure 3 , Figure 3 FIG. 1 shows a hardware structure diagram of a message forwarding device 30 provided in an embodiment of the present application. Figure 3 As shown, the message forwarding device 30 includes a processor 31, a memory 32, a network interface 33 and a bus 34. The processor 31, the memory 32 and the network interface 33 are connected via the bus 34.

[0089] The processor 31 is the control center of the message forwarding device 30. It can be a general-purpose central processing unit (CPU). The processor 31 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, graphics processing units (GPU), neural processing units (NPU), tensor processing units (TPU) or artificial intelligence (artificial intelligent) chips, data processors (DPU), etc.

[0090] As an example, the processor 31 may include one or more CPUs, such as Figure 3 In addition, the present application does not limit the number of processor cores in each processor.

[0091] The memory 32 is used to store program instructions or data to be accessed by the application process. The processor 31 can implement the message forwarding method provided in the embodiment of the present application by executing the program instructions in the memory 32.

[0092] The memory 32 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, the volatile memory may be read-only memory (ROM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronized dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). Non-volatile memory can be storage class memory (SCM), solid state drive (SSD), hard disk drive (HDD), etc. Storage class memory can be, for example, non-volatile memory (NVM), phase-change memory (PCM), persistent memory, etc.

[0093] In one possible implementation, memory 32 exists independently of processor 31. Memory 32 is connected to processor 31 via bus 34 and is used to store data, instructions, or program code. When processor 31 calls and executes the instructions or program code stored in memory 32, the message forwarding method provided in the embodiments of the present application can be implemented.

[0094] In another possible implementation, the memory 32 and the processor 31 are integrated together.

[0095] The network interface 33 is used to connect the message forwarding device 30 to other devices (such as nodes or terminal devices in a campus network) via a communication network. The communication network can be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The network interface 33 includes a receiving unit for receiving data / messages and a sending unit for sending data / messages.

[0096] The bus 34 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, a high-speed serial computer expansion bus (PCIe), a Compute Express Link (CXL), or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0097] It should be pointed out that Figure 3 The structure shown in the figure does not constitute a limitation on the message forwarding device 30, except Figure 3 In addition to the components shown, the message forwarding device 30 includes Figure 3 More or fewer components may be shown, or certain components may be combined, or the components may be arranged differently.

[0098] The message forwarding method provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0099] refer to Figure 4 , Figure 4 The following is a flow chart of a message forwarding method provided by an embodiment of the present application. Figure 2 In the campus network shown, the method is executed by any node in a sub-network with a preset network structure in the campus network. The preset network structure includes, but is not limited to, a single-link structure or a loop structure. Assuming that any node in a sub-network with a preset network structure in the campus network is the first node, the message forwarding method provided in the embodiment of the present application may include the following steps:

[0100] S101: A first node receives a first message, where the first message carries first positioning information.

[0101] The first node is any node in a sub-network (hereinafter referred to as the first sub-network) with a preset network structure in the campus network. For example, the first node is Figure 2 Node 11 in the campus network shown, or Figure 2 The nodes 10 and 15 in the campus network are shown, and no limitation is imposed on this.

[0102] In an embodiment of the present application, all nodes in the first subnetwork share an ID, for example, a shared first ID. In the first subnetwork, the first node can be uniquely identified by the ID of the first node (i.e., the first ID) and the depth of the first node in the first subnetwork (e.g., the first depth). The IDs of subnetworks with different preset network structures may belong to different domains. For example, the ID of a subnetwork with a single-link structure may be taken within the first domain, the ID of a subnetwork with a loop structure may be taken within the second domain, and so on. The depth of a node in a subnetwork is used to indicate the position of the node in the subnetwork relative to the starting node in the subnetwork.

[0103] It should be understood that nodes in a subnetwork can be divided into starting nodes and ending nodes according to their positions. Thus, in a subnetwork, the depth of each node increases or decreases in sequence along the direction from the starting node to the ending node. For simplicity of description, the embodiment of the present application uses the example of increasing the depth of each node in a subnetwork along the direction from the starting node to the ending node.

[0104] Optionally, intermediate nodes are included between the starting node and the ending node in the subnetwork. Thus, the depth of each node in the subnetwork increases sequentially in the direction from the starting node to the ending node via the intermediate nodes. For simplicity, in this embodiment of the application, the "direction from the starting node to the ending node via the intermediate nodes" is referred to as the "first direction" below.

[0105] The following takes a subnetwork with a single link structure and a subnetwork with a loop structure as examples to explain in detail the division of the start node, intermediate node, and end node in the subnetwork according to different situations.

[0106] Case 1: The subnetwork is a subnetwork with a single link structure

[0107] Because a subnetwork with a single-link structure is a single-input, single-output network, for a subnetwork with a single-link structure, embodiments of the present application can determine either of the subnetwork's two edge nodes as the starting node, and the other of the two edge nodes, excluding the starting node, as the subnetwork's terminating node. The two edge nodes of the subnetwork include the subnetwork's entry node and exit node. Furthermore, in a subnetwork with a single-link structure, except for the starting node and the terminating node, all other nodes are intermediate nodes.

[0108] As an example, the subnetwork is Figure 2 Taking subnetwork 21 in the campus network with a single link structure as an example, the edge nodes in subnetwork 21 include node 7 and node 14. Therefore, node 7 and node 14 are the starting node and ending node of subnetwork 21, respectively. Nodes 11, 12, and 13, excluding the edge nodes, are intermediate nodes in subnetwork 21.

[0109] Case 2: The subnetwork is a subnetwork with a loop structure

[0110] For a subnetwork with a loop structure, embodiments of the present application may determine any node in the subnetwork as the starting node, and any one of the two neighboring nodes of the starting node in the subnetwork as the ending node. Furthermore, in a subnetwork with a loop structure, except for the starting and ending nodes, all other nodes are intermediate nodes.

[0111] As an example, the subnetwork is Figure 2 Taking subnetwork 22, a loop structure within the campus network shown, as an example, if node 10 in subnetwork 22 is the starting node, then either of node 10's two neighboring nodes within subnetwork 22 (node ​​15 and node 18) is the ending node. Assuming node 15 is the ending node, nodes 18, 19, 20, 17, and 16 in subnetwork 22, excluding nodes 10 and 15, are intermediate nodes within subnetwork 22.

[0112] Thus, for nodes other than the starting node in the subnetwork, the depth of the other node is the sum of the initial depth of the starting node and the depth difference between the starting node and the other node. Here, the embodiment of the application does not specifically limit the value of the initial depth of the starting node, for example, it can be 0, 1, 16, etc.

[0113] The depth difference between the starting node and the other nodes is the product of the number of hops from the starting node to the other nodes and the depth step. Here, the depth step refers to the depth difference between any two adjacent nodes in the subnetwork. It should be understood that the depth difference between any two adjacent nodes in the subnetwork is equal. For a subnetwork with a loop structure, except for the adjacent starting node and ending node in the subnetwork, the depth difference between any other two adjacent nodes is equal. It can be seen that in the first direction, the depth of each node in the subnetwork increases in sequence with the depth step.

[0114] Exemplary, reference Figure 2 , assuming Figure 2 In the campus network shown, the depth step of subnetwork 21 with a single link structure is 1. The starting node of subnetwork 21 is node 7 and the ending node is node 14. Nodes 11, 12, and 13 are intermediate nodes. Therefore, the first direction is the direction from node 7 to node 14 via nodes 11, 12, and 13, that is, Figure 2 Direction 1 shown. Thus, in direction 1, the depth of each node in subnetwork 21 increases by 1. Specifically, assuming that the initial depth of node 7 (i.e., the starting node) is 1, the depth of the next hop node of node 7 in direction 1 (i.e., node 11) is 1+1, that is, the depth of node 11 is 2. The depth of the next hop node of node 11 in direction 1 (i.e., node 12) is 2+1, that is, the depth of node 12 is 3. The depth of the next hop node of node 12 in direction 1 (i.e., node 13) is 3+1, that is, the depth of node 13 is 4. The depth of the next hop node of node 13 in direction 1 (i.e., node 14) is 4+1, that is, the depth of node 14 is 5. Alternatively, the depth of the nodes in subnetwork 21 can also be described as: along direction 1, the depth of node 11, which is 1 hop away from node 7, is 1+1×1=2; the depth of node 12, which is 2 hops away from node 7, is 1+2×1=3; the depth of node 13, which is 3 hops away from node 7, is 1+3×1=4; and the depth of node 14, which is 4 hops away from node 7, is 1+4×1=5.

[0115] For example, reference Figure 2 , assuming Figure 2 In the campus network shown, the depth step of subnetwork 22 with a loop structure is 2. The starting node of subnetwork 22 is node 10 and the ending node is node 15. Then nodes 18, 19, 20, 17, and 16 are intermediate nodes. Therefore, the first direction is the direction from node 10 to node 15 via nodes 18, 19, 20, 17, and 16, that is, Figure 2Direction 2 as shown. Thus, in direction 2, the depth of each node in subnetwork 22 increases by 2. Specifically, assuming that the initial depth of node 10 (i.e., the starting node) is 1, the depth of node 10's next hop node in direction 2 (i.e., node 18) is 1+2, that is, the depth of node 18 is 3. The depth of node 18's next hop node in direction 2 (i.e., node 19) is 3+2, that is, the depth of node 19 is 5. The depth of node 19's next hop node in direction 2 (i.e., node 20) is 5+2, that is, the depth of node 20 is 7. The depth of node 20's next hop node in direction 2 (i.e., node 17) is 7+2, that is, the depth of node 17 is 9. The depth of node 17's next hop node in direction 2 (i.e., node 16) is 9+2, that is, the depth of node 16 is 11. The depth of node 16's next hop node in direction 2 (i.e., node 15, also the terminating node) is 11+2, which means that the depth of node 15 is 13. Alternatively, the depths of nodes in subnetwork 22 can also be described as follows: along direction 2, the depth of node 18, which is 1 hop away from node 10, is 1+1×2=3; the depth of node 19, which is 2 hops away from node 7, is 1+2×2=5; the depth of node 20, which is 3 hops away from node 7, is 1+3×2=7; the depth of node 17, which is 4 hops away from node 7, is 1+4×2=9; the depth of node 16, which is 5 hops away from node 7, is 1+5×2=11; and the depth of node 15, which is 6 hops away from node 7, is 1+6×2=13.

[0116] Optionally, if the depth of the terminating node in the sub-network is not limited, the depth step can be set to any value. In this case, in the first direction, the depth of each node in the sub-network increases in sequence by the arbitrary value.

[0117] Optionally, the embodiment of the present application may also limit the depth of the terminating node in the subnetwork, and the depth step of the subnetwork is the average depth difference between two adjacent nodes calculated based on the depth difference between the starting node and the terminating node in the subnetwork and the number of nodes in the subnetwork. Specifically, assuming that the subnetwork includes m nodes, the depth step of the subnetwork can be obtained by dividing the depth difference between the starting node and the terminating node in the subnetwork by (m-1).

[0118] Exemplary, reference Figure 2 , assuming Figure 2In the campus network shown, subnetwork 21, which has a single-link structure, starts at node 7 and ends at node 14. The initial depth of the starting node is 1, and the depth of the ending node is limited to 9. Since subnetwork 21 includes 5 nodes, the depth step of subnetwork 21 is (depth of ending node - initial depth of starting node) / (number of nodes - 1), or (9 - 1) / (5 - 1) = 2. Therefore, the depth step of subnetwork 21 is 2.

[0119] For example, reference Figure 2 , assuming Figure 2 In the campus network shown, subnetwork 22, which has a loop structure, starts at node 10 and ends at node 15. The initial depth of the starting node is 0, and the depth of the ending node is limited to 30. Since subnetwork 22 includes 7 nodes, the depth step of subnetwork 22 is (depth of the ending node - initial depth of the starting node) / (number of nodes - 1), that is, (30 - 0) / (7 - 1) = 5. In other words, the depth step of subnetwork 22 is 5.

[0120] It should be noted that when configuring IDs for sub-networks with different preset network structures in a campus network based on the above-mentioned method, the embodiments of the present application can take values ​​within different value ranges. For example, the depth of a node in a sub-network with a single-link structure in a campus network can take values ​​within the value range of 0-15, that is, within the value range of 00000000 to 00001111. For another example, the depth of a node in a sub-network with a loop structure in a campus network can take values ​​within the value range of 16-255, that is, within the value range of 00010000 to 11111111, and so on.

[0121] It can be understood that the ID shared by the nodes in the sub-network with a preset network structure within the campus network, and the depth of each node in the sub-network, can be set when the campus network is networked, or set when the campus network configures a sub-network with a preset network structure, or can be issued by the control device of the campus network based on the topological structure of the campus network after the campus network is networked. There is no limitation on this.

[0122] When the shared ID of nodes in a subnetwork with a preset network structure within a campus network, as well as the depth of each node in the subnetwork, are issued by the campus network's control device based on the campus network's topology after the campus network is established, each node in the campus network can optionally report its initial ID and the initial IDs of its neighboring nodes to the control device in advance. In this way, the control device can determine the campus network's topology based on the received initial IDs. Based on the determined topology, the control device can then identify the subnetworks within the campus network with the preset network structure, configure an ID for each identified subnetwork, and set a depth for each node in the subnetwork. For detailed instructions on how the control device configures IDs for subnetworks and sets depths for nodes in the subnetwork, please refer to the relevant instructions above and will not be repeated here. The control device can then send the configured IDs for the subnetworks within the campus network and the depths set for each node in the subnetwork to the corresponding nodes in the subnetwork, causing the nodes in the subnetwork to update their initial IDs to the IDs configured by the control device and record their depths.

[0123] Furthermore, the first positioning information carried in the first message received by the first node is used to determine the next-hop node for receiving the first message. This first positioning information includes the ID of the target terminal device that ultimately receives the first message, as well as node information for nodes on the campus network downlink path that can reach the target terminal device, excluding the root node. The node information is described above and will not be repeated here.

[0124] It should be noted that in the embodiment of the present application, since all nodes in a subnetwork (such as the first subnetwork) with a preset network structure in the campus network share an ID. Therefore, for nodes other than the subnetwork or other subnetworks in the campus network, the subnetwork can be regarded as a node. In this case, when all nodes on the path sent down from the campus network that can reach the target terminal device except the root node include multiple nodes in a subnetwork, the first positioning information only needs to include the node information of the node that is closest to the target terminal device (i.e., the least number of hops) among the multiple nodes in the subnetwork that can reach the target terminal device. In other words, the amount of node information carried in the first positioning information is greatly reduced. In this case, the node information of the node that is closest to the target terminal device in the subnetwork, in addition to including the ID of the node and the distance from the node to the target terminal device, also includes the depth of the node in the subnetwork.

[0125] For example, Figure 2 Taking subnet 21 in the campus network as an example, Figure 2The nodes on the campus network's downlink path that can reach terminal 1000 include node 3, node 4, and nodes 7, 11, 12, 13, and 14 within subnetwork 21. Node 14 within subnetwork 21 is the closest node (one hop) to terminal 1000. Assuming the shared ID of the nodes in subnetwork 21 is 30, and the depth of node 14 within subnetwork 21 is 5, the location information for terminal 1000 can be expressed as:

[0126] LOG:3(6),4(6),30(1)(5)

[0127] ID: 1000

[0128] The "ID" item in the positioning information indicates that the terminal ID is 1000. The "LOG" item indicates Figure 2 The node information of the nodes on the campus network downlink path that can reach the terminal 1000 except the root node is shown. Among them, the "3" in "3(6)" indicates that the node ID is 3, and the "(6)" in "3(6)" indicates the number of hops required for the node with ID 3 to reach the terminal 1000. The "4" in "4(6)" indicates that the node ID is 4, and the "(6)" in "4(6)" indicates the number of hops required for the node with ID 4 to reach the terminal 1000. The "30" in "30(1)(5)" indicates that the node ID is 30, and the "(1)" in "30(1)(5)" indicates the number of hops required for the node with ID 30 to reach the terminal 1000, and the "(5)" in "30(1)(5)" indicates that the node with ID 30 is a node in the subnetwork and has a depth of 5.

[0129] For example, Figure 2 Taking subnet 22 in the campus network as an example, Figure 2 The nodes on the campus network's downlink path that can reach terminal 2000 include nodes 5 and 6, as well as nodes 10, 18, 19, 20, 17, 16, and 15 within subnetwork 22. Node 20 within subnetwork 22 is the closest node (one hop) to terminal 2000. Assuming the shared ID of the nodes in subnetwork 22 is 40 and the depth of node 20 within subnetwork 22 is 7, the location information for terminal 2000 can be expressed as:

[0130] LOG:5(2),6(2),40(1)(7)

[0131] ID: 2000

[0132] The "ID" item in the positioning information indicates that the terminal ID is 2000. The "LOG" item indicates Figure 2The node information of the nodes on the campus network downlink path that can reach terminal 2000 except the root node is shown. Among them, the "5" in "5(2)" indicates that the node ID is 5, and the "(2)" in "5(2)" indicates the number of hops required for the node with ID 5 to reach terminal 2000. The "6" in "6(2)" indicates that the node ID is 6, and the "(2)" in "6(2)" indicates the number of hops required for the node with ID 6 to reach terminal 2000. The "40" in "40(1)(7)" indicates that the node ID is 40, and the "(1)" in "40(1)(7)" indicates the number of hops required for the node with ID 40 to reach terminal 2000, and the "(7)" in "40(1)(7)" indicates that the node with ID 40 is a node in the subnetwork and has a depth of 7.

[0133] It should be noted that for nodes that do not belong to a sub-network, the depth of the node can be defaulted to 0. In this case, the depth of the node in the sub-network is a non-zero value. In this way, the node information of the node that does not belong to the sub-network can also include the node depth in the positioning information.

[0134] Still Figure 2 Taking the sub-network 22 in the campus network as an example, the positioning information of the terminal 2000 described above can also be expressed as:

[0135] LOG: 5(2)(0), 6(2)(0), 40(1)(7)

[0136] ID: 2000

[0137] The "ID" item in the positioning information indicates that the terminal ID is 2000. The "LOG" item indicates Figure 2 The node information of the nodes on the campus network downlink path that can reach terminal 2000 except the root node is shown. Among them, the "5" in "5(2)(0)" indicates that the node ID is 5, the "(2)" in "5(2)(0)" indicates the number of hops required for the node with ID 5 to reach terminal 2000, and the "(0)" in "5(2)(0)" indicates that the node with ID 5 is not a node in the sub-network. The "6" in "6(2)(0)" indicates that the node ID is 6, and the "(2)" in "6(2)(0)" indicates the number of hops required for the node with ID 6 to reach terminal 2000. The "(0)" in "6(2)(0)" indicates that the node with ID 6 is not a node in the sub-network. The "40" in "40(1)(7)" indicates that the node's ID is 40, the "(1)" in "40(1)(7)" indicates the number of hops required for the node with ID 40 to reach the terminal 2000, and the "(7)" in "40(1)(7)" indicates that the node with ID 40 is a node in the subnetwork and its depth is 7.

[0138] It can be understood that in the embodiment of the present application, the control device in the campus network is pre-configured with the positioning information of each terminal device. Optionally, the control device in the campus network can determine all the nodes on the downlink path that can reach the terminal device except the root node based on the topological structure of the campus network, and then generate positioning information for locating the terminal device based on the distance (i.e., the number of hops) from each node in all the nodes to the terminal device and the depth of each node. When any terminal device in the campus network needs to communicate with the above-mentioned target terminal device based on its own needs, it can obtain the positioning information (i.e., the first positioning information) of the target terminal device from the control device and generate a first message including the first positioning information. Then, the any terminal device can send the first message to the access layer node connected to the any terminal device. In this way, the access layer node can forward the first message based on the method provided in the embodiment of the present application.

[0139] S102: The first node determines whether the first depth is the same as the depth corresponding to the first ID in the first positioning information.

[0140] Among them, the first depth is the depth of the first node in the first subnetwork. Since the first node can receive the first message, it means that the first positioning information carried by the first message carries the node information with the ID of the first ID. In this way, the first node determines whether the first depth and the depth corresponding to the first ID in the first positioning information are the same. Among them, the depth corresponding to the first ID in the first positioning information is the depth in the node information including the first ID in the first positioning information. For the sake of simple description, the embodiment of the present application will refer to the "depth corresponding to the first ID" as the "second depth" below.

[0141] In one possible scenario, when the first node determines that the first depth and the second depth are different, the first node determines that it is a node in the sub-network. Then, the first node determines the network structure of the first sub-network in which it is located, and executes S103 based on the network structure of the first sub-network.

[0142] Optionally, the first node may determine the network structure of the first subnetwork based on the domain segment to which the first ID belongs.

[0143] It can be understood that since the IDs of subnets with different preset network structures in the campus network belong to IDs in different domain segments, the first node can determine the network structure of the first subnet where the first node is located based on the domain segment to which the first ID belongs. For example, the ID of a subnet with a single-link structure in the campus network belongs to an ID in the first domain segment, and the ID of a subnet with a loop structure in the campus network belongs to an ID in the second domain segment. Therefore, when the first ID belongs to the first domain segment, the first node can determine that the network structure of the first subnet is a single-link structure. When the first ID belongs to the second domain segment, the first node can determine that the network structure of the first subnet is a loop structure.

[0144] Optionally, the first node may determine the network structure of the first sub-network according to a value range to which the first depth and / or the second depth belongs.

[0145] It can be understood that the depths of nodes in subnetworks with different preset network structures can be values ​​within different value ranges. In this way, the first node can determine the network structure of the first subnetwork where the first node is located based on the depth of the first node (first depth) and / or the value range of the depth (second depth) corresponding to the first ID in the first positioning information. For example, the depth of a node in a subnetwork with a single link structure in a campus network is a value within the range of 0-15, and the depth of a node in a subnetwork with a loop structure in a campus network is a value within the range of 16-255. Therefore, when the value range of the first depth and / or the second depth is 0-15, the first node can determine that the network structure of the first subnetwork is a single link structure. When the value range of the first depth and / or the second depth is 16-255, the first node can determine that the network structure of the first subnetwork is a loop structure.

[0146] In another possible scenario, when the first node determines that the first depth and the second depth are the same, the first node can determine that it is the node identified by the first ID and the second depth in the first positioning information. In this case, the first node matches the node information in the first positioning information with its own pre-configured neighbor table to determine the next hop node for receiving the first message. Among them, the first node matches the node information in the first positioning information with its own pre-configured neighbor table to determine the next hop node for receiving the first message. For a detailed description, please refer to the above description of forwarding messages based on the DV graph, which will not be repeated here.

[0147] It should be understood that each node in the campus network is pre-configured with a neighbor table. For any node in the campus network, the neighbor table of any node includes the IDs of all neighbor nodes of the node, the port number of the port assigned by the node to each neighbor node, and the root distance of each neighbor node. It should be noted that in an embodiment of the present application, when the neighbor node of any node is a node in a subnetwork with a preset network structure, the neighbor table configured by the node also includes the depth of the neighbor node. The process of configuring the neighbor table of the node in the campus network is described below and will not be repeated here.

[0148] It should also be understood that when the neighbor table of any node configuration includes a node depth item, if the neighbor node of any node is not a node in a sub-network with a preset network structure, the depth of the neighbor node can be a default value (for example, a default value of 0), or the depth item in the information corresponding to the neighbor node in the neighbor table of any node configuration is empty. It can be understood that when the embodiment of the present application defaults to a depth value of 0 for a node that does not belong to a sub-network with a preset network structure, in this case, the depth value of a node that belongs to a sub-network with a preset network structure is non-zero.

[0149] by Figure 2 Taking subnetwork 22 in the campus network shown as an example, assume that the shared ID of nodes in subnetwork 22 is 40, and that the depth of node 10 is 1. Node 10's neighbor nodes in subnetwork 22 include node 18 at a depth of 3 and node 15 at a depth of 13. Referring to Table 1, Table 1 shows the neighbor table for node 10 in subnetwork 22. As shown in Table 1, the neighbor node corresponding to port 7 of node 10 is node 5, whose depth is 0 and whose root distance is 1. The neighbor node corresponding to port 8 of node 10 is node 6, whose depth is 0 and whose root distance is 1. The neighbor node corresponding to port 9 of node 10 is node 40, whose depth is 3 and whose root distance is 3 (i.e., node 18). The neighbor node corresponding to port 10 of node 10 is node 40, whose depth is 13 and whose root distance is 3 (i.e., node 15).

[0150] Table 1

[0151] port Neighbor ID Distance from the root node (root distance) depth 7 5 1 0 8 6 1 0 9 40 3 3 10 40 3 13

[0152] S103: The first node determines a next hop node according to the first depth and the second depth.

[0153] The following describes in detail the process of the first node determining the next hop node according to the first depth and the second depth, taking the first subnetwork where the first node is located as a subnetwork with a single link structure and a subnetwork with a loop structure as examples.

[0154] Case 1: The first sub-network where the first node is located is a sub-network with a single link structure

[0155] Specifically, after the first node determines that the first subnetwork is a subnetwork with a single-link structure according to the method described in S102, the first node determines the neighbor nodes in the first subnetwork along the first depth to the second depth direction as the next hop nodes based on the neighbor table configured by the first node.

[0156] It should be understood that when the first depth is greater than the second depth, the first depth to the second depth direction is the direction in which the depth of the node in the first subnetwork decreases (i.e., the direction opposite to the above-mentioned first direction). In this case, the first node determines the neighbor node whose ID in the neighbor table is the first ID and whose depth is less than the first depth as the next hop node. When the first depth is less than the second depth, the first depth to the second depth direction is the direction in which the depth of the node in the first subnetwork increases (i.e., the above-mentioned first direction). In this case, the first node determines the neighbor node whose ID in the neighbor table is the first ID and whose depth is greater than the first depth as the next hop node.

[0157] Exemplary, reference Figure 2 , with the first subnetwork having a single-link structure being Figure 2 Taking the subnetwork 21 shown as an example, assuming that the first node is node 7 and the depth is 1 (i.e., the first depth is 1), the node identified by the first ID and the second depth in the first message location information is node 14 and the depth is 5 (i.e., the second depth is 5). In this case, since the first depth is less than the second depth, the direction from the first depth to the second depth is the direction of increasing node depth in the subnetwork 21, that is, Figure 2 In this case, node 7 can determine the neighbor node with the first ID in the neighbor table and a depth greater than 1 (ie, neighbor node 11 of node 7 in direction 1 in subnetwork 21) as the next hop node.

[0158] For example, suppose Figure 2 The node 13 in the campus network shown is connected to the terminal 3000, as shown in FIG. Figure 5 As shown, if the first node is node 13 and the depth is 4 (i.e., the first depth is 4), the node identified by the first ID and the second depth in the first message location information is node 7 and the depth is 1 (i.e., the second depth is 1). In this case, since the first depth is greater than the second depth, the direction from the first depth to the second depth is the direction of decreasing node depth in subnetwork 21, that is, Figure 5 In this case, node 13 can determine the neighbor node with the first ID in the neighbor table and a depth less than 4 (ie, neighbor node 12 of node 13 in direction 3 in subnetwork 21) as the next hop node.

[0159] Case 2: The first sub-network where the first node is located is a sub-network with a loop structure

[0160] Specifically, after the first node determines that the first subnetwork is a subnetwork with a loop structure according to the method described in S102, it can first determine the forwarding direction of the first message based on the depth difference between the first depth and the second depth. In this way, the first node can determine the neighbor node located in the forwarding direction in the first subnetwork as the next hop node based on the neighbor table. It should be noted that in an embodiment of the present application, the path along which the first node forwards the first message to the node corresponding to the second depth along the determined forwarding direction is shorter than the path along which the first node forwards the first message to the node corresponding to the second depth in the opposite direction to the forwarding direction. Among them, the node corresponding to the second depth is the node identified by the first ID and the second depth in the first positioning information.

[0161] In one possible implementation, if the first depth is less than the second depth, then when the first node determines that the depth difference between the first depth and the second depth is less than a threshold, the first node determines the direction of increasing node depth within the first subnetwork (i.e., the first direction) as the forwarding direction of the first message. In this way, the first node determines the neighbor node in the neighbor table whose ID is the first ID and whose depth is greater than the first depth (i.e., the neighbor node of the first node located in the first direction within the first subnetwork) as the next hop node. When the first node determines that the depth difference between the first depth and the second depth is greater than a threshold, the direction of decreasing node depth within the first subnetwork (i.e., the direction opposite to the first direction) is determined as the forwarding direction of the first message. Therefore, the first node determines the neighbor node in the neighbor table whose ID is the first ID and whose depth is less than the first depth (i.e., the neighbor node located in the direction opposite to the first direction) as the next hop node.

[0162] It should be understood that in a first subnetwork having a loop structure, when the first node is the terminating node of the first subnetwork, the neighbor node whose depth is greater than the terminating node's depth is the node with the smallest depth in the first subnetwork (i.e., the starting node in the first subnetwork). When the first node is the starting node of the first subnetwork, the neighbor node whose depth is less than the starting node's depth is the node with the largest depth in the first subnetwork (i.e., the terminating node in the first subnetwork).

[0163] The threshold value is half the loop depth of the first subnetwork with a loop structure. The loop depth is the sum of the depth difference between the end node depth and the start node depth, and the depth step. Specifically, the threshold value can be calculated using the following formula: Threshold = (End Node Depth - Start Node Depth + Depth Step) / 2.

[0164] Exemplary, reference Figure 5 , the first subnetwork with a loop structure is Figure 5 Taking the sub-network 22 shown as an example, assuming that the starting node of the sub-network 22 is node 10 and the depth is 1, the ending node is node 15 and the depth is 13, and the depth step of the sub-network 22 is 2, then the above threshold = (13-1+2) / 2 = 7.

[0165] like Figure 5 As shown, if the first node is node 10, that is, the first depth is 1, and the second depth is 7, that is, the node corresponding to the second depth is node 20, then the depth difference between the first depth and the second depth is 7-1=6. In other words, the depth difference between the first depth and the second depth is less than the threshold value 7. Therefore, node 10 determines the direction of increasing node depth in subnetwork 22 as the forwarding direction, that is, Figure 5 Direction 2 is determined as the forwarding direction. In this case, node 10 determines the neighbor node with the first ID in the neighbor table and a depth greater than the depth of node 10 (i.e., neighbor node 18 of node 10 located in direction 2 in subnetwork 22) as the next hop node.

[0166] like Figure 5 As shown, if the first node is node 10, that is, the first depth is 1, and the second depth is 11, that is, the node corresponding to the second depth is node 16, then the depth difference between the first depth and the second depth is 11-1=10. In other words, the depth difference between the first depth and the second depth is greater than the threshold value 7. Therefore, node 10 determines the direction of decreasing node depth in subnetwork 22 as the forwarding direction, that is, Figure 5 Direction 4 is determined as the forwarding direction. In this case, node 10 determines the neighbor node with the first ID in the neighbor table and a depth less than the depth of node 10 (i.e., neighbor node 15 of node 10 located in direction 4 in subnetwork 22) as the next hop node.

[0167] In another possible implementation, if the first depth is greater than the second depth, then when the first node determines that the depth difference between the first depth and the second depth is less than the threshold, the first node determines the direction of decreasing node depth within the first subnetwork (i.e., the direction opposite to the first direction) as the forwarding direction of the first message. In this way, the first node determines the neighbor node in the neighbor table with the first ID and a depth less than the first depth (i.e., the neighbor node of the first node located in the first subnetwork in the direction opposite to the first direction) as the next hop node. When the first node determines that the depth difference between the first depth and the second depth is greater than the threshold, the first node determines the forwarding direction of the first message with the direction of increasing node depth within the first subnetwork (i.e., the first direction). In this way, the first node determines the neighbor node in the neighbor table with the first ID and a depth greater than the first depth (i.e., the neighbor node of the first node located in the first direction within the first subnetwork) as the next hop node.

[0168] Exemplary, reference Figure 5 , the first subnetwork with a loop structure is Figure 5 Taking the sub-network 22 shown as an example, assuming that the starting node of the sub-network 22 is node 10 and the depth is 1, the ending node is node 15 and the depth is 13, and the depth step of the sub-network 22 is 2, then the above threshold = (13-1+2) / 2 = 7.

[0169] like Figure 5 As shown, if the first node is node 16, that is, the first depth is 11, and the second depth is 7, that is, the node corresponding to the second depth is node 20, then the depth difference between the first depth and the second depth is 11-7=4. In other words, the depth difference between the first depth and the second depth is less than the threshold value 7. Therefore, node 16 determines the direction of decreasing node depth in subnetwork 22 as the forwarding direction, that is, Figure 5 Direction 4 is determined as the forwarding direction. In this case, node 16 determines the neighbor node with the first ID in the neighbor table and a depth less than the depth of node 16 (i.e., node 16 determines neighbor node 17 located in direction 4 in subnetwork 22) as the next hop node.

[0170] like Figure 5 As shown, if the first node is node 16, that is, the first depth is 11, and the second depth is 1, that is, the node corresponding to the second depth is node 10, then the depth difference between the first depth and the second depth is 11-1=10. In other words, the depth difference between the first depth and the second depth is greater than the threshold value 7. Therefore, node 16 determines the direction of increasing node depth in subnetwork 22 as the forwarding direction, that is, Figure 5Direction 2 is determined as the forwarding direction. In this case, node 16 determines the neighbor node with the first ID in the neighbor table and a depth greater than the depth of node 16 (i.e., node 16 determines the neighbor node located in direction 2 (i.e., node 15) in subnetwork 22 as the next hop node.

[0171] S104: The first node forwards the first message to the next-hop node.

[0172] After determining the next-hop forwarding node according to the first depth and the second depth, the first node forwards the first message to the next-hop node through the port corresponding to the next-hop node.

[0173] In this way, when forwarding a message through the method described in S101-S104, when all the nodes in the campus network that can reach the destination terminal device for receiving the message include multiple nodes in the sub-network with a preset network structure in the campus network, the node information in the positioning information carried in the message only needs to include the node information of the node that is closest to the target terminal device (i.e., the least number of hops) among the multiple nodes in the sub-network that can reach the target terminal device. Compared with the traditional positioning information that needs to include the node information of all the nodes in the campus network that can reach the destination terminal device for receiving the message, the method provided in the embodiment of the present application greatly reduces the amount of node information carried in the positioning information. In this way, when the nodes in the campus network determine the next hop node by comparing the node information in the positioning information with the neighbor table configured by themselves, the computing resources consumed will be greatly reduced, and the next hop node can be quickly determined based on the comparison result, thereby improving the forwarding efficiency of the message.

[0174] In some embodiments, if the first node is a node in a sub-network with a loop structure, after the first node executes S101 to S103, if it detects that a link between the first node and the next hop node fails, then Figure 6 , the first node may further perform the following steps:

[0175] S105. After determining that the link between the first node and the above-mentioned next hop node fails, the first node updates the first ID to the second ID, determines a new next hop node based on the reverse rule indicated by the second ID, and forwards the first message to the new next hop node.

[0176] Optionally, after determining that a failure occurs in the link between the first node and the next-hop node, the first node further updates the first ID in the neighbor table to the second ID.

[0177] The second ID is an ID that has a one-to-one correspondence with the first ID.

[0178] The reverse rule instructs the first node to determine a neighboring node in the first subnetwork located in the opposite direction of the forwarding direction described above as the new next-hop node. The reverse rule also indicates that the neighboring node used to send the first message to the first node is not allowed to be determined as the new next-hop node. That is, when the ID of the first node is the second ID, the reverse rule indicated by the second ID does not allow the first node to retransmit the first message to the neighboring node that sent the first message to the first node.

[0179] In this way, based on the reverse rule, the first node determines a neighboring node in the first subnetwork that is located in the opposite direction of the forwarding direction as a new next-hop node, and forwards the first message to the new next-hop node.

[0180] As an example, refer to Figure 5 , the first subnetwork with a loop structure is Figure 5 Taking the sub-network 22 shown as an example, assuming that the first node is the node 10 in the sub-network 22, the forwarding direction determined by the node 10 is Figure 5 Direction 2 shown. In this case, after executing S103, node 10 determines that the next hop node is the neighboring node located in direction 2, namely, node 18. Then, when node 10 determines that the link between node 10 and node 18 has failed, it updates its first ID to its second ID and, based on the reverse rule indicated by the second ID, determines the neighboring node located in the direction opposite to direction 2 (i.e., reverse direction 4), namely, node 15, as the new next hop node and forwards the first message to node 15.

[0181] S106: The first node sends notification information to the remaining nodes in the first sub-network except the first node, to instruct the remaining nodes in the first sub-network except the first node to update their first IDs to second IDs.

[0182] It should be understood that in this embodiment of the present application, the IDs of nodes within the same subnetwork are shared. Therefore, after the first node updates its own ID, it also sends a notification message to the remaining nodes in the first subnetwork, instructing them to update their own IDs.

[0183] Optionally, the notification information sent by the first node to the remaining nodes in the first subnet other than the first node is also used to instruct the remaining nodes to update the first ID in their respective neighbor tables to the second ID. In this way, the IDs of the nodes in the first subnet can be unified with the IDs of the nodes in the neighbor tables.

[0184] In this way, after receiving the message, the remaining nodes in the first sub-network except the first node can forward the message based on the reverse rule indicated by the second ID.

[0185] It can be understood that, in the embodiment of the present application, before S105 determines that a new next hop node (hereinafter referred to as the second node) forwards the received first message, the second node needs to complete the update of its own ID. In this way, the second node can forward the first message based on the reverse rule indicated by the second ID after receiving the first message. Otherwise, when the second node determines the next hop node for receiving the first message, it may determine the first node as the next hop node, that is, the second node may return the first message to the first node. Therefore, the method provided by the embodiment of the present application can avoid the situation where the second node returns the first message to the first node.

[0186] In this way, through the method described in S105-S106, the switching of the fault forwarding path when the first node forwards the message is achieved, thereby ensuring the transmission of the message.

[0187] Reference below Figure 7 After the ID of the node in the first sub-network is updated to the second ID, another message forwarding method provided by the embodiment of the present application is described. Figure 7 As shown, this method can be applied to Figure 2 or Figure 5 The method is performed by a first node in a sub-network having a loop structure within the campus network. The method includes the following steps:

[0188] S201: A first node receives a second message, where the second message carries second positioning information.

[0189] Among them, the first node is any node in the first sub-network with a loop structure in the campus network, the ID of the first node is the second ID after the ID of the node in the first sub-network is updated, and the depth of the first node in the first sub-network is the first depth.

[0190] The second positioning information includes the node information whose ID is the first ID. It can be understood that the detailed description of the second positioning information can refer to the description of the first positioning information above, and will not be repeated here.

[0191] S202: The first node determines a first ID having a one-to-one correspondence with the second ID in the second positioning information.

[0192] It should be understood that the first node is pre-set with a set of IDs having a one-to-one correspondence. In this way, the first node can determine the first ID having a one-to-one correspondence with the second ID in the second positioning information by traversing the node information in the second positioning information and the pre-set set of IDs.

[0193] S203: The first node determines whether the first depth is the same as the third depth corresponding to the first ID in the second positioning information.

[0194] The third depth corresponding to the first ID in the second positioning information is the depth in the node information including the first ID in the second positioning information.

[0195] When the first node determines that the first depth and the third depth are the same, the first node determines that itself is the node identified by the first ID and the third depth in the second positioning information, and the node can also be called the node corresponding to the third depth. In this case, the first node matches the node information in the second positioning information with its own pre-configured neighbor table to determine the next hop node for receiving the first message. Among them, the first node matches the node information in the first positioning information with its own pre-configured neighbor table to determine the detailed description of the next hop node for receiving the first message. Please refer to the above description of forwarding messages based on the DV diagram, which will not be repeated here.

[0196] If the first node determines that the first depth and the third depth are different, the first node executes S204 .

[0197] S204: The first node determines a next hop node according to the first depth, the third depth, and the reverse rule indicated by the second ID.

[0198] In one possible implementation, if the ID of the node that sends the second message to the first node is the first ID, this indicates that the node that sends the second message to the first node is a node in the first subnetwork. In this case, based on the reverse rule indicated by the second ID, the first node determines the other neighboring node of the first node in the first subnetwork, other than the neighboring node used to send the second message to the first node, as the next hop node.

[0199] As an example, refer to Figure 5 , the first subnetwork with a loop structure is Figure 5 Taking the subnetwork 22 shown as an example, assuming that the first node is node 18 in the subnetwork 22, and the node used to send the second message to the first node is node 10 in the subnetwork 22, then based on the reverse rule indicated by the second ID, node 18 determines the other neighboring node (i.e., node 19) among the two neighboring nodes of node 18 in the subnetwork 22 (i.e., node 10 and node 19), except for node 10 used to send the second message to node 18, as the next hop node.

[0200] In another possible implementation, if the ID of the node sending the second message to the first node is different from the first ID, this indicates that the node sending the second message to the first node is not a node in the first subnetwork. In this case, the first node determines the neighboring node located in the opposite direction of the forwarding direction as the next hop node based on the reverse rule indicated by the second ID.

[0201] It should be understood that the path along which the first node forwards the first message to the node identified by the first ID and the second depth in the first positioning information along the forwarding direction described above is shorter than the path along which the first node forwards the first message to the node identified by the first ID and the second depth in the first positioning information along the direction opposite to the forwarding direction. In other words, the path along which the first node forwards the first message to the node identified by the first ID and the second depth in the first positioning information along the direction opposite to the forwarding direction is longer than the path along which the first node forwards the first message to the node identified by the first ID and the second depth in the first positioning information along the forwarding direction described above. Therefore, the path along which the first node forwards the second message to the node identified by the first ID and the third depth in the second positioning information along the direction opposite to the forwarding direction is longer than the path along which the first node forwards the second message to the node identified by the first ID and the third depth in the second positioning information along the forwarding direction.

[0202] Optionally, if the first depth is less than the third depth, when the first node determines that the depth difference between the first depth and the third depth is less than the threshold value described above, the first node determines the neighbor node located in the direction of decreasing node depth in the first sub-network (i.e., the opposite direction of the first direction) as the next hop node, that is, the first node determines the node in the neighbor table with an ID of the second ID and a depth less than the first depth as the next hop node. When the first node determines that the depth difference between the first depth and the third depth is greater than the threshold value described above, the first node determines the neighbor node located in the direction of increasing node depth in the first sub-network (i.e., the first direction) as the next hop node, that is, the first node determines the node in the neighbor table with an ID of the second ID and a depth greater than the first depth as the next hop node. Among them, the explanation of the threshold value can refer to the above description and will not be repeated here.

[0203] Exemplary, reference Figure 5 , the first subnetwork with a loop structure is Figure 5 Taking the sub-network 22 shown as an example, assuming that the starting node of the sub-network 22 is node 10 and the depth is 1, the ending node is node 15 and the depth is 13, and the depth step of the sub-network 22 is 2, then the above threshold = (13-1+2) / 2 = 7.

[0204] like Figure 5 As shown, if the first node is node 10, that is, the first depth is 1, and the third depth is 7, that is, the node corresponding to the third depth is node 20, then the depth difference between the first depth and the third depth is 7-1=6. In other words, the depth difference between the first depth and the third depth is less than the threshold value 7. Therefore, based on the reverse rule indicated by the second ID, node 10 will be located in the direction of decreasing node depth in subnetwork 22 (i.e. Figure 5The neighbor node in the direction 4 shown) is determined as the next hop node, that is, node 10 determines the neighbor node with the second ID in the neighbor table and a depth less than 1 (that is, the neighbor node 15 of node 10 in the direction 4 in the subnetwork 22) as the next hop node.

[0205] like Figure 5 As shown, if the first node is node 10, that is, the first depth is 1, and the third depth is 11, that is, the node corresponding to the third depth is node 16, then the depth difference between the first depth and the third depth is 11-1=10. In other words, the depth difference between the first depth and the third depth is greater than the threshold value 7. Therefore, based on the reverse rule indicated by the second ID, node 10 is located in the direction of increasing node depth in subnetwork 22 (i.e. Figure 5 The neighbor node in the direction 2) shown is determined as the next hop node, that is, node 10 determines the neighbor node with the second ID in the neighbor table and a depth greater than 1 (that is, the neighbor node 18 of node 10 in the direction 2 within the subnetwork 22) as the next hop node.

[0206] Optionally, if the first depth is greater than the third depth, when the first node determines that the depth difference between the first depth and the third depth is less than the threshold value described above, the first node determines the neighbor node located in the direction of increasing node depth (i.e., the first direction) in the first sub-network as the next hop node, that is, the first node determines the node in the neighbor table whose ID is the second ID and whose depth is greater than the first depth as the next hop node. When the first node determines that the depth difference between the first depth and the third depth is greater than the threshold value described above, the first node determines the neighbor node located in the direction of decreasing node depth (i.e., the opposite direction of the first direction) in the first sub-network as the next hop node, that is, the first node determines the node in the neighbor table whose ID is the second ID and whose depth is less than the first depth as the next hop node.

[0207] Exemplary, reference Figure 5 , the first subnetwork with a loop structure is Figure 5 Taking the sub-network 22 shown as an example, assuming that the starting node of the sub-network 22 is node 10 and the depth is 1, the ending node is node 15 and the depth is 13, and the depth step of the sub-network 22 is 2, then the above threshold = (13-1+2) / 2 = 7.

[0208] like Figure 5 As shown, if the first node is node 16, that is, the first depth is 11, and the third depth is 7, that is, the node corresponding to the third depth is node 20, then the depth difference between the first depth and the third depth is 11-7=4. In other words, the depth difference between the first depth and the third depth is less than the above threshold (i.e. 7). Therefore, based on the reverse rule indicated by the second ID, node 16 will be located in the direction of increasing node depth in subnetwork 22 (i.e. Figure 5The neighbor node in the direction 2) shown is determined as the next hop node, that is, node 16 determines the neighbor node with the second ID in the neighbor table and a depth greater than 11 (that is, the neighbor node 15 of node 16 in the direction 2 in the subnetwork 22) as the next hop node.

[0209] like Figure 5 As shown, if the first node is node 16, that is, the first depth is 11, and the third depth is 1, that is, the node corresponding to the third depth is node 10, then the depth difference between the first depth and the third depth is 11-1=10. In other words, the depth difference between the first depth and the third depth is greater than the threshold value 7. Therefore, based on the reverse rule indicated by the second ID, node 16 is located in the direction of decreasing node depth in subnetwork 22 (i.e. Figure 5 The neighbor node in the direction 4 shown) is determined as the next hop node, that is, node 16 determines the neighbor node with the second ID in the neighbor table and a depth less than 11 (that is, the neighbor node 17 of node 16 in the direction 4 in the subnetwork 22) as the next hop node.

[0210] S205: The first node forwards the second message to the next-hop node.

[0211] After determining the next-hop forwarding node according to the first depth, the third depth, and the reverse rule indicated by the second ID, the first node forwards the first message to the next-hop node through the port corresponding to the next-hop node.

[0212] In this way, the method described in S201-S205 implements forwarding of the message using the reverse rule indicated by the second ID. Using this method, when all nodes within the campus network that can reach the destination terminal device for receiving the message include multiple nodes in a subnetwork with a preset network structure within the campus network, the node information in the positioning information carried in the message only needs to include the node information of the node closest to the destination terminal device (i.e., the fewest hops) among the multiple nodes within the subnetwork that can reach the destination terminal device. Compared to traditional positioning information that requires including the node information of all nodes within the campus network that can reach the destination terminal device for receiving the message, the method provided in the embodiment of the present application greatly reduces the amount of node information carried in the positioning information. In this way, when a node in the campus network compares the node information in the positioning information with its own configured neighbor table to determine the next hop node, the computing resources consumed will be greatly reduced, and the next hop node can be quickly determined based on the comparison result. Therefore, the method provided in the embodiment of the present application improves the forwarding efficiency of the message.

[0213] The following describes the process of configuring neighbor tables for nodes in a campus network.

[0214] In a first possible implementation, the neighbor table of each node in the campus network may be issued by a control device of the campus network. Detailed description of the neighbor table can be found in the above description and is not limited here.

[0215] Specifically, each node in the campus network can pre-report its initial ID to the control device, as well as the initial IDs of its neighboring nodes. This allows the control device to obtain the initial ID of each node in the campus network and the initial IDs of each node's neighboring nodes. Based on the obtained initial IDs, the control device determines the topology of the campus network. Based on the determined topology, the control device can calculate the root distance of each node in the campus network (i.e., the number of hops required from each node to the root node).

[0216] The control device can also determine sub-networks with a preset network structure within the campus network based on the determined topology, configure an ID for each sub-network, and set a depth for each node in the sub-network. This process can be referred to the relevant description in S101 above and will not be repeated here.

[0217] For any node in the campus network, the control device sends the ID, depth, and root distance of each neighbor node of the node as neighbor information to the node.

[0218] In this way, after receiving the neighbor information sent by the control device, the node can generate a neighbor table. Optionally, the neighbor table also includes the port number of the port allocated by the node to each neighbor node, such as the neighbor table shown in Table 1.

[0219] In a second possible implementation, each node in the campus network can establish its initial neighbor table through an initial notification message sent between adjacent nodes. Furthermore, after the initial neighbor table is established, each node in the campus network can update it through multiple notification messages sent between adjacent nodes. The updated initial neighbor table of a node in the campus network includes the node's actual neighbor information.

[0220] The first notification message sent between adjacent nodes within a campus network includes the ID of the sending node, the node's depth, and the node's root distance. If the node sending the notification message is the root node, the root distance carried in the notification message is 0. If the node sending the notification message is any node in the campus network other than the root node, the root distance carried in the notification message is infinite (∞).

[0221] It should be understood that the depth of each node in the campus network has been configured before the first announcement message is sent between adjacent nodes in the campus network.

[0222] In this way, for a node that receives a notification message for the first time in the campus network, the node can generate an initial neighbor table based on the received notification message. In addition, the node also updates its own root distance based on the root distance of the neighbor node carried in the received notification message. Specifically, the updated root distance of the node = min(root distance before update, min(root distance of neighbor 1, ..., root distance of neighbor n) + 1). Where n is a positive integer. Wherein, neighbor 1, ... and neighbor n are all neighbor nodes of the node that receives the notification message in the campus network.

[0223] For example, for node 1 in a campus network, assuming it is not a root node, its initial root distance is ∞. When node 1 first receives notification messages from three nodes, and the root distances carried in these notification messages are 0, 1, and ∞, respectively, node 1 updates its root distance to min(∞, min(0, 1, ∞) + 1), which is 1.

[0224] After updating their root distances, each node in the campus network sends notification messages to each other again. The root distances carried in these notification messages are the updated root distances of each node. Nodes in the campus network that receive these notification messages can then update their initial neighbor table based on the updated root distances of their neighbor nodes carried in the notification messages. Specifically, they update the root distances of their neighbor nodes in the initial neighbor table.

[0225] Similarly, each node in the campus network can update its own neighbor table multiple times through the notification messages sent to each other by neighbor nodes multiple times, which carry the node's latest updated root distance, and finally obtain a neighbor table that includes the actual neighbor information of each node in the campus network.

[0226] In order to further deepen the understanding of the message forwarding method provided in the embodiment of the present application, it is further explained through specific examples below.

[0227] by Figure 2 or Figure 5 Taking the campus network shown in the figure as an example, the positioning information generated by the control device terminal 2000 in the campus network is:

[0228] LOG:5(2),6(2),40(1)(7)

[0229] ID: 2000

[0230] exist Figure 2 or Figure 5 In the campus network shown, assume that terminal 1000, based on its own business needs, determines that it needs to communicate with terminal 2000. Terminal 1000 then sends a positioning information request message carrying the ID of terminal 2000 to the control device, requesting the location information of terminal 2000. In response, the control device traverses its configured positioning information list to determine the positioning information with ID 2000 indicated by the ID item, and then sends the determined positioning information to terminal 1000. In this way, terminal 1000 obtains the location information of terminal 2000.

[0231] Then, terminal 1000 generates message 1 based on the acquired location information of terminal 2000. Message 1 includes the location information of terminal 2000. The data payload of message 1 is the data content sent by terminal 1000 to terminal 2000. Then, terminal 1000 sends message 1 to node 14 connected to terminal 1000.

[0232] After receiving message 1, node 14 matches its neighbor table with the node information in the positioning information carried by message 1. Figure 2 or Figure 5 As shown, the neighbor nodes of node 14 do not include the node ID in the location information of terminal 2000, that is, node 14 determines that the node ID in the location information carried by message 1 does not exist in its own neighbor table, so node 14 forwards message 1 through the default uplink path. Specifically, node 14 determines the neighbor node with the shortest root distance in the neighbor table as the next hop node and forwards message 1 to the next hop node. Figure 2 or Figure 5 As shown, node 14 determines node 13 as the next hop node and forwards message 1 to node 13 .

[0233] Similarly, node 13 determines node 12, which has the shortest root distance in its neighbor table, as the next-hop node and forwards message 1 to node 12. Node 12 determines node 11, which has the shortest root distance in its neighbor table, as the next-hop node and forwards message 1 to node 11. Node 11 determines node 17, which has the shortest root distance in its neighbor table, as the next-hop node and forwards message 1 to node 7.

[0234] When node 7 receives message 1, it determines that there are two neighbor nodes (node ​​3 and node 4) in the neighbor table with the same root distance and the shortest. In this case, node 7 determines the next hop node between node 3 and node 4 according to the preset rules. Here, the preset rule is, for example, a rule for randomly specifying the next hop node, which is not limited in the embodiments of the present application. Assuming that node 7 determines node 3 as the next hop node according to the preset rules, node 7 forwards message 1 to node 3.

[0235] Next, similar to the method in which node 7 forwards message 1, node 3 determines node 2 as the next hop node based on a preset rule and forwards message 1 to node 2.

[0236] After receiving Message 1, Node 2 determines that the IDs of Nodes 5 and 6, as contained in the positioning information carried in Message 1, are present in its neighbor table. Since Nodes 5 and 6 have the same root distance, Node 2 determines the next hop between Nodes 5 and 6 according to the preset rule. Assuming that Node 2 determines Node 6 as the next hop according to the preset rule, Node 2 forwards Message 1 to Node 6.

[0237] Furthermore, after receiving the message, node 6 determines that the node with ID 40 in the positioning information carried by message 1 exists in its neighbor table, and the depth of the node is different from the depth of the node with ID 40 in the positioning information. Then, node 6 can determine that the node with ID 40 is a node in the sub-network with the preset network structure. In this case, node 6 can determine the node with ID 40 in the neighbor table as the next hop node. Figure 2 or Figure 5 As shown, node 6 can determine node 10 as the next hop node and forward message 1 to node 10. It can be understood that if there are multiple nodes with ID 40 in the neighbor table of node 6, node 6 will determine the node with ID 40 and the closest depth to 7 in the neighbor table as the next hop node.

[0238] Then, node 10 may forward message 1 to a node (ie, node 20 ) with an ID of 40 and a depth of 7 in the positioning information carried by message 1 according to the method provided in the embodiment of the present application.

[0239] After receiving message 1, node 20 determines that the ID of terminal 2000 identical to the ID indicated by the ID item in the positioning information carried by message 1 exists in its neighbor table, and then forwards message 1 to terminal 2000. At this point, terminal 2000 has received message 1 from terminal 1000.

[0240] The above mainly introduces the solution provided in the embodiment of the present application from the perspective of method.

[0241] In order to achieve the above functions, Figure 8 As shown, Figure 8 The schematic diagram of the structure of a message forwarding device 80 provided in an embodiment of the present application is shown. The message forwarding device 80 is applied to the first node in the campus network and is used to execute the above-mentioned message forwarding method, for example, to execute Figure 4 、 Figure 6 or Figure 7 The method shown. The first node is any node in a subnetwork having a preset network structure in the campus network, and the depth of the first node in the subnetwork is a first depth. The message forwarding device 80 may include a receiving unit 81, a determining unit 82, and a sending unit 83.

[0242] Receiving unit 81 is configured to receive a first message carrying first positioning information. The first positioning information is used to determine a next-hop node for receiving the first message. The first positioning information includes a first ID for identifying a node in a subnetwork. Determining unit 82 is configured to determine a next-hop node based on the first depth and the second depth if the first depth and the second depth corresponding to the first ID in the first positioning information are different. Sending unit 83 is configured to forward the first message to the next-hop node.

[0243] As an example, combined with Figure 4 The receiving unit 81 may be used to execute S101, the determining unit 82 may be used to execute S102 and S103, and the sending unit 83 may be used to execute S104.

[0244] Optionally, the depth of the node in the above sub-network is used to indicate the position of the node relative to the starting node in the sub-network, and the depth of the node in the sub-network increases or decreases in sequence along the direction from the starting node to the ending node in the sub-network.

[0245] Optionally, the above-mentioned preset network structure includes a single link structure or a loop structure.

[0246] Optionally, the determining unit 82 is specifically configured to determine, if the preset network structure is a single-link structure, a neighbor node of the first node in the subnetwork in a direction from the first depth to the second depth as a next-hop node.

[0247] As an example, combined with Figure 4 , the determining unit 82 can be used to execute S103.

[0248] Optionally, the determining unit 82 is specifically configured to determine a depth difference between the first depth and the second depth if the preset network structure is a loop structure; and determine a next hop node according to the depth difference between the first depth and the second depth.

[0249] As an example, combined with Figure 4 , the determining unit 82 can be used to execute S103.

[0250] Optionally, the determination unit 82 is further specifically used to determine the forwarding direction of the first message based on the depth difference between the first depth and the second depth; wherein, the path along which the first node forwards the first message to the node corresponding to the second depth along the forwarding direction is shorter than the path along which the first node forwards the first message to the node corresponding to the second depth along the direction opposite to the forwarding direction; and, the neighbor node of the first node located in the forwarding direction is determined as the next hop node.

[0251] As an example, combined with Figure 4 , the determining unit 82 can be used to execute S103.

[0252] Optionally, the message forwarding device 80 further includes an updating unit 84 configured to, upon determining a link failure between the first node and the next-hop node, update the first ID used to identify a node in the subnetwork to a second ID having a one-to-one correspondence with the first ID. The second ID is configured to instruct the first node to determine a new next-hop node based on a reverse rule. The determining unit 82 is further configured to determine, based on the reverse rule indicated by the second ID, a neighboring node of the first node located in a direction opposite to the forwarding direction as the new next-hop node.

[0253] As an example, combined with Figure 6 , the updating unit 84 and the determining unit 82 can be used to execute S105.

[0254] Optionally, the above reverse rule is further used to indicate that it is not allowed to determine the neighbor node that sends the first message to the first node as the new next-hop node.

[0255] Optionally, receiving unit 81 is further configured to receive a second message carrying second positioning information. Determining unit 82 is further configured to determine, in the second positioning information, a first ID that has a one-to-one correspondence with the second ID; and, if the first depth and the third depth corresponding to the first ID in the second positioning information are different, then: when the node that sends the second message to the first node is not a neighboring node in the subnet, according to the above-mentioned reverse rule, a neighboring node of the first node in the subnet that is located in the opposite direction of the forwarding direction is determined as the next hop node for receiving the second message; or, when the node that sends the second message to the first node is a node in the subnet, according to the above-mentioned reverse rule, a neighboring node in the subnet other than the neighboring node that sends the second message to the first node is determined as the next hop node for receiving the second message. Sending unit 83 is further configured to forward the second message to the next hop node for receiving the second message.

[0256] As an example, combined with Figure 7 The receiving unit 81 may be used to execute S201, the determining unit 82 may be used to execute S202-S204, and the sending unit 83 may be used to execute S205.

[0257] Optionally, the determining unit 82 is further configured to determine a next hop node according to the neighbor table of the first node and the first positioning information if the first depth and the second depth are the same.

[0258] As an example, combined with Figure 4 , the determining unit 82 can be used to execute S102.

[0259] For the detailed description of the above optional manners, please refer to the above method embodiments, which will not be repeated here. In addition, the explanation and beneficial effects of any of the above message forwarding devices 80 can be referred to the above corresponding method embodiments, which will not be repeated here.

[0260] As an example, combined with Figure 3 The functions implemented by the determination unit 82 and the update unit 84 in the message forwarding device 80 can be realized by Figure 3 Processor 31 in the Figure 3 The functions implemented by the receiving unit 81 and the sending unit 83 can be realized by the program code in the memory 32. Figure 3 The network interface 33 in is implemented.

[0261] It should be readily apparent to those skilled in the art that, in combination with the units and algorithmic steps of the various examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0262] It should be noted that Figure 8 The module division described is illustrative and represents only one logical functional division. Actual implementations may employ different divisions. For example, two or more functions may be integrated into a single processing module. These integrated modules may be implemented as either hardware or software functional modules.

[0263] The present application also provides a computer program product and a computer-readable storage medium for storing the computer program product. The computer program product may include one or more program instructions, which, when executed by one or more processors, may provide the above-mentioned Figure 4 、 Figure 6 or Figure 7 Thus, for example, reference to Figure 4One or more features of S101 to S104 may be performed by one or more instructions in the computer program product.

[0264] In some examples, such as for Figure 4 、 Figure 6 or Figure 7 The described message forwarding apparatus may be configured to provide various operations, functions, or actions in response to one or more program instructions stored in a computer-readable storage medium.

[0265] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer executes the instructions on the computer and when the computer executes the instructions, the process or function according to the embodiment of the present application is generated in whole or in part. 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 computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more media that can be integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0266] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A message forwarding method, characterized in that: Applied to a first node in a campus network, the first node is any node in a subnetwork having a preset network structure in the campus network, the depth of the first node in the subnetwork is a first depth, the depth of the node in the subnetwork is used to indicate the position of the node in the subnetwork relative to the starting node in the subnetwork, and the depth of the node in the subnetwork increases or decreases in sequence along the direction from the starting node to the ending node in the subnetwork; the method includes: Receive a first message, where the first message carries first positioning information, where the first positioning information is used to determine a next hop node for receiving the first message, and the first positioning information includes a first identification number ID for identifying a node in the subnetwork; If the first depth is different from the second depth corresponding to the first ID in the first positioning information, determining the next hop node according to the first depth and the second depth; Forward the first message to the next hop node.

2. The method according to claim 1, characterized in that The preset network structure includes a single link structure or a loop structure.

3. The method according to claim 1 or 2, characterized in that If the preset network structure is a single-link structure, determining the next hop node according to the first depth and the second depth includes: A neighbor node of the first node in the subnetwork in a direction from the first depth to the second depth is determined as the next hop node.

4. The method according to claim 1 or 2, characterized in that If the preset network structure is a loop structure, determining the next hop node according to the first depth and the second depth includes: determining a depth difference between the first depth and the second depth; The next hop node is determined according to a depth difference between the first depth and the second depth.

5. The method according to claim 4, characterized in that The determining the next hop node according to the depth difference between the first depth and the second depth includes: Determining a forwarding direction of the first message based on a depth difference between the first depth and the second depth; wherein a path along which the first node forwards the first message to the node corresponding to the second depth along the forwarding direction is shorter than a path along which the first node forwards the first message to the node corresponding to the second depth along a direction opposite to the forwarding direction; A neighbor node of the first node located in the forwarding direction is determined as the next hop node.

6. The method according to claim 5, characterized in that When it is determined that a link between the first node and the next hop node is faulty, the method further includes: Updating a first ID used to identify a node in the subnetwork to a second ID having a one-to-one correspondence with the first ID; the second ID is used to instruct the first node to determine a new next-hop node based on a reverse rule; Based on the reverse rule, a neighbor node of the first node located in a direction opposite to the forwarding direction is determined as a new next-hop node.

7. The method according to claim 6, characterized in that The reverse rule is further used to indicate that the neighboring node that sends the first message to the first node is not allowed to be determined as the new next-hop node.

8. The method according to claim 7, characterized in that The method further comprises: receiving a second message, where the second message carries second positioning information; Determine, in the second positioning information, the first ID that has a one-to-one correspondence with the second ID, and if the first depth is different from a third depth corresponding to the first ID in the second positioning information, then: When the node that sends the second message to the first node is not a neighboring node in the sub-network, according to the reverse rule, a neighboring node of the first node in the sub-network that is located in a direction opposite to the forwarding direction is determined as a next hop node for receiving the second message; or When the node that sends the second message to the first node is a node in the subnetwork, determining, according to the reverse rule, neighboring nodes in the subnetwork other than the neighboring node that sends the second message to the first node as next-hop nodes for receiving the second message; Forward the second message to the next hop node for receiving the second message.

9. The method according to any one of claims 1-2 and 5-8, characterized in that The method further comprises: If the first depth and the second depth are the same, the next hop node is determined according to the neighbor table of the first node and the first positioning information.

10. A message forwarding device, characterized in that: Applied to a first node in a campus network, the first node is any node in a subnetwork having a preset network structure in the campus network, the depth of the first node in the subnetwork is a first depth, the depth of the node in the subnetwork is used to indicate the position of the node in the subnetwork relative to the starting node in the subnetwork, and the depth of the node in the subnetwork increases or decreases in sequence along the direction from the starting node to the ending node in the subnetwork; the device includes: A receiving unit, configured to receive a first message, where the first message carries first positioning information, where the first positioning information is used to determine a next hop node for receiving the first message, and the first positioning information includes a first identification number ID for identifying a node in the subnetwork; a determining unit, configured to determine the next hop node according to the first depth and the second depth if the first depth and the second depth corresponding to the first ID in the first positioning information are different; A sending unit is used to forward the first message to the next hop node.

11. The device according to claim 10, characterized in that The preset network structure includes a single link structure or a loop structure.

12. The device according to claim 10 or 11, characterized in that The determining unit is specifically configured to determine, if the preset network structure is a single-link structure, a neighbor node of the first node in the subnetwork in a direction from the first depth to the second depth as the next hop node.

13. The device according to claim 10 or 11, characterized in that The determining unit is specifically configured to determine a depth difference between the first depth and the second depth if the preset network structure is a loop structure; and determine the next hop node according to the depth difference between the first depth and the second depth.

14. The device according to claim 13, characterized in that The determination unit is further specifically used to determine the forwarding direction of the first message based on the depth difference between the first depth and the second depth; wherein, the path along which the first node forwards the first message to the node corresponding to the second depth along the forwarding direction is shorter than the path along which the first node forwards the first message to the node corresponding to the second depth along a direction opposite to the forwarding direction; and, determining the neighbor node of the first node located in the forwarding direction as the next hop node.

15. The device according to claim 14, characterized in that The device further comprises: an updating unit, configured to, when determining that a link failure between the first node and the next-hop node is present, update a first ID for identifying a node in the subnetwork to a second ID having a one-to-one correspondence with the first ID; the second ID being used to instruct the first node to determine a new next-hop node based on a reverse rule; The determining unit is further configured to determine, based on the reverse rule, a neighbor node of the first node located in a direction opposite to the forwarding direction as a new next-hop node.

16. The device according to claim 15, characterized in that The reverse rule is further used to indicate that the neighboring node that sends the first message to the first node is not allowed to be determined as the new next-hop node.

17. The device according to claim 16, characterized in that The receiving unit is further configured to receive a second message, where the second message carries second positioning information; The determining unit is further configured to determine, in the second positioning information, the first ID having a one-to-one correspondence with the second ID; and to, if the first depth and the third depth corresponding to the first ID in the second positioning information are different, then: when the node that sends the second message to the first node is not a neighboring node in the subnetwork, according to the reverse rule, determine a neighboring node of the first node in the subnetwork that is located in a direction opposite to the forwarding direction as a next hop node for receiving the second message; or, when the node that sends the second message to the first node is a node in the subnetwork, according to the reverse rule, determine a neighboring node in the subnetwork other than the neighboring node that sends the second message to the first node as a next hop node for receiving the second message; The sending unit is further configured to forward the second message to the next hop node for receiving the second message.

18. The device according to any one of claims 10-11, 14-17, characterized in that The determining unit is further configured to determine the next hop node according to the neighbor table of the first node and the first positioning information if the first depth and the second depth are the same.

19. A message forwarding device, characterized in that: include: A memory, a network interface, and one or more processors, wherein the one or more processors receive or send data through the network interface, and the one or more processors are configured to read program instructions stored in the memory to execute the method according to any one of claims 1 to 9.

20. A computer-readable storage medium, characterized in that The computer-readable storage medium includes program instructions. When the program instructions are executed on a computer or a processor, the computer or the processor is caused to perform the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Distance weighting based routing method and node-routing functional module

    WO2019218921A1