Session keep-alive detection method and device for distributed system
By monitoring the sending and receiving of BGP keep-alive packets in the interface board of the distributed system, the problem of difficulty in locating routing jitter in the existing technology is solved, enabling rapid fault characterization and improving network stability and service continuity.
Patent Information
- Application Number
- CN202511428721.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-01-13
AI Technical Summary
Existing network monitoring systems struggle to detect abnormal BGP keep-alive packet transmission and reception in distributed architectures in a timely manner, making it difficult to locate and analyze the root causes of routing jitter issues.
By establishing BGP session entries in the interface board of the distributed system, setting packet receive counters and packet send counters, and monitoring the sending and receiving of BGP keep-alive messages through the inter-processor communication (IPC) channel, the cause of the fault can be quickly identified.
It enables abnormal monitoring of BGP keep-alive packets in distributed systems, quickly locating the cause of routing jitter and improving network stability and service continuity.
Smart Images

Figure CN121334007A_ABST
Abstract
Description
Technical Field
[0001] This application relates to communication technology, specifically a method and device for session keep-alive detection in a distributed system. Background Technology
[0002] With the rapid development of the Internet and enterprise networks, network scale and structural complexity are increasing daily, and data flow and business interconnection have become an indispensable foundation for modern socio-economic activities. As a core technology for achieving network node interconnection and efficient data flow, routing protocols play a crucial role. Commonly used routing protocols include Border Gateway Protocol (BGP), Open Shortest Path First (OSPF), and Intermediate System to Intermediate System (ISIS).
[0003] With the continuous expansion of network scale and the increasing demands of services, the problem of unstable routing sessions is becoming increasingly prominent, especially the phenomenon of route flapping. Route flapping refers to the frequent state changes of a routing path in a short period of time, leading to repeated updates of the routing table and continuous oscillations in the network topology. This phenomenon not only affects network stability but may also cause service interruptions or performance degradation.
[0004] In current operational practices, locating and analyzing the root causes of routing jitter presents significant challenges. Routing jitter is characterized by its stealth and transient nature, often lasting only a few seconds and proving difficult to reproduce afterward. Existing network monitoring systems and log collection mechanisms struggle to capture complete and granular anomaly information in a timely manner, making it impossible to reconstruct the session state changes in detail afterward.
[0005] Current monitoring methods are mostly based on the single-board architecture design of network devices, making it difficult to determine routing jitter caused by abnormal BGP keep-alive packet transmission and reception in distributed architectures. Summary of the Invention
[0006] The purpose of this application is to provide a method and device for detecting session keep-alive in a distributed system, and to detect whether the sending and receiving of BGP keep-alive messages on the interface board of the distributed system are abnormal.
[0007] To achieve the above objectives, this application provides a session keep-alive detection method for a distributed system. The method includes: each interface board receiving BGP session information of the distributed system's BGP peers synchronized by the main control board via an inter-processor communication (IPC) channel, which serves as an inter-board communication channel; wherein the information includes at least the BGP peer IP address and the maximum keep-alive time; each interface board establishing a BGP session entry to record the maximum keep-alive time corresponding to the BGP peer IP address, setting a receive counter and a send counter for the BGP session entry record, and setting a first cycle flag bit for both the receive counter and the send counter; when any interface board finds its own BGP session entry based on the received peer BGP keep-alive message, it clears the count value of its receive counter to zero and removes the first cycle flag bit.
[0008] To achieve the above objectives, this application provides a session keep-alive detection device for a distributed system. This device is used as an interface board in a distributed system and includes a processor and a machine-readable storage medium. The processor executes machine-executable instructions recorded on the machine-readable storage medium to perform the following operations: receiving BGP session information synchronized via the main control board of the distributed system through an inter-processor communication (IPC) channel serving as an inter-board communication channel; this information includes at least the IP addresses of the BGP peers in the distributed system and their maximum keep-alive time; establishing a BGP session entry to record the maximum keep-alive time corresponding to the BGP peer IP address; setting a receive counter and a send counter for the BGP session entry; and setting a first-cycle flag bit for both the receive and send counters; when the source IP address of a peer BGP keep-alive message received by the interface of this board matches the BGP session entry, the receive counter value of the BGP session entry is cleared and the first-cycle flag bit is removed.
[0009] The beneficial effect of this application is that by monitoring the sending and receiving of BGP keep-alive packets on the interface board of the distributed system, the cause of the fault can be quickly identified when routing jitter occurs. Attached Figure Description
[0010] Figure 1 A flowchart illustrating an embodiment of a session keep-alive detection method for a distributed system provided in this application;
[0011] Figure 2 A schematic diagram illustrating BGP session keep-alive detection in the distributed system provided in this application;
[0012] Figure 3 This is a schematic diagram of BGP session entries provided in an embodiment of this application;
[0013] Figure 4 A schematic diagram of BGP session keep-alive packet sending and receiving in the distributed system provided in this application;
[0014] Figure 5 This is a schematic diagram of an embodiment of a session keep-alive detection device for a distributed system provided in this application. Detailed Implementation
[0015] The following detailed description will be provided with reference to several examples illustrated in the accompanying figures. In this detailed description, numerous specific details are used to provide a comprehensive understanding of the present application. Known methods, steps, components, and circuits are not described in detail in the examples to avoid obscuring their meaning.
[0016] In the terminology used, the term "including" means including but not limited to; the term "containing" means including but not limited to; the terms "above," "within," and "below" include the number itself; the terms "greater than" and "less than" mean not including the number itself. The term "based on" means based on at least a portion of them.
[0017] Figure 1 A flowchart illustrating an embodiment of a session keep-alive detection method for a distributed system provided in this application includes the following steps:
[0018] Step 101: Each interface board receives BGP session information of the distributed system's BGP peers synchronized by the main control board through the inter-processor communication (IPC) channel, which serves as the inter-board communication channel; the information includes at least the BGP peer IP address and the maximum keep-alive time.
[0019] Step 102: For each interface board, establish a BGP session entry to record the maximum keep-alive time corresponding to the BGP peer IP address, set a receive counter and a send counter for the BGP session entry, and set a first cycle flag bit for the receive counter and the send counter respectively.
[0020] Step 103: When any interface board finds its own BGP session table entry based on the received peer BGP keep-alive message, it clears the count value of its own packet receive counter and removes the first cycle flag.
[0021] Figure 1 The beneficial effect of this embodiment is that by monitoring the sending and receiving of BGP keep-alive packets on the interface board of the distributed system, the cause of the fault can be quickly identified when routing jitter occurs.
[0022] Figure 2 This is a schematic diagram illustrating session keep-alive detection in the distributed system provided in this application.
[0023] The BGP protocol process of the processor 231 on the main control board 23 of the distributed system establishes a BGP session with the BGP peer 24. The main control board 23 sends BGP session information synchronization messages 23a and 23b to the interface boards 21 and 22 through the IPC channel (Inter-Processor Communication), which serves as the inter-board communication channel. The BGP session information synchronization messages 23a and 23b include at least the IP address of the BGP peer (IP 1.1.1.1) and the maximum keep-alive time, such as 180 seconds.
[0024] Figure 3 This is a schematic diagram of BGP session entries provided in an embodiment of this application.
[0025] Figure 3 In the process, processor 211 receives BGP session information synchronization message 23a and records BGP session table entry 2141; the BGP peer IP address IP 1.1.1.1 and the maximum keep-alive time of 180 seconds are recorded. Processor 211 sets receive counter 2141 and send counter 2142 for BGP session table entry 2141; and sets the first cycle flag bit 01 for each of the receive counter 2141 and send counter 2142.
[0026] Processor 221 receives BGP session information synchronization message 23b and records BGP session table entry 2241; which records the BGP peer IP address IP 1.1.1.1 and the maximum keep-alive time of 180 seconds. Processor 221 sets receive counter 2241 and send counter 2242 for BGP session table entry 2241; and sets the first cycle flag bit 01 for each of the receive counter 2241 and send counter 2242.
[0027] Figure 4 This is a schematic diagram of BGP session keep-alive packet sending and receiving in the distributed system provided in this application.
[0028] Since the keep-alive messages of the BGP protocol usually have a unique send and receive path, the BGP keep-alive messages between the distributed system and the BGP peer 24 are sent and received through only one interface board.
[0029] Figure 4 In the process, the processor 211 of the interface board 21 receives the BGP keep-alive message 41 through the driver 213, finds the BGP session table entry 2141 based on the source IP address of the BGP keep-alive message 41, clears the count value of the receive counter 2141 to zero, and clears the first cycle flag bit 01 of the receive counter 2141.
[0030] The processor 211 of the interface board 21 receives the BGP keep-alive message 42 from the main control board 23 through the IPC channel 213; based on the destination IP address (i.e., the peer IP address) of the BGP keep-alive message 42, it finds the BGP session table entry 2141, determines that the first cycle flag bit of the packet sending counter 2142 is 01, clears the count value of the packet sending counter 2142 to zero, and clears the first cycle flag bit 01 of the packet receiving counter 2142.
[0031] Subsequently, the processor 211 of the interface board 21 receives a BGP keep-alive message from the BGP peer 24 through the driver 213. Based on the source IP address of the BGP keep-alive message, it finds the BGP session table entry 2141, determines that the receive counter 2141 has not set the first cycle flag bit, and clears the count value of the receive counter 2141 to zero.
[0032] The processor 211 of the interface board 21 receives the BGP keep-alive message from the distributed system of the main control board 23 through the IPC channel 213; based on the destination IP address of the keep-alive message 42 of this system, it finds the BGP session table entry 2141, determines that the packet sending counter 2142 has not set the first cycle flag bit, and clears the count value of the packet sending counter 2142 to zero.
[0033] The processor 221 of the interface board 22 determines that the count value of the packet receiving counter 2241 of the BGP session table entry 224 of this board has reached the maximum keep-alive time and the first cycle flag bit 01 has been set, and deletes the packet sending counter 2241 of the BGP session table entry 224 of this board; to avoid erroneous reporting of BGP keep-alive message packet receiving abnormality.
[0034] The processor 221 of the interface board 22 determines that the packet counter 2242 of the BGP session table entry 224 of this board has reached the maximum keep-alive time and the first cycle flag bit 01 has been set, and deletes the packet counter 2242 of the BGP session table entry 224 of this board; to avoid erroneous reporting of BGP keep-alive message packet transmission abnormality.
[0035] When the processor 211 of interface board 21 determines that the packet receive counter value 2141 of the BGP session table entry 214 of this board has reached the maximum keep-alive time and the first cycle flag has not been set, it sends a BGP keep-alive packet receive error message to the main control board 23 through the IPC channel so that the main control board 23 records the BGP keep-alive packet receive error fault. Alternatively,
[0036] When the processor 211 of the interface board 21 determines that the packet sending counter value 2142 of the BGP session table entry 214 of this board has reached the maximum keep-alive time and the first cycle identifier has not been set, it sends a BGP keep-alive packet sending abnormal message to the main control board 23 through the IPC channel so that the main control board 23 can record the BGP keep-alive packet receiving abnormal fault.
[0037] The beneficial effect of this application is that by monitoring the sending and receiving of BGP keep-alive packets on the interface board of the distributed system, the cause of the fault can be quickly identified when routing jitter occurs.
[0038] Figure 5 This is a schematic diagram of an embodiment of a session keep-alive detection device for a distributed system provided in this application. The device 50 is used as an interface board for a distributed system; the device 50 includes a processor 51 and a machine-readable storage medium 52.
[0039] Processor 51 executes the machine-executable instructions recorded in machine-readable storage medium 52 to perform the following operations: receiving BGP session information synchronized via the main control board of the distributed system through the inter-processor communication (IPC) channel, which serves as an inter-board communication channel; wherein, at least the IP addresses of the BGP peers in the distributed system and the maximum keep-alive time are included; establishing a BGP session entry to record the maximum keep-alive time corresponding to the BGP peer IP address; setting a receive counter and a send counter for the BGP session entry; setting a first cycle flag bit for the receive counter and the send counter respectively; when the source IP address of the peer BGP keep-alive message received by the local board interface is found in the BGP session entry, the receive counter value of the BGP session entry is cleared to zero and the first cycle flag bit is cleared.
[0040] The processor 51 performs the following operations by running machine-executable instructions recorded in the machine-readable storage medium 52: when the receive counter value of the BGP session table entry reaches the maximum keep-alive time, checks whether the first cycle flag of the receive counter is set, and deletes the receive counter.
[0041] The processor 51 executes the machine-executable instructions recorded in the machine-readable storage medium 52 to perform the following operations: receive the system's BGP keep-alive message from the main control board through the IPC channel; locate the BGP session entry based on the destination IP address of the system's BGP keep-alive message; clear the first cycle flag of the packet counter of the BGP session entry; reset the count value of the packet counter of the BGP session entry to zero; locate the outgoing interface of the destination IP address of the system's BGP keep-alive message; and send the system's BGP keep-alive message through the outgoing interface.
[0042] The processor 51 executes the machine-executable instructions recorded in the machine-readable storage medium 52 to perform the following operations: when any interface board determines that the packet counter value of the BGP session entry on its own board has reached the maximum keep-alive time and the first cycle flag has been set, the packet counter of the BGP session entry is deleted.
[0043] Processor 51 executes the machine-executable instructions recorded in machine-readable storage medium 52 to perform the following operations: Based on the source IP address of the received peer BGP keepalive message, it locates the BGP session table entry; determines that the receive packet counter has not set the first cycle flag; and resets the receive packet counter value to zero. Alternatively, it determines that the receive packet counter value of the BGP session table entry has reached the maximum keepalive time and has not set the first cycle flag; and sends a BGP keepalive message receive error message to the main control board via the IPC channel. Alternatively, it receives a local system BGP keepalive message from the main control board via the IPC channel; based on the destination IP address of the local system BGP keepalive message, it locates the BGP session table entry; determines that the send packet counter has not set the first cycle flag; and resets the counter value to zero. It also determines that the send packet counter value of the BGP session table entry has reached the maximum keepalive time and has not set the first cycle flag; and sends a BGP keepalive message send error message to the main control board via the IPC channel.
[0044] In this application, a machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device used to store or contain information (such as executable instructions, data, etc.). For example, any machine-readable storage medium described herein can be any type of random access memory (RAM), volatile memory, non-volatile memory, flash memory, storage drive (such as a hard disk drive), solid-state drive, any type of optical disc (such as an optical disc, DVD, etc.), and similar devices, or combinations thereof. Furthermore, any machine-readable storage medium described herein can be a non-transitory machine-readable storage medium.
[0045] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for session keep-alive detection in a distributed system, characterized in that, The method includes, Each interface board receives BGP session information of the distributed system's BGP peers synchronized by the main control board through the inter-processor communication (IPC) channel, which serves as the inter-board communication channel; this information includes at least the BGP peer IP address and the maximum keep-alive time. Each interface board establishes a BGP session entry to record the maximum keep-alive time corresponding to the BGP peer IP address, sets a packet receiving counter and a packet sending counter for the BGP session entry record, and sets a first cycle flag bit for the packet receiving counter and the packet sending counter respectively; When any of the interface boards finds the BGP session table entry of its own board based on the received peer BGP keep-alive message, it clears the count value of the packet receive counter of its own board to zero and clears the first cycle flag bit.
2. The method according to claim 1, characterized in that, The method also includes, When any of the interface boards determines that the packet receive counter value of the BGP session table entry on its own board has reached the maximum keep-alive time and the first period flag is set, the packet receive counter of the BGP session table entry on its own board is deleted.
3. The method according to claim 1, characterized in that, The method also includes, When any of the interface boards receives a BGP keep-alive message from the main control board via the IPC channel; The interface is located based on the BGP peer IP address carried in the BGP keep-alive message of this system. By sending the BGP keep-alive message of this system through the found outgoing interface, the count value of the packet sending counter of the BGP session table entry of this board is cleared to zero, and the first cycle flag bit of the packet sending counter of the BGP session table entry of this board is cleared.
4. The method according to claim 1, characterized in that, The method also includes, When any of the interface boards determines that the packet sending counter value of the BGP session table entry on its own board has reached the maximum keep-alive time and the first period flag is set, the packet sending counter of the BGP session table entry on its own board is deleted.
5. The method according to claim 1, characterized in that, The method also includes, When any of the interface boards finds the BGP session table entry of its own board based on the received peer BGP keep-alive message, and determines that the packet receiving counter of its own board has not set the first cycle flag bit, the count value of the packet receiving counter of its own board is cleared to zero. When any of the interface boards determines that the packet receiving counter value of the BGP session table entry on its own board has reached the maximum keep-alive time and the first period identifier has not been set, it sends a BGP keep-alive packet receiving abnormal message to the main control board through the IPC channel; or, Each of the interface boards receives a local system BGP keep-alive message from the main control board through the IPC channel; Based on the destination IP address of the BGP keep-alive message of this system, the BGP session table entry of this board is found, it is determined that the packet sending counter of this board is not set with the first period flag bit, and the count value of the packet sending counter of this board is cleared to zero. or, When any of the interface boards determines that the packet sending counter value of the BGP session table entry on its own board has reached the maximum keep-alive time and the first period identifier has not been set, it sends a BGP keep-alive packet sending error message to the main control board through the IPC channel.
6. A session keep-alive detection device for a distributed system, characterized in that, The device is used as an interface board in a distributed system. The device includes a processor and a machine-readable storage medium. The processor performs the following operations by executing machine-executable instructions recorded in the machine-readable storage medium. The system receives BGP session information synchronized via the main control board of the distributed system through the inter-processor communication (IPC) channel, which serves as an inter-board communication channel; wherein, at least the IP address of the BGP peer of the distributed system and the maximum keep-alive time are included. Establish a BGP session table entry to record the maximum keep-alive time corresponding to the BGP peer IP address, set a packet receiving counter and a packet sending counter for the BGP session table entry record, and set a first cycle flag bit for the packet receiving counter and the packet sending counter respectively; When the source IP address of the peer BGP keep-alive message received by this board interface is found in the BGP session table entry, the packet receive counter value of the BGP session table entry is cleared to zero and the first cycle flag is cleared.
7. The device according to claim 6, characterized in that, The processor performs the following operations by executing machine-executable instructions recorded on the machine-readable storage medium. When the packet receive counter value of the BGP session table entry reaches the maximum keep-alive time, check if the packet receive counter has the first cycle flag set, and delete the packet receive counter.
8. The device according to claim 6, characterized in that, The processor performs the following operations by executing machine-executable instructions recorded on the machine-readable storage medium. The system receives a BGP keep-alive message from the main control board via the IPC channel. The BGP session table entry is located based on the destination IP address of the BGP keep-alive message in this system. Clear the first cycle flag bit of the packet sending counter in the BGP session table entry; Clear the packet sending counter value of the BGP session table entry to zero. Locate the destination IP address of the BGP keep-alive message in this system. The system sends a BGP keep-alive message through the outgoing interface.
9. The device according to claim 6, characterized in that, The processor performs the following operations by executing machine-executable instructions recorded on the machine-readable storage medium. When any of the interface boards determines that the packet counter value of the BGP session entry on its board has reached the maximum keep-alive time and the first period flag has been set, the packet counter of the BGP session entry is deleted.
10. The device according to claim 6, characterized in that, The processor performs the following operations by executing machine-executable instructions recorded on the machine-readable storage medium. Based on the source IP address of the received peer BGP keep-alive message, the BGP session table entry is located, and it is determined that the first period flag bit is not set in the packet receive counter. The count value of the packet receive counter is then cleared to zero. or, If the packet reception counter value of the BGP session entry reaches the maximum keep-alive time and the first period identifier is not set, a BGP keep-alive packet reception error message is sent to the main control board through the IPC channel. or, The system receives a BGP keep-alive message from the main control board through the IPC channel; based on the destination IP address of the system's BGP keep-alive message, the BGP session table entry is found, it is determined that the packet sending counter has not set the first period flag bit, and the count value of the counter is cleared to zero; If the packet counter value of the BGP session table entry on this board reaches the maximum keep-alive time and the first period identifier is not set, a BGP keep-alive packet sending error message is sent to the main control board through the IPC channel.