Main and standby BFD session parameter synchronization method and device, equipment and storage medium
By designing a simplified time parameter determination method on the backup master disk, using the "only receiving and not sending" characteristics of BFD packets, the session parameters of the main master disk are synchronized, and resource consumption and mapping in the existing technology are solved The problem of relationship dependency ensures consistency of session state and no exception interrupts.
Patent Information
- Application Number
- CN202410936860.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-07-12
AI Technical Summary
When implementing BFD session parameters synchronization, the prior art requires additional hardware or software resources to be consumed, and depends on the mapping relationship between the BFD id and the local session entry number, resulting in the session parameters between the main and spare disks that may not be fully synchronized, and may cause exceptions. The session interrupts.
By designing a simplified time parameter determination method on the backup main control disk, using the "only receiving and not sending" characteristics of BFD packets, we can determine whether the target session entry needs to send messages or detect failures in accordance with the forced sending cycle or detecting cycle. , the actual transmission and detection cycle is determined based on the BFD control message sent by the remote device, and the session parameters of the main control disk are synchronized.
There is no need for additional hardware and software resources and overhead, and there is no need to rely on the mapping relationship between the BFD id and the local session entry number, which effectively ensures the consistency of the session state during the main and standby switch and avoids session interruption.
Smart Images

Figure CN118921380A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data communication technology, and in particular to a method, device, equipment and storage medium for synchronizing parameters of a primary and standby BFD session. Background Art
[0002] In the field of data communications, the BFD (Bidirectional Forwarding Detection) protocol is an important means of detecting bidirectional path failures. Among them, for small centralized data communication equipment at the access layer, the BFD session is usually deployed on the main control disk (i.e., the primary main control disk) where the control plane is located, and the main control disk usually has a dual disk (i.e., the backup main control disk) to perform 1+1 backup and protection at the device layer; generally speaking, the backup main control disk is in a dormant state. Therefore, the status of the BFD session running on the primary and backup disks and the sending time parameters and detection time parameters should be synchronized to ensure the consistency of the session status when the primary and backup switches, thereby ensuring that no abnormal session interruption occurs.
[0003] In the related art, 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 transfer 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, so that 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 parameters of a primary and secondary BFD session, which can solve the technical problems existing in the prior art of requiring additional consumption of hardware and software resources and relying on the mapping relationship between the BFD ID and the 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, wherein the method for synchronizing parameters of a master-slave BFD session is applied to a standby master control disk, and the method includes:
[0007] When it is detected 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 cycle;
[0008] If yes, the preset target sending period is used as the actual sending period of the target session entry to achieve synchronization of session parameters with the primary main control disk;
[0009] If not 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 session parameter synchronization with the active master control disk.
[0010] In combination with the first aspect, in an implementation manner, after the step of determining whether the target session entry needs to send a message according to a mandatory sending period, the method further includes:
[0011] When the target session entry does not need to send messages according to the mandatory sending period and the target BFD control message is not received, determining whether the target expected minimum sending period is the same as the historical expected minimum sending period;
[0012] If yes, 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 combination with the first aspect, in one implementation, 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:
[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 combination with the first aspect, in one implementation, determining the actual sending period of the target session entry according to 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 includes:
[0018] When the remote end's expected minimum reception period is less than the target's expected minimum transmission period, using the target's expected minimum transmission period as the actual transmission period of the target session entry;
[0019] When the remote end expected minimum reception period is equal to the target expected minimum transmission period, taking 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 combination with the first aspect, in one implementation, 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 cycle;
[0023] If yes, the preset target detection period is used as the actual detection period of the target session entry to achieve synchronization with the session parameters of the primary main control disk;
[0024] If not and a 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 main control disk.
[0025] In combination with the first aspect, in an implementation manner, after the step of determining whether the target session entry needs to perform fault detection according to a mandatory detection cycle, 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 message 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 implementation, 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 a connected state Up sent by a remote device is received, the session state corresponding to the target session entry is migrated from Down to Up to achieve session parameter synchronization with the active main control disk.
[0031] In a second aspect, an embodiment of the present application provides a primary and standby BFD session parameter synchronization device, wherein the primary and standby BFD session parameter synchronization device includes a sending time synchronization module, which is used to:
[0032] When it is detected 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 cycle;
[0033] If yes, the preset target sending period is used as the actual sending period of the target session entry to achieve synchronization of session parameters with the primary main control disk;
[0034] If not 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 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 used to:
[0036] When the target session entry does not need to send messages according to the mandatory sending period and the target BFD control message is not received, determining whether the target expected minimum sending period is the same as the historical expected minimum sending period;
[0037] If yes, 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 used 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 used to:
[0043] When the remote end's expected minimum reception period is less than the target's expected minimum transmission period, using the target's expected minimum transmission period as the actual transmission period of the target session entry;
[0044] When the remote end expected minimum reception period is equal to the target expected minimum transmission period, taking 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 combination with the second aspect, in one implementation, the active / standby BFD session parameter synchronization device further includes a detection time synchronization module, which is used to:
[0047] Determining whether the target session entry needs to be fault-checked according to a mandatory detection cycle;
[0048] If yes, the preset target detection period is used as the actual detection period of the target session entry to achieve synchronization with the session parameters of the primary main control disk;
[0049] If not and a 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 main control disk.
[0050] In conjunction with the second aspect, in one implementation, the detection time synchronization module is further used 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 message 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 combination with the second aspect, in one implementation, the active / standby BFD session parameter synchronization device further includes a session state synchronization module, which is used 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 a connected state Up sent by a remote device is received, the session state corresponding to the target session entry is migrated from Down to Up to achieve session parameter synchronization with the active main 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 brought by the technical solution provided by the embodiment of the present application include at least:
[0059] Taking advantage of the feature that the standby main control disk "only receives but does not send" BFD messages, a simplified time parameter determination method is designed on the BFD of the standby main control disk, so that the parameters of the standby main control disk can follow the parameters of the remote session, thereby indirectly keeping consistent with the active main control disk of the local end, that is, for the target session entry in the enabled state, it will be judged whether the target session entry needs to send messages according to the forced sending period; if so, the preset target sending period will be used as the actual sending period of the target session entry to achieve session parameter synchronization with the active main control disk; if not and the target BFD control message corresponding to the target session entry sent by the remote device is received, the actual sending period of the target session entry is determined according to the size 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 active main control disk, which does not require additional hardware and software resources and overhead, and does not need to rely on the mapping relationship between the BFD id and the local session entry number. 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 the present application;
[0061] Figure 2 A schematic diagram of a process flow for determining a sending time involved in an embodiment of the present application;
[0062] Figure 3 A schematic diagram of the process flow 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 a device for synchronizing parameters of a master and standby BFD session in 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 solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, 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 the present application clearer, the implementation methods of the present 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 a 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 the parameters of the master and standby BFD sessions of this application. Figure 1 As shown, the active-standby 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 an enabled state, it is determined whether the target session entry needs to send a message according to a mandatory sending cycle.
[0070] Exemplarily, in this embodiment, the master-slave election of the two main control disks will be realized through the clock processing module of the FPGA (Field Programmable Gate Array) of the two main control disks to generate the master-slave indication signal; it can be understood that the indication signals of the master and the standby disks should be mutually exclusive to ensure that the status of the two disks are mutually exclusive. Specifically, it is completed by the clock module running in the FPGA of the main control disk, that is, the health status and the master-slave indication of the two disks are communicated through the hardware connection between the FPGA of the disk and the FPGA of the dual disk, and the master-slave status of the two disks is determined according to the health status and the master-slave indication. It should be noted that the main control disk sends and receives BFD control messages, while the standby main control disk does not send BFD control messages, but only receives BFD control messages.
[0071] In this embodiment, the establishment of the BFD session can be completed by the platform side software, the device side software, the FPGA and the forwarding chip in coordination, that is, the platform side software sends the same configuration to the active main control disk and the standby main control disk, and the device side software enables the sending and detection of BFD control messages according to the platform configuration and by reading and writing FPGA, and reports the BFD alarm to the platform side software, that is, the device side software implements the configuration of the enabling state of each session entry, the mandatory requirements of the sending cycle, the mandatory requirements of the detection cycle, and the minimum time interval (i.e., the minimum expected sending cycle) of the local end. Among them, for the sending of BFD control messages, it will be determined whether the local disk sends the BFD control message configured by the device side software according to the current active and standby indication of the main control disk. If the local disk is in the active main control disk, it will be sent, and if it is in the standby main control disk, it will not be sent; and for the reception of BFD control messages, both the active main control disk and the standby main control disk simultaneously receive the BFD control message sent by the remote device.
[0072] It should be understood that this embodiment does not adopt the mechanism of synchronizing the primary main control disk to the backup main control disk when realizing the session parameter synchronization between the primary and backup disks, but realizes the session parameter synchronization of the primary and backup main control disks respectively according to different parameter synchronization processes, that is, in the BFD session running on the primary main control 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; and in the BFD session running on the backup main control disk, the time parameter negotiation is carried out according to a simplified process, that is, by following the parameters of the remote end indirectly to keep consistent with the primary main control 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 so that the BFD module starts to operate normally and waits 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 disk is in the active main control disk, its time negotiation algorithm is consistent with the algorithm specified in RFC5880, that is, the RFC5880 algorithm is switched to synchronize the session parameters. Since the method and principle of how to synchronize the session parameters through the RFC5880 algorithm are common knowledge in the art, they will not be described here for the sake of brevity; and if the disk is in the standby main control disk, the time parameter negotiation will no longer be performed, but will be performed according to a simplified process, that is, it will be kept consistent with the active main control disk indirectly by following the parameters of the remote end.
[0074] Among them, see Figure 2 As shown, the standby main control disk first determines whether the sending of the target session entry is enabled according to 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 is not required, and then waits for the acquisition timing of the next target session entry 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 main 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 main control disk.
[0076] For example, it can be 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 main 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 main control 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 main control 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 session parameter synchronization with the active master control disk.
[0078] Specifically, determining the actual sending period of the target session entry according to 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 includes:
[0079] When the remote end's expected minimum reception period is less than the target's expected minimum transmission period, using the target's expected minimum transmission period as the actual transmission period of the target session entry;
[0080] When the remote end expected minimum reception period is equal to the target expected minimum transmission period, taking 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 need to send messages according to the mandatory sending period, it is further determined whether a new packet (i.e., a target BFD control message) corresponding to the target session entry sent by the remote device is received; if the target BFD control message corresponding to the target session entry sent by the remote device is received, the newly received target BFD control message is parsed to determine the expected minimum receiving time interval (i.e., the remote expected minimum receiving period rmri) parameter carried by the target BFD control message sent by the remote device; then the remote rmri is compared with the minimum expected sending time interval (i.e., the target expected minimum sending period dmti) configured by the local end corresponding to the target session entry, and the larger value of the two is taken as the actual sending period of the target session entry. At this point, the sending time is determined, and the session parameter synchronization between the standby main control disk and the active main control disk is achieved, so that the BFD of the standby main control disk can be consistent with the active main control disk in real time, so that when the main control disk is switched between the active and standby, BFD will not generate a false alarm and the upper layer protocol will not perceive it. It can be understood 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 utilizes the characteristic of the standby main control disk that "only receives but does not send" BFD messages, and designs a simplified time parameter determination method on the BFD of the standby main control disk, so that the parameters of the standby main control disk can follow the parameters of the remote session, thereby indirectly maintaining consistency with the local main control disk. This not only saves hardware channel resources between the FPGAs of the primary 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 the primary and standby switching to ensure that no abnormal session interruption occurs.
[0084] Furthermore, in one embodiment, after the step of determining whether the target session entry needs to send a message according to a mandatory sending cycle, the step further includes:
[0085] When the target session entry does not need to send messages according to the mandatory sending period and the target BFD control message is not received, determining whether the target expected minimum sending period is the same as the historical expected minimum sending period;
[0086] If yes, 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 according to 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 messages according to the mandatory sending period and the target BFD control message corresponding to the target session entry sent by the remote device is not received, it is determined whether the local DMTI configuration corresponding to the target session entry has changed, that is, whether the target DMTI is the same as the historical DMTI; if they are the same (that is, no change), either the target DMTI or the historical DMTI can be used as the actual sending period of the target session entry; and if they are not the same (that is, changed), it will continue to determine whether the current local configured target DMTI is less than the historical DMTI. If so, the current local configured target DMTI is taken as the actual sending period of the target session entry; otherwise, the actual sending period of the target session entry is still the historical DMTI. At this point, the sending time is determined, and the session parameter synchronization between the standby main control disk and the active main control disk 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 cycle;
[0094] If yes, the preset target detection period is used as the actual detection period of the target session entry to achieve synchronization with the session parameters of the primary main control disk;
[0095] If not and a 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 main control disk.
[0096] For example, in this embodiment, the BFD session running on the standby master control disk also negotiates the detection time parameters according to a simplified process, that is, it is indirectly consistent with the active master control disk by following the parameters of the remote end. Figure 3 As shown, the BFD module in the FPGA is reset so that the BFD module starts to operate normally and waits 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 disk is in the active main control disk, its time negotiation algorithm is consistent with the algorithm specified in RFC5880, that is, the RFC5880 algorithm is switched to perform detection time parameter synchronization. Since the method and principle of how to implement detection time parameter synchronization through the RFC5880 algorithm are common knowledge in the art, they are not described here for the sake of brevity; and if the disk is in the standby main control disk, it will be indirectly consistent with the active main control disk by following the parameters of the remote end.
[0097] Among them, see Figure 3 As shown, the standby main control disk first determines whether the detection of the target session entry is enabled according to the enabling information configured by the device-side software. If the target session entry is not enabled, it means that there is no need to synchronize the detection time parameters of the target session entry, and then waits for the acquisition timing of the next target session entry to arrive; however, if the target session entry is enabled, it will further determine whether the target session entry needs to perform fault detection according to the forced detection cycle to control the synchronization of the detection time parameters of the standby main control disk.
[0098] It is understandable that if the target session entry is determined to be required to perform fault detection according to the mandatory detection period according to the mandatory detection period configured by the device-side software, then for the active main 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 main control 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 session parameter synchronization with the active main control disk.
[0099] However, if the target session entry does not need to perform fault detection according to the mandatory detection cycle, it will further determine whether a new packet (i.e., target BFD control message) corresponding to the target session entry sent by the remote device is received; if the target BFD control message corresponding to the target session entry sent by the remote device is received, the newly received target BFD control message is parsed to determine the expected minimum time interval for sending (i.e., the remote expected minimum sending period dmti) parameter carried by the target BFD control message sent by the remote device; then the remote dmti is compared with the minimum time interval for receiving (i.e., the target expected minimum receiving period rmri) configured on the local side corresponding to the target session entry, and the larger value of the two is taken as the actual detection period of the target session entry. At this point, the detection time is determined, and the detection time parameter synchronization between the standby main control disk and the active main control disk is achieved, so that the BFD of the standby main control disk can be consistent with the active main control disk in real time. It can be understood that if the remote dmti and the local target rmri are the same, either of the two can be used as the actual detection period of the target session entry.
[0100] Furthermore, in one embodiment, after the step of determining whether the target session entry needs to perform fault detection according to a mandatory detection cycle, the step 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 message 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 need to perform fault detection according to the mandatory detection period and the target BFD control message corresponding to the target session entry sent by the remote device is not received, then 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 (that is, no change), any one of the target RMRI and the historical RMRI can be used as the actual detection period of the target session entry; and if they are not the same (that is, changed), it will continue to determine whether the current local configured target RMRI is greater than the historical RMRI. If so, the current local configured target RMRI is taken as the actual detection period of the target session entry; otherwise, the actual detection period of the target session entry is still the historical RMRI. At this point, the detection time is determined, and the time detection parameter synchronization between the standby main control disk and the active main control disk is achieved.
[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 a connected state Up sent by a remote device is received, the session state corresponding to the target session entry is migrated from Down to Up to achieve session parameter synchronization with the active main control disk.
[0107] Exemplarily, in this embodiment, partial state migration of the BFD session in the standby master disk will be implemented, that is, the conditions for changing the session state from Down (disconnected) to Up (connected) will be simplified. Specifically, when this disk is in the standby 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 performed 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 a state of Up sent by a 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 standby 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 standby disks synchronized.
[0108] In a second aspect, an embodiment of the present application also provides a primary and backup BFD session parameter synchronization device.
[0109] In one embodiment, referring to Figure 4 , Figure 4 This is a functional module diagram of an embodiment of the active / standby BFD session parameter synchronization device of the present 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 it is detected 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 cycle;
[0111] If yes, the preset target sending period is used as the actual sending period of the target session entry to achieve synchronization of session parameters with the primary main control disk;
[0112] If not 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 session parameter synchronization with the active master control disk.
[0113] Furthermore, in one embodiment, the sending time synchronization module is also used for:
[0114] When the target session entry does not need to send messages according to the mandatory sending period and the target BFD control message is not received, determining whether the target expected minimum sending period is the same as the historical expected minimum sending period;
[0115] If yes, 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 used for:
[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 used to:
[0121] When the remote end's expected minimum reception period is less than the target's expected minimum transmission period, using the target's expected minimum transmission period as the actual transmission period of the target session entry;
[0122] When the remote end expected minimum reception period is equal to the target expected minimum transmission period, taking 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 device further includes a detection time synchronization module, which is used to:
[0125] Determining whether the target session entry needs to be fault-checked according to a mandatory detection cycle;
[0126] If yes, the preset target detection period is used as the actual detection period of the target session entry to achieve synchronization with the session parameters of the primary main control disk;
[0127] If not and a 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 main control disk.
[0128] Furthermore, in one embodiment, the detection time synchronization module is further used 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 message 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 device further includes a session state synchronization module, which is used 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 a connected state Up sent by a remote device is received, the session state corresponding to the target session entry is migrated from Down to Up to achieve session parameter synchronization with the active main control disk.
[0134] Among them, the functional implementation of each module in the above-mentioned active-standby BFD session parameter synchronization device corresponds to the steps in the above-mentioned active-standby BFD session parameter synchronization method embodiment, and its functions and implementation processes are no longer repeated here one by one.
[0135] In a third aspect, an embodiment of the present application provides a primary-standby BFD session parameter synchronization device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0136] Reference Figure 5 , Figure 5 The hardware structure diagram of the active / standby BFD session parameter synchronization device involved in the embodiment of the present application is shown in FIG. 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, the memory, and the communication interface.
[0138] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces, which are used to interconnect the devices inside the active and standby BFD session parameter synchronization devices, and interfaces used to interconnect the active and standby BFD session parameter synchronization devices with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[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, and the general-purpose processor may call the master-standby BFD session parameter synchronization program stored in the memory, and execute the master-standby BFD session parameter synchronization method provided in the 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 called may refer to the various embodiments of the master-standby BFD session parameter synchronization method of the present application, and will not be repeated here.
[0141] Those skilled in the art will understand that Figure 5 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[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 primary-standby BFD session parameter synchronization program, wherein when the primary-standby BFD session parameter synchronization program is executed by a processor, the steps of the primary-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 only for description 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 "first", "second" and "third" to different types.
[0147] In the description of the embodiments of the present application, "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 the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[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; the “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 that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed 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 a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially 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, disk, CD) as described above, and includes a number of instructions for 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 are not intended to 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 active and standby BFD sessions. It is 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 it is detected 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 cycle; If yes, the preset target sending period is used as the actual sending period of the target session entry to achieve synchronization of session parameters with the primary main control disk; If not 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 session parameter synchronization with the active master control disk.
2. The method for synchronizing active and standby BFD session parameters according to claim 1, It is characterized in that After the step of determining whether the target session entry needs to send a message according to a mandatory sending cycle, the method further includes: When the target session entry does not need to send messages according to the mandatory sending period and the target BFD control message is not received, determining whether the target expected minimum sending period is the same as the historical expected minimum sending period; If yes, 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, It is characterized in that The determining the actual sending period of the target session entry according to the size 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, It is characterized in that The step of determining the actual sending period of the target session entry according to 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 includes: When the remote end's expected minimum reception period is less than the target's expected minimum transmission period, using the target's expected minimum transmission period as the actual transmission period of the target session entry; When the remote end expected minimum reception period is equal to the target expected minimum transmission period, taking 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, It is characterized in that 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 cycle; If yes, the preset target detection period is used as the actual detection period of the target session entry to achieve synchronization with the session parameters of the primary main control disk; If not and a 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 main control disk.
6. The method for synchronizing active and standby BFD session parameters according to claim 5, It is characterized in that After the step of determining whether the target session entry needs to be fault-checked according to a mandatory detection cycle, 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 message 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, It is characterized in that 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 a connected state Up sent by a remote device is received, the session state corresponding to the target session entry is migrated from Down to Up to achieve session parameter synchronization with the active main control disk.
8. A master-slave BFD session parameter synchronization device, It is characterized in that The active / standby BFD session parameter synchronization device includes a sending time synchronization module, which is used to: When it is detected 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 cycle; If yes, the preset target sending period is used as the actual sending period of the target session entry to achieve synchronization of session parameters with the primary main control disk; If not 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 session parameter synchronization with the active master control disk.
9. A master / slave BFD session parameter synchronization device, It is 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, wherein 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, It is characterized in that The computer-readable storage medium stores a primary-standby BFD session parameter synchronization program, wherein when the primary-standby BFD session parameter synchronization program is executed by a processor, the steps of the primary-standby 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
Precision time protocol (PTP) clock source switching method, master and slave clock devices and system
CN102664726A
BFD (Bidirectional Forwarding Detection) realizing method and equipment
CN102801584A
Backup method of BFD (Bidirectional Forwarding Detection) session on primary and standby master control boards
CN109462557A
BFD processing method and network equipment
CN109495345A
