Method for maintaining routing table generation, packet forwarding method and device

By using a distributed routing table generation method, nodes only record the next-hop node and its routing cost to the target node, which solves the problems of high resource consumption and poor resilience on lightweight devices, and achieves efficient and reliable packet forwarding.

CN123074969APending Publication Date: 2026-11-10HANGZHOU MULTIPOINT COMMUNICATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611425735.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-15
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing wireless ad hoc network routing protocols have high resource overhead and poor resilience on lightweight embedded devices, and their rigid routing mechanisms lead to traffic concentration and insufficient QoS.

Method used

A distributed routing table generation method is adopted, in which nodes only record the next-hop node and its routing cost to the target node. The path is selected through dynamic routing cost, and two optimal paths are reserved as primary and backup paths.

Benefits of technology

Significantly reduces storage resource consumption, improves link robustness and fault response speed, ensures that service packets are scheduled on links with optimal wireless transmission quality, and meets the dynamic topology and real-time packet forwarding requirements of lightweight devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123074969A_ABST
    Figure CN123074969A_ABST
Patent Text Reader

Abstract

This invention provides a routing table generation and maintenance method, a packet forwarding method, and an apparatus. The routing table generation and maintenance method is applicable to a peer-to-peer and decentralized mesh network, and includes: generating an initial routing table: each node listens to packets forwarded by its neighboring nodes and generates a local initial routing table based on the link information contained in the packets; the local initial routing table includes a destination node identifier, a next-hop node identifier, and routing cost, where the next-hop node is a neighboring node of the current node. Route synchronization and update: each node broadcasts its currently maintained routing table information to its neighboring nodes and updates its own maintained local routing table based on the routing table information received from its neighboring nodes, including adding or deleting routing table entries and / or updating the routing cost within each entry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a method for generating and maintaining a routing table, a method for forwarding messages, and an apparatus. Background Technology

[0002] Existing routing protocols for wireless ad hoc networks (such as mesh networks) mainly include proactive, on-demand, and hybrid protocols. Proactive protocols maintain the network-wide routing table by periodically broadcasting control messages, offering advantages such as low end-to-end latency and rapid response to topology changes. However, the size of the routing table increases dramatically with the number of nodes, resulting in substantial control overhead, making it only suitable for small-scale static networks. On-demand protocols trigger the route discovery process only when there is a data transmission need at the source end, searching for paths on demand through flooding. This significantly reduces the network overhead and bandwidth consumption caused by periodic broadcasts, but the route discovery process introduces higher latency and poor real-time performance. Hybrid protocols combine the characteristics of the former two, balancing convergence speed and environmental adaptability, and are widely used in more complex network scenarios.

[0003] However, for lightweight embedded wireless devices with severely limited resources (such as embedded wireless mesh devices), the above solutions all reveal inherent shortcomings. Active and hybrid protocols require nodes to maintain large-scale routing tables, with significant amounts of memory and CPU resources frequently used for processing control messages and path updates, resulting in excessive resource overhead and making deployment on lightweight devices difficult. Forcibly simplifying routing tables to save resources inevitably leads to a significant decrease in network resilience; once a critical node fails, it can easily cause the entire routing system to collapse, preventing normal data forwarding. Furthermore, most current protocols still use "minimum hop count" as the sole routing metric, completely ignoring dynamic factors such as real-time link load, signal interference, and channel quality. This rigid routing mechanism easily leads to traffic congestion at hotspot nodes, making it difficult to meet the stringent Quality of Service (QoS) requirements of services such as video streaming and voice calls. Summary of the Invention

[0004] In order to overcome the shortcomings of the prior art, the present invention provides a method for generating and maintaining routing tables, a method for forwarding packets, and an apparatus.

[0005] To achieve the above objectives, a first aspect of the present invention provides a method for generating and maintaining a routing table. This method is applicable to a decentralized mesh network where all nodes are peer-to-peer, and includes: Generate an initial routing table: Each node listens to the packets forwarded by its neighboring nodes and generates a local initial routing table based on the link information contained in the packets; the local initial routing table includes the destination node identifier, the next-hop node identifier, and the routing cost, and the next-hop node is the node's neighbor node; Route synchronization update: Each node broadcasts its currently maintained routing table information to neighboring nodes, and updates its own local routing table based on the routing table information received from neighboring nodes. The update includes adding or deleting routing table entries and / or updating the routing cost within each entry.

[0006] According to an embodiment of the first aspect of the present invention, each node generates a local initial routing table based on the link information contained in the message, including: Each node listens for beacon frames sent by other nodes on each channel to build a neighbor table. The beacon frame includes the node's device ID and the network ID to which the node belongs. Based on the neighbor relationship table, each node listens to the messages forwarded by its neighbor nodes and parses the link information, including the sending address, receiving address and destination address, from the signaling part of the message. Each node monitors channel quality to obtain routing overhead; Generate a local initial routing table based on the neighbor relationship table, link information, and routing costs.

[0007] According to an embodiment of the first aspect of the present invention, the routing overhead includes direct overhead and subsequent overhead, wherein the direct overhead is the link overhead between the current node and the next-hop node, and the subsequent overhead is the sum of the path overhead from the next-hop node to the destination node.

[0008] According to an embodiment of the first aspect of the present invention, each node periodically measures the wireless channel quality, generates channel measurement information carrying the direct connection overhead between each node and its neighboring nodes, and sends the channel measurement information to the neighboring nodes to periodically update the local routing table maintained by each node; the channel measurement messages are measured and reported by the physical layer at millisecond intervals.

[0009] According to an embodiment of the first aspect of the present invention, adding or deleting routing table entries and / or updating the overhead within each entry includes: If the received routing table information contains a new destination node, a corresponding routing table entry is added to the local routing table, and the next-hop node and routing cost of the new routing table entry are determined based on the routing table information. If the received routing table information indicates that a node has left the current network, then delete the routing table entry in the local routing table that has the node that left the network as the destination node or the next hop node. If the received routing table information contains the destination node already recorded in the local routing table, then update the routing cost of the corresponding entry in the local routing table according to the routing table information.

[0010] According to an embodiment of the first aspect of the present invention, updating the local routing table maintained by itself based on the routing table information received from neighboring nodes further includes a routing table entry pruning step: For the same destination node, when there are more than two paths, the routing table entries corresponding to the two paths with the best total path cost are selected and retained based on the total path cost of each path. The total path cost is the sum of the path costs from the current node to the destination node.

[0011] According to an embodiment of the first aspect of the present invention, the routing table generation and maintenance method further includes node decommissioning awareness and routing aging steps: each node periodically sends and receives heartbeat messages to monitor the survival status of neighboring nodes; when no heartbeat message is received from a neighboring node within a preset period, it is determined that the neighboring node has decommissioned; each node deletes routing table entries in the routing table with the decommissioned node as the destination node or next-hop node and ignores routing table information related to the decommissioned node synchronized from other nodes.

[0012] A second aspect of the present invention also provides a packet forwarding method, which forwards packets based on the routing table generated and maintained as described above. During forwarding, each node queries its local routing table according to the destination node to which the packet is to be reached, determines the next-hop node based on the matching routing table entry, and forwards the packet to the next-hop node. The next-hop node then continues to forward the packet hop by hop until it reaches the destination node.

[0013] According to an embodiment of the second aspect of the present invention, when there are multiple paths for the same destination node, each node selects a matching routing table entry for packet forwarding with the optimal total path cost as the first priority and the minimum hop count as the second priority.

[0014] A third aspect of the present invention also provides a routing table generation and maintenance apparatus, which is deployed at each network node. The routing table generation and maintenance apparatus includes a physical layer module, a synchronization broadcast module, and a routing table generation and maintenance module. The physical layer module is used for transmitting and receiving wireless signals and for channel measurement. The synchronization broadcast module is used to periodically broadcast routing table information maintained by the node to neighboring nodes, and to receive and process routing table information broadcast by neighboring nodes. The routing table generation and maintenance module executes the above-described routing table generation and maintenance method to generate and maintain a local routing table.

[0015] In summary, the routing table generation and maintenance method provided by this invention adopts a distributed routing strategy. Each node only needs to record the next-hop node and its routing cost to the target node, without needing to record the complete node path. This "de-pathing" structure ensures that the size of a single node's routing table is determined solely by the number of target nodes reachable by that node, completely decoupling it from the total number of nodes in the network. This significantly simplifies the local routing table structure maintained by each node and substantially reduces storage resource consumption. Furthermore, by introducing dynamic routing cost as a path selection weight into the routing table, the system prioritizes the total path cost when selecting a route, supplementing it with the minimum hop count as a secondary reference when necessary. This mechanism no longer relies solely on the hop count but comprehensively considers dynamic factors such as real-time link load, signal interference, and channel quality, ensuring that service packets are always scheduled to the link with the best current wireless transmission quality.

[0016] Furthermore, this invention reserves two routing table entries with the optimal total cost for the same destination node, designating them as the primary and backup paths, respectively. When the primary path fails, the packet forwarding process can quickly switch to the backup path without triggering a network-wide route recalculation. This setting significantly improves the robustness and fault response time of the packet forwarding link while maintaining a streamlined structure in the local routing tables of each node.

[0017] To make the above and other objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0018] Figure 1 The diagram shows the steps of a routing table generation and maintenance method provided in an embodiment of the present invention.

[0019] Figure 2 The diagram shows the flowchart of routing table generation and route synchronization updates performed by each node in the MESH network.

[0020] Figure 3 The diagram shows the communication between nodes in an ideal MESH network.

[0021] Figure 4 As shown Figure 3 A simplified diagram.

[0022] Figure 5 The diagram shows the communication between nodes in another network using the routing table generation and maintenance method provided by this invention.

[0023] Figure 6 The diagram shown is a principle block diagram of routing table generation and maintenance provided by an embodiment of the present invention. Detailed Implementation

[0024] Existing wireless ad hoc networks (such as MESH networks) mainly employ active, on-demand, and hybrid routing protocols. When deployed on lightweight embedded wireless devices, these routing methods suffer from incompatibility issues regarding resource overhead and routing performance (including routing latency and link robustness), as well as problems such as uneven load distribution and insufficient QoS guarantees caused by using minimum hop count as the single path selection metric.

[0025] In view of this, this embodiment provides a routing table generation and maintenance method that is concise and controllable and whose routing link selection takes into account network load. This method is applicable to a decentralized mesh network where all nodes are peers.

[0026] like Figure 1 As shown, the routing table generation and maintenance methods provided in this implementation include: Step S10: Generate initial routing table: Each node listens to the packets forwarded by its neighboring nodes and generates a local initial routing table based on the link information contained in the packets. The local initial routing table includes the destination node identifier, the next-hop node identifier, and the routing cost. The next-hop node is the neighboring node of this node.

[0027] Step S20, Route Synchronization Update: Each node broadcasts its currently maintained routing table information to neighboring nodes, and updates its own maintained local routing table based on the routing table information received from neighboring nodes. The update includes adding or deleting routing table entries and / or updating the routing cost within each entry.

[0028] In the routing table generation and maintenance method provided in this embodiment, each entry only retains the next-hop node and routing cost. For paths with a length of more than three hops, this method does not need to record the complete node traversal path, thereby greatly simplifying the local routing table structure and significantly reducing storage resource consumption; and the larger the node scale, the more prominent its advantages become.

[0029] In one possible implementation, step S10 includes: Step S11: Each node listens for beacon frames sent by other nodes on each channel to build a neighbor table. The beacon frame includes the node's device ID and the network ID to which the node belongs. In a MESH network, each node listens for Mesh beacon frames sent periodically by other nodes on each channel. When updating the neighbor table, if the network ID received by the current node matches the pre-configured network ID, the node that sent the Mesh beacon frame is added to its neighbor table. If no beacon frame is received from a node in the neighbor table within a preset time, the node is deleted from the table.

[0030] Specifically, in this embodiment, the MESH network contains multiple independent sub-networks, and each sub-network corresponds to a network ID; for example, four nodes A, B, C, and D form a sub-network, and each of these four nodes has its own pre-configured sub-network ID. When node B detects a beacon frame from node A, it finds that the received network ID is consistent with the network ID pre-configured by node B, so node B adds node A to its neighbor table. If node B detects a beacon frame sent by node Z in another sub-network, but the received network ID is inconsistent with the network ID pre-configured by node B, node B will not add node Z to its neighbor table. Step S12: Based on the established neighbor table, each node listens to the packets forwarded by its neighbor nodes and parses the link information from the signaling part of the packet. The link information includes the sending address (i.e., the sending node identifier), the receiving address (i.e., the receiving node identifier), and the destination address (i.e., the destination node identifier). However, this invention does not impose any limitations on this.

[0031] Step S13: Each node monitors channel quality to obtain routing overhead. In this embodiment, each node periodically measures the wireless channel quality, generates channel measurement information carrying the direct connection overhead between each node and its neighboring nodes, and sends the channel measurement information to its neighboring nodes to periodically update the local routing tables maintained by each node. Preferably, this embodiment sets each node to quickly measure the channel through the hardware physical layer. Measurements are performed and reported at millisecond intervals via FPGA, quickly updating the routing overhead in the local routing tables maintained by each node, ensuring that packets use the optimal link during transmission.

[0032] In one possible implementation, the structure of channel measurement information is shown in Appendix 1. Link cost is quantified using natural numbers (unsigned integers) ranging from 0 to 65535. This value is not a direct reading of the physical quantity, but rather a unidirectional link quality score output by the FPGA (Field-Programmable Gate Array) after performing a preset weighted algorithm on underlying metrics such as the real-time acquired Received Signal Strength Indicator (RSSI), Signal-to-Noise Ratio (SNR), and Bit Error Rate (BER). This score is shown in the cost_T (transmit cost) and cost_R (receive cost) fields in Appendix 1. For better understanding, the following explanation of the generation and maintenance of the routing table maintained by each node will use the example of equal transmit and receive costs. However, this invention does not impose any limitations on this; transmit and receive costs may not be equal.

[0033] Step S14: Each node generates a local initial routing table based on the neighbor relationship table, link information, and routing cost. In this embodiment, the routing cost includes direct connection cost and subsequent cost. The direct connection cost is the link cost between the current node and the next-hop node, and the subsequent cost is the sum of the path costs from the next-hop node to the destination node. However, this invention does not limit the way routing costs are recorded in each entry. In other embodiments, the routing table entries may not need to record the direct connection cost separately, but may directly record the sum of the costs from the current node to the destination node.

[0034] The generated local initial routing table has the following format:

[0035] After obtaining the local initialization routing table of each node in step S10, each node does not have routing table information of non-neighboring nodes, or the subsequent overhead in the routing table entries is incomplete. Therefore, in step S20, each node needs to periodically broadcast its own routing table information to neighboring nodes. Neighboring nodes refresh or complete their maintained local routing tables based on the received routing table information, and finally the routing tables of all nodes globally are dynamically synchronized.

[0036] In one possible implementation, the step includes: Step S21: Each node's physical layer performs a network search to determine the network status of each neighbor node in the neighbor relationship table, and broadcasts its currently maintained routing table information to the neighbor nodes. Specifically, the network status of a node can be determined by listening to the heartbeat signals sent by each neighbor node during the network search, and the routing table information can be broadcast to the neighbor nodes within the data time slot. However, this invention does not impose any limitations on this.

[0037] Step S22: Each node receives the routing table information broadcast by its neighboring nodes and updates its own local routing table based on the received information. This update includes adding or deleting routing table entries and / or updating the routing costs within each entry. Specifically, adding or deleting routing table entries and / or updating the costs within each entry includes: For new operations, if the received routing table information contains a new destination node, a corresponding routing table entry is added to the local routing table, and the next-hop node and routing cost (including direct connection cost and successor cost) of the new routing table entry are determined based on the routing table information.

[0038] For deletion operations, if the received routing table information indicates that a node has left the current network, then delete the routing table entry in the local routing table that has the node that left the network as the destination node or the next hop node.

[0039] The cost update operation involves updating the direct cost and / or subsequent cost of the corresponding entry in the local routing table if the received routing table information contains the destination node already recorded in the local routing table.

[0040] Specifically, the routing table generation and maintenance method provided in this embodiment also includes node decommissioning awareness and route aging steps. Node decommissioning awareness: Each node periodically sends and receives heartbeat messages to monitor the liveness status of neighboring nodes; if no heartbeat message is received from a neighboring node within a preset period (e.g., 3 seconds), it is determined that the neighboring node has decommissioned. Then, route aging is performed: Each node deletes routing table entries in its routing table that have the decommissioned node as the destination node or next-hop node, and ignores routing table information related to the decommissioned node synchronized from other nodes, preventing inconsistent timing of decommissioning node processing by different nodes from causing repeated additions and deletions of routing table entries.

[0041] In a mesh network, there are usually multiple paths from each node to the destination node, and the total cost of each path is different. For each node, maintaining all paths to the same destination node would result in a complex routing table structure; in particular, paths with high total cost are usually not selected during packet forwarding, but maintaining these paths would consume node resources, resulting in wasted resources.

[0042] Therefore, the routing table generation and maintenance method provided in this embodiment includes a routing table entry pruning step: For the same destination node, when there are more than two paths, the routing table entries corresponding to the two paths with the optimal total path cost (total path cost = direct connection cost + subsequent cost) are filtered and retained. The total path cost is the sum of the path costs from the current node to the destination node. Of the two paths, the path with the optimal cost is used as the primary path, and the other is a backup path. When the primary path fails, the node quickly switches to the backup path without recalculating the route. This setting not only greatly simplifies the routing table data structure of each node but also improves routing resilience and reduces forwarding packet loss rate. However, this invention does not impose any limitations on this. In other embodiments, three or four paths may also be retained; or, if node resources are sufficient, more paths may be retained.

[0043] In one possible implementation, the data structure of the two paths in the routing table is shown in Appendix 2. In Appendix 2, srcDevice is the source node identifier, destDevice is the destination node identifier, and activeFlag is the routing table entry activation flag, 1 for validity and 0 for invalidity. Path M information (13 bytes): Records information about the first path, firstHopDeviceID_A: next-hop node identifier, firstHopCost_A: direct connection cost, firstHopAgeTime_A: aging time of the next-hop node, restHopCost_A: subsequent cost, restHopAgeTime_A: aging time of the subsequent node; Path N information (13 bytes): The meaning of the fields is the same as that of path M information, which stores the information of path N.

[0044] To better understand the working principle of the routing table generation and maintenance method provided in this embodiment, this embodiment uses a MESH network with only four nodes (A, B, C, and D) as an example for illustration. However, this invention does not impose any limitations on this. In reality, MESH networks have more nodes and more complex network structures.

[0045] Figure 3 The diagram illustrates bidirectional communication between four nodes in an ideal MESH network. However, in real-world applications, paths between some nodes are not interoperable. Furthermore, to better illustrate the updating of the routing tables maintained by each node in this embodiment, [the following is omitted as it is not part of the diagram]. Figure 3 Simplified to Figure 4 The structure in.

[0046] As described above, in step S10: After power-on, nodes A, B, C, and D send synchronization messages. Then, each node begins processing the received messages; taking node B as an example: node B processes the synchronization messages sent by its three neighboring nodes, parses and merges them to generate its local initial routing table. Afterwards, node B sends synchronization messages to nodes A, C, and D. The three nodes parse the messages sent by B and obtain their respective local initial routing tables.

[0047] The initial routing table contents on each node are as follows: Node A:

[0048] Node B:

[0049] C node:

[0050] Node D:

[0051] In the initial routing table entries generated in step S10, each node includes routing table information of its neighboring nodes, but not routing table information of non-neighboring nodes. Therefore, the process proceeds to step S20 for route synchronization update.

[0052] First synchronization: Node A broadcasts its currently maintained routing table information to its neighbor Node B. Similarly, nodes C and D also synchronously broadcast their own currently maintained routing table information to their neighbor Node B. After receiving the three synchronization messages, Node B merges them with its own currently maintained routing table to form a new routing table. Nodes A, C, and D, as broadcasters of synchronized routing table information, maintain their own routing tables unchanged.

[0053] Node A:

[0054] Node B: Synchronize the reason tables from nodes A, C, and D, and generate a new table after deduplication. However, since the routing table information generated by nodes A, C, and D does not include any new destination nodes (i.e., no neighboring nodes other than node B), node B completes the refresh confirmation of the routing costs for existing entries (to A, C, and D). If the routing costs remain unchanged, the following routing table is generated:

[0055] C node:

[0056] Node D:

[0057] Second synchronization: Node B broadcasts its currently maintained routing table information to its neighboring nodes A, C, and D. Upon receiving the message, nodes A, C, and D merge the information with their own existing routing tables, forming new routing tables. Node B's routing table remains unchanged.

[0058] Node A: Synchronize the routing table information of neighboring node B, generate routing table entries to nodes C and D, and update the direct connection cost X1 and subsequent cost between A and B. X2 , X3 );

[0059] Node B: As the broadcaster of routing table information, its routing table remains unchanged;

[0060] C node: Synchronize the routing table information of neighboring node B, generate routing table entries to nodes A and D, and update the direct connection cost X2 and subsequent cost between B and C. X3 , X1 );

[0061] Node D: Synchronize the routing table information of neighboring node B, generate routing table entries to nodes A and C, and update the direct connection cost X2 and subsequent cost between B and D. X1 , X2 );

[0062] Through two synchronizations, the local routing tables on the four nodes are dynamically synchronized. Subsequent synchronizations, if the network structure remains unchanged (including new node additions, node decommissioning, or new communication paths between nodes), only refresh the cost values ​​(direct connection cost and / or subsequent cost) of each routing table entry during synchronization. If the network structure changes, and multiple paths exist from the source node to the destination node, the two with the lowest cost are retained. As mentioned above, to better illustrate the routing synchronization of each node, this embodiment not only uses a four-node network as an example but also simplifies some communication paths between nodes. However, in real-world network scenarios, there will be more nodes, and the communication paths between nodes will be more complex. Figure 3 As shown, if there are communication paths between node A and nodes C and D, then nodes C and D are both neighbors of node A; similarly, nodes C and D will also have more neighbors. After synchronization in step S20, each node will form a local routing table with richer and more diverse paths; however, if there are multiple paths, each node's routing table retains the routing table entries corresponding to the two paths with the lowest total cost, and deletes the entries for other paths to ensure the robustness of the routing table.

[0063] Figure 5 The diagram illustrates communication between nodes in another network using the routing table generation and maintenance method provided by this invention. In this structure, there are multiple paths from node B to node F: ① The total path cost of B->D->F is 7. ② The total path cost of B->A->D->F is 12. ③ The total path cost of B->D->E->F is 8. ④ The total path cost from B to C to F is 12. ⑤、… The local routing table maintained by node B only retains path ① and path ③.

[0064] The routing table generation and maintenance method provided in this embodiment only records the next-hop node and its routing cost to the destination node, without needing to save the complete node path. This decouples the size of a single node's routing table from the total number of destination nodes reachable by that node, significantly simplifying the local routing table and reducing storage resource consumption. Simultaneously, nodes do not require complex calculations during synchronization; they only need to determine the direct connection cost based on the routing table information of adjacent nodes and obtain the subsequent cost through simple summation. Synchronizing routing table entries is very simple and efficient, requiring minimal resources. Furthermore, for the same destination node, a primary path and a backup path with the optimal total cost are retained. If the primary path fails, the system can quickly switch to the backup path without triggering a full-network route recalculation. This scheme offers advantages such as simplified routing tables, low storage overhead, fast failover, and strong link robustness. Therefore, it can be well deployed in lightweight embedded wireless devices with limited storage, computing power, and bandwidth, such as drones and mobile robots, meeting their dynamic topology and real-time packet forwarding requirements.

[0065] Furthermore, in terms of network structure: existing mesh networks mostly adopt a hierarchical tree structure, with mesh nodes typically needing to access the network via an upper-layer mesh gateway. Their external network interconnection, route aggregation, access authentication, address allocation, and centralized scheduling control and management functions are usually handled by a fixed root node or gateway, thus exhibiting strong dependence on fixed infrastructure and being more suitable for static node environments. For mobile vehicles such as drones and mobile robots, node locations are constantly changing: once they leave the coverage of the root node or gateway, they may be unable to access the upper-layer network; the root node or gateway is also prone to becoming a single point of failure and a traffic bottleneck; when the topology changes frequently, centralized route convergence and control updates are slow and costly; communication between adjacent nodes may also detour through the gateway, increasing latency and bandwidth consumption. Therefore, this hierarchical tree-like mesh network is difficult to adapt to mobile vehicles.

[0066] The routing table generation and maintenance method provided in this embodiment is applicable to a peer-to-peer and decentralized mesh network. Nodes can communicate directly or act as wireless relays. Network connectivity no longer relies on a single fixed node but is distributed among various mobile nodes, better suited to the characteristics of mobile carriers with variable locations and dynamic topology changes. Furthermore, in this embodiment, the mesh network also includes multiple independently communicating subnetworks. Each node can build a neighbor relationship table based on the subnetwork ID. Subnetworks do not communicate with each other (they can listen but do not communicate). This setup facilitates independent control by each mobile carrier group, reduces cross-group interference and management complexity, and enhances security: faults, attacks, or anomalies in one subnetwork are less likely to spread to other subnetworks, and information within a group is less likely to be leaked across groups. Therefore, this egalitarian, decentralized mesh structure that supports subnetwork isolation can adapt to flexible and reliable communication in mobile environments while meeting the needs of independent, easily managed, and highly secure mobile carrier groups.

[0067] Corresponding to the routing table generation and maintenance method described above, the second aspect of this embodiment also provides a packet forwarding method. In this method, each node forwards packets based on the routing table generated by the method described above in this embodiment. During forwarding, each node queries its local routing table according to the destination node to which the packet is to be reached, determines the next-hop node based on the matching routing table entry, and forwards the packet to the next-hop node. The next-hop node then continues to forward the packet hop by hop until it reaches the destination node.

[0068] For example, when a packet destined for node D arrives at node A, node A, as the source node, queries its local routing table. Using the destination node identifier, it determines the corresponding routing entry in the table, thus identifying node B as the next hop, with a direct cost of X1 and a subsequent cost of X3. Node A then forwards the packet to node B. Following the same steps, node B queries its local routing table using the destination node identifier, identifies node D as the next hop, and forwards the packet to node D, completing the packet forwarding process.

[0069] Furthermore, when multiple paths exist for the same destination node, each node selects a matching routing table entry for packet forwarding based on the optimal total path cost as the first priority and the minimum hop count as the second priority. Still using... Figure 5 For example, based on the principle of optimal (i.e., minimum) total path cost, Node B will select path ① with the minimum total path cost for packet forwarding. However, if two paths have the same total path cost (e.g., both are 7), the path with the lowest hop count can be selected as the second priority. The packet forwarding method provided by this invention no longer simply relies on the minimum hop count principle, but is based on the routing cost in the routing table, comprehensively considering dynamic factors such as real-time link load, signal interference, and channel quality, to ensure that service packets are always scheduled to the link with the best current wireless transmission quality, thereby greatly reducing the packet loss rate.

[0070] Correspondingly, the third aspect of this embodiment also provides a routing table generation and maintenance device, such as... Figure 6 As shown, it is deployed at each network node and includes a physical layer module 10, a synchronization broadcast module 20, and a routing table generation and maintenance module 30. The physical layer module 10 is used for transmitting and receiving wireless signals and for channel measurement. The synchronization broadcast module 20 is used to periodically broadcast the routing table information maintained by this node to neighboring nodes, and to receive and process the routing table information broadcast by neighboring nodes. The routing table generation and maintenance module 30 executes the above-described routing table generation and maintenance method to generate and maintain the local routing table.

[0071] Although this embodiment uses a MESH network as an example to describe in detail the routing table generation and maintenance method and the corresponding packet forwarding method, this invention does not limit it in any way. The routing table generation and maintenance method provided in this embodiment can also be applied to other network topologies.

[0072] In summary, the routing table generation and maintenance method provided by this invention adopts a distributed routing strategy. Each node only needs to record the next-hop node and its routing cost to the target node, without needing to record the complete node path. This "de-pathing" structure ensures that the size of a single node's routing table is determined solely by the number of target nodes reachable by that node, completely decoupling it from the total number of nodes in the network. This significantly simplifies the local routing table structure maintained by each node and substantially reduces storage resource consumption. Furthermore, by introducing dynamic routing cost as a path selection weight into the routing table, the system prioritizes the total path cost when selecting a route, supplementing it with the minimum hop count as a secondary reference when necessary. This mechanism no longer relies solely on the hop count but comprehensively considers dynamic factors such as real-time link load, signal interference, and channel quality, ensuring that service packets are always scheduled to the link with the best current wireless transmission quality.

[0073] Furthermore, this invention reserves two routing table entries with the optimal total cost for the same destination node, designating them as the primary and backup paths, respectively. When the primary path fails, the packet forwarding process can quickly switch to the backup path without triggering a network-wide route recalculation. This setting significantly improves the robustness and fault response time of the packet forwarding link while maintaining a streamlined structure in the local routing tables of each node.

[0074] Although the present invention has been disclosed above by way of preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art may make some modifications and refinements without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be determined by the scope of protection claimed in the claims.

[0075] Appendix 1

[0076] Appendix 2

Claims

1. A method for generating and maintaining a routing table, characterized in that, The routing table generation and maintenance method is applicable to peer-to-peer and decentralized mesh networks, and includes: Generate an initial routing table: Each node listens to the packets forwarded by its neighboring nodes and generates a local initial routing table based on the link information contained in the packets; the local initial route includes the destination node identifier, the next-hop node identifier, and the routing cost, where the next-hop node is the node's neighbor node; Route synchronization update: Each node broadcasts its currently maintained routing table information to neighboring nodes, and updates its own local routing table based on the routing table information received from neighboring nodes. The update includes adding or deleting routing table entries and / or updating the routing cost within each entry.

2. The routing table generation and maintenance method according to claim 1, characterized in that, Each node generates a local initial routing table based on the link information contained in the message, including: Each node listens for beacon frames sent by other nodes on each channel to build a neighbor relationship table. The beacon frames include the node's device ID and the network ID to which the node belongs. Based on the neighbor relationship table, each node listens to the messages forwarded by its neighbor nodes and parses the link information, including the sending address, receiving address and destination address, from the signaling part of the message. Each node monitors channel quality to obtain routing overhead; A local initial routing table is generated based on the neighbor relationship table, link information, and routing cost.

3. The routing table generation and maintenance method according to claim 1, characterized in that, The routing cost includes direct connection cost and subsequent cost. The direct connection cost is the link cost between the current node and the next-hop node, and the subsequent cost is the sum of the path costs from the next-hop node to the destination node.

4. The routing table generation and maintenance method according to claim 3, characterized in that, Each node periodically measures the wireless channel quality, generates channel measurement information carrying the direct connection overhead between each node and its neighboring nodes, and sends the channel measurement information to the neighboring nodes to periodically update the local routing table maintained by each node; the channel measurement messages are measured and reported by the physical layer at millisecond intervals.

5. The routing table generation and maintenance method according to claim 1, characterized in that, The addition and deletion of routing table entries and / or the updating of costs within each entry include: If the received routing table information contains a new destination node, a corresponding routing table entry is added to the local routing table, and the next-hop node and routing cost of the new routing table entry are determined based on the routing table information. If the received routing table information indicates that a node has left the current network, then delete the routing table entry in the local routing table that has the node that left the network as the destination node or the next hop node. If the received routing table information contains a destination node already recorded in the local routing table, then update the routing cost of the corresponding entry in the local routing table according to the routing table information.

6. The routing table generation and maintenance method according to claim 1, characterized in that, The process of updating the local routing table maintained by itself based on the routing table information received from neighboring nodes also includes a routing table entry pruning step: For the same destination node, when there are more than two paths, the routing table entries corresponding to the two paths with the best total path cost are filtered and retained based on the total path cost of each path. The total path cost is the sum of the path costs from the current node to the destination node.

7. The routing table generation and maintenance method according to claim 1, characterized in that, The routing table generation and maintenance method also includes node decommissioning awareness and routing aging steps: each node periodically sends and receives heartbeat messages to monitor the survival status of neighboring nodes; when no heartbeat message is received from a neighboring node within a preset period, it is determined that the neighboring node has decommissioned. Each node deletes the routing table entry with the decommissioned node as the destination node or next-hop node and ignores the routing table information related to the decommissioned node synchronized from other nodes.

8. A message forwarding method, characterized in that, The packet is forwarded based on the routing table generated and maintained according to any one of claims 1 to 7. During forwarding, each node queries its local routing table according to the destination node to which the packet is to be reached, determines the next-hop node based on the matching routing table entry, and forwards the packet to the next-hop node. The next-hop node continues to forward the packet hop by hop until it reaches the destination node.

9. The message forwarding method according to claim 8, characterized in that, When there are multiple paths to the same destination node, each node selects a matching routing table entry for packet forwarding based on the optimal total path cost as the first priority and the minimum hop count as the second priority.

10. A routing table generation and maintenance device, characterized in that, Deployed at each network node, the routing table generation and maintenance device includes: The physical layer module is used for wireless signal transmission and reception and channel measurement; The synchronous broadcast module is used to periodically broadcast the routing table information maintained by this node to neighboring nodes, as well as to receive and process the routing table information broadcast by neighboring nodes. The routing table generation and maintenance module executes the routing table generation and maintenance method as described in any one of claims 1 to 7.