Method and apparatus for managing distributed forwarding table, and computer device and storage medium
In the distributed forwarding table management, it is ensured that all business boards switch and mount routing entries uniformly after receiving the forwarding table creation instruction, which solves the packet loss problem caused by asynchronous updates and improves network stability.
Patent Information
- Application Number
- PCT/CN2023/142022
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-23
- Filing Date
- 2023-12-26
- Publication Date
- 2024-10-31
AI Technical Summary
In distributed non-network forwarding equipment, due to differences in the CPU processing performance and routing table update efficiency of each service board, the forwarding table update is asynchronous, which in turn causes packet loss and affects network stability.
After receiving the forwarding table creation instruction from the main control board, the target service board creates the first forwarding table and sends a creation completion message. The agent board sends a switching instruction after confirming that all service boards have been created to ensure that all service boards are created at the same time. Switch and attach routing entries to the first forwarding table to avoid asynchronous updates.
It effectively alleviates the asynchronous update of the forwarding table, reduces packet loss, and improves network stability.
Smart Images

Figure CN2023142022_31102024_PF_FP_ABST
Abstract
Description
Distributed forwarding table management method, device, computer equipment and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on April 23, 2023, with application number 202310461529.2 and invention name “Management method, device, computer equipment and storage medium for distributed forwarding tables”. The entire contents of the Chinese patent application are incorporated herein by reference. Technical Field
[0003] The embodiments of the present application relate to the field of network communication technology, and in particular to a method, apparatus, computer device, and storage medium for managing a distributed forwarding table. Background Art
[0004] In recent years, network communication technology has rapidly developed, and business deployments have gradually increased. In the field of big data, packet loss is particularly sensitive, and network stability is highly required. Therefore, maintaining network stability during network changes is particularly important. IP (Internet Protocol) forwarding is typically deployed using traffic load balancing, where N routes share a next-hop LDSH (Load Share) group, or N routes share the same next hop, with the next-hop link aggregated using a trunk (switch) group.
[0005] In related technologies, if a new link is added or a route on a link is revoked, the control plane will recalculate the forwarding table and synchronize it to the forwarding plane, and then notify the forwarding plane to update the forwarding table for each route entry.
[0006] However, in distributed non-network forwarding equipment, the table writing operations between each service board are independent of each other. Due to differences in the CPU (Central Processing Unit) processing performance, board type, and routing table addition / deletion efficiency of each service board, asynchronous table entry updates between boards are inevitable. During message forwarding, if the service board in the inbound direction completes the forwarding table update first, but the service board in the outbound direction has not completed the forwarding table update, the table lookup will fail, resulting in packet loss, which will affect traffic transmission.
[0007] Summary of the Invention
[0008] The embodiments of the present application provide a distributed forwarding table management method, apparatus, computer device, and storage medium, which can effectively alleviate the problem of asynchronous forwarding table updates, reduce packet loss, and improve network stability. The technical solution is as follows:
[0009] On the one hand, a method for managing a distributed routing table is provided, which is executed by a target business board, wherein the target business board is any one of N business boards, and the N business boards correspond to the same main control board, where N is a positive integer. The method includes: upon receiving a routing table creation instruction sent by the main control board, creating a first routing table based on the routing table creation instruction; after the creation of the first routing table is completed, sending a creation completion message to the agent board; after receiving a switching instruction sent by the agent board, switching the routing entries in the routing group from the second routing table and attaching them to the first routing table; the switching instruction is sent by the agent board after receiving the creation completion messages sent by N business boards; the routing entries in the routing group point to the same next hop.
[0010] On the other hand, a method for managing a distributed routing table is provided, which is executed by an agent board and includes: receiving creation completion messages sent by N business boards, the creation completion messages indicating that the corresponding business boards have completed the creation of a first routing table; the first routing table is created by the business board based on a routing table creation instruction received from a main control board; the N business boards correspond to the same main control board, and N is a positive integer; a switching instruction is sent to the N business boards to instruct the N business boards to switch the routing entries in their respective corresponding routing groups from the second routing table and attach them to the first routing table; the routing entries in the routing group point to the same next hop.
[0011] On the other hand, a distributed routing table management device is provided, which is applied to a target business single board, wherein the target business single board is any one of N business single boards, and the N business single boards correspond to the same main control board, where N is a positive integer. The device includes: a routing table creation module, which creates a first routing table based on the routing table creation instruction when receiving the routing table creation instruction sent by the main control board; a first message sending module, which is used to send a creation completion message to the agent board after the creation of the first routing table is completed; a routing table switching module, which is used to switch the routing entries in the routing group from the second routing table and attach them to the first routing table when receiving the switching instruction sent by the agent board; the switching instruction is sent by the agent board after receiving the creation completion messages sent by N business single boards; the routing entries in the routing group point to the same next hop.
[0012] In one possible implementation, the device also includes: a second message sending module, which sends a hang-up completion message to the proxy board after switching the routing entries in the routing group from the second forwarding table and hanging them on the first forwarding table; a table lookup module, which is used to perform a routing table lookup based on the first forwarding table when receiving an update completion message sent by the proxy board and having a routing requirement; the update completion message is sent by the proxy board after receiving the hang-up completion messages sent by N service boards.
[0013] In one possible implementation, the device also includes: a deletion module, which is used to delete the second forwarding table after switching the routing entry of the routing group from the second forwarding table and attaching it to the first forwarding table, if it is determined that the second forwarding table is in a state where there is no routing entry attached, after receiving the update completion message sent by the proxy board.
[0014] In one possible implementation, the forwarding table switching module includes: an identifier acquisition submodule, used to obtain the switching identifier corresponding to the routing group; an identifier attachment submodule, used to attach the switching identifier to each routing entry in the routing group; and a value setting submodule, used to set the value of the switching identifier of each routing entry in the routing group from a first value to a second value when receiving a switching instruction sent by the proxy board; the first value corresponds to the forwarding equivalence class resources of the second forwarding table, and the second value corresponds to the forwarding equivalence class resources of the first forwarding table.
[0015] On the other hand, a distributed routing table management device is provided, which is applied to an agent board, and the device includes: a first message receiving module, used to receive creation completion messages sent by N business boards, the creation completion messages indicating that the corresponding business boards have completed the creation of a first routing table; the first routing table is created by the business board based on a routing table creation instruction received from a main control board; the N business boards correspond to the same main control board, and N is a positive integer; an instruction sending module, used to send a switching instruction to the N business boards, so as to instruct the N business boards to switch the routing entries in their respective corresponding routing groups from the second routing table and attach them to the first routing table; the routing entries in the routing group point to the same next hop.
[0016] In one possible implementation, the device also includes: a second message receiving module, used to receive attachment completion messages sent by N business single boards, the attachment completion message indicating that the corresponding business single board has completed the forwarding table switching operation, and the forwarding table switching operation is an operation of switching the routing entries in the routing group from the second forwarding table and attaching them to the first forwarding table; a message sending module, used to send an update completion message to the N business single boards to instruct the N business single boards to perform routing table lookup based on the first forwarding table; the update completion message is used to indicate that all N business single boards have completed the forwarding table switching operation.
[0017] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the above-mentioned distributed forwarding table management method.
[0018] On the other hand, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the above-mentioned distributed forwarding table management method.
[0019] On the other hand, a computer program product is provided, which includes at least one computer program, and the computer program is loaded and executed by a processor to implement the distributed forwarding table management method provided in the various optional implementations above.
[0020] The technical solution provided by this application may have the following beneficial effects:
[0021] The distributed forwarding table management method provided in the embodiment of the present application is as follows: after receiving the forwarding table creation instruction sent by the main control board and completing the creation of the first forwarding table based on the forwarding table creation instruction, the service single board sends a creation completion message to the proxy board; after confirming the receipt of the creation completion message sent by all service single boards, the proxy board sends a switching instruction to all service single boards to instruct each service single board to start the forwarding table switching attachment operation at the same time; by setting the proxy board, the start time of the forwarding table switching attachment operation of each service single board is controlled, which can ensure that a unified forwarding table switching is performed after all service single boards have completed the creation operation of the first forwarding table, avoiding the problem of asynchronous table entry switching caused by different table writing efficiency between the service single boards, effectively alleviating the situation of asynchronous update of the forwarding table, reducing packet loss, and improving network stability.
[0022] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0024] FIG1 shows a schematic diagram of a distributed forwarding table management system corresponding to a distributed forwarding table management method provided by an exemplary embodiment of the present application;
[0025] FIG2 shows a flow chart of a method for managing a distributed forwarding table according to an exemplary embodiment of the present application;
[0026] FIG3 is a schematic diagram showing a packet loss period provided by an exemplary embodiment of the present application;
[0027] FIG4 shows a flow chart of a method for managing a distributed forwarding table according to an exemplary embodiment of the present application;
[0028] FIG5 is a schematic diagram showing a forwarding table switching process provided by an exemplary embodiment of the present application;
[0029] FIG6 shows a flow chart of a distributed load sharing management method provided by an exemplary embodiment of the present application;
[0030] FIG7 shows a block diagram of a distributed forwarding table management device provided by an exemplary embodiment of the present application;
[0031] FIG8 shows a block diagram of a distributed forwarding table management device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0032] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0033] In a network built with distributed architecture products, there are multiple routes pointing to the same next hop or the same next hop group, and the next hop export backups are on different boards. When a route is withdrawn on a network path or the network is expanded to broadband, in order to avoid packet loss caused by table lookup failures due to asynchronous updates of table entries between service boards, an embodiment of the present application provides a method for managing a distributed routing table. Figure 1 shows a schematic diagram of a distributed routing table management system corresponding to a distributed routing table management method provided by an exemplary embodiment of the present application. As shown in Figure 1, the distributed routing table management system may include a main control board 110, N service boards 120, and an agent board 130.
[0034] The main control board 110 corresponds to the control plane and is responsible for updating and interacting with routing protocols, as well as calculating routes. By controlling and managing the operation of various protocols, the router or switch can accurately understand the devices, links, and running protocols of the entire network, and can promptly detect and adjust when network changes occur. The service board 120 corresponds to the forwarding plane and is responsible for forwarding IP data packets. It can be used to receive, decapsulate, encapsulate, and look up routing tables to forward data. A communication connection is established between the main control board 110 and each service board 120 to instruct the forwarding plane to forward IP packets.
[0035] The proxy board 130 may be the main control board 110 , or may be a service board with information receiving and sending functions. When the proxy board 130 is not the main control board 110 , as shown in FIG1 , the proxy board 130 may establish communication connections with N service boards 120 .
[0036] Based on the distributed forwarding table management system shown in FIG1 , FIG2 shows a flow chart of a distributed forwarding table management method shown in an exemplary embodiment of the present application. The distributed forwarding table management method can be executed by a target service single board. The target service single board is any one of the N service single boards shown in FIG1 . The N service single boards correspond to the same main control board, and N is a positive integer. As shown in FIG2 , the distributed forwarding table management method can include the following steps:
[0037] Step 210: When receiving the forwarding table creation instruction sent by the main control board, create a first forwarding table based on the forwarding table creation instruction.
[0038] The forwarding table creation instruction is sent by the main control board to each service board after the main control board revokes or republishes the route on a certain link, or recalculates and forms a new forwarding table when a new link is added, instructing each service board to create a new forwarding table locally based on the forwarding table creation instruction, that is, the first forwarding table; the forwarding table creation instruction contains relevant information of the new forwarding table.
[0039] The forwarding table in the embodiment of the present application may be an LDSH (Load Share) table.
[0040] Step 220: After the first forwarding table is created, a creation completion message is sent to the proxy board.
[0041] In the embodiment of the present application, the proxy board may be the main control board, or the proxy board may be a service board with information receiving and sending functions, and the proxy board is used to coordinate the operation process between N service boards.
[0042] The creation completion message is used to indicate that the target service board has completed local creation of the first forwarding table.
[0043] The forwarding table of a service board includes inbound routing entries and outbound encapsulation tables. Updates to the forwarding table on each service board include updating routing entries and encapsulation tables in a chip-by-chip order (for example, in the order of unit0, unit1, unit2, etc.). Due to differences in CPU performance, board type (number of switching chips), and routing table addition / deletion efficiency among various service boards, table writing efficiency among various service boards varies. Therefore, the time it takes for various service boards to send creation completion messages to the proxy board varies.
[0044] Step 230, after receiving the switching instruction sent by the proxy board, the routing entries in the routing group are switched from the second forwarding table and attached to the first forwarding table; the switching instruction is sent by the proxy board after receiving the creation completion message sent by N service boards; the routing entries in the routing group point to the same next hop.
[0045] The next hop pointed to by the routing entries in the routing group can be a single next hop or a next hop group. A single next hop corresponds to one forwarding path, while a next hop group corresponds to multiple forwarding paths.
[0046] After confirming receipt of the creation completion message from all service boards, the proxy board sends a switching instruction to N service boards, instructing the N service boards to simultaneously start switching the routing entries in the routing group from the second forwarding table and attaching them to the first forwarding table. The process of switching the routing entries in the routing group from the second forwarding table and attaching them to the first forwarding table is the process of updating the routing table: the correspondence between the routing entries in the routing group and the second forwarding table is switched to a correspondence between the routing entries in the routing group and the first forwarding table. When forwarding messages through the routing entries in the routing group, the process of determining the message forwarding route by querying the information in the second forwarding table is changed to determining the message forwarding route by querying the information in the first forwarding table. The service boards can update the routing table by switching the forwarding table, and the actual routing is unaware of the switching process.
[0047] In traffic forwarding, the switching chip selects a forwarding path by querying the routing table in the inbound direction, and re-encapsulates the message by querying the encapsulation table in the outbound direction. When the inbound board and the outbound board corresponding to the traffic forwarding are different, if the outbound board has not completed the encapsulation table update when the inbound board completes the routing table update, it will cause the table lookup to fail and packet loss. Figure 3 shows a schematic diagram of a packet loss period provided by an exemplary embodiment of the present application. As shown in Figure 3, during the distributed routing table update process, the table write completion time t2 of the new LDSH table on the service board A is later than the table write completion time t1 of the new LDSH table on the service board B, thereby causing the start update time of the ROUTE table on the service board A to be later than the start update time of the new ROUTE table on the service board B. If there is a traffic transmission demand between t1 and t2, for example, with the service board B as the inbound board and the service board A as the outbound service board, the table lookup failure and packet loss will occur. Through the setting of the proxy board in the embodiment of the present application, after determining that the creation of the forwarding table has been completed in each business board, each business board can be instructed to synchronously start switching and connecting the forwarding table, which can effectively avoid the situation where the forwarding table creation process of different business boards is out of sync, and reduce the time difference in forwarding table update between different business boards.
[0048] In summary, the distributed routing table management method provided by the embodiment of the present application is that after the service single board receives the routing table creation instruction sent by the main control board and completes the creation of the first routing table based on the routing table creation instruction, it sends a creation completion message to the proxy board; after confirming that it has received the creation completion message sent by all service single boards, the proxy board sends a switching instruction to all service single boards to instruct each service single board to start the routing table switching attachment operation at the same time; by setting the proxy board, the start time of the routing table switching attachment operation of each service single board is controlled, which can ensure that a unified routing table switching is performed after all service single boards have completed the creation operation of the first routing table, avoiding the problem of asynchronous table entry switching caused by different table writing efficiency between the service single boards, and can effectively alleviate the situation of asynchronous update of the routing table, reduce packet loss, and improve network stability.
[0049] Based on the embodiment shown in Figure 2, it can be known that the proxy board can alleviate the problem of asynchronous update of the forwarding table caused by the different table writing efficiency of the N business boards by sending a switching instruction to instruct the N business boards to perform the switching and attaching operation of the forwarding table after confirming that the N business boards have completed the creation of the first forwarding table. However, there is still a problem of asynchronous switching and attaching operation of the forwarding table. As shown in Figure 3, the update completion time t4 of the ROUTE table on the business board A is later than the update completion time t3 of the ROUTE table on the business board B. If there is a traffic transmission demand in the stage of asynchronous update of the ROUTE table, that is, between t3 and t4, due to the asynchronous update of the ROUTE table, table lookup failure and packet loss will also occur. Therefore, based on the embodiment shown in FIG2 , the present application further optimizes the solution. FIG4 shows a flow chart of a distributed forwarding table management method shown in an exemplary embodiment of the present application. The distributed forwarding table management method can be executed by a target service board. The target service board is any one of the N service boards shown in FIG1 . The N service boards correspond to the same main control board, and N is a positive integer. As shown in FIG4 , the distributed forwarding table management method may include the following steps:
[0050] Step 410: When receiving the forwarding table creation instruction sent by the main control board, create a first forwarding table based on the forwarding table creation instruction.
[0051] In an embodiment of the present application, the main control board sends a forwarding table creation instruction to each service board through a MUX interface (Multiple Interface Layer, a protocol layer and forwarding layer communication interface).
[0052] Step 420: After the first forwarding table is created, a creation completion message is sent to the proxy board.
[0053] Optionally, the target service board sends a creation completion message to the proxy board in a unicast manner; unicast means that there is one sender and one receiver in the data transmission process, and the unicast address is the address of the receiver interface.
[0054] Step 430, after receiving the switching instruction sent by the proxy board, the routing entries in the routing group are switched from the second forwarding table and attached to the first forwarding table; the switching instruction is sent by the proxy board after receiving the creation completion message sent by N service boards; the routing entries in the routing group point to the same next hop.
[0055] Optionally, the proxy board responds to N service boards in a multicast manner, and triggers each service board to switch the forwarding table by sending a multicast message (i.e., a switching instruction) to the N service boards; wherein, multicast means that there is a sender and a group of designated receivers in the data transmission process, and the multicast address is the address of a group of interfaces.
[0056] In an embodiment of the present application, in the service board, the receiving end of the multicast message and the receiving end of the MUX message (i.e., the forwarding table creation instruction) are respectively registered in different tasks. Therefore, the process of the service board receiving the multicast message will not block the message processing of the service board.
[0057] Because each service board has prepared a new next-hop path (ie, has completed the creation of the first forwarding table) before switching the forwarding table, the routing table can be updated by synchronously switching the next hops of each service board.
[0058] In an embodiment of the present application, the first forwarding table may indicate one or more next-hop paths; the second forwarding table may indicate one or more next-hop paths; schematically, in a scenario where a new link is added to expand broadband capacity, if the second forwarding table indicates one next-hop path, the route may be attached to the first forwarding table indicating multiple next-hop paths; in a scenario where a route is withdrawn on a certain link, the second forwarding table indicates multiple next-hop paths, the route may be attached to the first forwarding table, and the number of next-hop paths indicated by the first forwarding table is less than the number of next-hop paths indicated by the second forwarding table; in a scenario where a link is replaced, the number of next-hop paths indicated by the second forwarding table is consistent with the number of next-hop paths indicated by the first forwarding table, but there are differences between the next-hop paths, etc. The above scenarios are merely illustrative, and the first forwarding table and the second forwarding table may be set differently based on different actual needs, and the present application does not impose any restrictions on this.
[0059] Step 440: After the routing entries in the routing group are switched from the second forwarding table and attached to the first forwarding table, a attach completion message is sent to the proxy board.
[0060] The attach completion message is used to indicate that the corresponding service board has completed the switching attach operation of the forwarding table. Since different service boards require different times for switching attach operations, the time when the agent board receives the attach completion messages sent by each service board is also different.
[0061] Step 450: upon receiving the update completion message sent by the proxy board and having routing requirements, perform routing table lookup based on the first forwarding table; the update completion message is sent by the proxy board after receiving the attachment completion messages sent by N service boards.
[0062] After the proxy board confirms that it has received the attachment completion message sent by N business boards, it indicates that the switching attachment operation of the forwarding table has been completed in each business board, and the forwarding tables in each business board are consistent. Therefore, if there is a routing requirement at this time, a routing table lookup based on the first forwarding table can obtain the inbound business board and the outbound business board, so that the traffic flows in from the inbound business board and flows out from the outbound business board based on the routing information obtained from the lookup.
[0063] By setting up a proxy board and counting the completion time of the forwarding table switching and attachment of each business single board, it can be ensured that the routing requirements are processed only after all business single boards have completed the switching and attachment operation from the second forwarding table to the first forwarding table. This avoids the problem of asynchronous table entry updates caused by different table switching efficiencies between business single boards, avoids packet loss caused by asynchronous forwarding table switching and attachment, and improves network stability.
[0064] In one possible implementation, after switching the routing entry of the routing group from the second forwarding table and attaching it to the first forwarding table, if it is determined that the second forwarding table is in a state of no routing entry attached, the second forwarding table is deleted after receiving an update completion message sent by the proxy board.
[0065] Each forwarding table may correspond to different routes. Schematically, before the forwarding table is switched, the second forwarding table corresponds to the second routing group in addition to the first routing group. After the routing entries in the first routing group are switched from the second forwarding table and attached to the first forwarding table, the routes in the second routing group are still attached to the second forwarding table, that is, the second forwarding table is in a state of having routing entries attached. At this time, there is no need to delete the second forwarding table.
[0066] If before the forwarding table is switched, the second forwarding table corresponds to only one routing group, after the routing entries in the routing group are switched from the second forwarding table and attached to the first forwarding table, the second forwarding table is in a state of no routing entries attached. After receiving the update completion message sent by the agent board, the target service board can delete the second forwarding table to reduce redundancy.
[0067] To sum up, the distributed routing table management method provided by the embodiment of the present application is that after the service single board receives the routing table creation instruction sent by the main control board and completes the creation of the first routing table based on the routing table creation instruction, it sends a creation completion message to the proxy board; after the proxy board confirms the receipt of the creation completion message sent by all service single boards, it sends a switching instruction to all service single boards to instruct each service single board to start the routing table switching attachment operation at the same time; after completing the switching attachment operation of the routing table, it sends an attachment completion message to the proxy board; after confirming the receipt of the attachment completion message sent by all service single boards, the proxy board sends an update completion message to all service single boards to indicate that the routing table update between each service single board is completed, and when there is a routing requirement, the routing table can be looked up based on the first routing table. By setting up a proxy board, the start time of the forwarding table switching and attachment operations of each business single board is controlled, and the routing requirements are processed based on the first forwarding table after ensuring that the forwarding table switching and attachment operations of each business single board are all completed. This avoids the problem of asynchronous table entry updates caused by differences in table writing efficiency and table entry switching efficiency between each business single board, avoids asynchronous updates of the forwarding table, reduces packet loss, and improves network stability.
[0068] In another possible implementation, the forwarding table can be quickly switched by the service board to shorten the time for switching and attaching the forwarding table in each service board, thereby reducing the asynchronous time difference between the service boards and achieving synchronous update of the table entries between the service boards. Based on this, in the embodiment shown in Figure 2 or Figure 3, upon receiving the switching instruction sent by the proxy board, the process of switching and attaching the routing entry in the routing group from the second forwarding table to the first forwarding table can be implemented as follows:
[0069] Get the switching identifier corresponding to the routing group;
[0070] Attach the switch identifier to each routing entry in the routing group;
[0071] When receiving the switching instruction sent by the proxy board, the value of the switching identifier of each routing entry in the routing group is set from the first value to the second value; the first value corresponds to the forwarding equivalence class resources of the second forwarding table, and the second value corresponds to the forwarding equivalence class resources of the first forwarding table.
[0072] The routing group has a routing group identifier (group id), which is generated by the main control board based on the protocol entity, protocol type, and other information of the dynamic route. The main control board synchronizes the routing group identifier to the service board. The service board applies for a switching identifier based on the routing group identifier and attaches it to the corresponding routing entry. Attaching the switching identifier to the corresponding routing entry can mean adding a switching identifier suffix to the routing identifier of each routing entry. For example, if the switching identifier is a failover id, after attaching the failover id to the routing entry, the routing identifier of the routing entry is changed from route to route->failover id. The value of the switching identifier is used to indicate the forwarding equivalence class resources of the corresponding forwarding table.
[0073] The routing entries in the same routing group have routes with the same routing attributes and share a next-hop group, corresponding to the same routing group identifier. When the next-hop LDSH table member changes, the routing group identifier will not change unless the next-hop LDSH table is deleted.
[0074] When the service board switches the proxy board, the forwarding path is switched by changing the value of the switch identifier, that is, the forwarding table is switched. Schematically, Figure 5 shows a schematic diagram of the forwarding table switching process provided by an exemplary embodiment of the present application. As shown in Figure 5, a routing group in a certain network contains 3 routing entries, and the routing identifiers are route1, route2 and route3. After the failover id is attached to the routing entry, the routing identifier is changed to route1->failover id, route2->failover id and route3->failover id; if the value of the switch identifier corresponding to the second forwarding table is 0, and the value of the switch identifier corresponding to the first forwarding table is 1, then as shown in Figure 5, before the forwarding table is switched, the routing identifiers of each routing entry in the routing group are route1->failover 0, route2->failover 0 and route3->failover 0, attached to the second forwarding table, calling the forwarding equivalence class resource fec1 of the second forwarding table; after receiving the forwarding table creation instruction sent by the main control board, the service board creates the first forwarding table based on the forwarding table creation instruction. At this time, the routing entries in the routing group have not yet been attached to the first forwarding table. After receiving the switching instruction sent by the agent board, the routing identifier of each routing entry in the routing group is changed to route1->failover 1, route2->failover 1 and route3->failover 1. Then, the routing entry can be switched from the second forwarding table and attached to the first forwarding table, calling the forwarding equivalence class resource fec2 of the first forwarding table, thereby realizing rapid update of the routing table.
[0075] Through the above method, when the service single board switches the forwarding table, the forwarding table can be quickly switched by unifying the numerical value of the switching identifier. This process takes a very short time, which can greatly reduce the time spent on the forwarding table switching process of each service single board, thereby realizing the synchronous update of the table items between each service single board.
[0076] Optional, actual application scenarios include adding an LDSH table and updating the LDSH table. When adding an LDSH table, a new forwarding FEC resource must be requested and then the new LDSH table must be mapped to the forwarding FEC resource. When updating the LDSH table, the forwarding FEC resource mapped by the updated LDSH table already exists and can be directly used. The FEC resource is the forwarding resource mapped based on the next hop of the service board or the next hop LDSH table. The FEC index is the corresponding forwarding index. The FEC table content includes the forwarding egress index and the egress encapsulation table index.
[0077] Optionally, after each service board completes the rapid switching of the forwarding table, when it is confirmed that the second forwarding table is in a state of no routing entry being attached, the second forwarding table is deleted.
[0078] It should be noted that during the application process, the proxy board is used to confirm that the switching and hooking operations of the forwarding tables in each business board have been completed to achieve synchronous updates of table items between each business board. This method and the business board's rapid switching of the forwarding tables to achieve synchronous updates of table items between each business board can be applied separately or in combination. This application does not impose any restrictions on this.
[0079] FIG6 shows a flow chart of a distributed load sharing management method provided by an exemplary embodiment of the present application. As shown in FIG6 , the distributed forwarding table management method may be executed by an agent board, which may be the agent board shown in FIG1 . As shown in FIG6 , the distributed forwarding table management method may include the following steps:
[0080] Step 610, receiving creation completion messages sent by N business boards, the creation completion messages indicating that the corresponding business boards have completed the creation of the first forwarding table; the first forwarding table is created by the business board based on the forwarding table creation instruction sent by the main control board; N business boards correspond to the same main control board, and N is a positive integer.
[0081] Step 620: Send a switching instruction to the N service boards to instruct the N service boards to switch the routing entries in their respective routing groups from the second forwarding table and attach them to the first forwarding table; the routing entries in the routing group point to the same next hop.
[0082] In a possible implementation, when the proxy board confirms that the switching and attaching operations of the forwarding tables in each service board have been completed to implement synchronous updating of table entries between the service boards, the method further includes:
[0083] Receive a hang completion message sent by N service boards, the hang completion message indicating that the corresponding service board has completed a forwarding table switching operation, the forwarding table switching operation is an operation of switching a routing entry in the routing group from the second forwarding table and hanging it on the first forwarding table;
[0084] An update completion message is sent to the N service boards to instruct the N service boards to perform routing table lookup based on the first forwarding table; the update completion message is used to indicate that the N service boards have completed the forwarding table switching operation.
[0085] The interaction between the proxy board and the service board can refer to the relevant content of the embodiment shown in Figure 2 or Figure 4, and will not be repeated here.
[0086] In summary, the distributed routing table management method provided by the embodiment of the present application is that after the service single board receives the routing table creation instruction sent by the main control board and completes the creation of the first routing table based on the routing table creation instruction, it sends a creation completion message to the proxy board; after confirming that it has received the creation completion message sent by all service single boards, the proxy board sends a switching instruction to all service single boards to instruct each service single board to start the routing table switching attachment operation at the same time; by setting the proxy board, the start time of the routing table switching attachment operation of each service single board is controlled, which can ensure that a unified routing table switching is performed after all service single boards have completed the creation operation of the first routing table, avoiding the problem of asynchronous table entry switching caused by different table writing efficiency between the service single boards, and can effectively alleviate the situation of asynchronous update of the routing table, reduce packet loss, and improve network stability.
[0087] FIG7 shows a block diagram of a distributed forwarding table management device provided by an exemplary embodiment of the present application. The device is applied to a target service board to implement all or part of the steps shown in the embodiment of FIG2 or FIG4 . The target service board is any one of N service boards, and the N service boards correspond to the same main control board, where N is a positive integer. The target service board is any one of N service boards, and the N service boards correspond to the same main control board, where N is a positive integer. The device includes:
[0088] The forwarding table creation module 710 creates a first forwarding table based on the forwarding table creation instruction when receiving the forwarding table creation instruction sent by the main control board;
[0089] A first message sending module 720 is configured to send a creation completion message to the proxy board after the creation of the first forwarding table is completed;
[0090] The routing table switching module 730 is used to switch the routing entries in the routing group from the second routing table and attach them to the first routing table when receiving the switching instruction sent by the proxy board; the switching instruction is sent by the proxy board after receiving the creation completion message sent by N service boards; the routing entries in the routing group point to the same next hop.
[0091] In a possible implementation, the apparatus further includes:
[0092] A second message sending module, after switching the routing entries in the routing group from the second forwarding table and attaching them to the first forwarding table, sends a attach completion message to the proxy board;
[0093] The table lookup module is used to perform routing table lookup based on the first forwarding table when receiving the update completion message sent by the proxy board and having routing requirements; the update completion message is sent by the proxy board after receiving the attachment completion messages sent by N service boards.
[0094] In a possible implementation, the apparatus further includes:
[0095] The deletion module is used to delete the second forwarding table after switching the routing entry of the routing group from the second forwarding table and attaching it to the first forwarding table. If it is determined that the second forwarding table is in a state of no routing entry being attached, the deletion module is used to delete the second forwarding table after receiving the update completion message sent by the proxy board.
[0096] In a possible implementation, the forwarding table switching module 730 includes:
[0097] An identification acquisition submodule, used to obtain a switching identification corresponding to the routing group;
[0098] An identifier attachment submodule, configured to attach the switching identifier to each routing entry in the routing group;
[0099] A numerical setting submodule is used to set the numerical value of the switching identifier of each routing entry in the routing group from a first numerical value to a second numerical value when receiving a switching instruction sent by the proxy board; the first numerical value corresponds to the forwarding equivalence class resources of the second forwarding table, and the second numerical value corresponds to the forwarding equivalence class resources of the first forwarding table.
[0100] In summary, in the distributed routing table management device provided by the embodiment of the present application, after the service single board receives the routing table creation instruction sent by the main control board and completes the creation of the first routing table based on the routing table creation instruction, it sends a creation completion message to the proxy board; after confirming that it has received the creation completion message sent by all service single boards, the proxy board sends a switching instruction to all service single boards to instruct each service single board to start the routing table switching attachment operation at the same time; by setting the proxy board, the start time of the routing table switching attachment operation of each service single board is controlled, which can ensure that a unified routing table switching is performed after all service single boards have completed the creation operation of the first routing table, avoiding the problem of asynchronous table entry switching caused by different table writing efficiency between the service single boards, and can effectively alleviate the situation of asynchronous update of the routing table, reduce packet loss, and improve network stability.
[0101] FIG8 shows a block diagram of a distributed forwarding table management device provided by an exemplary embodiment of the present application. The device is applied to an agent board to perform all or part of the steps of the embodiment shown in FIG6 . As shown in FIG6 , the device includes:
[0102] A first message receiving module 810 is configured to receive creation completion messages sent by N service boards, wherein the creation completion messages indicate that the corresponding service boards have completed creation of a first forwarding table; the first forwarding table is created by the service board based on a forwarding table creation instruction received from the main control board; the N service boards correspond to the same main control board, where N is a positive integer;
[0103] The instruction sending module 820 is used to send switching instructions to N service boards to instruct the N service boards to switch the routing entries in their corresponding routing groups from the second forwarding table and attach them to the first forwarding table; the routing entries in the routing groups point to the same next hop.
[0104] In a possible implementation, the apparatus further includes:
[0105] A second message receiving module is configured to receive attachment completion messages sent by N service boards, wherein the attachment completion messages indicate that the corresponding service boards have completed a forwarding table switching operation, wherein the forwarding table switching operation is an operation of switching a routing entry in a routing group from the second forwarding table to the first forwarding table;
[0106] The message sending module is used to send an update completion message to N service boards to instruct the N service boards to perform routing table lookup based on the first forwarding table; the update completion message is used to indicate that the N service boards have completed the forwarding table switching operation.
[0107] In summary, in the distributed routing table management device provided by the embodiment of the present application, after the service single board receives the routing table creation instruction sent by the main control board and completes the creation of the first routing table based on the routing table creation instruction, it sends a creation completion message to the proxy board; after confirming that it has received the creation completion message sent by all service single boards, the proxy board sends a switching instruction to all service single boards to instruct each service single board to start the routing table switching attachment operation at the same time; by setting the proxy board, the start time of the routing table switching attachment operation of each service single board is controlled, which can ensure that a unified routing table switching is performed after all service single boards have completed the creation operation of the first routing table, avoiding the problem of asynchronous table entry switching caused by different table writing efficiency between the service single boards, and can effectively alleviate the situation of asynchronous update of the routing table, reduce packet loss, and improve network stability.
[0108] In an exemplary embodiment, a computer device is provided, which can be implemented as a target device in the present application, or an external monitoring device, or a remote control device; the computer device includes a processor core memory, which stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement all or part of the steps of the above-mentioned distributed forwarding table management method.
[0109] In an exemplary embodiment, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement all or part of the steps in the above-mentioned distributed forwarding table management method. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0110] In an exemplary embodiment, a computer program product is also provided, which includes at least one computer program, which is loaded by a processor and executes all or part of the steps of the distributed forwarding table management method shown in any of the embodiments of Figures 2, 4, or 6.
[0111] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered merely as exemplary, and the true scope and spirit of the present application are indicated by the claims.
[0112] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for managing a distributed forwarding table, the method being executed by a target service board, the target service board being any one of N service boards, the N service boards corresponding to the same main control board, N being a positive integer, the method comprising: When receiving the forwarding table creation instruction sent by the main control board, creating a first forwarding table based on the forwarding table creation instruction; After the first forwarding table is created, sending a creation completion message to the proxy board; After receiving the switching instruction sent by the proxy board, the routing entries in the routing group are switched from the second forwarding table and attached to the first forwarding table; the switching instruction is sent by the proxy board after receiving the creation completion message sent by N service boards; the routing entries in the routing group point to the same next hop.
2. The method according to claim 1, wherein: The method further comprises: After switching the routing entries in the routing group from the second forwarding table and attaching them to the first forwarding table, sending an attachment completion message to the proxy board; When receiving the update completion message sent by the proxy board and there is a routing requirement, a routing table lookup is performed based on the first forwarding table; the update completion message is sent by the proxy board after receiving the attachment completion messages sent by N service boards.
3. The method according to claim 2, wherein: The method further comprises: After switching the routing entries of the routing group from the second forwarding table and attaching them to the first forwarding table, if it is determined that the second forwarding table is in a state of having no routing entries attached, the second forwarding table is deleted after receiving the update completion message sent by the proxy board.
4. The method according to claim 1, wherein: The step of switching the routing entries in the routing group from the second forwarding table and attaching them to the first forwarding table includes: Obtaining a switching identifier corresponding to the routing group; Hanging the switching identifier to each routing entry in the routing group; When receiving the switching instruction sent by the proxy board, the value of the switching identifier of each routing entry in the routing group is set from the first value to the second value; the first value corresponds to the forwarding equivalence class resource of the second forwarding table, and the second value corresponds to the forwarding equivalence class resource of the first forwarding table. Price resources.
5. A distributed load sharing management method, the method being executed by an agent board, the method comprising: Receiving creation completion messages sent by N service boards, wherein the creation completion messages indicate that the corresponding service boards have completed creation of the first forwarding table; The first forwarding table is created by the service board based on a forwarding table creation instruction received from the main control board; the N service boards correspond to the same main control board, and N is a positive integer; A switching instruction is sent to the N service boards to instruct the N service boards to switch the routing entries in their respective corresponding routing groups from the second forwarding table and attach them to the first forwarding table; the routing entries in the routing groups point to the same next hop.
6. The method according to claim 5, wherein: The method further comprises: Receiving attachment completion messages sent by N service boards, wherein the attachment completion messages indicate that the corresponding service boards have completed a forwarding table switching operation, wherein the forwarding table switching operation is an operation of switching a routing entry in a routing group from the second forwarding table and attaching it to the first forwarding table; An update completion message is sent to the N service boards to instruct the N service boards to perform routing table lookup based on the first forwarding table; the update completion message is used to indicate that the N service boards have completed the forwarding table switching operation.
7. A distributed forwarding table management device, the device is applied to a target service board, the target service board is any one of N service boards, the N service boards correspond to the same main control board, N is a positive integer, the device comprises: A forwarding table creation module, when receiving a forwarding table creation instruction sent by the main control board, creates a first forwarding table based on the forwarding table creation instruction; A first message sending module, used for sending a creation completion message to the proxy board after the first forwarding table is created; A routing table switching module is used to switch the routing entries in the routing group from the second routing table and attach them to the first routing table when receiving a switching instruction sent by the proxy board; the switching instruction is sent by the proxy board after receiving the creation completion message sent by N service boards; the routing entries in the routing group point to the same next hop.
8. A distributed forwarding table management device, the device is applied to an agent board, the device comprising: A first message receiving module, configured to receive creation completion messages sent by N service boards, wherein the creation completion messages indicate that the corresponding service boards have completed creation of the first forwarding table; The first forwarding table is created by the service board based on a forwarding table creation instruction received from the main control board; the N service boards correspond to the same main control board, and N is a positive integer; The instruction sending module is used to send switching instructions to N service boards to instruct the N service boards to switch the routing entries in their respective corresponding routing groups from the second forwarding table and attach them to the first forwarding table; the routing entries in the routing groups point to the same next hop.
9. A computer device, comprising a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the distributed forwarding table management method according to any one of claims 1 to 6.
10. A computer-readable storage medium, wherein at least one computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the distributed forwarding table management method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Routing table creation method, PE device, electronic device and storage medium
CN113746739A
Method and device for quickly switching links, electronic equipment and storage medium
CN115514702A
Routing path switching method and device, equipment, medium and router
CN115580575A
Route switching method, computing device and computer storage medium
CN115801667A
Relay device, network system, route switching method, and recording medium
US20110019539A1
