[go: up one dir, main page]

CN114244769A - Method, equipment and storage medium for sending keep-alive message - Google Patents

Method, equipment and storage medium for sending keep-alive message Download PDF

Info

Publication number
CN114244769A
CN114244769A CN202111425483.6A CN202111425483A CN114244769A CN 114244769 A CN114244769 A CN 114244769A CN 202111425483 A CN202111425483 A CN 202111425483A CN 114244769 A CN114244769 A CN 114244769A
Authority
CN
China
Prior art keywords
bgp
tcp
standby
socket
main
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202111425483.6A
Other languages
Chinese (zh)
Inventor
谢皓鑫
梅海涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd Hefei Branch
Original Assignee
New H3C Technologies Co Ltd Hefei Branch
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd Hefei Branch filed Critical New H3C Technologies Co Ltd Hefei Branch
Priority to CN202111425483.6A priority Critical patent/CN114244769A/en
Publication of CN114244769A publication Critical patent/CN114244769A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a method, equipment and storage medium for sending keep-alive messages. Backing up TCP information of a transmission layer control protocol TCP connection connected with a BGP neighbor to a BGP standby process of standby control equipment by a BGP main process of the main control equipment; the BGP standby process establishes a standby socket based on the IP address of the TCP information source, the protocol type and the TCP source port number which are configured and backed up; monitoring a main socket connected with a TCP (transmission control protocol) of a BGP main process by a BGP standby process; the BGP main process restarts and closes the main socket; the BGP standby process monitors that the main socket is closed, activates the standby socket and obtains a TCP serial number based on TCP information; the BGP standby process uses the activated standby socket to send a keep-alive message to the BGP neighbor through the TCP connection; wherein, the TCP serial number of the keep-alive message is the obtained TCP serial number plus 1.

Description

Method, equipment and storage medium for sending keep-alive message
Technical Field
The present application relates to communications technologies, and in particular, to a method, a device, and a storage medium for sending keep-alive messages.
Background
BGP (Border Gateway Protocol) is a dynamic routing Protocol that can be used both between different ASs (Autonomous systems) and within the same AS. The BGP Protocol uses TCP (Transmission Control Protocol) as its transport layer Protocol. BGP may establish Neighbor relations (neighbors) across multi-hop routing devices.
After the routing equipment establishes BGP neighbor relations with other routing equipment, the routing equipment respectively sends keep-alive messages at regular time according to a keep-alive timer, and when the routing equipment cannot receive the keep-alive messages of the BGP neighbors in specified time, the neighbor relations are disconnected.
In a frame communication device with a plurality of main control boards, a main process and a standby process of a BGP protocol are respectively operated on the main control board and the standby control board, when main/standby switching between the main control board and the standby control board occurs, OSPF link state information is backed up from the main process of the main control board BGP to neighbor information of the BGP standby process of the standby control board based on NSR (non-stop Routing) technology, thereby ensuring that BGP neighbors/peers cannot sense the BGP protocol interruption.
In an IRF (intelligent resilient Framework) system, a BGP main process and a BGP standby process respectively run in a Master control device (Master) and a Slave device (Slave), and when a Master-Slave switch occurs between a member device serving as the Master control device and a member device serving as the Slave, the BGP main process needs to be switched to the BGP standby process by relying on an NSR as well. And the main process and the standby process of the slave BGP protocol run in different member devices.
However, when the BGP host process and the standby process of the frame router or the IRF system are switched, the BGP standby process is started based on the necessary protocol state and data that are backed up in advance, and sends the keep-alive message. However, when the BGP route amount is large, the route attribute is discrete, and there are many route messages, the BGP backup process cannot send keep-alive messages in time due to long switching time between the BGP host process and the backup process, and when the time when the BGP neighbor does not receive the keep-alive messages is overtime, the neighbor relationship is broken, causing route oscillation.
Disclosure of Invention
The present application aims to provide a method, a device, and a storage medium for sending keep-alive messages, so that a BGP standby process of a standby control device keeps-alive messages before switching, and thereby BGP neighbor relations are prevented from being disconnected overtime.
In order to achieve the above purpose, the present application provides a method for sending keep-alive messages, which includes that a BGP main process of a main control device backups TCP information connected with a transport layer control protocol (TCP) of a BGP neighbor to a BGP standby process of a standby control device; the BGP standby process establishes a standby socket based on the configured and backed-up TCP information source IP address, the protocol type and the TCP source port number; monitoring a main socket connected with a TCP (transmission control protocol) of a BGP main process by a BGP standby process; the BGP main process restarts and closes the main socket; the BGP standby process monitors that the main socket is closed, activates the standby socket and obtains a TCP serial number based on TCP information; the BGP standby process uses the activated standby socket to send a keep-alive message to the BGP neighbor through the TCP connection; wherein, the TCP serial number of the keep-alive message is the obtained TCP serial number plus 1.
In order to achieve the above object, the present application further provides a device for sending keep-alive messages, where the device includes a processor and a memory; the memory is used for storing processor executable instructions; the processor is used for sending the keep-alive messages by running processor executable instructions in the memory.
To achieve the above object, the present application also provides a computer-readable storage medium for storing processor-executable instructions that, when executed by a processor, implement keep-alive messages.
The method and the device have the advantages that before the BGP standby process is upgraded into the BGP main process, the BGP standby process activates the standby socket to send the keep-alive messages of the TCP connection to the BGP neighbors, and the situation that the BGP neighbors do not receive the keep-alive messages through the TCP connection for a long time due to long switching time of the BGP main and standby processes is avoided, and the BGP neighbor relation is disconnected.
Drawings
Fig. 1 is a flowchart of a keep-alive message sending method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of another embodiment of a keep-alive message sending method provided in the present application;
fig. 3 is a schematic diagram of a frame-type communication device suitable for the keep-alive message sending method shown in fig. 2 according to the present invention;
fig. 4 is a schematic diagram of a device that sends a keep-alive packet according to an embodiment of the present application.
Detailed Description
A detailed description will be given of a number of examples shown in a number of figures. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the present application. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the examples.
The term "including" as that term is used is meant to include, but is not limited to; the term "comprising" means including but not limited to; the terms "above," "within," and "below" include the instant numbers; the terms "greater than" and "less than" mean that the number is not included. The term "based on" means based on at least a portion thereof.
Fig. 1 is a flowchart illustrating an embodiment of a method for sending keep-alive messages according to the present application, where the method includes,
step 101, a BGP main process of a main control device backups TCP information of a transmission layer control protocol TCP connection connected with a BGP neighbor to a BGP standby process of a standby control device;
102, establishing a standby socket by a BGP standby process based on a configuration backup TCP information source IP address, a protocol type and a TCP source port number;
103, monitoring a main socket connected with TCP of a BGP main process by a BGP standby process;
104, restarting and closing a main socket by the BGP main process;
step 105, the BGP standby process monitors that the main socket is closed, activates the standby socket and obtains a TCP serial number based on TCP information;
106, the BGP standby process uses the activated standby socket to send a keep-alive message to a BGP neighbor through the TCP connection; wherein, the TCP serial number of the keep-alive message is the obtained TCP serial number plus 1.
The method and the device have the advantages that before the BGP standby process is upgraded into the BGP main process, the BGP standby process activates the standby socket to send the keep-alive messages of the TCP connection to the BGP neighbors, and the situation that the BGP neighbors do not receive the keep-alive messages through the TCP connection for a long time due to long switching time of the BGP main and standby processes is avoided, and the BGP neighbor relation is disconnected.
Fig. 2 is a schematic diagram illustrating another embodiment of a keep-alive message sending method provided by the present application. In the frame communication device shown in fig. 3, a main control board 1 is a main control device for running a BGP main process, and main control boards 2 and 3 are standby control devices for running a BGP standby process; the main control board 2 and the main control board 3 elect the main control board 2 as the preferred standby equipment through the HA protocol message, and the main control board 2 starts the BGP uninterrupted routing function. If the performance of the main control board 2 is reduced, the main control board 3 is elected as a new preferred standby device through re-election, and the main control board 2 closes the BGP uninterrupted routing function; the main control board 3 starts the BGP uninterrupted routing function.
If the main control board 3 is removed from the frame communication device, the main control board 2, as a preferred standby device, starts the BGP uninterrupted routing function.
The method shown in fig. 2 is explained below with reference to fig. 3.
The BGP standby process run by the main control board 2 determines that the standby control device is elected as the preferred standby device role, and starts the BGP uninterrupted routing function.
The BGP main process of the main control board 1 backs up TCP information connected with a transport layer control protocol TCP connected with a BGP neighbor to the BGP standby process of the main control board 2. The BGP backup process establishes a backup socket based on the TCP information source IP address, the protocol type and the TCP source port number of the configuration backup.
The BGP standby process monitors a main socket of the TCP connection of the BGP main process. In the application, the BGP standby process can register a protocol control block PCB state change event to the TCP, and monitor the information of the PCB of the TCP of the BGP main process through the registered PCB state change event of the TCP; or, the BGP standby process sets a monitoring timer; and when the monitoring timer arrives, the BGP standby process calls the TCP interface to acquire the PCB information of the TCP protocol of the BGP main process.
When the BGP host process running on the processor of the main control board 1 receives the restart signal, the BGP host process executes a restart, the host socket connection of the BGP host process is closed, and the BGP NSR state of the BGP host process changes from "READY" to "Closed (CLOSING)". A BGP standby process running by a processor of the main control board 2 monitors that a main socket is closed, and the BGP standby process acquires quintuple information of TCP connection based on the backup TCP information; the quintuple information comprises an IP address of a BGP neighbor serving as a target IP address and a protocol TCP port number of an NSR (non-stop routing) of the BGP neighbor; an IP address of a BGP host process as a source IP address; TCP port number of NSR protocol of BGP main process and virtual forwarding instance mark; the BGP standby process associates the standby socket with the quintuple information; and activating the standby socket, wherein the BGP protocol supports multi-VRF (virtual forwarding instance) and TCP (transmission control protocol) bidirectional connection, and the standby socket is associated with the correct and unique TCP connection by associating the standby socket with the quintuple.
The BGP standby process of the main control board 2 acquires a TCP serial number from the backup TCP information, and an activated standby socket sends a keep-alive message to a BGP neighbor through TCP connection; wherein, the TCP serial number of the keep-alive message is added with 1 on the basis of the TCP serial number of the acquired backup TCP information. The BGP standby process of the main control board 2 starts a timer of the keep-alive message transmission period.
Before the BGP standby process of the main control board 2 is upgraded into the BGP main process, the method and the device can quickly sense the closing of the TCP main socket on the main control board 1, activate the standby socket to send a protection message, and avoid the phenomenon that the TCP connection between the frame communication equipment and a BGP neighbor is disconnected due to the long switching time of the BGP main and standby processes on the main control board 1 and the main control board 2, so that the route is vibrated.
The BGP standby process of the main control board 2 is switched to the BGP main process, and the BGP uninterrupted routing function is closed.
The embodiment of fig. 2 may be used with an IRF system in addition to the block communication device shown in fig. 3. In the IRF system, a member device in a master (master) role is a master control device running a BGP master process, and a member device in a Slave (Slave) role is a Slave control device running a BGP Slave process. In an IRF system, a member device is selected from among devices as a preferred standby device. And the BGP standby process operated by the BGP standby control equipment as the preferred standby equipment starts the BGP uninterrupted routing function.
Referring to fig. 4, the device 400 for sending keep-alive messages according to the embodiment of the present application further includes a communication interface 402 and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete communication with each other through the communication bus 404. The 400 may be used as a master card of a frame communication device, a member device of an IRF system. Processor 401 of device 400 is configured to implement the keep-alive messaging method illustrated in fig. 2 by executing processor-executable instructions in memory 403.
An embodiment of the present application further provides a computer-readable storage medium, where processor-executable instructions are stored in the computer-readable storage medium, and when the processor-executable instructions are executed by a processor, the keep-alive message sending method according to fig. 1, fig. 2, and fig. 3 of the present application is implemented.
The above description is only for the preferred embodiment of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (10)

1. A method of sending keep-alive messages, the method comprising,
backing up TCP information connected with a transmission layer control protocol TCP connected with a BGP neighbor to a BGP standby process of standby control equipment by a BGP main process of the main control equipment;
the BGP standby process establishes a standby socket based on the TCP information source IP address, the protocol type and the TCP source port number which are configured and backed up;
the BGP standby process monitors a main socket connected with a TCP of the BGP main process;
the BGP main process restarts and closes the main socket;
the BGP standby process monitors that the main socket is closed, activates the standby socket and acquires a TCP serial number based on the TCP information;
the BGP standby process uses the activated standby socket to send a keep-alive message to the BGP neighbor through the TCP connection; wherein, the TCP serial number of the keep-alive message is the obtained TCP serial number plus 1.
2. The method of claim 1, wherein the monitoring, by the BGP backup process, of a host socket of a TCP connection of the BGP host process comprises:
the BGP standby process registers a protocol control block PCB state change event to a TCP protocol;
and the BGP standby process monitors the PCB information of the TCP protocol of the BGP main process through the registered PCB state change event of the TCP protocol.
3. The method of claim 1, wherein the monitoring, by the BGP backup process, of a host socket of a TCP connection of the BGP host process comprises:
the BGP standby process sets a monitoring timer;
and when the monitoring timer arrives, the BGP standby process calls a TCP interface to acquire the PCB information of the TCP protocol of the BGP main process.
4. The method of claim 1, wherein before the primary control device BGP host process backups TCP information of a transport layer control protocol TCP connection connecting BGP neighbors to the BGP backup process of the backup control device, the method further comprises:
and the BGP standby process determines that the standby control equipment is elected as the preferred TCP uninterrupted routing equipment, and starts a BGP uninterrupted routing function.
5. The method of claim 1, wherein the BGP standby process activating the standby socket comprises:
the BGP standby process acquires quintuple information of the TCP connection based on the backup TCP information; the five-tuple information comprises an IP address of the BGP neighbor as a destination IP address and a protocol TCP port number of an NSR (non-stop routing) of the BGP neighbor; an IP address of the BGP host process as a source IP address; the TCP port number of the NSR protocol of the BGP main process and the virtual forwarding instance identifier;
the BGP standby process associates the standby socket with the quintuple information;
and the BGP standby process activates the standby socket.
6. The method of claim 5, further comprising:
the BGP standby process starts a timer of a keep-alive message sending period;
and the BGP standby process is switched to a new BGP main process.
7. The method of claim 6, further comprising:
and the new BGP main process closes the BGP uninterrupted routing function.
8. The method of claim 5, wherein before the BGP host process of the primary control device backing up TCP information of a transport layer control protocol, TCP, connection to a BGP neighbor to the BGP backup process of the backup control device, the method further comprises:
and the BGP standby process determines that the standby control equipment is degraded to common standby control equipment by the optimized TCP uninterrupted routing equipment, and closes the BGP uninterrupted routing function.
9. A device for sending keep-alive messages is characterized by comprising a processor and a memory; the memory is to store processor-executable instructions; wherein the processor implements the method of sending keep-alive messages according to any one of claims 1 to 8 by executing processor-executable instructions in the memory.
10. A computer-readable storage medium having stored therein processor-executable instructions that, when executed by a processor, perform a method of sending keep-alive messages according to any one of claims 1 to 8.
CN202111425483.6A 2021-11-26 2021-11-26 Method, equipment and storage medium for sending keep-alive message Withdrawn CN114244769A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111425483.6A CN114244769A (en) 2021-11-26 2021-11-26 Method, equipment and storage medium for sending keep-alive message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111425483.6A CN114244769A (en) 2021-11-26 2021-11-26 Method, equipment and storage medium for sending keep-alive message

Publications (1)

Publication Number Publication Date
CN114244769A true CN114244769A (en) 2022-03-25

Family

ID=80751723

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111425483.6A Withdrawn CN114244769A (en) 2021-11-26 2021-11-26 Method, equipment and storage medium for sending keep-alive message

Country Status (1)

Country Link
CN (1) CN114244769A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116319539A (en) * 2022-12-29 2023-06-23 网络通信与安全紫金山实验室 Message processing method, device, equipment and readable storage medium
CN117395189A (en) * 2023-12-08 2024-01-12 新华三技术有限公司 Routing processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060068532A (en) * 2004-12-16 2006-06-21 한국전자통신연구원 Router Redundancy Device Using Fault Tolerant TC / IP Protocol and Its Method
US20150032904A1 (en) * 2012-07-25 2015-01-29 Hangzhou H3C Technologies Co., Ltd. Non-Stop Routing of Routing Protocol
WO2017219779A1 (en) * 2016-06-21 2017-12-28 中兴通讯股份有限公司 Device active/standby switchover method and apparatus based on link protocol, and storage medium
CN109951819A (en) * 2019-03-19 2019-06-28 新华三技术有限公司 A kind of message forwarding method and device
CN110958176A (en) * 2019-11-20 2020-04-03 烽火通信科技股份有限公司 System and method for controlling uninterrupted routing during switching of main and standby control planes

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060068532A (en) * 2004-12-16 2006-06-21 한국전자통신연구원 Router Redundancy Device Using Fault Tolerant TC / IP Protocol and Its Method
US20150032904A1 (en) * 2012-07-25 2015-01-29 Hangzhou H3C Technologies Co., Ltd. Non-Stop Routing of Routing Protocol
WO2017219779A1 (en) * 2016-06-21 2017-12-28 中兴通讯股份有限公司 Device active/standby switchover method and apparatus based on link protocol, and storage medium
CN109951819A (en) * 2019-03-19 2019-06-28 新华三技术有限公司 A kind of message forwarding method and device
CN110958176A (en) * 2019-11-20 2020-04-03 烽火通信科技股份有限公司 System and method for controlling uninterrupted routing during switching of main and standby control planes

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116319539A (en) * 2022-12-29 2023-06-23 网络通信与安全紫金山实验室 Message processing method, device, equipment and readable storage medium
CN117395189A (en) * 2023-12-08 2024-01-12 新华三技术有限公司 Routing processing method and device

Similar Documents

Publication Publication Date Title
US7894335B2 (en) Redundant routing capabilities for a network node cluster
CN101588304B (en) Implementation method of VRRP and device
CN102404146B (en) Master-slave switching method, network device and DHCP server
CN103227792B (en) Smooth restarting implementation method in IS-IS network and equipment
CN102624635B (en) Method and device for realizing graceful restart
WO2009067865A2 (en) Method, router, line card and active master card for realizng a link state database synchronization
CN105164991A (en) Redundancy network protocol system
WO2012129137A1 (en) System and method for failover recovery at geo-redundant gateways
CN109495345B (en) BFD processing method and network equipment
CN103200109B (en) A kind of ospf neighbor relationship management method and equipment
CN100579076C (en) A method for establishing a neighbor relationship and a router
CN114244769A (en) Method, equipment and storage medium for sending keep-alive message
CN105340226A (en) Primary and secondary system handover method for dynamic route device, and apparatus thereof
CN105939254B (en) The method and device of VRRP backup group state switching
KR101017540B1 (en) Uninterrupted network control message during local node shutdown
CN113055196B (en) Message processing method, network device and computer readable storage medium
CN111953591A (en) Fault processing method and device
JP3493035B2 (en) Dynamic path switching method
CN102361474B (en) Method and equipment for realizing GR (Graceful Restart) treatment
US10642702B1 (en) Mechanism for faster control plane switchover
CN112398731A (en) Method for processing message and first network equipment
CN115801555B (en) Main-standby switching method and device based on preemption delay and electronic equipment
CN115102897B (en) Stacking splitting protection method based on link aggregation
CN102035744A (en) Method for performing communication among virtual router redundancy protocol (VRRP) routers and routers
JPH0991233A (en) Network connection device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20220325

WW01 Invention patent application withdrawn after publication