Route management method and device, router, readable storage medium and program product
By generating and sending route revocation messages in the SONiC system and deleting routing entries after the timer arrives, the traffic packet loss problem of white box layer three switches when passing revoked BGP routing is solved, and network stability and data are achieved Improvement of packet transmission quality.
Patent Information
- Application Number
- CN202411724405.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In SONiC system, the white box layer three switch causes traffic packet loss during the process of revoking BGP routing.
When a route revocation message is monitored, the relevant route revocation message is generated and sent to the neighbor router, and the route revocation timer is enabled. After the timer reaches the timing time, delete the associated routing entries in the routing table to ensure that the neighbor router has enough time to update the routing table.
It effectively avoids traffic packet loss, improves network stability and packet transmission quality in BGP large-routing revocation scenarios, and achieves zero packet loss.
Smart Images

Figure CN119520364A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a routing management method, device, router, computer-readable storage medium, and computer program product. Background Art
[0002] The switch devices in the white-box three-layer switch networking architecture based on the SONiC system (an open source network operating system) are subject to various scenarios such as restart, power failure, one-click isolation, port oscillation, and route withdrawal. In these scenarios, the upstream switch will notify and withdraw the BGP (Border Gateway Protocol) route to the downstream switch. After receiving the withdrawn BGP route from the neighboring router, the switch will process it and send it to the switching chip. The entire convergence time of this process is relatively long, and traffic packet loss is prone to occur.
[0003] Therefore, it is urgent to provide a method that can avoid traffic packet loss in the process of transmitting and revoking BGP routes. Summary of the invention
[0004] Based on this, it is necessary to provide a routing management method, device, router, computer-readable storage medium and computer program product that can avoid traffic packet loss in the process of transmitting and revoking BGP routes to address the above technical problems.
[0005] In a first aspect, the present application provides a routing management method, applied to a first router, comprising:
[0006] When a route withdrawal message is detected, a related route withdrawal message is generated;
[0007] Sending the route withdrawal message to each neighbor router and starting a route withdrawal timer; wherein the neighbor router is a router that establishes a border gateway protocol with the first router;
[0008] When the route withdrawal timer reaches the timing time and each of the neighbor routers updates the relevant neighbor routing table based on the route withdrawal message, delete the routing entry associated with the route withdrawal message in the first routing table; wherein the first routing table is the routing entry table of the first router.
[0009] In one embodiment, it also includes:
[0010] When the route withdrawal timer does not reach the timing time, the data packet is forwarded based on the route entry corresponding to the route withdrawal message.
[0011] In one embodiment, it also includes:
[0012] When the route withdrawal timer reaches the timing time, obtaining the state information of the neighbor routing table of each neighbor router;
[0013] When the state information of each neighbor routing table indicates that the routing entry associated with the route withdrawal message is deleted, it is determined that each neighbor router has updated the related neighbor routing table based on the route withdrawal message.
[0014] In one of the embodiments, after deleting the routing entry associated with the routing withdrawal message in the first routing table, the method further includes:
[0015] The forwarding item associated with the route withdrawal message in the forwarding table of the forwarding plane is deleted, and the route entry associated with the route withdrawal message is stopped from being used to forward the data packet.
[0016] In one embodiment, it also includes:
[0017] Within the start time of the route withdrawal timer, the forwarding log of each data packet is collected and the forwarding log is transmitted to the terminal; wherein the terminal is used to store and analyze the forwarding log.
[0018] In one of the embodiments, the timing duration of the route withdrawal timer is determined based on at least one of the number of the neighbor routers, the network size associated with the first router, and the network condition associated with the first router.
[0019] In a second aspect, the present application further provides a routing management device, applied to a first router, comprising:
[0020] A message generation module, used to generate a related route withdrawal message when a route withdrawal message is detected;
[0021] A message sending module, used to send the route withdrawal message to each neighbor router and start the route withdrawal timer; wherein the neighbor router is a router that establishes a border gateway protocol with the first router;
[0022] A route deletion module is used to delete the route entry associated with the route withdrawal message in the first routing table when the route withdrawal timer reaches the timing time and each of the neighbor routers updates the relevant neighbor routing table based on the route withdrawal message; wherein the first routing table is the route entry table of the first router.
[0023] In a third aspect, the present application further provides a router, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0024] When a route withdrawal message is detected, a related route withdrawal message is generated;
[0025] Sending the route withdrawal message to each neighbor router and starting a route withdrawal timer; wherein the neighbor router is a router that establishes a border gateway protocol with the first router;
[0026] When the route withdrawal timer reaches the timing time and each of the neighbor routers updates the relevant neighbor routing table based on the route withdrawal message, delete the routing entry associated with the route withdrawal message in the first routing table; wherein the first routing table is the routing entry table of the first router.
[0027] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0028] When a route withdrawal message is detected, a related route withdrawal message is generated;
[0029] Sending the route withdrawal message to each neighbor router and starting a route withdrawal timer; wherein the neighbor router is a router that establishes a border gateway protocol with the first router;
[0030] When the route withdrawal timer reaches the timing time and each of the neighbor routers updates the relevant neighbor routing table based on the route withdrawal message, delete the routing entry associated with the route withdrawal message in the first routing table; wherein the first routing table is the routing entry table of the first router.
[0031] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0032] When a route withdrawal message is detected, a related route withdrawal message is generated;
[0033] Sending the route withdrawal message to each neighbor router and starting a route withdrawal timer; wherein the neighbor router is a router that establishes a border gateway protocol with the first router;
[0034] When the route withdrawal timer reaches the timing time and each of the neighbor routers updates the relevant neighbor routing table based on the route withdrawal message, delete the routing entry associated with the route withdrawal message in the first routing table; wherein the first routing table is the routing entry table of the first router.
[0035] The present application provides a routing management method, device, router, computer-readable storage medium and computer program product, which is applied to the routing management method of the first router, by generating a related routing withdrawal message when a routing withdrawal message is detected; sending the routing withdrawal message to each neighbor router, and starting a routing withdrawal timer; wherein the neighbor router is a router that establishes a border gateway protocol with the first router; when the routing withdrawal timer reaches the timing time and each neighbor router updates the related neighbor routing table based on the routing withdrawal message, deleting the routing entry associated with the routing withdrawal message in the first routing table; wherein the first routing table is the routing entry table of the first router; it can be seen that when a routing withdrawal message is detected, the first router will first send the related routing withdrawal message to the neighbor router so that the neighbor router can start to prepare to update its own routing table, and the first router starts a routing withdrawal timer to ensure that the neighbor router has enough time to receive and process the related withdrawal message, and then when it is determined that each neighbor router has updated its own routing table, the related routing entry in its own routing table is formally deleted, which is conducive to improving the stability of the network and the transmission quality of data packets in the BGP large routing withdrawal scenario, and achieving true zero packet loss. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 An application environment diagram of a routing management method in an embodiment;
[0038] Figure 2 A schematic diagram of a flow chart of a routing management method in an embodiment;
[0039] Figure 3 A schematic diagram of a routing interaction process in a related technical embodiment;
[0040] Figure 4 is a structural block diagram of a routing management device in an embodiment;
[0041] Figure 5 FIG. 4 is a diagram showing the internal structure of a router in one embodiment. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] It should be noted that BGP Speakers that exchange messages with each other are called peers; the router that sends BGP messages is called a BGP speaker, which receives or generates new routing information and publishes it to other BGP speakers.
[0044] In the related technology, when the upstream switch BGP receives a route withdrawal message from the peer, it updates the local hardware forwarding table and sends a BGP withdraw message (withdrawal message) to the downstream switch to notify the route withdrawal. After the downstream switch receives the route withdrawal message, it executes the same process to update the local hardware forwarding table. This causes the hardware forwarding plane of the upstream switch to be updated before the hardware forwarding table of the downstream switch. For a certain route, the time difference between the deletion time of the upstream switch hardware forwarding table and the deletion time of the downstream switch hardware forwarding table will cause the corresponding message to be forwarded from the downstream switch hardware to the upstream switch hardware. The hardware in the upstream switch cannot find the corresponding route (the deleted route) and discards it, which leads to traffic packet loss.
[0045] In order to solve the traffic packet loss problem existing in the related art, the present application embodiment provides a routing management method, which can be applied to Figure 1In the application environment shown. Among them, the first router 101 can communicate with the neighbor router 102 through BGP, that is, the first router 101 and the neighbor router 102 are configured as each other's neighbor routing devices in advance; the configuration of the neighbor routing device is generally achieved by specifying the Internet Protocol (IP) address of the other party. After that, the two interacting parties can use their own IP addresses and the IP address of the other party to establish a Transmission Control Protocol (TCP) session. After the routing device establishes a TCP session with the neighbor routing device, it will send BGP messages to each other. Among them, BGP messages include update messages and capability messages, etc. The update message is used to exchange routing update information between the routing device and the neighbor routing device, including the withdrawal of routes and reachable routes and corresponding routing attributes; the capability message is used to dynamically change the routing capability after the BGP neighbor is successfully established. Among them, at least some of the neighbor routers 102 are upstream routers relative to the first router 101, and some of the neighbor routers 102 are downstream routers relative to the first router 101, that is, the first router 101 can communicate with both upstream routers and downstream routers. Among them, Figure 1 The neighbor routers 102 shown in FIG. 1 are a plurality of different routers.
[0046] In addition, the first router 101 or the network including the first router 101 can be connected to at least one of the server and the terminal in communication, and the first router 101 or the network including the first router 101 can realize data communication between the server and the terminal, and can also realize data communication between the terminal and the terminal. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0047] In an exemplary embodiment, Figure 2 As shown, a routing management method is provided, which is applied to Figure 1 Taking the first router 101 in the example as an example, the method includes the following steps 202 to 206. Among them:
[0048] Step 202: When a route withdrawal message is detected, a related route withdrawal message is generated.
[0049] Among them, the route withdrawal message is a message that the route entry pointed to by the route withdrawal message needs to be deleted in the network formed by multiple routers based on BGP communication. After the route entry pointed to by the route withdrawal message is deleted in each router in the network, data packets can no longer be transmitted in the network based on the route entry.
[0050] The route withdrawal message is a message sent to the neighbor router 102 and used to notify the neighbor router 102 to delete the route entry pointed to by the route withdrawal message.
[0051] Exemplarily, when the first router 101 detects a route withdrawal message, it indicates that a specific BGP route needs to be withdrawn in the networking. At this time, the first router 101 is not in a hurry to delete the relevant route entries in its own routing table, but generates a route withdrawal message associated with the route withdrawal message. This route withdrawal message can be used to notify the neighboring router 102 to delete the route entries related to the route withdrawal message, so that all neighboring routers 102 in the networking where the first router 101 is located can be aware of the message that the route entries related to the route withdrawal message need to be deleted.
[0052] Step 204 : Send a route withdrawal message to each neighbor router 102 , and start a route withdrawal timer; wherein the neighbor router 102 is a router that establishes a border gateway protocol with the first router 101 .
[0053] Among them, the route withdrawal timer in the present application is used to count down the time for the first router 101 to delete the route entry pointed to by the route withdrawal message, that is, after the route withdrawal timer is started, a countdown or time will be performed. Before the timing time corresponding to the route withdrawal timer is reached, the route entry pointed to by the route withdrawal message cannot be deleted. After the timing time corresponding to the route withdrawal timer is reached, the route entry pointed to by the route withdrawal message can be deleted based on demand.
[0054] Exemplarily, after the first router 101 generates a route withdrawal message associated with the route withdrawal message based on the monitored route withdrawal message, the route withdrawal message can be transmitted to each neighbor router 102 in its corresponding network, so that each neighbor router 102 in the network knows to delete the relevant route entries in their respective routing tables; at the same time, the first router 101 will synchronously start the route withdrawal timer, so as not to delete the route entry pointed to by the route withdrawal message before the timing time corresponding to the route withdrawal timer is reached, and only after the timing time corresponding to the route withdrawal timer is reached, the route entry pointed to by the route withdrawal message can be deleted based on demand.
[0055] Among them, during the period when the route withdrawal timer has not reached the timing time, each neighbor router 102 can delete its own related route entries based on the received route withdrawal message, so that before each neighbor router 102 deletes the route entry pointed to by the route withdrawal message, the route entry in the first router 101 will not be deleted.
[0056] Step 206 , when the route withdrawal timer reaches the timing time and each neighbor router 102 updates the relevant neighbor routing table based on the route withdrawal message, delete the routing entry associated with the route withdrawal message in the first routing table; wherein the first routing table is the routing entry table of the first router 101 .
[0057] Each neighbor router 102 updates the related neighbor routing table based on the routing withdrawal message, which means that each neighbor router 102 deletes the routing entry pointed to by the routing withdrawal message in its own routing table based on the routing withdrawal message, and obtains a new routing table after deleting the related routing entry.
[0058] Exemplarily, when the route withdrawal timer reaches the timing time, the first router 101 does not directly delete the route entry pointed to by the route withdrawal message in its routing table, but first confirms whether each neighbor router 102 has updated its respective neighbor routing table based on the route withdrawal message, until it is determined that each neighbor router 102 in the network has deleted the route entry pointed to by the route withdrawal message in its respective routing table based on the received route withdrawal message, and then deletes the route entry pointed to by the route withdrawal message in its own (first router 101) first routing table, so that the deletion time of the route entry to be deleted by the first router 101 is after the deletion time of the related route entry by the neighbor router 102 in the network; in this way, it can avoid the situation that the related route entry in the neighbor router 102 is not deleted, the neighbor router 102 transmits a data packet to the first router 101 based on the related route entry, and the related route entry in the first router 101 has been deleted, and the data packet cannot be received, that is, the occurrence of packet loss events can be avoided.
[0059] In summary, the routing management method applied to the first router 101 provided by the present application generates a related routing withdrawal message when a routing withdrawal message is detected; sends the routing withdrawal message to each neighbor router 102, and starts a routing withdrawal timer; wherein the neighbor router 102 is a router that establishes a border gateway protocol with the first router 101; when the routing withdrawal timer reaches the timing time and each neighbor router 102 updates the related neighbor routing table based on the routing withdrawal message, deletes the routing entry associated with the routing withdrawal message in the first routing table; wherein the first routing table is the routing entry table of the first router 101; It can be seen that when a route withdrawal message is detected, the first router 101 will first send the relevant route withdrawal message to the neighbor router 102, so that the neighbor router 102 can start preparing to update its own routing table, and the first router 101 starts a route withdrawal timer to ensure that the neighbor router 102 has enough time to receive and process the relevant withdrawal message, and then formally delete the relevant route entries in its own routing table after confirming that each neighbor router 102 has updated its own routing table, which is conducive to improving the stability of the network and the transmission quality of data packets in the BGP large route withdrawal scenario, and achieving true zero packet loss.
[0060] In an exemplary embodiment, the routing management method provided by the present application and applied to the first router 101 further includes: forwarding a data packet based on a routing entry corresponding to a routing withdrawal message when a routing withdrawal timer has not reached a timing time.
[0061] Exemplarily, after starting the route withdrawal timer based on executing step 204, if the route withdrawal timer has not reached the timing time, the route entry pointed to by the route withdrawal message in the first routing table of the first router 101 has not been deleted. At this time, if the first router 101 receives a data packet transmitted by the neighbor router 102 based on the route entry, the received data packet can still be forwarded based on the route entry to ensure smooth transmission of the received data packet, which is conducive to avoiding the occurrence of packet loss events.
[0062] That is, when the route withdrawal timer is in the on state, although the first router 101 has known that the route entry corresponding to the route withdrawal message will be deleted, it still allows data packets to be forwarded according to the route entry to be withdrawn.
[0063] In an exemplary embodiment, the routing management method provided by the present application and applied to the first router 101 further includes:
[0064] When the route withdrawal timer reaches the timing time, the state information of the neighbor routing table of each neighbor router 102 is obtained;
[0065] When the status information of each neighbor routing table indicates that the routing entry associated with the route withdrawal message is deleted, it is determined that each neighbor router 102 has updated the relevant neighbor routing table based on the route withdrawal message.
[0066] Exemplarily, after the route withdrawal timer is started based on the execution of step 204, when the route withdrawal timer reaches the timing time, the first router 101 does not directly delete the route entry pointed to by the route withdrawal message in its first routing table, but first obtains the status information of the neighbor routing table of each neighbor router 102, and confirms whether each neighbor router 102 has updated its own neighbor routing table based on the route withdrawal message based on the status information of each neighbor routing table, until it is determined based on the status information of each neighbor routing table that each neighbor router 102 in the network has deleted the route entry pointed to by the route withdrawal message in its own routing table based on the received route withdrawal message, which means that each neighbor router 102 has updated its own neighbor routing table based on the status information of each neighbor routing table. The router 102 updates the related neighbor routing table based on the routing withdrawal message; at this time, the first router 101 deletes the routing entry pointed to by the routing withdrawal message in its own (the first router 101) first routing table, so that the first router 101 deletes the routing entry to be deleted after the neighbor router 102 in the networking deletes the related routing entry; in this way, it can be avoided that the related routing entry in the neighbor router 102 is not deleted, the neighbor router 102 transmits a data packet to the first router 101 based on the related routing entry, and the related routing entry in the first router 101 has been deleted, and the data packet cannot be received, that is, the occurrence of packet loss events can be avoided.
[0067] In an exemplary embodiment, after deleting the routing entry associated with the routing withdrawal message in the first routing table, it also includes: deleting the forwarding item associated with the routing withdrawal message in the forwarding table of the forwarding plane, and stopping using the routing entry associated with the routing withdrawal message to forward data packets.
[0068] Exemplarily, after deleting the routing entry associated with the routing withdrawal message in the first routing table, the first router 101 further deletes the forwarding item associated with the routing withdrawal message in the forwarding table of the forwarding plane, and stops using the routing entry associated with the routing withdrawal message to forward data packets.
[0069] That is, when the first router 101 formally deletes the routing entry from its hardware routing table, the formal deletion action triggers the forwarding plane of the first router 101 to update its forwarding table, stop using the revoked routing entry for data packet forwarding, and also stop using the deleted forwarding table for data packet forwarding.
[0070] It should be noted that the routing table is used to determine the best path, and the forwarding table is used to quickly forward data packets.
[0071] In an exemplary embodiment, the routing management method provided by the present application and applied to the first router 101 further includes: within the start time of the routing withdrawal timer, collecting the forwarding log of each data packet and transmitting the forwarding log to the terminal; wherein the terminal is used to store and analyze the forwarding log.
[0072] Exemplarily, within the start time of the route withdrawal timer, the first router 101 will collect and store the forwarding logs corresponding to each data packet forwarded by it in real time, or send the forwarding logs to the terminal with which it has established a communication relationship for storage, so as to facilitate the subsequent extraction and analysis of relevant forwarding logs when needed.
[0073] For example, during the entire process from when the first routing table receives the route withdrawal message to when the relevant route entry in its routing table is deleted based on the route withdrawal message, the forwarding status of the data packets forwarded based on it can be synchronously monitored to verify whether zero packet loss can be achieved. It is also convenient to ensure that during the route withdrawal period, all data packets forwarded from the neighbor router 102 can be correctly redirected to the new path, and will not be discarded due to the temporary confusion caused by the route update.
[0074] In addition, during the entire process from receiving the route withdrawal message in the first routing table to deleting the relevant route entries in its routing table based on the route withdrawal message, the network status and route update progress can be continuously monitored to record key events for subsequent analysis and troubleshooting.
[0075] In an exemplary embodiment, the timing duration of the route withdrawal timer is determined based on at least one of the number of neighbor routers 102 , the network scale associated with the first router 101 , and the network condition associated with the first router 101 .
[0076] Exemplarily, the present application does not specifically limit the timing duration of the route withdrawal timer, and provides an optional setting method, which is based on the number of neighbor routers 102 in the networking, for example, the larger the number of neighbor routers 102 in the networking, the longer the timing duration of the route withdrawal timer, and based on the scale of the network including the first router 101, for example, the larger the scale of the network including the first router 101, the longer the timing duration of the route withdrawal timer, and based on the network conditions of the network where the first router 101 is located, for example, the worse the network conditions of the network where the first router 101 is located, the longer the timing duration of the route withdrawal timer.
[0077] In order to clearly illustrate the improvement of network stability and data packet transmission quality in the scenario of large route withdrawal in this application compared with the related art, please refer to Figure 3 , Figure 3 The figure is a schematic diagram of a routing interaction process in a related technical embodiment, which is used to reflect the synchronization process of BGP routing in SONiC, including steps S1 to S9, wherein:
[0078] Step S1, the bgp socket in the kernel receives the BGP update message, which is then sent to the bgpd process. Among them, Socket is the intermediate software abstraction layer for communication between the application layer and the TCP / IP (Transmission Control Protocol / Internet Protocol) protocol family, which is a set of interfaces. Bgpd is used to obtain the routing status and send it to the forwarding plane through the zebra and fpmsyncd interfaces. It should also be added that BGP (Border Gateway Protocol) is a protocol for Internet routing, and bgpd is a daemon that implements the BGP protocol. It is used to maintain and update the routing table to ensure that routing information between different autonomous systems (AS) can be exchanged correctly.
[0079] Step S2, bgpd processes the message, notifies the bgp peer of the route withdrawal message, and notifies the zebra process to update, specifically to add a new prefix and associate the next hop. Among them, zebra is an open source routing manager (routing software); it provides routing table updates, interface queries, and routing distribution between different protocols; at the same time, it will send the calculated FIB (Forwarding Info Base, forwarding table) to the kernel (through netlink) and the southbound forwarding process component (through the Forwarding-Plane-Manage interface, also known as FPM). In other words, zebra supports multiple routing protocols and is often used in network devices related to routing protocols. It is a routing protocol daemon responsible for interacting with the kernel routing table.
[0080] Step S3: After Zebra determines that the destination is reachable, it generates a routing network link information and injects the information into the kernel.
[0081] Step S4, the zebra process passes the routing network link information to the fpmsyncd process through the fpm interface. Among them, FPM (Forwarding Plane Manager) Sync Daemon is a synchronization service, which is usually used to synchronize the data plane (Forwarding Plane) and the control plane (Control Plane) of the network device. Its function is to synchronize the status and configuration information of the device with the database to ensure the consistency and accuracy of the device operation. Further, fpmsyncd is a small daemon process, which is mainly responsible for injecting the FIB status collected from zebra into the APPL_DB table in the Redis (a database) engine. Among them, Redis is an open source high-performance memory data structure storage system, which is usually used as a database, cache and message middleware. APPL_DB is used to refer to the application database (ApplicationDatabase), which is used to store the internal status information of all services, that is, to store data related to the application, such as the status route, next hop, neighbor, etc. generated by all application containers, that is, including device configuration, status information, etc.
[0082] Step S5: fpmsyncd pushes this status to APPL_DB.
[0083] Step S6, orchagent subscribes to the corresponding table entry and can receive the route deletion information. Among them, orchagent (Orchestration Agent) is a daemon process used to manage the control plane of the switch. It manages the configuration, status and operation of network devices through interaction with the database, and performs configuration changes and other tasks; for example, orchagent contains a logic processing function to extract all status information injected from other syncd processes, and then process and forward this information, and finally push this information to the southbound interface of orchagent. This southbound interface is ASIC_DB in the redis engine, so we can find that orchagent is both a subscriber and a producer, because it not only obtains data from APPL_DB, but also provides data to ASIC_DB. Among them, ASIC_DB is an ASIC (Application-Specific Integrated Circuit) database, which stores hardware-related information, such as ASIC-related status, configuration and other data; for example, ASIC_DB is used to store necessary status to drive the configuration and operation of ASIC, and the status here is kept in an ASIC-friendly format.
[0084] Step S7, the orchagent processes the received information and calls the sairedis APIs (the interface for controlling the forwarding unit) to inject the new state into the ASIC_DB.
[0085] Step S8, syncd subscribes to the message generated by orchagent and generates a new state. Among them, Syncd (Synchronizer Daemon) is a service that interacts with hardware. It is responsible for synchronizing the hardware status of network devices with the database and ensuring data consistency between hardware and software; that is, Syncd is used to execute the synchronization mechanism. During compilation, syncd connects to the ASIC SDK provided by the hardware vendor and injects the status information into the ASIC. This effect is achieved by referencing the provided interface. Syncd subscribes to the information of ASIC_DB and obtains information from SWSS. At the same time, it registers itself as a producer and publishes the status information obtained from the hardware. SWSS (SWitch StateService) is a set of tool kits that can effectively promote communication between various modules of SONiC; in other words, SWSS is a service responsible for storing the status information of the switch, including interfaces, VLANs, routes, etc. It interacts with other services through a database (such as Redis).
[0086] Step S9, syncd calls SAI API to inject this state into the corresponding state of ASIC driver. SAI (Switch Abstraction Interface) is a software interface for abstracting switch hardware; SAI API is an API interface defined by SAI, that is, SAI API provides a standard interface that allows the control software of network devices to interact with hardware and perform network data forwarding and other operations. ASIC (Application Specific Integrated Circuit) is a dedicated integrated circuit.
[0087] Furthermore, it should be added that Figure 3The user space in it is user space, and kernel space is kernel space. Kernel space is the memory area occupied by the kernel of the operating system. In this area, the kernel code, system calls, drivers, etc. of the operating system run and interact directly with the hardware; kernel space and user space have strict permission isolation; container is a container, and database container is a database container; redis-server is the service process of the redis database, which is used to handle data access and management; sdk is the abbreviation of Software Development Kit, which means software development kit in Chinese, that is, the software development kit provided by the switching chip hardware manufacturer; drivers refer to drivers, which are used to interact with specific hardware; network drivers are network drivers, which are intermediaries between the operating system and network hardware (such as network cards). They are responsible for managing the initialization, data transmission, error handling and other functions of the network interface; transceivers are transceivers, which are hardware components used for data transmission in network devices. They are responsible for converting signals from electrical signals to optical signals, or vice versa; common examples include SFP (small form factor pluggable optical module) and QSFP (quad-channel small form factor pluggable optical module). ASIC SDK (Software Development Kit) is a toolkit used by developers to interact with ASIC chips. It provides some interfaces and libraries to help developers implement hardware control on the operating system. asicdrivers are ASIC drivers used to interact with specific ASIC hardware, control its operation and exchange data with upper-level software; they communicate with the hardware through the operating system kernel to ensure the normal operation of the ASIC. hardware refers to the physical components in a computer system, such as CPU, memory, hard disk, network interface, etc.; in network devices, hardware usually refers to the actual electronic components of the device, such as ASIC chips, network interface cards, etc. ASIC (Application Specific Integrated Circuit) is an integrated circuit designed specifically for a specific task; in network devices, ASIC is usually used to accelerate packet processing, forwarding and other network-related operations, and is one of the core components of network devices.
[0088] The process in the above-mentioned related technology is based on database drive, and the process is relatively long. There will be a large delay in the delivery scenario of large routes. Taking the BCM chip as an example, in the specification of 100K IPv4 routes combined with 100K IPv6 routes, it takes about 30 seconds from the receipt of the route update by BGP to the complete writing into the switching chip.
[0089] This large delay will cause a large time difference between the deletion time of the upstream switch hardware forwarding table and the deletion time of the downstream switch hardware forwarding table in the BGP large route withdrawal scenario, which will lead to a large number of messages sent from the downstream switch to the upstream switch being lost.
[0090] Based on the above related technologies, in order to ensure that there is no packet loss in the BGP large route withdrawal scenario, the present application proposes a method for preventing packet loss in the BGP large route withdrawal scenario on a SONiC white box switch, that is, the route management method specifically provided by the present application. The method optimizes the BGP route withdrawal process. When revoking the BGP route, the BGP route withdrawal message is first sent to the neighbor (neighbor router), and the local machine (first router) delays for a period of time before deleting the local hardware route (route entry). In this way, when the route is withdrawn, the forwarding plane of the upstream switch is delayed and removed, thereby ensuring zero packet loss of the data message forwarded from the downstream switch in this scenario.
[0091] Ensuring no packet loss in a BGP route removal scenario involves sophisticated route control and time coordination. Figure 3 A more detailed process description of the method for preventing packet loss in a BGP large route withdrawal scenario on a SONiC white box switch provided in the present application is intended to optimize the BGP route withdrawal process and ensure the continuity and integrity of data packets during large-scale route changes; specifically, steps S11 to S20, wherein:
[0092] Step S11, the bgp socket in the kernel receives the BGP withdrawal message and sends it to the bgpd process.
[0093] Step S12, bgpd processes the message and notifies the zebra process to delete the prefix and the associated next hop. At the same time, a timer is started, and after a delay of a period of time, a route withdrawal message is notified to the bgp peer after the timer expires.
[0094] Step S13, Zebra generates a routing network link information, and injects the routing deletion information into the kernel.
[0095] Step S14, the zebra process passes the routing network link information to the fpmsyncd process through the fpm interface.
[0096] Step S15: fpmsyncd pushes this status to APPL_DB.
[0097] Step S16: The orchagent subscribes to the corresponding table entry and can receive more detailed routing information.
[0098] Step S17, the orchagent processes the received information and calls the sairedis APIs to inject the new state into the ASIC_DB.
[0099] Step S18: syncd subscribes to the message generated by orchagent and generates a new state.
[0100] Step S19: syncd calls the SAI API to inject this state into the corresponding state of the ASIC driver.
[0101] Step S20: The revoked route is deleted from the hardware and is no longer forwarded.
[0102] Further, for the routing management method provided in the present application, the present application also provides an optional implementation method, which is implemented by executing steps S31 to S34, wherein:
[0103] Step S31, route withdrawal notification: when it is detected that a specific BGP route needs to be withdrawn (route withdrawal message), a corresponding BGP withdrawal message (route withdrawal message) is first generated. These withdrawal messages are sent to all relevant BGP neighbors (neighboring routers). It is used to give neighbors advance warning so that they can start preparing to update their routing tables.
[0104] Step S32, local delayed deletion; including that after sending the revocation message, the local router (first router) does not immediately delete the route entry from its hardware routing table. Instead, it enters a predefined delay phase (route revocation timer). The length of this delay period needs to be carefully designed and can be calculated according to the maximum number of supported routes to ensure that all neighbors have enough time to receive and process the revocation message and update their routing status. This delay period is also called the "soft deletion" phase because during this phase, although the local router knows that the route will be revoked, it still allows data packets to be forwarded according to the route that is about to be revoked.
[0105] Step S33, Synchronous Update and Formal Deletion: includes at the end of the delay period, the local router checks whether all neighbors have successfully updated their routing tables. If it is confirmed that the neighbors are ready, the local router will formally delete the route entry from its hardware routing table. This formal deletion action triggers the forwarding plane of the local router to update its forwarding table and stop using the revoked route for data packet forwarding.
[0106] Step S34: Zero packet loss verification: Specifically, in the whole process, by monitoring the forwarding of data packets, it can be verified whether zero packet loss is achieved. It is ensured that during the route withdrawal period, all data packets forwarded from the downstream switch can be correctly redirected to the new path and will not be discarded due to the temporary confusion caused by the route update.
[0107] Furthermore, for the routing management method provided in this application, some additional considerations are also provided, including:
[0108] Delay time setting: The delay time should be selected based on factors such as network size, number of neighbors, and network conditions to balance the need for fast response and avoiding packet loss.
[0109] Failure recovery mechanism: A failure recovery strategy should be designed to prevent unexpected situations during the delay period, such as neighbors failing to update routes in time. A backup plan is needed to ensure that the network connectivity is not affected.
[0110] Monitoring and logging: Throughout the process, continuously monitor network status and routing update progress, and record key events for subsequent analysis and troubleshooting.
[0111] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0112] Based on the same inventive concept, the embodiment of the present application also provides a routing management device for implementing the routing management method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more routing management device embodiments provided below can refer to the limitations of the routing management method above, and will not be repeated here.
[0113] In an exemplary embodiment, Figure 5 As shown, a routing management device 800 is provided, including: a message generating module 81, a message sending module 82 and a routing deleting module 83, wherein:
[0114] A message generation module 81 is used to generate a related route withdrawal message when a route withdrawal message is detected;
[0115] A message sending module 82, used to send a route revocation message to each neighbor router and start a route revocation timer; wherein the neighbor router is a router that establishes a border gateway protocol with the first router;
[0116] The route deletion module 83 is used to delete the route entry associated with the route withdrawal message in the first routing table when the route withdrawal timer reaches the timing time and each neighbor router updates the relevant neighbor routing table based on the route withdrawal message; wherein the first routing table is the route entry table of the first router.
[0117] In an exemplary embodiment, the routing management device 800 further includes a data forwarding module, which is configured to forward a data packet based on a routing entry corresponding to a routing withdrawal message when a routing withdrawal timer has not reached a timing time.
[0118] In an exemplary embodiment, the route deletion module 83 is also used to obtain the status information of the neighbor routing table of each neighbor router when the route withdrawal timer reaches the timing time; when the status information of each neighbor routing table indicates that the routing entry associated with the route withdrawal message is deleted, it is determined that each neighbor router has updated the relevant neighbor routing table based on the route withdrawal message.
[0119] In an exemplary embodiment, after deleting the routing entry associated with the routing withdrawal message in the first routing table, the routing deletion module 83 is also used to delete the forwarding item associated with the routing withdrawal message in the forwarding table of the forwarding plane, and stop using the routing entry associated with the routing withdrawal message to forward data packets.
[0120] In an exemplary embodiment, the routing management device 800 also includes a log collection module, which is used to collect the forwarding log of each data packet within the start time of the routing revocation timer and transmit the forwarding log to the terminal; wherein the terminal is used to store and analyze the forwarding log.
[0121] In an exemplary embodiment, the timing duration of the route withdrawal timer is determined based on at least one of the number of neighbor routers, the size of a network associated with the first router, and a network condition associated with the first router.
[0122] Each module in the above-mentioned routing management device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of the processor in the router in the form of hardware, or can be stored in the memory in the router in the form of software, so that the processor can call and execute the corresponding operations of each module above.
[0123] In an exemplary embodiment, a router is provided. The router may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The router includes a processor, a memory, an input / output interface and a communication interface. The input / output interface of the router is used to exchange information between the processor and neighboring processors, such as data packets and messages. The communication interface of the router is used to communicate with an external terminal or server through a network connection.
[0124] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the router to which the solution of the present application is applied. A specific router may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0125] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the routing management method provided in the present application are implemented.
[0126] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the routing management method provided in the present application when executed by a processor.
[0127] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0128] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0129] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0130] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A routing management method, characterized in that: Applied to a first router, the method includes: When a route withdrawal message is detected, a related route withdrawal message is generated; Sending the route withdrawal message to each neighbor router and starting a route withdrawal timer; wherein the neighbor router is a router that establishes a border gateway protocol with the first router; When the route withdrawal timer reaches the timing time and each of the neighbor routers updates the relevant neighbor routing table based on the route withdrawal message, delete the routing entry associated with the route withdrawal message in the first routing table; wherein the first routing table is the routing entry table of the first router.
2. The method according to claim 1, characterized in that: Also includes: When the route withdrawal timer does not reach the timing time, the data packet is forwarded based on the route entry corresponding to the route withdrawal message.
3. The method according to claim 1, characterized in that Also includes: When the route withdrawal timer reaches the timing time, obtaining the state information of the neighbor routing table of each neighbor router; When the state information of each neighbor routing table indicates that the routing entry associated with the route withdrawal message is deleted, it is determined that each neighbor router has updated the related neighbor routing table based on the route withdrawal message.
4. The method according to claim 1, characterized in that After deleting the routing entry associated with the routing withdrawal message in the first routing table, the method further includes: The forwarding item associated with the route withdrawal message in the forwarding table of the forwarding plane is deleted, and the route entry associated with the route withdrawal message is stopped from being used to forward the data packet.
5. The method according to claim 1, characterized in that Also includes: Within the start time of the route withdrawal timer, the forwarding log of each data packet is collected and the forwarding log is transmitted to the terminal; wherein the terminal is used to store and analyze the forwarding log.
6. The method according to any one of claims 1 to 5, characterized in that: The timing duration of the route withdrawal timer is determined based on at least one of the number of the neighbor routers, the network scale associated with the first router, and the network condition associated with the first router.
7. A routing management device, characterized in that: Applied to a first router, the device comprises: A message generation module, used to generate a related route withdrawal message when a route withdrawal message is detected; A message sending module, used to send the route withdrawal message to each neighbor router and start the route withdrawal timer; wherein the neighbor router is a router that establishes a border gateway protocol with the first router; A route deletion module is used to delete the route entry associated with the route withdrawal message in the first routing table when the route withdrawal timer reaches the timing time and each of the neighbor routers updates the relevant neighbor routing table based on the route withdrawal message; wherein the first routing table is the route entry table of the first router.
8. A router, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Routing update method and router
CN101141382A
Router and route updating method thereof
CN101312438A
BGP (Border Gateway Protocol) routing processing method and BGP routing equipment
CN102594714A
Default route cancellation method and device
CN107070787A
Route management method and device
CN111107006A