Peer-based routing atomization processing method and device, and electronic equipment

CN121309469BActive Publication Date: 2026-08-21NEW H3C TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511403888.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2026-08-21
Estimated Expiration
2045-09-28

AI Technical Summary

Technical Problem

这导致路由表项效率低、路由收敛期间流量分布不均匀等问题

Benefits of technology

[0008]本申请实施例还提供一种机器可读存储介质,该存储介质存储有计算机程序指令,当该计算机程序指令被执行时,能够实现如上方法的步骤。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121309469B_ABST
    Figure CN121309469B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a Peer-based route atomization processing method and device and electronic equipment. In the present application, when a neighbor interaction message sent by a peer is received, a mapping relationship between a next hop IP address of a to-be-synchronized route, all next hop interfaces from the device to the IP address, and a next hop group identifier NGID is established in advance, so that when the route is synchronized subsequently, a matched NGID is found based on the next hop IP address carried in each route, and only one route table item carrying the destination IP address of the route and the found NGID is issued, compared with issuing route table items for each interface in the related art, only one route table item is issued, which greatly improves the efficiency of route synchronization. Furthermore, an atomization operation of issuing forwarding items to multiple next hop interfaces is implemented, so that the issuing states of the multiple next hop interfaces remain consistent, inconsistent next hop combinations in the convergence process are avoided, and traffic skew during the convergence period is eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method, apparatus and electronic device for Peer-based routing atomication processing. Background Technology

[0002] In large networks (such as data center networks and carrier networks), routing devices exchange a large number of routes through routing protocols, such as the Border Gateway Protocol (BGP). When a routing device learns multiple routes from its peers, it needs to synchronize these routes to its local routing table and finally distribute them to the forwarding table of the forwarding chip to guide the forwarding of packets.

[0003] In existing routing and forwarding systems, routing tables are typically distributed interface-by-interface. When multiple equal-cost next hops exist (such as in Equal-cost multi-path routing (ECMP) scenarios), the control plane needs to generate and distribute routing entries separately for each next-hop interface. This leads to problems such as low efficiency of routing entries and uneven traffic distribution during route convergence. Summary of the Invention

[0004] In view of this, embodiments of this application provide a method, apparatus and electronic device for atomizing routing based on peers, so as to improve the efficiency of route delivery and avoid uneven traffic distribution during route convergence.

[0005] This application provides a peer-based routing atomicity processing method, which is applied to network devices and includes: For each peer of this device, based on each Internet Protocol IP address carried in the neighbor interaction message sent from the peer, obtain all next-hop interfaces from this device to that IP address; the neighbor interaction message carries the next-hop IP address of each of the N routes to be synchronized to this device; N is greater than or equal to 1; Based on the interface identifiers of all next-hop interfaces from this device to this IP address, generate a next-hop group identifier (NGID) that is bound to this IP address and all next-hop interfaces from this device to this IP address; Based on all the next-hop interfaces bound to the next-hop group identifier NGID, generate the NGID forwarding table entry corresponding to the next-hop group identifier NGID and record it in the NGID forwarding table; When a route update notification is received from the peer, for each of the N routes to be synchronized to this device carried in the route update notification, the next-hop IP address bound to the next-hop IP address is determined, and a new route forwarding table entry containing the following content is added to the routing table: the destination IP address of the route carried in the route update notification and the determined next-hop group identifier NGID. Based on the NGID forwarding table, determine all next-hop interfaces bound to the determined next-hop group identifier NGID; and atomically send forwarding entries containing the destination IP address of the route to each determined next-hop interface.

[0006] This application also provides a peer-based routing atomicity processing device, which is applied to a network device, and the device includes: The acquisition module is used to obtain, for each peer of this device, all next-hop interfaces from this device to each Internet Protocol IP address carried in the neighbor interaction message sent by the peer; the neighbor interaction message carries the next-hop IP address of each of the N routes to be synchronized to this device; N is greater than or equal to 1; The generation module is used to generate a next-hop group identifier (NGID) that is bound to the IP address and all next-hop interfaces from this device to the IP address, based on the interface identifiers of all next-hop interfaces from this device to the IP address. The first distribution module is used to generate NGID forwarding entries corresponding to the next-hop group identifier NGID based on all the next-hop interfaces bound to the next-hop group identifier NGID and record them in the NGID forwarding table; The routing synchronization module is used to, when receiving a routing update notification sent by the peer, determine the next-hop group identifier (NGID) that is bound to the next-hop IP address in each of the N routes to be synchronized to this device carried in the routing update notification, and add a new routing forwarding table entry containing the following content: the destination IP address of the route carried in the routing update notification and the determined next-hop group identifier (NGID). The second distribution module is used to determine all next-hop interfaces bound to the determined next-hop group identifier NGID based on the NGID forwarding table; and to atomically distribute forwarding entries containing the destination IP address of the route to each determined next-hop interface.

[0007] This application also provides an electronic device, including: a processor and a computer-readable storage medium for storing computer program instructions, wherein the computer program instructions, when executed by the computer-readable storage medium, cause the processor to perform the steps of the above method.

[0008] This application also provides a machine-readable storage medium storing computer program instructions that, when executed, enable the implementation of the steps described above.

[0009] As can be seen from the above technical solutions, in this embodiment, when receiving neighbor interaction messages sent by peers, a mapping relationship is established in advance between the next-hop IP address of the route to be synchronized, all next-hop interfaces from this device to that IP address, and the next-hop group identifier (NGID). This allows the matching NGID to be found based on the next-hop IP address carried in each synchronized route during subsequent route synchronization. Furthermore, only one routing table entry carrying the destination IP address of the route and the found NGID is sent for each route. Compared with the related technologies that send routing table entries interface by interface, this greatly improves the efficiency of route synchronization.

[0010] Furthermore, after generating the NGID, the corresponding NGID forwarding table entry for the NGID and the next-hop interface will be sent to the chip of this device. The NGID is used to associate a route with a group of next-hop interfaces, realizing the atomic operation of sending forwarding entries to multiple next-hop interfaces. This ensures that the sending status of multiple next-hop interfaces is consistent, avoids inconsistent next-hop combinations during the convergence process, eliminates traffic skew during the convergence period, and always ensures full-path load balancing. Attached Figure Description

[0011] Figure 1 A network architecture diagram provided for embodiments of this application; Figure 2 A flowchart illustrating the method provided in the embodiments of this application; Figure 3 A flowchart illustrating the method provided in the embodiments of this application; Figure 4 This is a schematic diagram of the device provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0012] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.

[0013] Before introducing the method provided in the embodiments of this application, let's first combine... Figure 1 The existing technical problems are explained: In existing Internet Protocol (IP) network routing and forwarding systems, routing table entries are typically distributed per interface (i.e., physical port). When multiple equal-cost next hops exist, such as in Equal-cost multi-path routing (ECMP) scenarios, the control plane needs to generate and distribute routing table entries separately for each next-hop interface. Furthermore, the control plane needs to program and distribute these entries to the forwarding table of the forwarding chip one by one.

[0014] See Figure 1 , Figure 1 The network architecture diagram provided in this application embodiment shows that network devices A, B, and C are peers of network device D. Network devices A, B, and C are also peers of network device E. When network device B learns service routes locally or synchronizes service routes learned from peer E to network device D, for each route, if multiple equal-cost paths (ECMP) exist in network device D, the routing table needs to maintain a separate routing table entry for each next-hop interface (i.e., routing table entries are distributed interface by interface). If a route synchronized by network device D determines that the next-hop interfaces are eth1, eth2, and eth3, then eth1, eth2, and eth3 are associated with eth1, eth2, and eth3 respectively in the routing table. Forwarding entries for eth1, eth2, and eth3 are then distributed to the forwarding chips respectively.

[0015] This presents the following problems: (1) The routing table entries are inefficient. They require maintaining an independent routing table entry for each next-hop interface, which occupies scarce resources such as ternary content addressable memory (TCAM) and consumes a lot of resources.

[0016] (2) During the route learning process, due to the difference in the completion time of each interface's learning (that is, the completion time of the above-mentioned forwarding entry to the forwarding chip), the interface that completes the learning first will immediately take on the forwarding task, resulting in concentrated traffic impact on a few interfaces, causing frequent oscillations in path forwarding.

[0017] (3) The convergence efficiency is low. It is necessary to wait for all next-hop interfaces to complete programming before load balancing can be achieved. During this period, traffic skew occurs. During the route convergence period, the next-hop combinations formed at different time points are inconsistent, causing frequent oscillations in the forwarding path.

[0018] (4) When there are many interfaces in a large-scale network, programming them one by one leads to a linear increase in convergence time and is sensitive to programming delay.

[0019] These problems are particularly prominent in large data center networks or SDN environments, severely impacting network convergence speed and bandwidth utilization.

[0020] Based on this, embodiments of this application provide a peer-based routing atomicity processing method, apparatus, and electronic device to solve the above-mentioned problems.

[0021] See Figure 2 , Figure 2 This is a flowchart illustrating the method provided in an embodiment of this application. As one embodiment, the executing entity of this method can be a network device, such as a switch or router.

[0022] like Figure 2 As shown, the process may include the following steps: S201, for each peer of this device, based on each Internet Protocol IP address carried in the neighbor interaction message sent from the peer, obtain all next-hop interfaces from this device to that IP address; the neighbor interaction message carries the next-hop IP address of each of the N routes to be synchronized to this device; N is greater than or equal to 1.

[0023] In this embodiment, for each peer of this device, the device listens for BGP OPEN messages or Open Shortest Path First (OSPF) Hello messages sent by that peer. The IP address carried in the BGP OPEN message or OSPF Hello message is obtained from the message.

[0024] It should be noted that in this embodiment, when the peer sends a BGP OPEN message or an OSPF Hello message, it adds the next-hop IP address of the route to be synchronized. The route to be synchronized can be a route learned by the peer itself, or a route learned by the peer from other peers of the peer. Here, other peers refer to: remote peers among the peers of this device that are different from and not belonging to this device. The next-hop IP address of the route to be synchronized may be the device IP address of the peer, or it may be the next-hop IP address in the original route passed from other peers of the peer, depending on the type of BGP.

[0025] If it is the Internal Border Gateway Protocol (IBGP), the next-hop IP address carried in the BGP OPEN message for the route to be synchronized may be the device IP address of the peer. If it is the External Border Gateway Protocol (EBGP), the next-hop IP address carried in the BGP OPEN message for the route to be synchronized may be the device IP address of the peer.

[0026] Reference Figure 1 As shown, network device B sends a BGP OPEN message or an OSPF Hello message to network device D. The message carries the next-hop IP addresses of N routes to be synchronized. These routes to be synchronized may be routes learned by B itself, or routes forwarded to network device B by other peers of network device D - network device E.

[0027] In this embodiment, there are many specific ways to obtain all next-hop interfaces from the local device to each Internet Protocol (IP) address carried in the neighbor interaction message sent from the peer. For example, as one embodiment, for each IP address carried in the BGP message, all routing table entries with the next-hop IP address as that IP address are queried from the local basic routing table. The local basic routing table is constructed based on the connection relationship after the network topology of the network device is built. The outgoing interfaces on the local device recorded in all the queried routing table entries are all next-hop interfaces from the local device to that IP address.

[0028] S202, Based on the interface identifiers of all next-hop interfaces from this device to the IP address, generate a next-hop group identifier (NGID) that is bound to the IP address and all next-hop interfaces from this device to the IP address.

[0029] It should be noted that step S202 above is performed on the premise that no next-hop group identifier (NGID) corresponding to any next-hop interface from this device to this IP address is found in the local NGID mapping table.

[0030] In other words, when determining the interface identifiers of all next-hop interfaces for a given IP address, the system first checks the local NGID mapping table to see if an NGID corresponding to the interface identifiers of these next-hop interfaces already exists.

[0031] If not, it indicates that other peers of this device, different from this peer, did not establish mapping entries for the interface identifiers and NGIDs of these next-hop interfaces during previous route synchronization. In this case, based on the interface identifiers of all next-hop interfaces from this device to this IP address, a next-hop group identifier (NGID) is generated and bound to this IP address and all next-hop interfaces from this device to this IP address. Then, based on all next-hop interfaces bound to this next-hop group identifier (NGID), an NGID mapping entry corresponding to this next-hop group identifier (NGID) is generated and recorded in the NGID mapping table.

[0032] If so, it indicates that other peers of this device, different from this peer, established mapping entries for the interface identifiers and NGIDs of these next-hop interfaces during route synchronization. In this case, directly establish the mapping relationship between the IP address, all next-hop interfaces from this device to the IP address already stored in the local NGID mapping table, and the next-hop group identifier NGID. That is, establish the mapping relationship between the IP address, all next-hop interfaces from this device to the IP address, and the next-hop group identifier NGID.

[0033] In this embodiment, step S202 is specifically implemented as follows: A hash operation is performed on the interface identifiers of all next-hop interfaces from this device to the IP address. The hash operation result is determined as the next-hop group identifier (NGID). In this way, multiple next-hop interfaces are abstracted into a logical group (i.e., NGID) for unified management. Multiple next-hop interfaces constitute a next-hop group. A logical set composed of multiple equivalent next-hop interfaces is treated as a single logical entity during routing and forwarding, identified by a unique NGID.

[0034] It should be noted that a Next-hop Group is different from a Logical Next-hop Group. A Logical Next-hop Group is a virtual next-hop group abstracted from multiple next hops. It presents a single next-hop characteristic to the outside world (e.g., bandwidth = the sum of the routing next hops), implements load balancing internally (based on flow hashing for member selection), operates only at the network layer (data link layer only), and is bound to the next-hop IP rather than the physical interface.

[0035] It should be noted that the NGID mapping table in the control plane maintains the mapping relationship between the IP address (the next-hop IP address of the route to be synchronized), all next-hop interfaces from this device to that IP address, and the next-hop group identifier (NGID) bound to all next-hop interfaces from this device to that IP address.

[0036] S203. Based on all the next-hop interfaces bound to the next-hop group identifier NGID, generate the NGID forwarding table entry corresponding to the next-hop group identifier NGID and record it in the NGID forwarding table.

[0037] It should be noted that the NGID forwarding table is a mapping relationship between all next-hop interfaces (i.e., equivalent next-hop interfaces) and their corresponding NGIDs maintained in the switch forwarding chip (i.e., the data plane) from the device to the next-hop IP address of the route to be synchronized.

[0038] Since the routes synchronized from the control plane are generated into routing table entries and then sent to the forwarding table in the switch's forwarding chip (the data plane also needs a forwarding table for subsequent packet forwarding), after updating the NGID mapping table, it is also necessary to send it to the NGID forwarding table in the switch's forwarding chip.

[0039] In this embodiment, step S203 can be implemented as follows: write an NGID forwarding table entry containing the following content into the preset NGID forwarding table in the chip of this network device: the generated next-hop group identifier NGID, and the interface identifiers of all next-hop interfaces bound to the next-hop group identifier NGID.

[0040] S204, when receiving a route update notification sent by the peer, for each of the N routes to be synchronized to this device carried in the route update notification, determine the next-hop group identifier NGID that the next-hop IP address is bound to, and add a route forwarding table entry in the routing table containing the following: the destination IP address of the route carried in the route update notification and the determined next-hop group identifier NGID.

[0041] In this embodiment, only one routing table entry is stored in the routing table: the target IP address (prefix) of the synchronized route and the NGID. The format of the traditional routing table entry is changed from <prefix, next-hop IP> to <prefix, NGID>. Equivalent next-hop IPs share one routing table entry, and the number of routing table entries is reduced from multiple to one. This achieves entry compression, significantly reduces the resource consumption of TCAM, and improves the efficiency of route distribution.

[0042] The routing table entries store the mapping relationship between prefixes and NGIDs, and the NGID mapping table maintains the mapping relationship between NGIDs and the identifiers of each next-hop interface, thereby establishing the mapping relationship between prefixes and each next-hop interface in the control plane.

[0043] S205, based on the NGID forwarding table, determine all next-hop interfaces bound to the determined next-hop group identifier NGID; atomically send forwarding entries containing the destination IP address of the route to each determined next-hop interface.

[0044] Atomic routing refers to the operation of writing routing table entries to the forwarding plane in batches in a transactional manner, ensuring that all entries on the next-hop interfaces within the group take effect or become invalid at the same time. Necessary implementation conditions include hardware support for transactional entry writing (BEGIN_TXN / COMMIT instructions) and the forwarding chip having a group operation atomicity guarantee mechanism.

[0045] The routing table entries store the mapping relationship between prefixes and NGIDs. The NGID forwarding table maintains the mapping relationship between NGIDs and the identifiers of each next-hop interface at the data forwarding layer (hardware layer). Therefore, after generating the routing table entries, forwarding entries also need to be issued to each interface to establish the mapping relationship between prefixes and each next-hop interface at the data forwarding layer. The forwarding plane only needs to store the mapping relationship between NGIDs and prefixes, without needing to maintain the characteristics of individual next-hop states, reducing chip state synchronization overhead and supporting sub-second failover.

[0046] It should be noted that during the routing protocol convergence process, the temporary inconsistencies caused by non-atomic operations manifest as: some next-hop interfaces have become effective while others have not, and there are temporary differences in the next-hop combinations between different nodes.

[0047] In this embodiment, inconsistencies in route learning are eliminated by atomic delivery. Compared with the traditional technology of delivery one by one, atomic delivery can ensure that each physical interface corresponding to the NGID is updated synchronously. Hardware-level transactions ensure that all forwarding entries take effect at the same time, and the learning rate of each interface is synchronized, which can avoid forwarding path oscillation caused by traffic tilt.

[0048] Furthermore, as an example, if it is determined that the forwarding entry for any given next-hop interface fails to be issued, the process returns to deleting the forwarding entries for other next-hop interfaces that have already been issued, and then returns to the step of atomically issuing forwarding entries containing the destination IP address of the route to each determined next-hop interface. This continues until all next-hop interfaces are successfully synchronized. Through version control and transaction mechanisms, it is ensured that all changes within the group take effect or are rolled back, ensuring that traffic is always evenly distributed and avoiding momentary congestion caused by traffic skew when only some interfaces are effective.

[0049] As an example, when deleting the first route, the next-hop group identifier (NGID) bound to the next-hop IP address carried in the first route is obtained; the routing table entry on this device that includes the destination IP address of the first route and the obtained next-hop group identifier (NGID) is deleted. In this way, it is not necessary to delete routing table entries on each interface, ensuring that the deletion of the first route is completed synchronously on each port, avoiding frequent oscillations in forwarding paths caused by inconsistent next-hop combinations during route convergence.

[0050] This concludes the process. Figure 2 The process is shown below.

[0051] pass Figure 2 As can be seen from the process shown, in this embodiment, when receiving the neighbor interaction message sent by the peer, a mapping relationship is established in advance between the next-hop IP address of the route to be synchronized, all next-hop interfaces from this device to that IP address, and the next-hop group identifier (NGID). This allows the matching NGID to be found based on the next-hop IP address carried in each synchronized route during subsequent route synchronization. Furthermore, only one routing table entry carrying the destination IP address of the route and the found NGID is sent for each route. Compared with the related technologies that send routing table entries interface by interface, this greatly improves the efficiency of route synchronization.

[0052] Furthermore, after generating the NGID, the corresponding NGID forwarding table entry for the NGID and the next-hop interface will be sent to the chip of this device. The NGID is used to associate a route with a group of next-hop interfaces, realizing the atomic operation of sending forwarding entries to multiple next-hop interfaces. This ensures that the sending status of multiple next-hop interfaces is consistent, avoids inconsistent next-hop combinations during the convergence process, eliminates traffic skew during the convergence period, and always ensures full-path load balancing.

[0053] To more clearly illustrate the specific implementation of steps S201 to S205 above, the following will combine... Figure 3 The details are explained in detail by way of specific embodiments.

[0054] See Figure 3 , Figure 3 This is a flow diagram of the method provided in an embodiment of this application. The execution subject of this method can be a network device. Figure 1 The network device D shown is an Autonomous System Boundary Router (ASBR) for a data center. like Figure 3 As shown, the process may include the following steps: S301: Dynamic Next Hop Detection: S3011: Protocol Message Parsing: The ASBR device detected a BGP OPEN message sent by a peer. The BGP OPEN message carried the next-hop IP addresses of the three routes to be synchronized: 192.168.1.1; 10.0.0.1; and 172.16.1.1. S3012: Port Aggregation (Physical Port Set, Next-Hop Interface Set) Query the outgoing interfaces, physical ports eth1, eth2, and eth3, with the next-hop address 192.168.1.1 in the local basic routing table. Query the outgoing interfaces with the next-hop address 10.0.0.1 in the local basic routing table, specifically the physical ports eth4 and eth5; Query the outgoing interfaces with the next-hop address 172.16.1.1 in the local basic routing table, specifically the physical ports eth6 and eth7.

[0055] S302: Virtual Next Hop Construction: S3021: Generate NGID: Use a hash algorithm to generate unique identifiers: {"eth1", "eth2", "eth3"} → NGID_0x8A3D {"eth4", "eth5"} → NGID_0x4F21 {"eth6", "eth7"} → NGID_0xE79C S3022: Control plane constructs mapping table: Establish a mapping table between the next-hop IP address and physical port of the route to be synchronized: "192.168.1.1": {"eth1", "eth2", "eth3"}, "10.0.0.1": {"eth4", "eth5"}, "172.16.1.1": {"eth6", "eth7"} Effect: Automatically discovers multi-path topology, avoiding manual configuration errors.

[0056] Maintain the NGID mapping table in the control plane: | NGID | Physical Port Set | |---------|---------------------| | 0x8A3D | {eth1, eth2, eth3} | | 0x4F21 | {eth4, eth5} | | 0xE79C | {eth6, eth7} | S3023: Data plane configuration: The NGID forwarding table is pre-configured in the switch chip: table ngid_table { key = { ngid: exact;} actions = { set_egress_ports;} } Effect: Decoupling the logical next hop from the physical port.

[0057] S303: Batch processing of routing table entries: S3031: Receive BGP route update notifications: Received route: 203.0.113.0 / 24 via 192.168.1.1 S3032: Routing table update: The NGID obtained from the mapping table is: 192.168.1.1 → 0x8A3D Only store the following in the routing table: 203.0.113.0 / 24 → NGID_0x8A3D Compared to traditional methods in related technologies: Effect: Three forwarding table entries need to be sent to eth1 / eth2 / eth3 respectively: 203.0.113.0 / 24 → eth1, 203.0.113.0 / 24 → eth2, and 203.0.113.0 / 24 → eth3. The number of routing table entries is reduced by 66% (3 entries to 1 entry), which significantly reduces TCAM resource consumption.

[0058] S304: Atomization Distribution Mechanism: S3041: Triggering condition: When port eth1 receives a BGP route update S3042: Triggering condition: Hardware-level transaction processing: The switch chip executes a sequence of atomic operations: S3043: Start transaction: Add the entry 203.0.113.0 / 24 to the forwarding table of eth1. Add the entry 203.0.113.0 / 24 to the forwarding table of eth2. Add the entry 203.0.113.0 / 24 to the forwarding table of eth3. Commit transaction S3044: Troubleshooting: If the distribution of data to port eth3 fails, the entire transaction will be automatically rolled back, and the system will retry until all ports are successfully synchronized. Effect: Ensures that traffic is always evenly distributed, avoiding traffic skew (50%→50%→0%) when only eth1 / eth2 is active, and instantaneous congestion caused by traditional drop-down methods.

[0059] Optionally, when the network topology changes (e.g., a new peer D is added): Dynamic expansion: New peer F is automatically discovered. When peer F receives a BGP OPEN message, the above steps are followed. That is, during the next route update, the new port group is automatically added to the forwarding set without requiring manual adjustment of the routing policy. The beneficial effects that can be obtained through the above methods are: (1) Improved convergence speed: The route learning time is reduced from O(N) to O(1), where N is the number of equivalent paths; (2) Bandwidth utilization optimization: Eliminate traffic skew during convergence and always ensure load balance across the entire path; (3) Reduced resource consumption: The number of routing table entries is reduced by 50%-90% (depending on the scale of ECMP); (4) Enhanced stability: Avoids inconsistent next-hop combinations during convergence; (5) Compatible with existing hardware: This can be achieved by modifying the driver layer without replacing the forwarding chip; (6) Simplified operation and maintenance: Batch operation of interface groups instead of individual interfaces reduces configuration complexity.

[0060] The methods provided in the embodiments of this application have been described above. The apparatus provided in the embodiments of this application is described below: See Figure 4 , Figure 4 This is a structural diagram of the device provided in an embodiment of this application. Figure 4 As shown, the device is applied to network equipment. The device 400 includes: an acquisition module 401, a generation module 402, a first distribution module 403, a route synchronization module 404, and a second distribution module 405.

[0061] The module 401 is used to obtain, for each peer of the device, all next-hop interfaces from the device to each Internet Protocol IP address carried in the neighbor interaction message sent by the peer; the neighbor interaction message carries the next-hop IP address of each of the N routes to be synchronized to the device; N is greater than or equal to 1; The generation module 402 is used to generate a next-hop group identifier (NGID) that is bound to the IP address and all next-hop interfaces from the device to the IP address based on the interface identifiers of all next-hop interfaces from the device to the IP address. The first distribution module 403 is used to generate NGID forwarding entries corresponding to the next hop group identifier NGID based on all the next hop interfaces bound to the next hop group identifier NGID and record them in the NGID forwarding table; The routing synchronization module 404 is used to, when receiving a routing update notification sent by the peer, determine the next-hop group identifier NGID that is bound to the next-hop IP address in each of the N routes to be synchronized to this device carried in the routing update notification, and add a routing forwarding table entry containing the following content: the destination IP address of the route carried in the routing update notification and the determined next-hop group identifier NGID. The second distribution module 405 is used to determine all the next-hop interfaces bound to the determined next-hop group identifier NGID based on the NGID forwarding table; and to atomically distribute forwarding entries containing the destination IP address of the route to each determined next-hop interface.

[0062] As one embodiment, based on each Internet Protocol (IP) address carried in the neighbor interaction messages sent from the peer, obtaining all next-hop interfaces from this device to that IP address includes: For each IP address carried in the neighbor interaction message, the local basic routing table is queried to find all routing table entries whose next-hop IP address is that IP address; the local basic routing table is built based on the connection relationship after the network topology of the network device is constructed; The outgoing interfaces recorded in all the routing table entries retrieved are all the next-hop interfaces from this device to that IP address.

[0063] As one embodiment, based on the interface identifiers of all next-hop interfaces from this device to that IP address, generating a next-hop group identifier (NGID) bound to that IP address and all next-hop interfaces from this device to that IP address includes: Perform a specified hash operation on the interface identifiers of all next-hop interfaces from this device to this IP address; The hash result is used as the next-hop group identifier (NGID).

[0064] As an example, the generation of a next-hop group identifier (NGID) bound to the IP address and all next-hop interfaces from the device to the IP address, based on the interface identifiers of all next-hop interfaces from the device to the IP address, is performed on the premise that no corresponding next-hop group identifier (NGID) for all next-hop interfaces from the device to the IP address is found in the local NGID mapping table; The generation module is also used to: generate NGID mapping entries corresponding to the next-hop group identifier NGID based on all the next-hop interfaces bound to the next-hop group identifier NGID and record them in the NGID mapping table; The generation module is also used to: if the local NGID mapping table finds the next-hop group identifier (NGID) corresponding to all next-hop interfaces from this device to the IP address, then establish the mapping relationship between the IP address, all next-hop interfaces from this device to the IP address, and the next-hop group identifier (NGID).

[0065] As an example, based on all the next-hop interfaces bound to the next-hop group identifier NGID, generating and recording the NGID forwarding table entry corresponding to the next-hop group identifier NGID in the NGID forwarding table includes: Write an NGID forwarding table entry containing the following content into the pre-configured NGID forwarding table in the chip of this network device: the generated next-hop group identifier NGID, and the interface identifiers of all next-hop interfaces bound to the next-hop group identifier NGID.

[0066] As an example, the second distribution module is configured to, after atomically distributing a forwarding entry containing the destination IP address of the route to each determined next-hop interface, if it is determined that the distribution of a forwarding entry for any determined next-hop interface has failed, return to delete the forwarding entries of other next-hop interfaces that have already been distributed, and return to the step of atomically distributing a forwarding entry containing the destination IP address of the route to each determined next-hop interface.

[0067] As one embodiment, the apparatus further includes: a deletion module for: When the first route is to be deleted, obtain the next-hop group identifier (NGID) bound to the next-hop IP address carried in the first route; Delete the routing table entry on this device that includes the destination IP address of the first route and the NGID (Next Hop Group Identifier).

[0068] This concludes the process. Figure 4 Structural description of the device shown.

[0069] See Figure 5 , Figure 5 This is a structural diagram of an electronic device provided in an embodiment of this application. Figure 5As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.

[0070] Based on the same application concept as the above method, this application embodiment also provides a machine-readable storage medium storing a plurality of computer instructions, which, when executed by a processor, can implement the method disclosed in the above examples of this application.

[0071] For example, the aforementioned machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, etc. For instance, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.

[0072] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A peer-based routing atomicity processing method, characterized in that, This method is applied to network devices, and the method includes: For each peer of this device, based on each Internet Protocol IP address carried in the neighbor interaction message sent from the peer, obtain all next-hop interfaces from this device to that IP address; the neighbor interaction message carries the next-hop IP address of each of the N routes to be synchronized to this device; N is greater than or equal to 1; Based on the interface identifiers of all next-hop interfaces from this device to this IP address, generate a next-hop group identifier (NGID) that is bound to this IP address and all next-hop interfaces from this device to this IP address; Based on all the next-hop interfaces bound to the next-hop group identifier NGID, generate the NGID forwarding table entry corresponding to the next-hop group identifier NGID and record it in the NGID forwarding table; When a route update notification is received from the peer, for each of the N routes to be synchronized to this device carried in the route update notification, the next-hop IP address bound to the next-hop IP address is determined, and a new route forwarding table entry containing the following content is added to the routing table: the destination IP address of the route carried in the route update notification and the determined next-hop group identifier NGID. Based on the NGID forwarding table, all next-hop interfaces bound to the determined next-hop group identifier NGID are determined; forwarding entries containing the destination IP address of the route are atomically distributed to each determined next-hop interface; wherein, the atomic distribution means that the forwarding entries are written to the forwarding plane in batches in a transactional manner to determine whether the forwarding entries of all determined next-hop interfaces are effective or invalid at the same time.

2. The method according to claim 1, characterized in that, The process of obtaining all next-hop interfaces from this device to each Internet Protocol IP address carried in the neighbor interaction message sent from the peer includes: For each IP address carried in the neighbor interaction message, all routing table entries with the next-hop IP address being that IP address are retrieved from the local basic routing table; the local basic routing table is constructed based on the connection relationship after the network topology to which the network device belongs is built; The outgoing interfaces recorded in all the routing table entries retrieved are all the next-hop interfaces from this device to that IP address.

3. The method according to claim 1, characterized in that, The generation of a next-hop group identifier (NGID) bound to the IP address and all next-hop interfaces from this device to the IP address, based on the interface identifiers of all next-hop interfaces from this device to the IP address, includes: Perform a specified hash operation on the interface identifiers of all next-hop interfaces from this device to this IP address; The hash result is used as the next-hop group identifier NGID.

4. The method according to claim 1, characterized in that, The process of generating a next-hop group identifier (NGID) that is bound to the IP address and all next-hop interfaces from the device to the IP address based on the interface identifiers of all next-hop interfaces from the device to the IP address is performed on the premise that no next-hop group identifier (NGID) corresponding to all next-hop interfaces from the device to the IP address is found in the local NGID mapping table. The method further includes: Based on all the next-hop interfaces bound to the next-hop group identifier NGID, generate the NGID mapping table entry corresponding to the next-hop group identifier NGID and record it in the NGID mapping table; If the local NGID mapping table finds the next-hop group identifier (NGID) corresponding to all next-hop interfaces from this device to this IP address, then a mapping relationship is established between this IP address, all next-hop interfaces from this device to this IP address, and the next-hop group identifier (NGID).

5. The method according to claim 1, characterized in that, The process of generating and recording NGID forwarding entries corresponding to the NGID based on all next-hop interfaces bound to the NGID next-hop group identifier includes: Write an NGID forwarding table entry containing the following content into the pre-configured NGID forwarding table in the chip of this network device: the generated next-hop group identifier NGID, and the interface identifiers of all next-hop interfaces bound to the next-hop group identifier NGID.

6. The method according to claim 1, characterized in that, After atomically issuing forwarding entries containing the destination IP address of the route to each determined next-hop interface, the method further includes: If it is determined that the forwarding entry for any given next-hop interface fails to be issued, then return to delete the forwarding entries for other next-hop interfaces that have already been issued, and return to the step of atomically issuing forwarding entries containing the destination IP address of the route to each determined next-hop interface.

7. The method according to claim 1, characterized in that, The method further includes: When the first route is to be deleted, obtain the next-hop group identifier (NGID) bound to the next-hop IP address carried in the first route; Delete the routing table entry on this device that includes the destination IP address of the first route and the NGID (Next Hop Group Identifier).

8. A peer-based routing atomization processing device, characterized in that, This device is used in network equipment, and the device includes: The acquisition module is used to obtain, for each peer of this device, all next-hop interfaces from this device to each Internet Protocol IP address carried in the neighbor interaction message sent by the peer; the neighbor interaction message carries the next-hop IP address of each of the N routes to be synchronized to this device; N is greater than or equal to 1; The generation module is used to generate a next-hop group identifier (NGID) that is bound to the IP address and all next-hop interfaces from this device to the IP address, based on the interface identifiers of all next-hop interfaces from this device to the IP address. The first distribution module is used to generate NGID forwarding entries corresponding to the next-hop group identifier NGID based on all the next-hop interfaces bound to the next-hop group identifier NGID and record them in the NGID forwarding table; The routing synchronization module is used to, when receiving a routing update notification sent by the peer, determine the next-hop group identifier (NGID) that is bound to the next-hop IP address in each of the N routes to be synchronized to this device carried in the routing update notification, and add a new routing forwarding table entry containing the following content: the destination IP address of the route carried in the routing update notification and the determined next-hop group identifier (NGID). The second distribution module is used to determine all next-hop interfaces bound to the determined next-hop group identifier NGID based on the NGID forwarding table; and to atomically distribute forwarding entries containing the destination IP address of the route to each determined next-hop interface; wherein, the atomic distribution means that the forwarding entries are written to the forwarding plane in batches in a transactional manner to determine whether the forwarding entries of all determined next-hop interfaces are effective or invalid at the same time.

9. The apparatus according to claim 8, characterized in that, The process of obtaining all next-hop interfaces from this device to each Internet Protocol IP address carried in the neighbor interaction message sent from the peer includes: For each IP address carried in the neighbor interaction message, all routing table entries with the next-hop IP address being that IP address are retrieved from the local basic routing table; the local basic routing table is constructed based on the connection relationship after the network topology to which the network device belongs is built; The outgoing interfaces on this device recorded in all the routing table entries retrieved are all the next-hop interfaces from this device to that IP address. And / or, The generation of a next-hop group identifier (NGID) bound to the IP address and all next-hop interfaces from this device to the IP address, based on the interface identifiers of all next-hop interfaces from this device to the IP address, includes: Perform a specified hash operation on the interface identifiers of all next-hop interfaces from this device to this IP address; The hash operation result is determined as the next-hop group identifier NGID; And / or, The process of generating a next-hop group identifier (NGID) that is bound to the IP address and all next-hop interfaces from the device to the IP address based on the interface identifiers of all next-hop interfaces from the device to the IP address is performed on the premise that no next-hop group identifier (NGID) corresponding to all next-hop interfaces from the device to the IP address is found in the local NGID mapping table. The generation module is further configured to: generate an NGID mapping entry corresponding to the next-hop group identifier NGID based on all next-hop interfaces bound to the next-hop group identifier NGID and record it in the NGID mapping table; The generation module is further configured to: if the next-hop group identifier (NGID) corresponding to all next-hop interfaces from the device to the IP address is found in the local NGID mapping table, then establish a mapping relationship between the IP address, all next-hop interfaces from the device to the IP address, and the next-hop group identifier (NGID); And / or, The process of generating and recording NGID forwarding entries corresponding to the NGID based on all next-hop interfaces bound to the NGID next-hop group identifier includes: Write an NGID forwarding table entry containing the following content into the pre-configured NGID forwarding table in the chip of this network device: the generated next-hop group identifier NGID, and the interface identifiers of all next-hop interfaces bound to the next-hop group identifier NGID; And / or, The second delivery module is configured to, after atomically delivering forwarding entries containing the destination IP address of the route to each determined next-hop interface, if it is determined that the delivery of forwarding entries for any determined next-hop interface has failed, return to delete the forwarding entries of other next-hop interfaces that have already been delivered, and return to the step of atomically delivering forwarding entries containing the destination IP address of the route to each determined next-hop interface. The device further includes: a deletion module for: When the first route is to be deleted, obtain the next-hop group identifier (NGID) bound to the next-hop IP address carried in the first route; Delete the routing table entry on this device that includes the destination IP address of the first route and the NGID (Next Hop Group Identifier).

10. An electronic device, characterized in that, The electronic device includes: Processor; and A computer-readable storage medium storing computer program instructions that, when executed by the processor, cause the processor to perform the steps of the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Routing learning method and equipment

    CN104486224A

  • Route issuing method and device and related equipment

    CN120499084A