Method, device and system for realizing uninterrupted routing based on CRIU (Clustered Register Interconnection Unit) + connection proxy
By combining CRIU and TCP Repair with the lightweight connection proxy BGPProxy, uninterrupted BGP session switching and efficient data synchronization are achieved. This solves the hardware dependency, kernel modification and performance loss problems of existing BGP NSR solutions, adapts to cloud-based network element deployment, and improves the reliability and upgrade flexibility of network devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG COMM & NETWORKS INST
- Filing Date
- 2025-12-04
- Publication Date
- 2026-04-28
AI Technical Summary
Existing BGP NSR solutions rely on hardware, require kernel modifications, suffer from performance losses, and have poor adaptability, making them difficult to adapt to cloud-based network element deployment scenarios.
By combining CRIU and TCP Repair with the lightweight connection proxy BGPProxy, BGP sessions can be switched without interruption and data synchronization can be achieved. CRIU is used to realize primary and backup BGP data synchronization, TCP Repair is used to maintain TCP connections, and BGPProxy takes over and migrates TCP connections, combining iterative synchronization and diskless synchronization technologies.
It achieves BGP NSR without hardware support or kernel modification, improving the reliability and upgrade flexibility of network devices, reducing synchronization time and performance loss, adapting to cloud environments, and reducing network oscillation rate to 0.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of network reliability technology, specifically to a method, apparatus, and system for implementing uninterrupted routing (BGP NSR) based on CRIU (Checkpoint / RestoreIn Userspace) and a connection agent. It is applicable to scenarios involving online BGP protocol upgrades and primary / backup switching of network devices, aiming to ensure uninterrupted routing services and seamless operation for network neighbors. Background Technology
[0002] BGP NSR (Non-Disruptive Routing) is a core high-reliability technology for network devices. Its core objective is to maintain BGP neighbor relationships without the need for neighboring devices during control engine switching (such as primary / standby failover or online upgrades), thus avoiding network instability. The key to implementing BGP NSR lies in: first, the synchronization of configuration, routing, and status data between primary and standby BGP nodes; and second, ensuring uninterrupted TCP connections during primary / standby failover, guaranteeing the continued validity of BGP sessions.
[0003] Traditional solutions employ protocol stack replication technology to implement BGP NSR: wrappers are introduced into the TCP / IP protocol stack to replicate each data packet sent and received by the primary BGP and send it to the backup BGP, maintaining consistency between the primary and backup BGP by synchronizing TCP connection states (sequence numbers, acknowledgment numbers, etc.) and BGP data. However, this solution has significant drawbacks: first, it requires modification of the operating system kernel, affecting system upgrade compatibility; second, packet replication latency reduces performance; and third, it relies on specific hardware support, making it difficult to adapt to software-based deployment scenarios such as cloud-based network elements.
[0004] With the trend of network software-defined networking, there is an urgent need for a BGP NSR solution that does not rely on hardware, does not modify the kernel, and is adapted to cloud environments. CRIU (user-space checkpoint / recovery tool) can save and restore process states, and TCP Repair (Linux kernel function) supports the migration of TCP connections. The combination of the two provides a new technical path for BGP NSR, but a complete collaborative solution has not yet been formed in the existing technology. Summary of the Invention
[0005] To address the issues of traditional BGP NSR solutions, such as reliance on hardware, kernel modifications, performance degradation, and poor adaptability, this invention provides a non-disruptive routing implementation method based on CRIU + connection agent. It aims to achieve non-disruptive BGP session switching and efficient data synchronization through native Linux functions (CRIU, TCPRepair) and a lightweight connection agent, thereby improving the reliability and upgrade flexibility of network devices.
[0006] The technical solution of this invention achieves primary and backup BGP data synchronization through CRIU, maintains TCP connections through TCP Repair combined with BGPProxy (connection proxy), and the two work together to complete BGP NSR, specifically including the following steps:
[0007] Environment Deployment: Enable CRIU on the primary and backup BGP nodes to support process state checkpointing and restoration; deploy BGPProxy on the backup BGP node, which supports TCP Repair and can take over and migrate TCP connections.
[0008] BGP Session Migration to Proxy: The primary BGP node enters a silent state (stops actively sending updates and only passively responds), and migrates the current BGP session (including TCP connection state and BGP state machine) to BGPProxy via TCP Repair; after taking over, BGPProxy maintains TCP connections with neighbors, responds to Keepalive messages and caches Update messages to ensure that neighbors are unaware of the process.
[0009] Primary / backup data synchronization: The primary BGP node synchronizes data with the backup BGP node via CRIU. The synchronized content includes BGP configuration, routing table (RIB), protocol status, etc. (excluding TCP session information). Synchronization adopts a combination of iterative synchronization (multiple rounds of incremental data transmission) and diskless synchronization (data is transmitted directly through memory and network without being written to disk) to reduce synchronization time and performance loss.
[0010] BGP Session Migration to Backup Node: After the primary and backup data synchronization is completed, BGPProxy migrates the BGP session (including cached Update messages) to the backup BGP node via TCP Repair; the backup BGP node resumes normal operation, processes cached messages, and synchronizes routes to the Forwarding Information Table (FIB), completing a seamless switchover.
[0011] Compared with the prior art, the present invention has the following beneficial effects:
[0012] Hardware-independent: Based on Linux's native CRIU and TCP Repair functions, it requires no dedicated hardware support, reducing deployment costs.
[0013] No kernel modification required: It uses built-in system functions and does not involve modifications to the kernel protocol stack, thus avoiding impacts on system stability and upgrade compatibility.
[0014] High performance and low latency: Improved data synchronization efficiency through iterative synchronization (incremental data transmission) and diskless synchronization (reduced I / O overhead), reducing the correlation between synchronization time and routing data volume by more than 30%.
[0015] Adapted to cloud scenarios: The software-based implementation solution supports cloud-based network element deployment, facilitating centralized backup of BGP data and single-machine NSR (uninterrupted recovery through local recovery when there is no backup machine).
[0016] Network-agnostic: During the BGPProxy takeover, TCP connections and the BGP state machine are maintained, and neighbors are not aware of the connection loss during the switchover process, reducing the network oscillation rate to 0. Attached Figure Description
[0017] Figure 1 This is a diagram of BGP NSR based on protocol stack replication, illustrating the introduction of wrappers into the TCP / IP protocol stack to seamlessly maintain TCP connections.
[0018] Figure 2 This is a schematic diagram of BGP NSR based on CRIU, illustrating that traditional data synchronization requires writing the process's memory and state information to disk and recovering it from disk.
[0019] Figure 3 The diagram shows a comparison between disk synchronization and diskless synchronization, illustrating their respective execution processes. Diskless synchronization accelerates data synchronization between the master and slave processes through memory and network transmission. Detailed Implementation
[0020] The following describes the specific implementation of the present invention in detail, taking into account the complete process of primary and backup BGP switching.
[0021] BGP session persistence (TCP connection not interrupted).
[0022] Session persistence is the core of BGP NSR. BGPProxy acts as an intermediary, taking over TCP connections during primary / standby failover. The specific steps are as follows:
[0023] 1. Primary BGP Quiet Configuration: Before switching over, the primary BGP node is configured to enter a quiet state via route mapping, ceasing to send update messages outwards but maintaining existing connections and processing received update messages. Example configuration logic: Create a "deny update sending" route mapping (BGP-QUIESCE) and apply it to the outward direction of BGP neighbors.
[0024] 2. Session migration to BGPProxy: The primary BGP node migrates the BGP session to BGPProxy via TCP Repair. The process includes: (1) Enable TCP Repair mode to obtain key parameters of the BGP connection (MSS, window scaling factor, timestamp, etc.). (2) Export the sequence numbers and buffered data of the TCP send and receive queues (such as unsent acknowledgments and received Update messages); (3) Restore the above parameters and queue data in BGPProxy, turn off TCP Repair mode, and let BGPProxy take over the connection.
[0025] 3. BGPProxy Transition: BGPProxy maintains TCP connections with neighbors, runs the BGP state machine (FSM), responds to keepalive messages from neighbors, and caches received update messages (without processing routing logic); at the same time, the primary BGP node synchronizes the final state data to the backup BGP.
[0026] 4. Session migration to backup BGP: After the backup BGP node completes data synchronization, BGPProxy repeats the TCPRepair process in step 2 to migrate the session (including cached Update messages) to the backup BGP; the backup BGP resumes normal operation, processes cached messages, and sends status announcements to neighbors.
[0027] BGP data synchronization (master and backup status consistency).
[0028] Data synchronization is achieved through CRIU, combining iterative synchronization and diskless synchronization to improve efficiency. The specific process is as follows:
[0029] 1. Initialization: (1) Primary BGP node: During normal operation, memory mirroring is set up and CRIU is enabled to track memory changes; (2) Backup BGP node: Mount a temporary file system (tmpfs) as a data buffer, start a CRIU page server, and listen on a specified port to receive data from the master node.
[0030] 2. Iterative Migration: During normal operation, the primary BGP node migrates BGP data (routing tables, configurations, etc.) to the backup node through multiple rounds of incremental synchronization. Each round of synchronization only transmits newly added or modified data and stores it in a separate directory; the primary node remains operational, ensuring uninterrupted service.
[0031] 3. Switching Phase: After the primary BGP enters a silent state and migrates the session to BGPProxy, it performs a final data synchronization (including the latest state). After the synchronization is complete, the primary node stops its service; BGPProxy continues to maintain the session.
[0032] 4. Backup node recovery: The backup BGP node loads the synchronized data through CRIU and restores the BGP process state; at this time, the backup node's routing table and configuration are completely consistent with those before the primary node switchover.
[0033] The complete handover process is shown in the following example.
[0034] 1. The primary BGP is running normally, establishing connections with neighbors and exchanging routes, while simultaneously initiating iterative data synchronization with the backup BGP;
[0035] 2. Triggering a switchover (e.g., an upgrade command): The primary BGP is configured in silent mode, and the session is migrated to BGPProxy via TCP Repair;
[0036] 3. BGPProxy takes over the session, responds with Keepalive and caches Update, and stops after the main BGP performs the last data synchronization;
[0037] 4. The backup BGP restores data via CRIU, and BGPProxy migrates the session to the backup BGP via TCP Repair;
[0038] 5. Prepare BGP to process cached Update messages, send route updates to neighbors, and the switchover is complete (the neighbors are unaware of the entire process).
[0039] It should be noted that, for the sake of simplicity, the above methods or process embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0040] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A non-disruptive routing implementation method based on CRIU + connection proxy, characterized in that, Includes the following steps: (1) Enable CRIU (User-space Checkpoint / Recovery) function on the primary and backup BGP nodes, and deploy BGPProxy connection proxy based on TCPRepair on the backup BGP node; (2) The primary BGP node migrates the BGP session to BGPProxy through TCP Repair. BGPProxy takes over and maintains the TCP connection and BGP neighbor session, while caching BGP messages. (3) The primary BGP node synchronizes the status and data of the BGP protocol with the backup BGP node through CRIU (excluding TCP session information). During the synchronization, the backup BGP node keeps the network silent. (4) After the primary and backup data synchronization is completed, BGPProxy migrates the BGP session to the backup BGP node through TCP Repair. The backup BGP node processes the cached BGP messages and resumes normal operation, realizing uninterrupted route switching.
2. The method according to claim 1, characterized in that, Before migrating the BGP session to BGPProxy in step (2), the primary BGP node needs to enter a silent state: stop actively sending update messages, but maintain the existing connection and passively respond, and restrict sending updates outward through route mapping configuration.
3. The method according to claim 1, characterized in that, The process of migrating a BGP session using TCP Repair in steps (2) and (4) includes: enabling TCP Repair mode, obtaining and exporting key parameters of the BGP connection (including sequence number, acknowledgment number, window size) and send / receive queue data, restoring parameters and queue data on the target node (BGPProxy or backup BGP), and disabling TCP Repair mode to restore normal communication.
4. The method according to claim 1, characterized in that, The CRIU data synchronization described in step (3) adopts a combination of iterative synchronization and diskless synchronization: by synchronizing data in multiple small batches, the amount of data synchronized in a single time is reduced; the synchronized data is transmitted directly through memory and network without going through disk storage, thereby improving synchronization efficiency.
5. The method according to claim 4, characterized in that, The iterative synchronization includes initializing the memory image, multiple rounds of incremental data migration, and complete data migration in the final switchover phase; the diskless synchronization achieves direct data transmission between the primary and backup nodes through a temporary file system (tmpfs) and a CRIU page server.
6. The method according to claim 1, characterized in that, The BGPProxy, as a lightweight connection proxy, is only responsible for maintaining TCP connections and the BGP state machine. It does not participate in route update propagation, responds to keepalive messages from BGP neighbors, and caches update messages for subsequent backup BGP nodes to process.
7. A non-disruptive routing implementation device based on CRIU+ connection agent, characterized in that, include: Session migration module: used to execute the BGP session migration steps described in claims 1, 2, and 3, and to achieve session switching between primary BGP, BGPProxy, and backup BGP through TCP Repair; Data synchronization module: used to execute the CRIU data synchronization steps described in claims 1, 4, and 5, to achieve consistency of status and data between primary and backup BGP nodes; Connection Proxy Module: Used to perform the BGPProxy function as described in claims 1 and 6, take over and maintain the BGP session, and cache update messages.
8. A non-disruptive routing implementation system based on CRIU+ connection proxy, characterized in that, It includes a primary BGP node, a backup BGP node, and a BGP Proxy; both the primary and backup BGP nodes support the CRIU function for status and data synchronization; the BGP Proxy is deployed on the backup BGP node and supports the TCP Repair function for taking over and migrating BGP sessions; the three work together to achieve uninterrupted BGP route switching.