Forwarded information verification method, apparatus and device, and computer readable storage medium
By using multiple distance data (first distance, second distance and third distance) in the communication system to verify the next hop address in the forwarding information, the problem of packet forwarding path error caused by inaccurate forwarding information stored by the node is solved, and the reliability of the verification and network reliability are improved.
Patent Information
- Application Number
- CN202311128176.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2025-02-28
AI Technical Summary
In the communication system, the forwarding information stored by the node is inaccurate, resulting in the error in the forwarding path of the packet and the destination node cannot be correctly reached.
By obtaining the forwarding information to be verified, including the destination network segment address and the next hop address, multiple distance data (first distance, second distance and third distance) are obtained in the node's database based on these addresses, and the correctness of the next hop address is verified based on these distance data.
It improves the reliability of forwarded information verification, ensures the accuracy of forwarded information, reduces errors under the influence of the environment, and improves the high reliability guarantee of the network.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a verification method, device, equipment and computer-readable storage medium for forwarding information. Background Art
[0002] In a communication system, a node needs to determine the forwarding path of a message based on the stored forwarding information, such as determining the next hop and destination node of the forwarding path, and forward the message based on the determined forwarding path. If the forwarding information stored by the node is inaccurate, the forwarding path of the message will be wrong, and the message will not be able to reach the destination node along the correct path. Therefore, it is necessary to verify the forwarding information, determine the accuracy of the stored forwarding information, and ensure the accuracy of message forwarding based on the forwarding information or correct the wrong forwarding information in a timely manner. Summary of the invention
[0003] The present application provides a method, device, equipment and computer-readable storage medium for verifying forwarded information to improve the reliability of verification. The technical solution is as follows:
[0004] In the first aspect, a method for verifying forwarding information is provided, the method comprising: a first node obtains forwarding information to be verified, the forwarding information to be verified includes the address of the destination network segment and the address of the next hop from the first node to the destination network segment, the next hop is a neighboring node in the node domain of the first node, and the node domain of the first node includes the first node and at least one neighboring node of the first node; based on the address of the next hop and the address of the destination network segment, a first distance between the next hop and the destination network segment, a second distance between the first node and the next hop, and a third distance between the first node and the destination network segment are obtained in the database of the first node; according to the first distance, the second distance and the third distance, the correctness of the address of the next hop included in the forwarding information to be verified is verified. The embodiment of the present application determines multiple distances corresponding to the forwarding information, namely the first distance, the second distance and the third distance, and determines whether the address of the next hop in the forwarding information is correct according to the multiple distances, rather than only verifying according to the forwarding information itself, so that the verification result is more reliable.
[0005] In a possible implementation, the correctness of the address of the next hop included in the forwarding information to be verified is verified based on the first distance, the second distance and the third distance, including: when the sum of the first distance and the second distance is equal to the third distance, determining that the address of the next hop included in the forwarding information to be verified is correct. Since the third distance from the first node to the destination network segment is certain, and the next hop is a node between the first node and the destination network segment, the third distance from the first node to the destination network segment should be equal to the sum of the first distance from the next hop to the destination network segment and the second distance from the first node to the next hop. If the sum of the first distance and the second distance is equal to the third distance, it can be explained that the path from the first node to the next hop and then to the destination network segment is correct, that is, the address of the next hop in the forwarding information is correct, and then it can be explained that the forwarding information is correct.
[0006] In a possible implementation, the correctness of the address of the next hop included in the forwarding information to be verified is verified based on the first distance, the second distance, and the third distance, including: when the sum of the first distance and the second distance is not equal to the third distance, determining that the address of the next hop included in the forwarding information to be verified is wrong. If the sum of the first distance and the second distance is not equal to the third distance, it can be explained that the path from the first node to the next hop and then to the destination network segment is wrong, that is, the address of the next hop in the forwarding information is wrong, and then it can be explained that the forwarding information is wrong.
[0007] In a possible implementation, after determining that the address of the next hop included in the forwarding information to be verified is wrong, it also includes: according to the address of the destination network segment, obtaining the fourth distance between the alternative next hop and the destination network segment and the fifth distance between the first node and the alternative next hop, the alternative next hop is a neighbor node other than the next hop in the node domain of the first node; the first node replaces the address of the next hop in the forwarding information with the address of the alternative next hop based on the sum of the fourth distance and the fifth distance being equal to the third distance. After verifying that the forwarding information is wrong, an alternative next hop can be obtained, and after determining that the fourth distance and the fifth distance corresponding to the alternative next hop can match the third distance, the next hop in the forwarding information is replaced with the alternative next hop to correct the forwarding information and ensure the reliability of the forwarding information.
[0008] In a possible implementation, before obtaining the forwarding information to be verified, the method further includes: sending invitation information to multiple second nodes to join the node domain of the first node, and the multiple second nodes and the first node belong to the same network; based on receiving acceptance information sent by at least one second node, determining at least one second node as at least one neighbor node. The first node ensures the accuracy of the forwarding information corresponding to the neighboring nodes in the node domain that have joined the first node, and does not need to ensure the accuracy of the forwarding information corresponding to the nodes that have not joined the node domain, thereby reducing the verification pressure of the first node.
[0009] In a possible implementation, before obtaining the first distance between the next hop and the destination network segment, the second distance between the first node and the next hop, and the third distance between the first node and the destination network segment in the database of the first node, it also includes: obtaining the distance data corresponding to the next hop, the distance data including the distance between the next hop and the destination network segment and the first check code corresponding to the distance between the next hop and the destination network segment; performing a matching check on the distance between the next hop and the destination network segment and the first check code, and determining the first distance based on the first result obtained by the matching check; and storing the first distance in the database. The first node will periodically check the distance data according to the distance and the check code corresponding to the distance, and save the distance determined after the check in the database to ensure that the distance stored in the database is an accurate distance, so as to further ensure the reliability of subsequent checks based on the distance in the database.
[0010] In a possible implementation, determining the first distance based on the first result obtained by the matching check includes: when the first result indicates that the distance between the next hop and the destination network segment matches the first check code, determining the distance between the next hop and the destination network segment as the first distance. If the distance between the next hop and the destination network segment matches the first check code, it means that the distance between the next hop and the destination network segment obtained by the first node and the first check code are correct, and determining the correct distance as the first distance can ensure the reliability of subsequent checks based on the first distance.
[0011] In a possible implementation, determining the first distance based on the first result obtained by the matching check includes: sending a data request to the next hop when the first result indicates that the distance between the next hop and the destination network segment does not match the first check code; receiving update data sent by the next hop based on the data request, the update data including the first update distance between the next hop and the destination network segment and the first update check code corresponding to the first update distance; determining the first update distance as the first distance when the first update distance matches the first update check code. If the distance between the next hop and the destination network segment does not match the first check code, it means that at least one of the distance between the next hop and the destination network segment and the first check code obtained by the first node is wrong, and the first node can require the next hop to resend the first update distance and the first update check code, and determine the correct first update distance as the first distance, which can ensure the reliability of subsequent verification based on the first distance.
[0012] In a possible implementation, obtaining the forwarding information to be verified includes: receiving at least one link state information sent by at least one neighboring node; determining at least one forwarding information according to the at least one link state information; and selecting the forwarding information to be verified from the at least one forwarding information. The first node may calculate multiple forwarding information according to the link state information sent by each neighboring node, and verify each forwarding information in turn to ensure the accuracy of each forwarding information.
[0013] In a possible implementation, before obtaining the first distance between the next hop and the destination network segment, the second distance between the first node and the next hop, and the third distance between the first node and the destination network segment in the database of the first node, it also includes: calculating the distance between the first node and the first network segment and the second check code according to at least one link state information, the first network segment includes the next hop or the destination network segment; performing a matching check on the distance between the next hop and the first network segment and the second check code, and determining the sixth distance based on the second result obtained by the matching check; storing the sixth distance in the database, when the first network segment is the next hop, the sixth distance is the second distance, and when the first network segment is the destination network segment, the sixth distance is the third distance. The first node will regularly check the distance data according to the distance and the check code corresponding to the distance, and save the distance determined after the check in the database to ensure that the distance stored in the database is an accurate distance, so as to further ensure the reliability of subsequent verification based on the distance in the database.
[0014] In a possible implementation, determining the sixth distance based on the second result obtained by the matching check includes: when the second result is that the distance between the first node and the first network segment does not match the second check code, recalculating the second updated distance between the first node and the first network segment and the second updated check code corresponding to the second updated distance according to at least one link state information; when the second updated distance matches the second updated check code, determining the second updated distance as the sixth distance. The first node may recalculate the second updated distance and the second updated check code, and when the second updated distance and the second updated check code can match, determine the second distance or the third distance, so as to ensure the reliability of subsequent checks based on the second distance and the third distance.
[0015] In a second aspect, a device for verifying forwarding information is provided, the device comprising: an acquisition module, used to obtain forwarding information to be verified, the forwarding information to be verified comprising the address of the destination network segment and the address of the next hop from the first node to the destination network segment, the next hop being a neighboring node within the node domain of the first node, the node domain of the first node comprising the first node and at least one neighboring node of the first node; the acquisition module, further used to obtain, in a database of the first node, a first distance between the next hop and the destination network segment, a second distance between the first node and the next hop, and a third distance between the first node and the destination network segment based on the address of the next hop and the address of the destination network segment; a verification module, used to verify the correctness of the address of the next hop included in the forwarding information to be verified based on the first distance, the second distance and the third distance.
[0016] In a possible implementation, the verification module is configured to determine that the address of the next hop included in the forwarding information to be verified is correct when the sum of the first distance and the second distance is equal to the third distance.
[0017] In a possible implementation, the verification module is configured to determine that the address of the next hop included in the forwarding information to be verified is wrong when the sum of the first distance and the second distance is not equal to the third distance.
[0018] In one possible implementation, the acquisition module is also used to obtain, based on the address of the destination network segment, a fourth distance between the alternative next hop and the destination network segment and a fifth distance between the first node and the alternative next hop, where the alternative next hop is a neighboring node other than the next hop in the node domain of the first node; based on the sum of the fourth distance and the fifth distance being equal to the third distance, the address of the next hop in the forwarding information is replaced with the address of the alternative next hop.
[0019] In one possible implementation, the device also includes a sending module, which is used to send invitation information to multiple second nodes to join the node domain of the first node, and the multiple second nodes belong to the same network as the first node; the acquisition module is also used by the first node to determine at least one second node as at least one neighbor node based on receiving acceptance information sent by at least one second node.
[0020] In one possible implementation, the acquisition module is also used to obtain distance data corresponding to the next hop, the distance data including the distance between the next hop and the destination network segment and a first check code corresponding to the distance between the next hop and the destination network segment; the check module is also used to match the distance between the next hop and the destination network segment and the first check code, and determine the first distance based on the first result obtained from the matching check; and store the first distance in a database.
[0021] In a possible implementation, the verification module is configured to determine the distance between the next hop and the destination network segment as the first distance when the first result indicates that the distance between the next hop and the destination network segment matches the first verification code.
[0022] In one possible implementation, a verification module is used to send a data request to the next hop when a first result indicates that the distance between the next hop and the destination network segment does not match the first verification code; receive update data sent by the next hop based on the data request, the update data including the first update distance between the next hop and the destination network segment and the first update verification code corresponding to the first update distance; and determine the first update distance as the first distance when the first update distance matches the first update verification code.
[0023] In a possible implementation, the acquisition module is used to receive at least one link state information sent by at least one neighboring node; determine at least one forwarding information based on the at least one link state information; and select the forwarding information to be verified from the at least one forwarding information.
[0024] In one possible implementation, the acquisition module is also used to calculate the distance between the first node and the first network segment and the second check code based on at least one link state information, the first network segment including the next hop or the destination network segment; the check module is also used to match the distance between the next hop and the first network segment and the second check code, and determine the sixth distance based on the second result obtained by the matching check; the sixth distance is stored in the database, when the first network segment is the next hop, the sixth distance is the second distance, and when the first network segment is the destination network segment, the sixth distance is the third distance.
[0025] In one possible implementation, the verification module is used to recalculate the second updated distance between the first node and the first network segment and the second updated verification code corresponding to the second updated distance based on at least one link state information when the second result indicates that the distance between the first node and the first network segment does not match the second verification code; the first node determines the second update distance as the sixth distance when the second update distance matches the second update verification code.
[0026] In a third aspect, another communication device is provided, the device comprising: a network interface, a memory, and a processor. The network interface, the memory, and the processor communicate with each other through an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the network interface to receive signals and control the network interface to send signals, and when the processor executes the instructions stored in the memory, the processor executes the method in the first aspect or any possible implementation of the first aspect.
[0027] Optionally, there are one or more processors and one or more memories.
[0028] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0029] In a fourth aspect, a computer program (product) is provided, which includes: computer program code, which, when executed by a computer, enables the computer to execute the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.
[0030] In a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a program or instruction. When the program or instruction runs on a computer, the method in the above-mentioned first aspect or any possible implementation of the first aspect is executed.
[0031] In a sixth aspect, a chip is provided, comprising a processor for calling and executing instructions stored in a memory, so that a computer equipped with the chip executes the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0032] In the seventh aspect, another chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, a computer equipped with the chip executes the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0033] It should be understood that the beneficial effects achieved by the technical solutions of the second to seventh aspects of the present application and the corresponding possible implementation methods can be found in the above-mentioned technical effects of the first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of an implementation scenario provided for an embodiment of the present application;
[0035] Figure 2 A schematic diagram of the structure of a space-based network provided in an embodiment of the present application;
[0036] Figure 3 A schematic diagram of the structure of a ground network provided in an embodiment of the present application;
[0037] Figure 4 A flowchart of a method for verifying forwarding information provided in an embodiment of the present application;
[0038] Figure 5A schematic diagram of a first node and at least one neighboring node in a satellite communication scenario provided in an embodiment of the present application;
[0039] Figure 6 A schematic diagram of a forwarding information table provided in an embodiment of the present application;
[0040] Figure 7 A schematic diagram of the format of a distance information table provided in an embodiment of the present application;
[0041] Figure 8 A flowchart of a method for interactively completing verification of forwarding information provided in an embodiment of the present application;
[0042] Fig. 9 A flowchart of another method for interactively completing the verification of forwarding information provided in an embodiment of the present application;
[0043] Fig.10 A schematic diagram of a configuration of a communication network provided in an embodiment of the present application;
[0044] Fig.11 A schematic diagram of an alternative next hop information table provided in an embodiment of the present application;
[0045] Fig.12 A schematic diagram of a process for inspecting and automatically correcting a forwarding information table provided in an embodiment of the present application;
[0046] Fig.13 A schematic diagram of a process for verifying forwarding information using a related technology provided in an embodiment of the present application;
[0047] Fig.14 A schematic diagram of the structure of a verification device for forwarding information provided in an embodiment of the present application;
[0048] Fig.15 A schematic diagram of the structure of a verification device for forwarding information provided in an embodiment of the present application;
[0049] Fig.16 A schematic diagram of the structure of another verification device for forwarding information provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0051] A communication network may include multiple nodes for forwarding messages, for example, a node may be a router or a switch. After receiving a message, each node needs to determine the forwarding path of the message based on the forwarding information stored locally in the node, and forward the message according to the determined forwarding path. Among them, the forwarding information stored locally in the node may be erroneous forwarding information. For example, since the forwarding information stored locally in the node is calculated by the node autonomously based on the link status information sent by other nodes, if the local computing module is abnormal or the device is unstable, the calculated forwarding information may be abnormal.
[0052] In addition, even if the link state information sent by other nodes is correct, and the forwarding information calculated by the node based on the correct link state information sent by other nodes is correct, the forwarding information stored locally at the node may also change due to environmental influences, causing the correct forwarding information stored locally at the node to be affected and become incorrect forwarding information.
[0053] For example, there are a lot of high-energy particle radiation phenomena such as solar wind and cosmic rays in the universe. Each satellite in the satellite network based on the sixth generation mobile communication technology (6th generation mobile networks, 6G), that is, each node in the satellite network, may be affected by a lot of high-energy particle radiation, causing the satellite's storage device to flip. For dynamic routing that is dynamically adjusted based on link status, long-term exposure to bit flips will cause errors in the calculation and storage process of forwarding information calculated by the correct process. In addition, for similar reasons, nodes on the ground will also be affected by the ground environment, thereby affecting the node's calculation and storage process of forwarding information, making the forwarding information stored by the node erroneous forwarding information.
[0054] If the forwarding information stored locally in the node is inaccurate, the forwarding path of the message determined by the node based on the locally stored forwarding information will be wrong, making it impossible for the message to reach the destination node along the correct path, which will in turn cause routing loops, packet loss and other phenomena that damage the quality of network services. Therefore, it is necessary to verify the forwarding information stored locally in the node, determine the accuracy of the forwarding information stored locally in the node, ensure the accuracy of message forwarding based on the forwarding information, or correct the erroneous forwarding information in a timely manner, improve the reliability of the forwarding information stored locally in the node, and achieve high reliability of the network.
[0055] In order to alleviate the impact of the environment on the process of node calculation and storage of forwarding information, the relevant technology regularly verifies the calculation results of the forwarding information stored locally by the node to reduce the probability of errors in the forwarding information. However, due to the large number of calculation modules used to calculate the forwarding information, that is, the number of dynamic routing protocol calculation modules, and the large size of the storage space or storage chip used to store the forwarding information, it is more complicated to verify the calculation results of each module, that is, to verify the forwarding information itself, and the verification behavior is still affected by the environment.
[0056] The present application provides a forwarding information verification method, which can verify the forwarding information stored locally on the node, and not only verify the forwarding information itself, but also verify the forwarding information through the distance data corresponding to the forwarding information, which can improve the reliability of the verification and reduce the impact of the environment on the verification process. For example, see Figure 1 , a schematic diagram of an implementation scenario of a method for verifying forwarding information provided by an embodiment of the present application is shown. The implementation scenario includes a first node 11 and a neighboring node 12 of the first node 11. The first node 11 and the neighboring node 12 are different nodes in the same communication network. The first node 11 and the neighboring node 12 of the first node 11 can be connected to each other via wired or wireless communication. The first node 11 can be any node in the communication network, and the neighboring node 12 can be one or more.
[0057] Figure 1 The implementation scenario shown can be applied to a space-based network, which can also be called a satellite application network. The structure of the space-based network can be as follows: Figure 2 As shown, it includes multiple satellite routers and multiple gateways. The communication between the two end-side gateways depends on the satellite routers in the middle to forward the messages. Figure 1 The first node 11 shown may be any satellite router in the space-based network, and the neighboring node 12 may be one or more satellite routers located in the node domain of the first node 11 .
[0058] Accordingly, Figure 1 The scenario shown can also be applied to ground networks. The structure of ground networks can refer to Figure 3 The ground network may include multiple network devices, such as multiple routers, and the multiple network devices can route each other and forward messages. Figure 1 The first node 11 shown may be any network device in a ground network, and the neighboring node 12 may be one or more network devices located in the node domain of the first node 11 .
[0059] See also Figure 4 , shows a flow chart of a method for verifying forwarding information, which can be applied to Figure 1In the implementation scenario shown, the method includes but is not limited to the following S401 to S403.
[0060] S401, the first node obtains forwarding information to be verified, the forwarding information to be verified includes the address of the destination network segment and the address of the next hop from the first node to the destination network segment, the next hop is a neighboring node within the node domain of the first node, the node domain of the first node includes the first node and at least one neighboring node of the first node.
[0061] The first node may also be referred to as a local node, and the forwarding information to be verified may be any one of the at least one forwarding information locally stored by the first node. Optionally, the forwarding information to be verified may be the forwarding information of the neighboring node in the at least one forwarding information locally stored by the first node. Therefore, before the first node obtains the forwarding information to be verified, the neighboring nodes of the first node may be determined first. The embodiment of the present application does not limit the method for the first node to determine the neighboring nodes. Exemplarily, the first node may send an invitation message to join the node domain of the first node to multiple second nodes belonging to the same network as the first node. Among them, the node domain may also be referred to as a virtual node domain (virtual node domain, VND).
[0062] The first node sends an invitation message to each second node in the network to which the first node belongs to join the node domain of the first node, so as to notify each second node of the need for the first node to establish a node domain. Each second node may be a node adjacent to the first node, or a node that has established an interior gateway protocol (IGP) neighbor relationship with the first node, or a node that has established a border gateway protocol (BGP) neighbor relationship with the first node. The invitation message may include information such as an identifier (ID) and an Internet protocol (IP) address of the first node that can identify the identity or location of the first node.
[0063] After receiving the invitation information sent by the first node, each second node can accept the invitation or reject the invitation. If the second node accepts the invitation of the first node, it means that the second node agrees to join the node domain of the first node, and the second node can send an acceptance message to the first node to accept the invitation. The first node can determine at least one second node as at least one neighbor node based on the acceptance information received from at least one second node, that is, the first node can establish the node domain of the first node with the at least one second node. In the node domain of the first node, the first node is the master node and at least one second node is a member node.
[0064] For example, see Figure 5 , shows a schematic diagram of a first node and at least one neighboring node in a satellite communication scenario. In the satellite communication scenario, the first node and at least one neighboring node are both satellites located at Figure 5 The satellite in the middle position is the first node, and the four satellites around the first node are all neighbor nodes of the first node. The first node and at least one neighbor node can communicate based on an inter-satellite channel, that is, a communication link between satellites. For example, the first node can send an invitation message to the four surrounding satellites based on the inter-satellite channel, and the four surrounding satellites can also send an acceptance message to the first node based on the inter-satellite channel. Based on this, the first node can establish a node domain of the first node with the four surrounding satellites, and the four satellites around the first node can become four neighbor nodes in the node domain of the first node.
[0065] The first node establishes a node domain of the first node with at least one neighboring node, so that the first node and at least one neighboring node can reach an information exchange agreement. For neighboring nodes in the node domain that agree to enter the first node, the first node can ensure that the message forwarded to the neighboring node is forwarded according to the correct forwarding path corresponding to the correct forwarding information. For a second node in the node domain that does not agree to enter the first node, it is difficult for the first node to ensure the forwarding correctness of the message forwarded to the second node.
[0066] After the first node determines at least one neighboring node, the first node can obtain the forwarding information to be verified. In a possible implementation, the at least one forwarding information locally stored by the first node can be autonomously calculated and stored by the first node. Exemplarily, the first node can receive at least one link state information sent by at least one neighboring node, and determine at least one forwarding information based on the at least one link state information; the first node selects the forwarding information to be verified from the at least one forwarding information.
[0067] Optionally, the first node may receive at least one link state information corresponding to at least one neighboring node by receiving link state information sent by each node in the network. Wherein, one link state information may include information of two nodes at both ends of a link and link parameters, the node information may be, for example, the address of the node and the ID of the node, and the link parameters include but are not limited to the length of the link, that is, the distance between the two end nodes of the link, the validity of the link, and the type of the link.
[0068] After each node in the communication network completes configuration, update or restart, it can send the link state information it has to each other. Each node determines the best path between each two nodes based on the received link state information. This process can be called convergence. The best path between two nodes can be the path with the best performance among multiple paths between the two nodes, for example, it can be the shortest path, the path with the least loss, or the path with the least delay. During the convergence process, the first node receives at least one link state information sent by at least one neighboring node, and stores the at least one link state information in the link state database (link state data base, LSDB) of the first node. The first node can determine the best path from the first node to the destination network segment and its corresponding forwarding information based on the link state information received from the neighboring node. Optionally, the first node can integrate the determined at least one forwarding information into a forwarding information base (FIB), and store the forwarding information table in the database of the first node, or directly store at least one forwarding information in the database of the first node.
[0069] For example, see Figure 6 , shows a schematic diagram of a forwarding information table. Each row in the forwarding information table (except the header) is a table entry or an entry, and each table entry represents a forwarding information. Each forwarding information includes the address of a destination network segment and the address of the next hop corresponding to the destination network segment. For example, forwarding information 1 includes the address of the destination network segment as 12.0.0.0 / 24, and the address of the next hop from the first node to the destination network segment is 12.0.0.1. Optionally, the forwarding information may also include interface information corresponding to the next hop. The interface information may be, for example, Figure 6 The Ethernet interface ID shown in . Optionally, in addition to dynamic routes, the forwarding information table may also include non-dynamic routes, and the non-dynamic routes may be sent by each neighboring node to the first node, or may be generated autonomously by the first node, which is not limited in the embodiments of the present application.
[0070] After the first node determines at least one forwarding information, it can traverse the at least one forwarding information, determine each forwarding information as the forwarding information to be verified in turn, and verify each forwarding information in turn. The verification process of each forwarding information can refer to the Figure 4 The method flow shown will not be repeated one by one.
[0071] S402, the first node obtains a first distance between the next hop and the destination network segment, a second distance between the first node and the next hop, and a third distance between the first node and the destination network segment in a database of the first node based on the address of the next hop and the address of the destination network segment.
[0072] In a possible implementation, before obtaining the first distance between the next hop and the destination network segment, the second distance between the first node and the next hop, and the third distance between the first node and the destination network segment in the database of the first node, the first node may first store the determined first distance, second distance, and third distance in the database. Exemplarily, the first node may obtain distance data corresponding to the next hop, the distance data including the distance between the next hop and the destination network segment and the first check code corresponding to the distance between the next hop and the destination network segment.
[0073] The embodiment of the present application does not limit the manner in which the first node obtains the distance data corresponding to the next hop. For example, in the initialization phase, that is, the phase in which the first node obtains each distance data for the first time, each neighbor node in at least one neighbor node can send the distance data between each neighbor node and the destination network segment to the first node, wherein the distance data between each neighbor node and the destination network segment includes the distance data corresponding to the next hop in the forwarding information to be verified. The distance data includes the distance between the neighbor node and the destination network segment, and the verification code corresponding to the distance. The distance data can also be referred to as distance information, which can be calculated by the dynamic routing protocol module of each node.
[0074] Each neighbor node can send the distance data between each neighbor node and the destination network segment to the first node after completing the convergence. Since each node can determine the shortest path between each neighbor node and the destination network segment during the convergence, the distance between the neighbor node and the destination network segment can be the shortest distance on the shortest path between the neighbor node and the destination network segment. The check code corresponding to the distance is the data calculated based on the distance, for example, it can be a cyclic redundancy check (CRC) or message digest algorithm (MD)5 code corresponding to the distance.
[0075] The distance data sent by each neighbor node to the first node includes not only the distance between each neighbor node and the destination network segment, but also the verification code corresponding to the distance, so that when the first node receives the distance data, it can verify the distance based on the verification code to ensure that the distance data received by the first node is correct.
[0076] In one possible implementation, since the distance from any neighbor node to part of the destination network segment calculated according to the incremental shortest path tree (SPT) calculation principle may not have changed at each convergence, any neighbor node can also adopt an incremental method to inform the first node of the distance from any neighbor node to the changed part of the destination network segment and the corresponding check code.
[0077] After receiving the distance data sent by each neighbor node and ensuring that the distance data is correct, the first node can copy each distance data and keep it in the database of the first node. Afterwards, the first node can reply to each neighbor node with a message of successful reception to inform each neighbor node that the first node has successfully received the distance data.
[0078] After the initialization is completed, in the distance data pipeline verification stage, that is, the stage of verifying each distance data in turn, the first node can start the verification thread and regularly verify each distance data stored in the database. For example, the first node matches the distance between the next hop and the destination network segment and the first verification code, and determines the first distance based on the first result obtained by the matching verification. Different first results can correspond to different situations. The following takes situation A1 and situation A2 as examples to illustrate different situations.
[0079] In case A1, the first result is that the distance between the next hop and the destination network segment matches the first check code. In this case, the distance between the next hop and the destination network segment is determined as the first distance.
[0080] If the distance between the next hop and the destination network segment matches the first check code corresponding to the distance, it means that the distance between the next hop and the destination network segment stored by the first node and the first check code corresponding to the distance are correct, and the distance can be directly determined as the first distance.
[0081] In case A2, the first result is that the distance between the next hop and the destination network segment does not match the first check code. In this case, it can be considered that at least one of the distance between the next hop and the destination network segment stored by the first node and the first check code is wrong. The first node can send a data request to the next hop, requiring the next hop to resend the distance data.
[0082] The first node receives update data sent by the next hop based on the data request, and the update data includes a first update distance between the next hop and the destination network segment and a first update check code corresponding to the first update distance. Optionally, the first node can verify the first update distance and the first update check code, and when the first update distance matches the first update check code, the first update distance can be determined as the first distance.
[0083] After determining the first distance, the first node may store the first distance in a distance information table of the database, so that when verifying the forwarding information, the first node can obtain the first data in the database. The format of the distance information table can refer to Figure 7 , each row of the distance information table (except the header) is a table item or an entry of the distance information table, and an entry of the distance information table represents a distance data. A distance data may include the next hop IP address, the IP address of the destination network segment, and the shortest distance between the next hop and the destination network segment corresponding to the distance data. Among them, each entry whose next hop IP address is 0.0.0.0 represents the distance data from the first node to each destination network segment, and each entry whose next hop is not 0.0.0.0 represents the distance data from the neighbor node to which the next hop IP address belongs to each destination network segment. The shortest distance between a node and a destination network segment may be a relative distance determined based on the shortest path from the node to the destination network segment, and the format type of the shortest distance may be an integer (integer, int) type. Optionally, the distance information table may also include whether the route corresponding to each distance data is a dynamic route.
[0084] Before obtaining the first distance between the next hop and the destination network segment, the second distance between the first node and the next hop, and the third distance between the first node and the destination network segment in the database of the first node, the first node may also store the determined second data and the third data in the database. Exemplarily, the first node may calculate the distance between the first node and the first network segment and the second check code corresponding to the distance between the first node and the first network segment based on at least one link state information, and the first network segment includes the next hop or the destination network segment.
[0085] After completing convergence, the first node can autonomously calculate the distance between the first node and each destination network segment and the corresponding check code based on at least one link status information, that is, obtain various distance data corresponding to the first node, including the distance between the first node and the next hop and its corresponding second check code, or the distance between the first node and the destination network segment and its corresponding second check code.
[0086] In addition, the first node may also send down and store each distance data corresponding to the first node in the database of the first node, and send each distance data corresponding to the first node to each neighboring node, so as to realize synchronization and sharing of distance data between the first node and each neighboring node.
[0087] Afterwards, the first node may perform a matching check on the distance between the first node and the first network segment and the second check code, and determine the sixth distance based on a second result obtained by the matching check.
[0088] If the second result is that the distance between the first node and the first network segment matches the second check code, the first node can directly determine the distance between the first node and the first network segment as the sixth data. If the second result is that the distance between the first node and the first network segment does not match the second check code, in this case, the first node can recalculate the second updated distance between the first node and the first network segment and the second updated check code corresponding to the second updated distance according to at least one link state information.
[0089] Since the distance between the first node and the first network segment and the corresponding second check code are obtained by autonomous calculation by the first node, if the distance between the first node and the first network segment does not match the second check code, the first node can recalculate and send the second updated distance and the second updated check code according to the link state information. If the second updated distance matches the second updated check code, the first node can determine the second updated distance as the sixth distance.
[0090] Then the first node can store the sixth distance in a database, for example, in a distance information table of the database. Wherein, when the first network segment is the next hop, the sixth distance is the second distance, and when the first network segment is the destination network segment, the sixth distance is the third distance.
[0091] S403: The first node verifies the correctness of the address of the next hop included in the forwarding information to be verified according to the first distance, the second distance and the third distance.
[0092] Based on the foregoing, it can be known that the forwarding information to be verified includes the address of the destination network segment and the address of the next hop from the first node to the destination network segment, and the forwarding information to be verified can be the forwarding information corresponding to the shortest path from the first node to the destination network segment, so the forwarding information to be verified can identify the shortest path from the first node to the destination network segment, and the address of the next hop in the forwarding information to be verified can be the address of the next hop of the first node on the shortest path. Therefore, the third distance between the first node and the destination network segment should be equal to the sum of the second distance between the first node and the next hop and the first distance between the next hop and the destination network segment.
[0093] Different results may be obtained by checking the forwarding information to be checked according to the first distance, the second distance and the third distance. The following takes case B1 and case B2 as examples to illustrate the process and results of the check.
[0094] In case B1, the sum of the first distance and the second distance is equal to the third distance. In this case, it can be determined that the address of the next hop included in the forwarding information to be verified is correct.
[0095] That is, if the first distance, the second distance, and the third distance satisfy the following formula (1), the forwarding information to be verified can be considered correct. In formula (1), dist(,) represents the shortest distance between two nodes or between a node and a network segment or between a network segment and a network segment, R represents the local node, that is, the first node, N represents the node where the next hop address is located, and D represents the destination network segment.
[0096] dist(R,D)=dist(R,N)+dist(N,D) (1)
[0097] If the forwarding information to be verified stored in the first node is correct, when the first node receives a message corresponding to the destination network segment, it can be ensured that the message is forwarded along a correct path according to the forwarding information to be verified stored in the first node.
[0098] In case B2, the sum of the first distance and the second distance is not equal to the third distance. In this case, it is determined that the address of the next hop included in the forwarding information to be verified is wrong.
[0099] If the sum of the first distance and the second distance is not equal to the third distance, that is, the above formula (1) cannot be satisfied, it can be considered that the address of the next hop in the forwarding information to be verified is not the address of the next hop on the shortest path from the first node to the destination network segment. Optionally, the first node can update the erroneous forwarding information to be verified.
[0100] Exemplarily, after the first node determines that the address of the next hop included in the forwarding information to be verified is incorrect, it can obtain the fourth distance between the alternative next hop and the destination network segment and the fifth distance between the first node and the alternative next hop based on the address of the destination network segment. The alternative next hop is a neighboring node in the node domain of the first node other than the next hop.
[0101] The alternative next hop may also be referred to as a candidate next hop, and the alternative next hop may be determined by the first node according to at least one forwarding information. For example, the first node may determine a node that can directly communicate with the first node as the alternative next hop of the first node, or the first node may determine the next hop of the first node on each path between the first node and the destination network segment as the alternative next hop. Optionally, the alternative next hop may be a neighbor node that has joined the node domain of the first node.
[0102] The first node may determine an alternative next hop information table according to the determined addresses of the alternative next hops. Alternatively, the first node may determine an alternative next hop information table corresponding to each destination network segment according to the addresses of the alternative next hops corresponding to the destination network segment.
[0103] Exemplarily, the first node may traverse each next hop in the candidate next hop information table, and determine the fourth distance between each candidate next hop and the destination network segment and the fifth distance between the first node and each candidate next hop in the distance information table according to the address of each candidate next hop.
[0104] After determining the fourth distance and the fifth distance, the first node performs verification based on the third distance, the fourth distance and the fifth distance. If the sum of the fourth distance and the fifth distance is equal to the third distance, the first node can replace the address of the next hop in the forwarding information with the address of the alternative next hop. That is, if the alternative next hop is used to replace the next hop in the forwarding information to be verified, the above formula (1) can be established, which means that the replaced forwarding information is correct.
[0105] Afterwards, the first node may delete the entry corresponding to the forwarding information to be verified in the forwarding information table, and store the replaced forwarding information in the forwarding information table of the database. Optionally, if there is an alternative next hop N+ that can make the above formula (1) true, the forwarding information obtained by replacing the one alternative next hop may be stored in the forwarding information table. If there are multiple alternative next hops that can make the above formula (1) true, the forwarding information obtained by replacing all or part of the multiple alternative next hops may be stored in the forwarding information table.
[0106] Below, the complete process of the method for verifying forwarding information provided in the embodiment of the present application is illustrated by way of example.
[0107] See also Figure 8 , shows a flow chart of a method for interactively completing the verification of forwarding information. The local node is the first node to execute the verification method for forwarding information, and the method can be completed by the local node interacting with its neighboring nodes.
[0108] by Figure 8 Taking the local node and neighbor node 1 in as an example, the local node and each neighbor node can verify and correct the forwarding information based on the node domain invitation and reply, distance data notification and reply, and local request to resend distance data and reply.
[0109] For details, please refer to Fig. 9 A flow chart of another interactive verification method for completing forwarding information is shown. First, the local node sends an invitation message to the second node around the local node to join the node domain of the local node, inviting the second node to join the node domain. If the second node agrees to join the node domain, the second node sends an acceptance message to the local node, joins the node domain of the local node, and becomes a neighbor node of the local node.
[0110] For example, in Fig.10In the schematic diagram of the configuration of the communication network shown in FIG. 1 , node R is a local node. Node R invites four nodes, namely, node a, node e, node c and node b, to join the node domain of node R. All four nodes agree to join the node domain of node R, and the four nodes become neighbor nodes of node R. The scope of the node domain of node R can be as follows: Fig.10 As shown by the dotted line in , node R is the master node of the node domain.
[0111] After completing convergence, the local node can receive the link status information sent by each node in the communication network, and generate the following information based on the link status information sent by each node: Figure 6 According to the forwarding information table, the local node can determine the candidate next hop information table. For example, Fig.10 The node R in Figure 6 The candidate next hop information table determined by the forwarding information table shown can be as follows Fig.11 shown.
[0112] Continue to refer Fig. 9 After the neighbor node completes routing convergence, the neighbor node sends the distance from the neighbor node to the destination network segment and the check code to the local node based on the convergence triggering neighbor node. Optionally, the neighbor node can send the distance data and the check code by sending a distance data message or a distance information message to the local node. After receiving the distance data and the check code sent by the neighbor node, the local node replies to the neighbor node that it has been successfully received. The local node can also determine the distance and the check code between the local node and each destination network segment based on the link status information. The local node can store the distance data sent by the neighbor node and the distance data calculated autonomously by the local node in the database of the first node.
[0113] Afterwards, the local node performs a regular check on each distance data in the database and its corresponding check code. If it is found that the distance included in the distance data sent by the neighbor node does not match the check code, the local node is triggered to request the neighbor node to resend the distance data that does not match the check code. The neighbor node sends the updated distance data and the corresponding check code to the local node, so that the local node can start the inspection and automatic correction of the forwarding information table according to the matching distance and check code.
[0114] The process of local node inspection and automatic correction of forwarding information table can be found in Fig.12 Exemplarily, the total number of entries in the forwarding information table may be n (an integer greater than zero), and the number of candidate next hops may be m (an integer greater than zero).
[0115] After the inspection starts, let i=1, the local node reads the i-th row entry of the forwarding information table from the database, and determines whether the i-th row entry is a dynamic route. If the i-th row entry is a non-dynamic route, the entry may not be verified, or the verification method for forwarding information provided in the embodiment of the present application may not be used for verification. If the i-th row entry is a dynamic route, it may be determined whether the next hop in the i-th row entry satisfies the determination formula, which is the formula (1) described above.
[0116] If the i-th row entry satisfies the judgment formula, the i-th row entry can be considered correct, that is, the forwarding information corresponding to the i-th row entry is correct. Then, i+=1 can be set, that is, i=i+1, so that the value of i increases by 1. If the increased i is greater than n, it means that each entry in the forwarding information table has been verified, and the inspection of the forwarding information table can be ended. If the increased i is not greater than n, it means that there are still unverified entries in the forwarding information table, and the next entry can be verified.
[0117] If the i-th row entry does not satisfy the judgment formula, it can be considered that the i-th row entry is wrong, that is, the forwarding information corresponding to the i-th row entry is wrong. Then, j=1 can be set to find the j-th alternative next hop in the alternative next hop information table. Substitute the alternative next hop into the judgment formula to determine whether the alternative next hop satisfies the judgment formula. If the j-th alternative next hop can satisfy the judgment formula, the address of the next hop in the i-th row entry can be replaced with the address of the j-th alternative next hop. If the j-th alternative next hop cannot satisfy the judgment formula, j+=1 can be set, that is, j=j+1, so that the value of j increases by 1. If the increased j is greater than m, it means that the judgment of each alternative next hop in the alternative next hop information table has been completed, and the selection of the alternative next hop can be ended, and the above operations corresponding to the increased i and subsequent operations can be repeated. If the increased j is not greater than m, it means that there are still alternative next hops available for selection in the alternative next hop information table, and the next alternative next hop can be substituted into the judgment formula to determine whether the next alternative next hop satisfies the judgment formula.
[0118] For example, Fig.10 The correct next hop for the destination network segment 12.0.5.0 / 24 (between 12.0.5.2 / 24 and 12.0.5.1 / 24) is 12.0.6.2, but the next hop currently recorded in the forwarding information table is as follows: Figure 612.0.3.2 as shown. When the entry is traversed during the inspection process, it is found that dist(R,N)+dist(N,D)=10+12=22, and dist(R,D)=11. It can be seen that when 12.0.3.2 is substituted into formula (1), formula (1) does not hold, and the forwarding information can be considered to be wrong. In this case, the alternative next hops in the alternative next hop information table are traversed, and it is found that the address of the alternative next hop 12.0.6.2 satisfies dist(R,N)+dist(N,D)=6+5=11=dist(R,D). Therefore, the next hop of the entry in the forwarding information table can be updated from 12.0.3.2 to 12.0.6.2, completing the verification and correction of the entry.
[0119] The first node can periodically Fig.12 The steps shown verify each piece of forwarding information in the forwarding information table, and correct the erroneous forwarding information through an asynchronous process to ensure the correctness of each piece of forwarding information in the forwarding information table.
[0120] Below, by comparing with related technologies, the beneficial effects of the forwarding information verification method provided in the embodiment of the present application are explained.
[0121] See also Fig.13 , shows a flow chart of a related technology for verifying forwarding information. The related technology is a mechanism for continuously reconciling the forwarding information table. The forwarding information is the forwarding information calculated by the traceable dynamic routing protocol module, Fig.13 The n in the forwarding information table represents the total number of entries.
[0122] After the related technology starts the check, let i=1, read the i-th row entry in the forwarding information table, and determine whether the entry is a dynamic route. In the case of a dynamic route, determine whether the hop forwarding information matches the checksum. If they match, it means that the forwarding information is correct. If they do not match, request the dynamic routing protocol module in the device to recalculate the forwarding information of the entry, and based on the recalculated result, update the next hop information in the i-th row entry in the forwarding information table.
[0123] When requesting a device to recalculate the forwarding information of a certain entry, the related technology needs to re-call the dynamic protocol calculation main process module to recalculate the forwarding information and checksum, which is not only time-consuming and computing-intensive, but also unable to solve the problem of forwarding information errors caused by problems with the dynamic protocol calculation module itself, and the problem of forwarding information errors caused by errors in intermediate calculation results due to environmental influences, and has poor reliability.
[0124] The embodiment of the present application determines multiple distances corresponding to the forwarding information, namely the first distance, the second distance and the third distance, and determines whether the address of the next hop in the forwarding information is correct based on the multiple distances, rather than only verifying based on the forwarding information itself, so that the verification result is more reliable.
[0125] Specifically, the embodiment of the present application provides an automatic error checking technology and automatic correction technology for the next hop in the forwarding information calculated by the dynamic routing protocol using the distance information from the neighbor node to the destination network segment. During the inspection process, the unmatched entries can be judged by the distance information, and the matching alternative next hop can be searched from the alternative next hop information table to obtain the correct forwarding information, avoiding the need to re-acquire the forwarding information using the existing process. Among them, using the distance information obtained from other devices to verify the local forwarding information can improve reliability.
[0126] The embodiment of the present application can also promptly correct the forwarding information with calculation errors and storage anomalies, thereby improving the reliability of the forwarding information. Compared with the need to re-acquire the correct next hop data from the routing calculation process after an error occurs in the forwarding information table, the embodiment of the present application only needs to maintain the correctness of the distance data to directly obtain the correct next hop from the data plane. Even if the distance from the required neighbor node to the destination network segment is wrong, since it is impossible to find a correctly matched next hop, the device will maintain the original calculation result and will not cause additional errors. Through such a heterogeneous computing verification design, the reliability of forwarding information can be greatly improved.
[0127] In addition, the present application also provides a virtual node domain technology. Compared with the local calculation of the distance information from the neighboring node to the destination network segment, the reliability is increased. Because when an SPT calculation error occurs locally, the other distance information calculated is also likely to be wrong. Due to the different hardware and environments of different devices (first node and neighboring node), the probability of errors occurring simultaneously in the SPT information calculated by the neighboring node and the SPT information calculated by the first node is very low. Therefore, by using the distance data from each neighboring node to the destination network segment, the reliability of the automatic error check of the next hop in the forwarding information calculated by the dynamic routing protocol is improved.
[0128] The above describes the forwarding information verification method provided by the embodiment of the present application. Corresponding to the above method, the embodiment of the present application also provides a forwarding information verification device. The device is applied to the first node. The device is used to Fig.14 The modules shown above perform the Figure 4 The verification method of the forwarding information executed by the first node. Fig.14 As shown, the verification device for forwarding information provided in the embodiment of the present application includes the following modules.
[0129] The acquisition module 1401 is used to obtain forwarding information to be verified, and the forwarding information to be verified includes the address of the destination network segment and the address of the next hop from the first node to the destination network segment, the next hop is a neighboring node within the node domain of the first node, and the node domain of the first node includes the first node and at least one neighboring node of the first node; the acquisition module 1401 is also used to obtain, in the database of the first node, a first distance between the next hop and the destination network segment, a second distance between the first node and the next hop, and a third distance between the first node and the destination network segment based on the address of the next hop and the address of the destination network segment; the verification module 1402 is used to verify the correctness of the address of the next hop included in the forwarding information to be verified based on the first distance, the second distance and the third distance.
[0130] In a possible implementation, the verification module 1402 is configured to determine that the address of the next hop included in the forwarding information to be verified is correct when the sum of the first distance and the second distance is equal to the third distance.
[0131] In a possible implementation, the verification module 1402 is configured to determine that the address of the next hop included in the forwarding information to be verified is wrong when the sum of the first distance and the second distance is not equal to the third distance.
[0132] In one possible implementation, the acquisition module 1401 is also used to obtain, based on the address of the destination network segment, a fourth distance between the alternative next hop and the destination network segment and a fifth distance between the first node and the alternative next hop, where the alternative next hop is a neighbor node other than the next hop in the node domain of the first node; based on the sum of the fourth distance and the fifth distance being equal to the third distance, the address of the next hop in the forwarding information is replaced with the address of the alternative next hop.
[0133] In one possible implementation, the device also includes a sending module, which is used to send invitation information to multiple second nodes to join the node domain of the first node, and the multiple second nodes belong to the same network as the first node; the acquisition module 1401 is also used for the first node to determine at least one second node as at least one neighbor node based on receiving acceptance information sent by at least one second node.
[0134] In one possible implementation, the acquisition module 1401 is also used to obtain the distance data corresponding to the next hop, the distance data including the distance between the next hop and the destination network segment and the first check code corresponding to the distance between the next hop and the destination network segment; the check module 1402 is also used to match the distance between the next hop and the destination network segment and the first check code, and determine the first distance based on the first result obtained from the matching check; and store the first distance in a database.
[0135] In a possible implementation, the verification module 1402 is configured to determine the distance between the next hop and the destination network segment as the first distance when the first result is that the distance between the next hop and the destination network segment matches the first verification code.
[0136] In one possible implementation, the verification module 1402 is used to send a data request to the next hop when the first result is that the distance between the next hop and the destination network segment does not match the first verification code; receive update data sent by the next hop based on the data request, the update data including the first update distance between the next hop and the destination network segment and the first update verification code corresponding to the first update distance; and determine the first update distance as the first distance when the first update distance matches the first update verification code.
[0137] In a possible implementation, the acquisition module 1401 is used to receive at least one link state information sent by at least one neighboring node; determine at least one forwarding information based on the at least one link state information; and select the forwarding information to be verified from the at least one forwarding information.
[0138] In one possible implementation, the acquisition module 1401 is also used to calculate the distance between the first node and the first network segment and the second check code corresponding to the distance between the first node and the first network segment based on at least one link state information, the first network segment including the next hop or the destination network segment; the check module 1402 is also used to match the distance between the next hop and the first network segment and the second check code, and determine the sixth distance based on the second result obtained by the matching check; the sixth distance is stored in the database, when the first network segment is the next hop, the sixth distance is the second distance, and when the first network segment is the destination network segment, the sixth distance is the third distance.
[0139] In one possible implementation, the verification module 1402 is used to recalculate the second updated distance between the first node and the first network segment and the second updated verification code corresponding to the second updated distance based on at least one link state information when the second result is that the distance between the first node and the first network segment does not match the second verification code; and the first node determines the second updated distance as the sixth distance when the second update distance matches the second update verification code.
[0140] It should be understood that the above Fig.14 The device provided has the following beneficial effects when achieving its function: Figure 4 The provided forwarding information verification method has the same beneficial effects, which will not be repeated here. Fig.14When the device provided realizes its functions, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0141] See also Fig.15 , shows a schematic diagram of the structure of a forwarding information verification device provided by an embodiment of the present application. The device includes a link state database module, a destination network segment distance calculation module, a forwarding information calculation module, a distance database module from a local node and a neighboring node to a destination network segment, a forwarding management module and an interface card.
[0142] Among them, the link state database module is used to store the received link state message, and the link state message includes the link state information sent by each node to the first node. The destination network segment distance calculation module can calculate the distance from the first node to each destination network segment based on the link state message sent by the link state database module, including the distance from the first node to the next hop. The destination network segment distance calculation module can also calculate the corresponding check code based on the distance between the first node and the destination network segment. The destination network segment distance calculation module stores the calculated distance data in the distance database module from the local node and the neighboring node to the destination network segment. The forwarding information calculation module can calculate each forwarding information based on the link state message sent by the link state database module, and generate a forwarding information table.
[0143] The distance database module of the local node and the neighbor node to the destination network segment also stores the distance data in the distance data message sent by each neighbor node. The distance data message can be received by the interface card. When the message enters the device through the interface card, it will be determined whether the message is a protocol message for transmitting distance data. If it is a protocol message for transmitting distance data, the distance data is retained in the memory of the interface board and the main control board respectively ( Fig.16 The distance database module of the local node and neighbor node to the destination network segment is shown in FIG. If it is another type of message, the original process of the message is processed according to the first node. In addition, the interface card can also be used to send messages to other devices. The forwarding management module can perform regular inspection and correction on the forwarding information, and can also check the distance data stored in the device.
[0144] See also Fig.16 , Fig.16A structural schematic diagram of another forwarding information verification device provided in an embodiment of the present application is shown. The hardware of the forwarding information verification device is carried by a hardware platform. A main control board and an interface board are arranged on the hardware platform, wherein the main control board includes a processor and a memory, and the interface board includes a processor, a memory and an interface card. The main control board can also be called a main processing unit (MPU) or a route processing card (route processor card), and the processor of the main control board is used to call the program instructions in the main control board memory to perform corresponding functions and generate forwarding information and distance data. The interface board can also be called a line processing unit card (LPU), a line card (line card) or a service board, and the processor of the interface board is used to call the program instructions in the memory of the interface board to receive and send messages, and regularly inspect and correct the forwarding information table.
[0145] It is worth noting that there may be one or more main control boards, which may include a primary main control board and a backup main control board. There may be one or more interface boards. The stronger the data processing capability of the verification device that forwards information, the more interface boards are provided. There may also be one or more interface cards on the interface board.
[0146] In an exemplary embodiment, a forwarding information verification system is provided, the system comprising a first node and a neighboring node, the first node is used to perform Figure 4 The method executed by the first node in the Figure 4 The method executed by the neighbor nodes in the.
[0147] In an exemplary embodiment, a computer program (product) is provided, the computer program (product) comprising: a computer program code, when the computer program code is executed by a computer, the computer executes Figure 4 The method shown.
[0148] In an exemplary embodiment, a computer-readable storage medium is provided, the computer-readable storage medium storing a program or instruction, when the program or instruction is executed on a computer, the computer executes the above Figure 4 The method shown.
[0149] In an exemplary embodiment, a chip is provided, including a processor for calling and executing instructions stored in a memory, so that a computer equipped with the chip executes Figure 4 The method shown.
[0150] In an exemplary embodiment, another chip is provided, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected through an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the computer equipped with the chip executes Figure 4 The method shown.
[0151] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, 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 program instructions are loaded and executed on a computer, the process or function described in this 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 site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk), etc.
[0152] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limitation on the quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another element.
[0153] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0154] The term "at least one" in this application means one or more, and the term "multiple" in this application means two or more, for example, multiple second devices means two or more second devices. The terms "system" and "network" are often used interchangeably herein.
[0155] It should be understood that the terms used in the description of the various examples herein are only for describing specific examples and are not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0156] It should also be understood that the term "and / or" used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or" is a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0157] It should also be understood that the terms "if" and "if" may be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, the phrases "if it is determined that ..." or "if [a stated condition or event] is detected" may be interpreted to mean "upon determining that ..." or "in response to determining that ..." or "upon detecting [a stated condition or event]" or "in response to detecting [a stated condition or event]," depending on the context.
[0158] The above description is only an embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for verifying forwarding information, characterized in that: The method comprises: The first node obtains forwarding information to be verified, where the forwarding information to be verified includes an address of a destination network segment and an address of a next hop from the first node to the destination network segment, where the next hop is a neighboring node in a node domain of the first node, and the node domain of the first node includes the first node and at least one neighboring node of the first node; Based on the address of the next hop and the address of the destination network segment, obtaining in a database of the first node a first distance between the next hop and the destination network segment, a second distance between the first node and the next hop, and a third distance between the first node and the destination network segment; The correctness of the address of the next hop included in the forwarding information to be verified is verified according to the first distance, the second distance and the third distance.
2. The method according to claim 1, characterized in that The verifying, according to the first distance, the second distance, and the third distance, whether the address of the next hop included in the forwarding information to be verified is correct includes: When the sum of the first distance and the second distance is equal to the third distance, it is determined that the address of the next hop included in the forwarding information to be verified is correct.
3. The method according to claim 1, characterized in that The verifying, according to the first distance, the second distance, and the third distance, whether the address of the next hop included in the forwarding information to be verified is correct includes: When the sum of the first distance and the second distance is not equal to the third distance, it is determined that the address of the next hop included in the forwarding information to be verified is wrong.
4. The method according to claim 3, characterized in that After determining that the address of the next hop included in the forwarding information to be verified is wrong, the method further includes: According to the address of the destination network segment, obtain a fourth distance between the candidate next hop and the destination network segment and a fifth distance between the first node and the candidate next hop, wherein the candidate next hop is a neighbor node in the node domain of the first node except the next hop; Based on the sum of the fourth distance and the fifth distance being equal to the third distance, the address of the next hop in the forwarding information is replaced with the address of the candidate next hop.
5. The method according to any one of claims 1 to 4, characterized in that: Before obtaining the forwarding information to be verified, the method further includes: Sending invitation information to multiple second nodes to join the node domain of the first node, wherein the multiple second nodes and the first node belong to the same network; Based on receiving acceptance information sent by at least one second node, the at least one second node is determined as the at least one neighbor node.
6. The method according to any one of claims 1 to 5, characterized in that: Before acquiring, in the database of the first node, the first distance between the next hop and the destination network segment, the second distance between the first node and the next hop, and the third distance between the first node and the destination network segment, the method further includes: Acquire distance data corresponding to the next hop, the distance data including the distance between the next hop and the destination network segment and a first check code corresponding to the distance between the next hop and the destination network segment; Performing a matching check on the distance between the next hop and the destination network segment and the first check code, and determining the first distance based on a first result obtained by the matching check; The first distance is stored in the database.
7. The method according to claim 6, characterized in that The determining the first distance based on the first result obtained by the matching verification includes: When the first result indicates that the distance between the next hop and the destination network segment matches the first verification code, the distance between the next hop and the destination network segment is determined as the first distance.
8. The method according to claim 6, characterized in that The determining the first distance based on the first result obtained by the matching verification includes: When the first result indicates that the distance between the next hop and the destination network segment does not match the first verification code, sending a data request to the next hop; receiving update data sent by the next hop based on the data request, the update data including a first update distance between the next hop and the destination network segment and a first update check code corresponding to the first update distance; In a case where the first update distance matches the first update verification code, the first update distance is determined as the first distance.
9. The method according to any one of claims 1 to 8, characterized in that: The obtaining of the forwarding information to be verified includes: Receiving at least one link state information sent by the at least one neighboring node; Determining at least one forwarding information according to the at least one link state information; The forwarding information to be verified is selected from the at least one forwarding information.
10. The method according to claim 9, characterized in that Before acquiring, in the database of the first node, the first distance between the next hop and the destination network segment, the second distance between the first node and the next hop, and the third distance between the first node and the destination network segment, the method further includes: Calculate, according to the at least one link state information, a distance between the first node and a first network segment and a second check code, wherein the first network segment includes the next hop or the destination network segment; Performing a matching check on the distance between the next hop and the first network segment and the second check code, and determining a sixth distance based on a second result obtained from the matching check; The sixth distance is stored in the database. When the first network segment is the next hop, the sixth distance is the second distance. When the first network segment is the destination network segment, the sixth distance is the third distance.
11. The method according to claim 10, characterized in that The determining the sixth distance based on the second result obtained by the matching verification includes: If the second result indicates that the distance between the first node and the first network segment does not match the second check code, recalculate a second updated distance between the first node and the first network segment and a second updated check code corresponding to the second updated distance according to the at least one link state information; In a case where the second update distance matches the second update check code, the second update distance is determined as the sixth distance.
12. A verification device for forwarding information, characterized in that: The device comprises: an acquisition module, configured to acquire forwarding information to be verified, wherein the forwarding information to be verified includes an address of a destination network segment and an address of a next hop from a first node to the destination network segment, wherein the next hop is a neighboring node in a node domain of the first node, and the node domain of the first node includes the first node and at least one neighboring node of the first node; The acquisition module is further used to acquire, in a database of the first node, a first distance between the next hop and the destination network segment, a second distance between the first node and the next hop, and a third distance between the first node and the destination network segment based on the address of the next hop and the address of the destination network segment; A verification module is used to verify the correctness of the address of the next hop included in the forwarding information to be verified according to the first distance, the second distance and the third distance.
13. A verification device for forwarding information, characterized in that: The device includes a processor, which is coupled to a memory; the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor, so that the forwarding information verification device implements the forwarding information verification method described in any one of claims 1-11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and the instruction is loaded and executed by the processor to implement the forwarding information verification method described in any one of claims 1-11.
15. A computer program product, characterized in that The computer program product includes a computer program or instructions, and the computer program or instructions are executed by a processor to enable a computer to implement the forwarding information verification method according to any one of claims 1 to 11.