Active / standby BFD session parameter synchronization method, device, equipment, and storage medium

By simplifying the time parameter determination method on the backup master disk, the resource consumption and mapping relationship dependency issues in master-slave BFD session parameter synchronization are resolved, parameter synchronization and session state consistency between the master and backup disks are achieved, and abnormal interruptions are avoided.

CN118921380BActive Publication Date: 2025-09-26FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410936860.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2025-09-26
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

In the existing technology, the method for synchronizing the active and standby BFD session parameters requires additional hardware or software resources and relies on the mapping relationship between the BFD ID and the local session entry number, resulting in the inability to guarantee the synchronization of session parameters between the active and standby disks, which may cause abnormal session interruption.

Method used

A simplified time parameter determination method is designed on the backup master control disk. By judging the session entry status and received BFD control packets, the actual sending and detection periods are determined to achieve parameter synchronization with the active master control disk, avoiding additional resource consumption and mapping relationship dependence.

Benefits of technology

This achieves synchronization of active and standby BFD session parameters, reduces hardware resource consumption, avoids abnormal session interruptions, and ensures session state consistency during active/standby switchover.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921380B_ABST
    Figure CN118921380B_ABST
Patent Text Reader

Abstract

A method, apparatus, device and storage medium for synchronizing parameters of a primary and backup BFD session relate to the field of data communications. The method includes determining whether the target session entry needs to send messages according to a mandatory sending period when detecting that the target session entry is in an enabled state; if so, using a preset target sending period as the actual sending period of the target session entry; if not and a target BFD control message corresponding to the target session entry is received from a remote device, determining the actual sending period of the target session entry based on the relationship between the remote expected minimum receiving period corresponding to the target BFD control message and the target expected minimum sending period of the local disk, so as to achieve session parameter synchronization with the primary master disk. This application enables the parameters of the backup master disk to follow the parameters of the remote session to indirectly maintain consistency with the primary master disk, reducing hardware and software resources and overhead, and eliminating the need to rely on the mapping relationship between the BFD ID and the local session entry number.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data communication technology, and in particular to a method, apparatus, device, and storage medium for synchronizing active / standby BFD session parameters. Background Art

[0002] In the field of data communications, the BFD (Bidirectional Forwarding Detection) protocol is an important means of detecting bidirectional path failures. For small, centralized data communications equipment at the access layer, BFD sessions are typically deployed on the master control disk (i.e., the primary master control disk) where the control plane is located. The master control disk typically has a dual disk (i.e., the backup master control disk) for 1+1 backup and protection at the device layer; generally, the backup master control disk is in a dormant state. Therefore, the state of the BFD sessions running on the primary and backup disks, as well as the sending and detection time parameters, must be synchronized to ensure consistency of the session state during a primary-backup switchover, thereby preventing abnormal session interruptions.

[0003] In related technologies, the time parameters of each session entry are usually transmitted from the primary master control disk to the backup master control disk, and the session parameter synchronization between the primary and backup disks is achieved based on hardware synchronization or software synchronization. That is, the backup master control disk does not participate in the standard BFD session time parameter negotiation process, but is forced to use the session parameters transmitted by the primary master control disk for synchronization.

[0004] However, the above method consumes additional hardware or software resources because it needs to create a data synchronization channel to transmit session parameters. In addition, it also needs to rely on the mapping relationship between the BFD identifier ID and the local session entry number to achieve session parameter synchronization between the primary and backup disks. However, since the power-on time of the primary and backup disks is inconsistent during the session parameter transmission process, it cannot be guaranteed that the correspondence formed by the BFD global ID and the local session entry number of the primary main control disk is completely consistent with the correspondence formed by the BFD global ID and the local session entry number of the backup main control disk. As a result, the session parameters between the primary and backup disks may not be synchronized, which may cause abnormal session interruption. Summary of the Invention

[0005] The present application provides a method, apparatus, device and storage medium for synchronizing active and standby BFD session parameters, which can solve the technical problems in the prior art of requiring additional consumption of hardware and software resources and relying on the mapping relationship between BFD ID and local session entry number.

[0006] In a first aspect, an embodiment of the present application provides a method for synchronizing parameters of a master / slave BFD session. The method is applied to a slave master control disk. The method includes:

[0007] When detecting that the target session entry is in an enabled state, determining whether the target session entry needs to send a message according to a mandatory sending period;

[0008] If yes, the preset target sending period is used as the actual sending period of the target session entry to synchronize the session parameters with the active master control disk;

[0009] If not and the target BFD control message corresponding to the target session entry is received from the remote device, the actual sending period of the target session entry is determined based on the relationship between the remote expected minimum receiving period corresponding to the target BFD control message and the target expected minimum sending period of this disk, so as to achieve session parameter synchronization with the active master control disk.

[0010] In conjunction with the first aspect, in one embodiment, after the step of determining whether the target session entry needs to send messages according to the mandatory sending period, the method further includes:

[0011] When the target session entry does not need to send packets according to the mandatory sending period and the target BFD control packet is not received, determining whether the target expected minimum sending period is the same as the historical expected minimum sending period;

[0012] If so, taking the target expected minimum sending period or the historical expected minimum sending period as the actual sending period of the target session entry;

[0013] If not, the actual sending period of the target session entry is determined according to the relationship between the target expected minimum sending period and the historical expected minimum sending period.

[0014] In conjunction with the first aspect, in one embodiment, determining the actual sending period of the target session entry based on the relationship between the target expected minimum sending period and the historical expected minimum sending period includes:

[0015] When the target expected minimum sending period is less than the historical expected minimum sending period, using the target expected minimum sending period as the actual sending period of the target session entry;

[0016] When the target expected minimum sending period is greater than the historical expected minimum sending period, the historical expected minimum sending period is used as the actual sending period of the target session entry.

[0017] In conjunction with the first aspect, in one embodiment, determining the actual sending period of the target session entry based on the relationship between the remote end's expected minimum receiving period corresponding to the target BFD control packet and the local disk's target expected minimum sending period includes:

[0018] When the remote end's expected minimum receiving period is less than the target's expected minimum sending period, using the target's expected minimum sending period as the actual sending period of the target session entry;

[0019] When the remote end expected minimum reception period is equal to the target expected minimum transmission period, using the remote end expected minimum reception period or the target expected minimum transmission period as the actual transmission period of the target session entry;

[0020] When the remote-end expected minimum reception period is greater than the target expected minimum transmission period, the remote-end expected minimum reception period is used as the actual transmission period of the target session entry.

[0021] In conjunction with the first aspect, in one embodiment, after the step of detecting that the target session entry is in an enabled state, the method further includes:

[0022] Determining whether the target session entry needs to be fault-checked according to a mandatory detection period;

[0023] If yes, the preset target detection period is used as the actual detection period of the target session entry to synchronize the session parameters with the active master control disk;

[0024] If not and the target BFD control message corresponding to the target session entry is received from the remote device, the actual detection period of the target session entry is determined based on the relationship between the remote expected minimum sending period corresponding to the target BFD control message and the target expected minimum receiving period of this disk, so as to achieve session parameter synchronization with the active master control disk.

[0025] In conjunction with the first aspect, in one embodiment, after the step of determining whether the target session entry needs to be fault-detected according to a mandatory detection period, the method further includes:

[0026] When the target session entry does not need to perform fault detection according to the mandatory detection period and the target BFD control packet is not received, determining whether the target expected minimum reception period is the same as the historical expected minimum reception period;

[0027] If yes, taking the target expected minimum reception period or the historical expected minimum reception period as the actual detection period of the target session entry;

[0028] If not, the maximum value between the target expected minimum reception period and the historical expected minimum reception period is used as the actual detection period of the target session entry.

[0029] In combination with the first aspect, in one embodiment, the method further includes:

[0030] When it is detected that the session state corresponding to the target session entry is in the disconnected state Down and a BFD control message with the connection state Up sent by the remote device is received, the session state corresponding to the target session entry is migrated from Down to Up to achieve synchronization of session parameters with the active master control disk.

[0031] In a second aspect, an embodiment of the present application provides a primary and backup BFD session parameter synchronization device, wherein the primary and backup BFD session parameter synchronization device includes a sending time synchronization module, which is configured to:

[0032] When detecting that the target session entry is in an enabled state, determining whether the target session entry needs to send a message according to a mandatory sending period;

[0033] If yes, the preset target sending period is used as the actual sending period of the target session entry to synchronize the session parameters with the active master control disk;

[0034] If not and the target BFD control message corresponding to the target session entry is received from the remote device, the actual sending period of the target session entry is determined based on the relationship between the remote expected minimum receiving period corresponding to the target BFD control message and the target expected minimum sending period of this disk, so as to achieve session parameter synchronization with the active master control disk.

[0035] In conjunction with the second aspect, in one implementation, the sending time synchronization module is further configured to:

[0036] When the target session entry does not need to send packets according to the mandatory sending period and the target BFD control packet is not received, determining whether the target expected minimum sending period is the same as the historical expected minimum sending period;

[0037] If so, taking the target expected minimum sending period or the historical expected minimum sending period as the actual sending period of the target session entry;

[0038] If not, the actual sending period of the target session entry is determined according to the relationship between the target expected minimum sending period and the historical expected minimum sending period.

[0039] In conjunction with the second aspect, in one implementation, the sending time synchronization module is specifically configured to:

[0040] When the target expected minimum sending period is less than the historical expected minimum sending period, using the target expected minimum sending period as the actual sending period of the target session entry;

[0041] When the target expected minimum sending period is greater than the historical expected minimum sending period, the historical expected minimum sending period is used as the actual sending period of the target session entry.

[0042] In conjunction with the second aspect, in one implementation, the sending time synchronization module is further configured to:

[0043] When the remote end's expected minimum receiving period is less than the target's expected minimum sending period, using the target's expected minimum sending period as the actual sending period of the target session entry;

[0044] When the remote end expected minimum reception period is equal to the target expected minimum transmission period, using the remote end expected minimum reception period or the target expected minimum transmission period as the actual transmission period of the target session entry;

[0045] When the remote-end expected minimum reception period is greater than the target expected minimum transmission period, the remote-end expected minimum reception period is used as the actual transmission period of the target session entry.

[0046] In conjunction with the second aspect, in one embodiment, the active / standby BFD session parameter synchronization apparatus further includes a detection time synchronization module, which is configured to:

[0047] Determining whether the target session entry needs to be fault-checked according to a mandatory detection period;

[0048] If yes, the preset target detection period is used as the actual detection period of the target session entry to synchronize the session parameters with the active master control disk;

[0049] If not and the target BFD control message corresponding to the target session entry is received from the remote device, the actual detection period of the target session entry is determined based on the relationship between the remote expected minimum sending period corresponding to the target BFD control message and the target expected minimum receiving period of this disk, so as to achieve session parameter synchronization with the active master control disk.

[0050] In conjunction with the second aspect, in one implementation, the detection time synchronization module is further configured to:

[0051] When the target session entry does not need to perform fault detection according to the mandatory detection period and the target BFD control packet is not received, determining whether the target expected minimum reception period is the same as the historical expected minimum reception period;

[0052] If yes, taking the target expected minimum reception period or the historical expected minimum reception period as the actual detection period of the target session entry;

[0053] If not, the maximum value between the target expected minimum reception period and the historical expected minimum reception period is used as the actual detection period of the target session entry.

[0054] In conjunction with the second aspect, in one embodiment, the active / standby BFD session parameter synchronization apparatus further includes a session state synchronization module, which is configured to:

[0055] When it is detected that the session state corresponding to the target session entry is in the disconnected state Down and a BFD control message with the connection state Up sent by the remote device is received, the session state corresponding to the target session entry is migrated from Down to Up to achieve synchronization of session parameters with the active master control disk.

[0056] In a third aspect, an embodiment of the present application provides a master-standby BFD session parameter synchronization device, which includes a processor, a memory, and a master-standby BFD session parameter synchronization program stored on the memory and executable by the processor, wherein when the master-standby BFD session parameter synchronization program is executed by the processor, the steps of the master-standby BFD session parameter synchronization method as described above are implemented.

[0057] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a master-standby BFD session parameter synchronization program is stored. When the master-standby BFD session parameter synchronization program is executed by a processor, the steps of the master-standby BFD session parameter synchronization method as described above are implemented.

[0058] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:

[0059] Leveraging the backup master's characteristic of "receiving but not sending" BFD messages, a simplified timing parameter determination method is designed for the backup master's BFD session, enabling its parameters to follow those of the remote session and thus indirectly maintain consistency with those of the local primary master. Specifically, for an enabled target session entry, the system determines whether the target session entry requires message transmission according to the mandatory transmission period. If so, the preset target transmission period is used as the target session entry's actual transmission period, achieving synchronization with the session parameters of the primary master. If not, and a target BFD control message corresponding to the target session entry is received from the remote device, the target session entry's actual transmission period is determined based on the relationship between the remote-end expected minimum reception period corresponding to the target BFD control message and the local disk's target expected minimum transmission period, achieving synchronization with the session parameters of the primary master. This method does not require additional hardware or software resources or overhead, and does not rely on the mapping relationship between BFD IDs and local session entry numbers. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 This is a flow chart of an embodiment of the method for synchronizing parameters of a master / standby BFD session in this application;

[0061] Figure 2 This is a flow chart of a sending time determination process involved in an embodiment of the present application;

[0062] Figure 3 This is a flow chart of the process of determining the detection time involved in the embodiment of the present application;

[0063] Figure 4 This is a functional module diagram of an embodiment of the active / standby BFD session parameter synchronization device of the present application;

[0064] Figure 5 This is a schematic diagram of the hardware structure of the master-slave BFD session parameter synchronization device involved in the embodiment of the present application. DETAILED DESCRIPTION

[0065] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0066] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0067] In a first aspect, an embodiment of the present application provides a method for synchronizing parameters of a primary and backup BFD session.

[0068] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of an embodiment of the method for synchronizing parameters of the master and backup BFD sessions of this application. Figure 1 As shown, the master-slave BFD session parameter synchronization method is applied to the standby master control disk, and the method includes:

[0069] Step S10: When it is detected that the target session entry is in the enabled state, it is determined whether the target session entry needs to send messages according to the mandatory sending period.

[0070] For example, in this embodiment, the master / slave selection of the two master control disks is implemented through the clock processing modules in the FPGAs (Field Programmable Gate Arrays) of both the active and standby control disks, generating master / slave indication signals. It is understood that the indication signals of the active and standby disks should be mutually exclusive to ensure that the states of the two disks are mutually exclusive. Specifically, this is accomplished by the clock module running within the FPGA of the active control disk. This hardware connection between the FPGA of the active and standby disks communicates the health status and master / slave indications of the two disks, and determines the master / slave status of the two disks based on the health status and master / slave indications. It should be noted that the active control disk sends and receives BFD control messages, while the standby control disk does not send BFD control messages but only receives them.

[0071] In this embodiment, the establishment of a BFD session can be collaboratively accomplished by platform-side software, device-side software, FPGA, and forwarding chips. Specifically, the platform-side software delivers the same configuration to both the active and standby master control disks. The device-side software, based on the platform configuration, enables the sending and detection of BFD control messages by reading and writing to the FPGA, and reports BFD alarms to the platform-side software. Specifically, the device-side software configures the enablement status of each session entry, mandatory requirements for the sending and detection periods, and the minimum expected transmission interval (i.e., the minimum expected transmission interval) for the local end. Regarding the sending of BFD control messages, the current active / standby status indicator of the master control disk determines whether the local end sends the BFD control messages configured by the device-side software. If the local end is in the active state, the local end sends the BFD control messages; if the local end is in the standby state, the local end does not. Regarding the reception of BFD control messages, both the active and standby master control disks simultaneously receive BFD control messages sent by the remote device.

[0072] It should be understood that this embodiment does not adopt the mechanism of synchronizing the primary master disk to the backup master disk when realizing the session parameter synchronization between the primary and backup disks. Instead, it realizes the session parameter synchronization of the primary master disk and the backup master disk respectively according to different parameter synchronization processes. That is, in the BFD session running on the primary master disk, the time parameter negotiation and state migration will be carried out according to the process specified by the RFC5880 (Internet Engineering Task Force No. 5880) standard; while in the BFD session running on the backup master disk, the time parameter negotiation is carried out according to a simplified process, that is, by indirectly following the parameters of the remote end to keep consistent with the primary master disk.

[0073] Therefore, when performing BFD time parameter negotiation, the FPGA will determine the specific time negotiation algorithm based on the current active / standby status of the disk. Figure 2As shown, the BFD module in the FPGA is reset to enable normal operation and wait for the collection timing corresponding to any target session entry to arrive. When the target session entry arrives, a decision is made based on the master / slave indication input by the clock processing module in the FPGA. If the local disk is in the active master control disk, its time negotiation algorithm is consistent with the algorithm specified in RFC5880. That is, the RFC5880 algorithm is used to synchronize session parameters. Since the method and principle of implementing session parameter synchronization using the RFC5880 algorithm are common knowledge in the field, they are not detailed here for the sake of brevity. If the local disk is in the standby master control disk, time parameter negotiation is no longer performed. Instead, a simplified process is used, namely, the parameters are indirectly synchronized with the active master control disk by following the remote end.

[0074] Among them, see Figure 2 As shown, the standby master control disk first determines whether the sending of the target session entry is enabled based on the enabling information configured by the device-side software. If the target session entry is not enabled, it means that the session parameter synchronization of the target session entry does not need to be performed, and the acquisition timing of the next target session entry is waited for to arrive. However, if the target session entry is enabled, it will further determine whether the target session entry needs to send messages according to the forced sending cycle to control the session parameter synchronization of the standby master control disk.

[0075] Step S20: If yes, the preset target sending period is used as the actual sending period of the target session entry to achieve synchronization with the session parameters of the active master control disk.

[0076] For example, it is understood that if the target session entry is determined to need to send messages according to the mandatory sending period according to the mandatory sending period configured by the device-side software, then for the primary master control disk, after complex time parameter negotiation according to the RFC5880 algorithm, the target sending period configured by the device-side software will be used as the actual sending period of the target session entry; therefore, see Figure 2 As shown, for the backup master disk, if the target session entry needs to send messages according to the mandatory sending cycle, the sending time is determined. That is, this embodiment directly uses the target sending cycle as the actual sending cycle of the target session entry to achieve session parameter synchronization with the active master disk.

[0077] Step S30: If no and a target BFD control message corresponding to the target session entry is received from the remote device, the actual sending period of the target session entry is determined based on the relationship between the remote expected minimum receiving period corresponding to the target BFD control message and the target expected minimum sending period of this disk, so as to achieve synchronization of the session parameters with the active master disk.

[0078] Specifically, determining the actual sending period of the target session entry according to the relationship between the remote end's expected minimum receiving period corresponding to the target BFD control message and the local disk's target expected minimum sending period includes:

[0079] When the remote end's expected minimum receiving period is less than the target's expected minimum sending period, using the target's expected minimum sending period as the actual sending period of the target session entry;

[0080] When the remote end expected minimum reception period is equal to the target expected minimum transmission period, using the remote end expected minimum reception period or the target expected minimum transmission period as the actual transmission period of the target session entry;

[0081] When the remote-end expected minimum reception period is greater than the target expected minimum transmission period, the remote-end expected minimum reception period is used as the actual transmission period of the target session entry.

[0082] For example, see Figure 2 As shown, if the target session entry does not require message transmission according to the mandatory transmission period, the system further determines whether a new packet corresponding to the target session entry (i.e., a target BFD control message) has been received from the remote device. If a target BFD control message corresponding to the target session entry has been received from the remote device, the system parses the newly received target BFD control message to determine the minimum expected reception time interval (i.e., the remote expected minimum reception period rmri) parameter carried in the target BFD control message sent by the remote device. The system then compares the remote rmri with the minimum expected transmission time interval (i.e., the target expected minimum transmission period dmti) configured locally for the target session entry, and takes the larger value as the actual transmission period for the target session entry. The transmission time is now determined, achieving session parameter synchronization between the backup and active master disks. This ensures that the BFD session on the backup and active master disks remains consistent with that on the active master disk in real time. Consequently, when the master / backup master disk switches, BFD does not generate false alarms and the upper layer protocol is not aware of the issue. It is understandable that if the remote RMRI and the local target DMTI are the same, either one of them can be used as the actual sending period of the target session entry.

[0083] It can be seen that this embodiment takes advantage of the fact that the standby master control disk "only receives but does not send" BFD messages. By designing a simplified time parameter determination method on the BFD of the standby master control disk, the parameters of the standby master control disk can follow the parameters of the remote session, thereby indirectly maintaining consistency with the local active master control disk. This not only saves hardware channel resources between the FPGAs of the active and standby disks and reduces the resources consumed by the CPU polling the FPGA, but also does not need to rely on the mapping relationship between the BFD ID and the local session entry number, effectively ensuring the consistency of the session state during active-standby switching, thereby ensuring that no abnormal session interruption occurs.

[0084] Furthermore, in one embodiment, after the step of determining whether the target session entry needs to send messages according to the mandatory sending period, the method further includes:

[0085] When the target session entry does not need to send packets according to the mandatory sending period and the target BFD control packet is not received, determining whether the target expected minimum sending period is the same as the historical expected minimum sending period;

[0086] If so, taking the target expected minimum sending period or the historical expected minimum sending period as the actual sending period of the target session entry;

[0087] If not, the actual sending period of the target session entry is determined according to the relationship between the target expected minimum sending period and the historical expected minimum sending period.

[0088] The step of determining the actual sending period of the target session entry based on the relationship between the target expected minimum sending period and the historical expected minimum sending period includes:

[0089] When the target expected minimum sending period is less than the historical expected minimum sending period, using the target expected minimum sending period as the actual sending period of the target session entry;

[0090] When the target expected minimum sending period is greater than the historical expected minimum sending period, the historical expected minimum sending period is used as the actual sending period of the target session entry.

[0091] For example, see Figure 2As shown, if the target session entry does not need to send packets according to the mandatory sending period and the target BFD control packet corresponding to the target session entry is not received from the remote device, the local DMTI configuration corresponding to the target session entry is determined to be changed, that is, whether the target DMTI is the same as the historical DMTI. If they are the same (i.e., unchanged), either the target DMTI or the historical DMTI can be used as the actual sending period of the target session entry. If they are different (i.e., changed), the current local target DMTI is determined to be less than the historical DMTI. If so, the current local target DMTI is used as the actual sending period of the target session entry. Otherwise, the actual sending period of the target session entry remains the historical DMTI. At this point, the sending time is determined, and session parameter synchronization between the backup and active master control disks is achieved.

[0092] Furthermore, in one embodiment, after the step of detecting that the target session entry is in an enabled state, the method further includes:

[0093] Determining whether the target session entry needs to be fault-checked according to a mandatory detection period;

[0094] If yes, the preset target detection period is used as the actual detection period of the target session entry to synchronize the session parameters with the active master control disk;

[0095] If not and the target BFD control message corresponding to the target session entry is received from the remote device, the actual detection period of the target session entry is determined based on the relationship between the remote expected minimum sending period corresponding to the target BFD control message and the target expected minimum receiving period of this disk, so as to achieve session parameter synchronization with the active master control disk.

[0096] For example, in this embodiment, the BFD session running on the standby master disk also uses a simplified process to negotiate the detection time parameters, that is, it is indirectly consistent with the active master disk by following the parameters of the remote end. Figure 3 As shown, the BFD module in the FPGA is reset to enable normal operation and wait for the collection timing corresponding to any target session entry to arrive. When the target session entry arrives, a decision is made based on the master / slave indication input by the clock processing module in the FPGA. If the local disk is in the active master control disk, its time negotiation algorithm is consistent with the algorithm specified in RFC5880. That is, the RFC5880 algorithm is used to detect time parameter synchronization. Since the method and principle of how to implement time parameter synchronization using the RFC5880 algorithm are common knowledge in the field, they are not detailed here for the sake of brevity. If the local disk is in the standby master control disk, it will indirectly maintain consistency with the active master control disk by following the remote parameters.

[0097] Among them, see Figure 3 As shown, the standby master control disk first determines whether the detection of the target session entry is enabled based on the enable information configured by the device-side software. If the target session entry is not enabled, it means that the detection time parameter synchronization of the target session entry does not need to be performed, and the acquisition timing of the next target session entry is waited for to arrive. However, if the target session entry is enabled, it will further determine whether the target session entry needs to be fault detected according to the mandatory detection cycle to control the detection time parameter synchronization of the standby master control disk.

[0098] It is understandable that if the target session entry is determined to be fault-detected according to the mandatory detection period configured by the device-side software, then for the active master control disk, after complex time parameter negotiation according to the RFC5880 algorithm, the target detection period configured by the device-side software will be used as the actual detection period of the target session entry; therefore, see Figure 3 As shown, for the backup master disk, if the target session entry needs to perform fault detection according to the mandatory detection cycle, the detection time is determined. That is, this embodiment directly uses the target detection cycle as the actual detection cycle of the target session entry to achieve synchronization with the session parameters of the active master disk.

[0099] However, if the target session entry does not require fault detection according to the mandatory detection period, the system will further determine whether a new packet corresponding to the target session entry (i.e., a target BFD control packet) has been received from the remote device. If a target BFD control packet corresponding to the target session entry has been received, the system will parse the newly received target BFD control packet to determine the desired minimum transmission interval (i.e., the remote desired minimum transmission period dmti) parameter carried in the target BFD control packet sent by the remote device. The system will then compare the remote dmti with the local configured minimum reception interval (i.e., the target desired minimum reception period rmri) corresponding to the target session entry, and take the larger value as the actual detection period for the target session entry. This completes the detection time determination, achieving synchronization of detection time parameters between the backup and active master disks, ensuring that the backup master disk's BFD session remains consistent with the active master disk in real time. It is understood that if the remote dmti and the local target rmri are the same, either one can be used as the actual detection period for the target session entry.

[0100] Furthermore, in one embodiment, after the step of determining whether the target session entry needs to be fault-checked according to a mandatory detection period, the method further includes:

[0101] When the target session entry does not need to perform fault detection according to the mandatory detection period and the target BFD control packet is not received, determining whether the target expected minimum reception period is the same as the historical expected minimum reception period;

[0102] If yes, taking the target expected minimum reception period or the historical expected minimum reception period as the actual detection period of the target session entry;

[0103] If not, the maximum value between the target expected minimum reception period and the historical expected minimum reception period is used as the actual detection period of the target session entry.

[0104] For example, see Figure 3 As shown, if the target session entry does not require fault detection according to the mandatory detection period and the target BFD control message corresponding to the target session entry is not received from the remote device, it is determined whether the local RMRI configuration corresponding to the target session entry has changed, that is, whether the target RMRI is the same as the historical RMRI. If they are the same (i.e., unchanged), either the target RMRI or the historical RMRI can be used as the actual detection period of the target session entry. If they are different (i.e., changed), it is further determined whether the current local configured target RMRI is greater than the historical RMRI. If so, the current local configured target RMRI is used as the actual detection period of the target session entry. Otherwise, the actual detection period of the target session entry remains the historical RMRI. At this point, the detection time is determined, and the time detection parameters between the backup and active master control disks are synchronized.

[0105] Furthermore, in one embodiment, the method further includes:

[0106] When it is detected that the session state corresponding to the target session entry is in the disconnected state Down and a BFD control message with the connection state Up sent by the remote device is received, the session state corresponding to the target session entry is migrated from Down to Up to achieve synchronization of session parameters with the active master control disk.

[0107] Exemplarily, in this embodiment, partial state migration of the BFD session in the backup master disk will be implemented, that is, the conditions for changing the session state from Down (i.e., disconnected) to Up (i.e., connected) will be simplified. Specifically, when this disk is in the backup master disk, the state migration process of the target session entry in the disconnected state Down will be simplified, and the state migration of the target session entry in the connected state Up will be carried out according to the conventional RFC5880 algorithm process for the BFD session state migration. Among them, when it is detected that the session state of the target session entry is Down, upon receiving a BFD control message with the state Up sent by the remote device, the session state of the target session entry will be immediately controlled to migrate from Down to Up, so as to achieve synchronization of the session state parameters of the backup master disk and the active master disk. It can be seen that this embodiment can keep the parameters and states of the BFD sessions deployed on the primary and backup disks synchronized.

[0108] In a second aspect, an embodiment of the present application further provides a device for synchronizing parameters of a primary and backup BFD sessions.

[0109] In one embodiment, referring to Figure 4 , Figure 4 This is a functional module diagram of an embodiment of the master / slave BFD session parameter synchronization device of this application. Figure 4 As shown, the active / standby BFD session parameter synchronization device includes a sending time synchronization module, which is used to:

[0110] When detecting that the target session entry is in an enabled state, determining whether the target session entry needs to send a message according to a mandatory sending period;

[0111] If yes, the preset target sending period is used as the actual sending period of the target session entry to synchronize the session parameters with the active master control disk;

[0112] If not and the target BFD control message corresponding to the target session entry is received from the remote device, the actual sending period of the target session entry is determined based on the relationship between the remote expected minimum receiving period corresponding to the target BFD control message and the target expected minimum sending period of this disk, so as to achieve session parameter synchronization with the active master control disk.

[0113] Furthermore, in one embodiment, the sending time synchronization module is further configured to:

[0114] When the target session entry does not need to send packets according to the mandatory sending period and the target BFD control packet is not received, determining whether the target expected minimum sending period is the same as the historical expected minimum sending period;

[0115] If so, taking the target expected minimum sending period or the historical expected minimum sending period as the actual sending period of the target session entry;

[0116] If not, the actual sending period of the target session entry is determined according to the relationship between the target expected minimum sending period and the historical expected minimum sending period.

[0117] Furthermore, in one embodiment, the sending time synchronization module is specifically configured to:

[0118] When the target expected minimum sending period is less than the historical expected minimum sending period, using the target expected minimum sending period as the actual sending period of the target session entry;

[0119] When the target expected minimum sending period is greater than the historical expected minimum sending period, the historical expected minimum sending period is used as the actual sending period of the target session entry.

[0120] Furthermore, in one embodiment, the sending time synchronization module is further configured to:

[0121] When the remote end's expected minimum receiving period is less than the target's expected minimum sending period, using the target's expected minimum sending period as the actual sending period of the target session entry;

[0122] When the remote end expected minimum reception period is equal to the target expected minimum transmission period, using the remote end expected minimum reception period or the target expected minimum transmission period as the actual transmission period of the target session entry;

[0123] When the remote-end expected minimum reception period is greater than the target expected minimum transmission period, the remote-end expected minimum reception period is used as the actual transmission period of the target session entry.

[0124] Furthermore, in one embodiment, the active / standby BFD session parameter synchronization apparatus further includes a detection time synchronization module, which is configured to:

[0125] Determining whether the target session entry needs to be fault-checked according to a mandatory detection period;

[0126] If yes, the preset target detection period is used as the actual detection period of the target session entry to synchronize the session parameters with the active master control disk;

[0127] If not and the target BFD control message corresponding to the target session entry is received from the remote device, the actual detection period of the target session entry is determined based on the relationship between the remote expected minimum sending period corresponding to the target BFD control message and the target expected minimum receiving period of this disk, so as to achieve session parameter synchronization with the active master control disk.

[0128] Furthermore, in one embodiment, the detection time synchronization module is further configured to:

[0129] When the target session entry does not need to perform fault detection according to the mandatory detection period and the target BFD control packet is not received, determining whether the target expected minimum reception period is the same as the historical expected minimum reception period;

[0130] If yes, taking the target expected minimum reception period or the historical expected minimum reception period as the actual detection period of the target session entry;

[0131] If not, the maximum value between the target expected minimum reception period and the historical expected minimum reception period is used as the actual detection period of the target session entry.

[0132] Furthermore, in one embodiment, the active / standby BFD session parameter synchronization apparatus further includes a session state synchronization module, which is configured to:

[0133] When it is detected that the session state corresponding to the target session entry is in the disconnected state Down and a BFD control message with the connection state Up sent by the remote device is received, the session state corresponding to the target session entry is migrated from Down to Up to achieve synchronization of session parameters with the active master control disk.

[0134] The functional implementation of each module in the above-mentioned active-standby BFD session parameter synchronization device corresponds to each step in the above-mentioned active-standby BFD session parameter synchronization method embodiment, and their functions and implementation processes are not repeated here one by one.

[0135] In a third aspect, an embodiment of the present application provides a primary and backup BFD session parameter synchronization device. The primary and backup BFD session parameter synchronization device can be a personal computer (PC), a laptop, a server, or other device with data processing capabilities.

[0136] Reference Figure 5 , Figure 5 FIG2 is a schematic diagram of the hardware structure of the active / standby BFD session parameter synchronization device involved in the embodiment of the present application. In the embodiment of the present application, the active / standby BFD session parameter synchronization device may include a processor, a memory, a communication interface, and a communication bus.

[0137] The communication bus may be of any type and is used to interconnect the processor, memory, and communication interface.

[0138] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces. These interfaces interconnect components within the active and standby BFD session parameter synchronization devices, as well as interfaces that connect the active and standby BFD session parameter synchronization devices to other devices (such as other computing devices or user devices). Physical interfaces can be Ethernet, fiber, or ATM interfaces; user devices can be displays or keyboards.

[0139] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0140] The processor may be a general-purpose processor that can invoke a master-standby BFD session parameter synchronization program stored in a memory and execute the master-standby BFD session parameter synchronization method provided in an embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the master-standby BFD session parameter synchronization program is invoked can be referenced to the various embodiments of the master-standby BFD session parameter synchronization method of the present application and will not be further described here.

[0141] Those skilled in the art will understand that Figure 5 The hardware structure shown in the figure does not constitute a limitation to the present application and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0142] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.

[0143] The readable storage medium of the present application stores a master-standby BFD session parameter synchronization program, wherein when the master-standby BFD session parameter synchronization program is executed by a processor, the steps of the master-standby BFD session parameter synchronization method as described above are implemented.

[0144] Among them, the method implemented when the master-standby BFD session parameter synchronization program is executed can refer to the various embodiments of the master-standby BFD session parameter synchronization method of the present application, and will not be repeated here.

[0145] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0146] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit the "first", "second" and "third" to different types.

[0147] In the description of the embodiments of this application, the words "exemplary," "for example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "for example," or "for example" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.

[0148] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0149] In some processes described in the embodiments of the present application, multiple operations or steps are included that appear in a specific order. However, it should be understood that these operations or steps may not be performed in the order in which they appear in the embodiments of the present application or may be performed in parallel. The sequence numbers of the operations are only used to distinguish between different operations, and the sequence numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations or steps may be performed in sequence or in parallel, and these operations or steps may be combined.

[0150] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device to execute the methods described in each embodiment of the present application.

[0151] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for synchronizing parameters of a master / slave BFD session, characterized in that: The method for synchronizing parameters of a master-slave BFD session is applied to a standby master control disk, and the method includes: When detecting that the target session entry is in an enabled state, determining whether the target session entry needs to send a message according to a mandatory sending period; If yes, the preset target sending period is used as the actual sending period of the target session entry to synchronize the session parameters with the active master control disk; If not, and the target BFD control packet corresponding to the target session entry is received from the remote device, the actual sending period of the target session entry is determined based on the relationship between the remote expected minimum receiving period corresponding to the target BFD control packet and the target expected minimum sending period of the local disk, so as to synchronize the session parameters with the active master disk; In a BFD session running on the active master control disk, time parameter negotiation and state transition are performed according to the process specified in the RFC5880 standard. BFD control packets are sent if the disk is in the active master control disk, but not if it is in the standby master control disk. BFD control packets are received by both the active and standby master control disks simultaneously.

2. The method for synchronizing active and standby BFD session parameters according to claim 1, wherein: After the step of determining whether the target session entry needs to send messages according to the mandatory sending period, the method further includes: When the target session entry does not need to send packets according to the mandatory sending period and the target BFD control packet is not received, determining whether the target expected minimum sending period is the same as the historical expected minimum sending period; If so, taking the target expected minimum sending period or the historical expected minimum sending period as the actual sending period of the target session entry; If not, the actual sending period of the target session entry is determined according to the relationship between the target expected minimum sending period and the historical expected minimum sending period.

3. The method for synchronizing active and standby BFD session parameters according to claim 2, wherein: The determining the actual sending period of the target session entry according to the relationship between the target expected minimum sending period and the historical expected minimum sending period includes: When the target expected minimum sending period is less than the historical expected minimum sending period, using the target expected minimum sending period as the actual sending period of the target session entry; When the target expected minimum sending period is greater than the historical expected minimum sending period, the historical expected minimum sending period is used as the actual sending period of the target session entry.

4. The method for synchronizing active and standby BFD session parameters according to claim 1, wherein: The step of determining the actual sending period of the target session entry based on the relationship between the remote end's expected minimum receiving period corresponding to the target BFD control message and the local disk's target expected minimum sending period includes: When the remote end's expected minimum receiving period is less than the target's expected minimum sending period, using the target's expected minimum sending period as the actual sending period of the target session entry; When the remote end expected minimum reception period is equal to the target expected minimum transmission period, using the remote end expected minimum reception period or the target expected minimum transmission period as the actual transmission period of the target session entry; When the remote-end expected minimum reception period is greater than the target expected minimum transmission period, the remote-end expected minimum reception period is used as the actual transmission period of the target session entry.

5. The method for synchronizing active and standby BFD session parameters according to claim 1, wherein: After the step of detecting that the target session entry is in an enabled state, the method further includes: Determining whether the target session entry needs to be fault-checked according to a mandatory detection period; If yes, the preset target detection period is used as the actual detection period of the target session entry to synchronize the session parameters with the active master control disk; If not and the target BFD control message corresponding to the target session entry is received from the remote device, the actual detection period of the target session entry is determined based on the relationship between the remote expected minimum sending period corresponding to the target BFD control message and the target expected minimum receiving period of this disk, so as to achieve session parameter synchronization with the active master control disk.

6. The method for synchronizing active and standby BFD session parameters according to claim 5, wherein: After the step of determining whether the target session entry needs to be fault-detected according to a mandatory detection period, the method further includes: When the target session entry does not need to perform fault detection according to the mandatory detection period and the target BFD control packet is not received, determining whether the target expected minimum reception period is the same as the historical expected minimum reception period; If yes, taking the target expected minimum reception period or the historical expected minimum reception period as the actual detection period of the target session entry; If not, the maximum value between the target expected minimum reception period and the historical expected minimum reception period is used as the actual detection period of the target session entry.

7. The method for synchronizing active and standby BFD session parameters according to claim 1, wherein: The method further comprises: When it is detected that the session state corresponding to the target session entry is in the disconnected state Down and a BFD control message with the connection state Up sent by the remote device is received, the session state corresponding to the target session entry is migrated from Down to Up to achieve synchronization of session parameters with the active master control disk.

8. A master / slave BFD session parameter synchronization device, characterized in that: The active / standby BFD session parameter synchronization device includes a sending time synchronization module, which is used to: When detecting that the target session entry is in an enabled state, determining whether the target session entry needs to send a message according to a mandatory sending period; If yes, the preset target sending period is used as the actual sending period of the target session entry to synchronize the session parameters with the active master control disk; If no, and the target BFD control packet corresponding to the target session entry is received from the remote device, the actual sending period of the target session entry is determined based on the relationship between the remote expected minimum receiving period corresponding to the target BFD control packet and the target expected minimum sending period of the local disk, thereby achieving session parameter synchronization with the active master disk; In a BFD session running on the active master control disk, time parameter negotiation and state transition are performed according to the process specified in the RFC5880 standard. BFD control packets are sent if the disk is in the active master control disk, but not if it is in the standby master control disk. BFD control packets are received by both the active and standby master control disks simultaneously.

9. A master / slave BFD session parameter synchronization device, characterized in that: The active-standby BFD session parameter synchronization device includes a processor, a memory, and an active-standby BFD session parameter synchronization program stored in the memory and executable by the processor. When the active-standby BFD session parameter synchronization program is executed by the processor, the steps of the active-standby BFD session parameter synchronization method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a primary-backup BFD session parameter synchronization program, wherein when the primary-backup BFD session parameter synchronization program is executed by the processor, the steps of the primary-backup BFD session parameter synchronization method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Path detection method and device

    CN102025562A

  • BFD (Bidirectional Forwarding Detection) realizing method and equipment

    CN102801584A