WO2018010614A1 - Bfd session connection establishment - Google Patents

Bfd session connection establishment Download PDF

Info

Publication number
WO2018010614A1
WO2018010614A1 PCT/CN2017/092337 CN2017092337W WO2018010614A1 WO 2018010614 A1 WO2018010614 A1 WO 2018010614A1 CN 2017092337 W CN2017092337 W CN 2017092337W WO 2018010614 A1 WO2018010614 A1 WO 2018010614A1
Authority
WO
WIPO (PCT)
Prior art keywords
state
bfd
bfd session
session
peer device
Prior art date
Application number
PCT/CN2017/092337
Other languages
French (fr)
Chinese (zh)
Inventor
吴文
汪亮
Original Assignee
新华三技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 新华三技术有限公司 filed Critical 新华三技术有限公司
Publication of WO2018010614A1 publication Critical patent/WO2018010614A1/en

Links

Images

Definitions

  • BFD Bidirectional Forwarding Detection
  • BFD establishes sessions on two devices to monitor bidirectional forwarding between the two devices.
  • Path which serves the upper layer protocol.
  • the BFD protocol specifies three states for establishing a BFD session connection: DOWN (not ready), INIT (ready), and UP (established).
  • FIG. 1 is a state transition diagram of a BFD session connection establishment according to an exemplary embodiment of the present disclosure
  • FIG. 2 is a flowchart showing a method of determining that a preset condition is satisfied, according to an exemplary embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of message interaction of a BFD session connection establishment process according to an exemplary embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a hardware structure of a network device to which a BFD session connection establishing apparatus is applied according to an exemplary embodiment of the present disclosure
  • FIG. 5 is a schematic structural diagram of the network device according to an exemplary embodiment of the present disclosure.
  • FIG. 6 is another schematic structural diagram of the network device according to an exemplary embodiment of the present disclosure.
  • BFD can be associated with other upper-layer protocols.
  • a typical application is to detect whether the PW is normal through BFD-linked PW (Pseudowire). Assume that there are two PEs (Provider Edges, service provider network edge) devices PE1 and PE2, and a PW is established on the physical link between PE1 and PE2. The PW is bound to a BFD session, and the BFD is on PE1 and PE2. The initial state of the session is DOWN.
  • a BFD session connection can be established between PE1 and PE2 through the following processing.
  • PE1 can send a BFD packet indicating that the BFD session is in the DOWN state to PE2.
  • the PE2 switches the BFD session to the INIT state, and then sends the BFD packet indicating that the BFD session is in the INIT state to the PE1.
  • the PE1 After receiving the BFD packet indicating the INIT state, the PE1 switches the BFD session to the UP state, and then sends the BFD packet indicating that the BFD session is in the Up state to PE2. After receiving the BFD packet indicating the UP state, the PE2 switches the BFD session to the UP state.
  • the BFD packets exchanged between PE1 and PE2 need to be sent to the CPU (Central Processing Unit) for judgment and processing.
  • the CPU Central Processing Unit
  • the CPU processing performance of any of the devices deteriorates, for example, when PE2 has a large processing workload, resulting in a decrease in processing performance, the following may occur.
  • the PE2 After receiving the BFD packet in the UP state, the PE2 sends the BFD packet to the CPU. The CPU fails to process the BFD packet and is discarded. After the detection time is reached, the BFD session on PE2 is switched from the INIT state to the DOWN state. The state of PE1 is also switched from the UP state to the DOWN state after the detection time is reached. Afterwards, PE1 and PE2 will try to initiate a BFD session connection again. The CPU of PE2 may still discard BFD packets. Therefore, after the oscillating process, the BFD session on PE1 and PE2 will eventually reach the UP state. In this process, the state of the BFD session is oscillated due to the degraded CPU processing performance of the PE2. As a result, the upper-layer protocol that is associated with the BFD session is also flapped. For example, the neighbor relationship of the upper-layer routing protocol flaps.
  • the BFD session connection establishment method is provided in the following embodiment, and the BFD session connection establishment method is provided in the following embodiment, and the method can be applied to the BFD session connection.
  • Method of network equipment Method of network equipment.
  • a new state PRE-UP is introduced on the basis of three states DOWN (not ready), INIT (ready), and UP (established) established by the BFD session. (quasi-UP), PER-UP represents an unsteady state that has not been fully UP and may change.
  • the BFD session connection establishment method is described with a PE device as an example of a network device, but
  • the application of the method is not limited to the PE device, and may be other network devices that can run the BFD protocol.
  • the BFD session on the PE device is in the DOWN state, if the PE device receives the BFD packet sent by the peer device to indicate the DOWN state, the BFD session is switched to the INIT state.
  • the BFD session is in the INIT state, if the PE device receives the BFD packet sent by the peer device and indicates the status of the INIT or the UP, the BFD session is switched to the PRE-UP state.
  • the BFD session is in the PRE-UP state, if the PE device receives the BFD packet sent by the peer device and indicates the INIT or the UP state, the BFD session is maintained in the PRE-UP state.
  • the PE device switches the BFD session to the UP state when it determines that the preset condition is met.
  • the foregoing preset condition is: the N (N is a positive integer) BFD packets sent from the peer device, and the two adjacent BFD packets in the N BFD packets are continuously received.
  • the interval between receptions is within a preset time range.
  • the preset time range may be expressed as [T-t1, T+t2], where T represents a transmission time interval of the BFD message, and t1 and t2 represent preset time interval errors.
  • t1 and t2 may be the same or different. For example, both t1 and t2 may be preset to 20%T.
  • the received BFD packet indicating the UP state may be counted by a counter, and the initial value of the counter value i of the counter is 0.
  • the method for determining whether the foregoing preset condition is met may be as shown in FIG. 2, and includes the following steps.
  • step S201 the PE device determines whether the BFD packet of the BFD session is to be established. If yes, the process proceeds to step S202. Otherwise, the process returns to step S201.
  • step S202 the PE device determines whether the BFD packet indicates the UP state. If yes, step S203 is performed. Otherwise, step S209 is performed.
  • step S204 the PE device determines whether the counter value of the counter is greater than 1, that is, determines whether i is greater than 1, and if so, proceeds to step S205, otherwise, returns to step S201.
  • step S205 the PE device calculates a difference A between the time when the BFD packet indicating the UP state is received and the time when the BFD packet indicating the UP state is received, and then the step S206 is performed.
  • step S206 the PE device determines whether A is within the preset time range [T-t1, T+t2]. If yes, step S207 is performed; otherwise, step S209 is performed.
  • Step S207 the PE device determines whether the counter value of the counter is equal to N, that is, determines whether i is equal to N, and if so, proceeds to step S208, otherwise, returns to step S201.
  • the PE device receives the BFD packet sent by the peer device, and does not receive the BFD packet from the peer device.
  • the BFD session is switched to the DOWN state.
  • the PE device switches the BFD session to the PRE-UP state if it receives the BFD packet sent by the peer device and indicates the INIT state.
  • the PE device receives the BFD packet indicating the DOWN state sent by the peer device, or does not receive the BFD indicating the UP state sent by the peer device within the detection time. If the packet is received, the BFD session is switched to the DOWN state.
  • the PE device When the BFD session is in the DOWN state, the PE device maintains the BFD session in the DOWN state if it receives the BFD packet from the peer device.
  • the PE device When the BFD session is in the INIT state, the PE device maintains the BFD session in the INIT state if it receives the BFD packet in the DOWN state sent by the peer device.
  • the PE device If the BFD session is in the UP state, the PE device maintains the BFD session in the UP state if it receives the BFD packet in the INIT or the UP state.
  • the PE device When the BFD session is in the INIT state, the PE device does not receive the peer device during the detection time. The BFD session is switched to the DOWN state.
  • the PE device When the BFD session is in the DOWN state, the PE device sends a BFD packet indicating the DOWN state to the peer device.
  • the device When the BFD session is in the INIT state, the device sends a BFD packet indicating the INIT state to the peer device.
  • the BFD packet indicating the UP state is sent to the peer device.
  • the BFD packet indicating the UP state is sent to the peer device.
  • a new BFD session connection establishment state PRE-UP is introduced. If the BFD session is in the DOWN state, the network device, such as the PE device, does not directly switch the BFD session to the UP state but switches to the BFD session. PRE-UP status. When the BFD session is in the INIT state, the network device does not directly switch the BFD session to the UP state but switches to the PRE-UP if it receives the BFD packet from the peer device indicating the INIT or the UP state. After the BFD session enters the PRE-UP state, the device sends a BFD packet indicating the UP state to the peer device, and receives the BFD packet from the peer device.
  • the BFD session is switched to the UP state when the condition is met.
  • the preset condition is that the receiving time intervals between the N BFD packets indicating the UP state and the BFD packets indicating the UP state are consecutively within a preset time range.
  • the description of whether the PW is normal or not is detected by the BFD linkage PW.
  • a PW is established on the physical link between the two PEs, PE1 and PE2.
  • the PW is bound to a BFD session.
  • the CPU of PE2 has a large processing workload, so the processing performance is poor.
  • the initial state of the BFD session on both PE1 and PE2 is DOWN.
  • the BFD session connection establishment process between PE1 and PE2 includes the following steps.
  • step S301 the PE1 sends a BFD packet indicating the DOWN state to the PE2.
  • Step S302 After receiving the BFD packet indicating the DOWN state, the PE2 switches the BFD session to the INIT state, and then sends the BFD packet indicating the INIT state to the PE1.
  • Step S303 After receiving the BFD packet indicating the INIT state, the PE1 switches the BFD session to the PRE-UP state, and then sends the BFD packet indicating the UP state to the PE2.
  • Step S304 after receiving the BFD packet indicating the UP state, the PE2 switches the BFD session to the PRE-UP. Status, and then send a BFD packet indicating the UP status to PE1.
  • PE1 and PE2 When the BFD session is in the PRE-UP state, PE1 and PE2 send BFD packets indicating the UP state to the peer according to the interval.
  • step S305 the PE1 switches the BFD session to the UP state when it determines that the preset condition is met.
  • step S306 the PE2 switches the BFD session to the UP state when it determines that the preset condition is met.
  • the present disclosure also provides an embodiment of a network device.
  • network device 40 can include a processor 10, a machine readable storage medium 20 that stores machine executable instructions.
  • Processor 10 and machine readable storage medium 20 are communicable via system bus 30. And, by reading and executing the machine executable instructions in the machine readable storage medium 20 corresponding to the BFD session establishment control logic, the processor 10 can perform the BFD session connection establishment method described above.
  • the machine-readable storage medium 20 referred to herein can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like.
  • the machine-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as a hard disk drive), solid state drive, any type of storage disk. (such as a disc, dvd, etc.), or a similar storage medium, or a combination thereof.
  • the BFD session connection establishment control logic may include: a receiving module 501, a first switching module 502, a second switching module 503, a sending module 504, and a third switching module 505, where:
  • the receiving module 501 is configured to receive a BFD packet sent by the peer device of the BFD session.
  • the first switching module 502 is configured to: when the BFD session is in the DOWN state, if the receiving module 501 receives the BFD packet sent by the peer device and indicates the INIT state, the BFD session is switched to the PRE-UP state;
  • the second switching module 503 is configured to: when the BFD session is in the INIT state, if the receiving module 501 receives the BFD packet sent by the peer device and indicates the INIT or the UP state, the BFD session is switched to the PRE-UP state. ;
  • the sending module 504 is configured to: when the BFD session is in the PRE-UP state, send a BFD packet indicating the UP state to the peer device;
  • the third switching module 505 is configured to switch the BFD session to the UP state when the BFD session is in the PRE-UP state, if the preset condition is met, the preset condition is that the N BFDs indicating the UP state are continuously received.
  • the receiving time interval between the two adjacent BFD packets in the BFD packet indicating the UP state is within a preset time range, where N is a positive integer.
  • the BFD session connection establishment control logic further includes: a maintenance module 506, configured to: when the BFD session is in the PRE-UP state, if the receiving module 501 receives the UP status sent by the peer device The BFD session is maintained in the PRE-UP state if the BFD packet is not met.
  • the maintenance module 506 is further configured to: when the BFD session is in the PRE-UP state, if the receiving module 501 receives the BFD packet sent by the peer device and indicates the INIT state, the BFD session is maintained as the PRE-UP. status.
  • the BFD session connection establishment control logic further includes: a fourth switching module 507, configured to: when the BFD session is in the PRE-UP state, if the receiving module 501 receives the peer device, the DOWN indicates that the DOWN is sent. If the receiving module 501 does not receive the BFD packet sent by the peer device within the detection time, the BFD session is switched to the DOWN state.
  • a fourth switching module 507 configured to: when the BFD session is in the PRE-UP state, if the receiving module 501 receives the peer device, the DOWN indicates that the DOWN is sent. If the receiving module 501 does not receive the BFD packet sent by the peer device within the detection time, the BFD session is switched to the DOWN state.
  • the preset time range is [T-t1, T+t2], where T represents the transmission time interval of the BFD message, and t1 and t2 represent the preset time interval error.
  • the processor 10 is caused to execute by executing machine executable instructions in the machine readable storage medium 20 corresponding to the BFD session connection establishment control logic described above:
  • the BFD session on the network device When the BFD session on the network device is in the inactive DOWN state and the BFD packet sent by the peer device indicating that the INIT state is ready is received, the BFD session is switched to the established PRE-UP state.
  • the BFD session After the BFD session is in the INIT state and receives the BFD packet sent by the peer device to indicate the INIT state or the UP state, the BFD session is switched to the PRE-UP state;
  • the BFD session is switched from the PRE-UP state to the UP state.
  • the preset condition is that the two BFD packets indicating the UP state are continuously received from the peer device, and the two adjacent BFD packets in the BFD packet indicating the UP state are consecutively received.
  • the receiving time interval is within a preset time range, wherein the N is a positive integer.
  • the processor 10 is further caused by the machine executable instruction to: when the BFD session is in the PRE-UP state, if a BFD packet indicating the UP state sent by the peer device is received, and the method is not satisfied
  • the preset condition is to maintain the BFD session in the PRE-UP state.
  • the processor 10 is further caused by the machine executable instruction to: when the BFD session is in the PRE-UP state, if the BFD packet sent by the peer device indicating the INIT state is received, The BFD session is maintained in the PRE-UP state.
  • the processor 10 is further caused by the machine executable instruction to: when the BFD session is in the PRE-UP state, if the BFD packet indicating the DOWN state sent by the peer device is received, The BFD session is switched to the DOWN state.
  • the processor 10 is further caused by the machine executable instruction to: when the BFD session is in the PRE-UP state, if the BFD packet sent by the peer device is not received within the detection time, The BFD session is switched to the DOWN state.
  • the preset time range is [T-t1, T+t2], where T represents the transmission time interval of the BFD message, and t1 and t2 represent the preset time interval error.
  • machine readable storage medium comprising machine executable instructions, such as machine readable storage medium 20 of FIG. 4, which may be processor 10 in network device 40 Executed to implement the BFD session connection establishment method described above.
  • the processor 10 can perform the following operations:
  • the BFD session When the BFD session is in the DOWN state and the BFD packet is sent to the peer device, the BFD session is switched to the PRE-UP state.
  • the BFD session is switched to the PRE-UP state, when the BFD session is in the INIT state and the BFD packet is sent to the peer device to indicate the INIT state or the UP state.
  • the BFD session is switched from the PRE-UP state to the UP state.
  • the preset condition is that the two BFD packets indicating the UP state are continuously received from the peer device, and the two adjacent BFD packets in the BFD packet indicating the UP state are consecutively received.
  • the receiving time interval is within a preset time range, wherein the N is a positive integer.
  • the machine executable instruction further causes the processor 10 to: if the BFD session is in the PRE-UP state, if a BFD packet indicating the UP state sent by the peer device is received, and the method is not satisfied
  • the preset condition maintains the BFD session in the PRE-UP state.
  • the machine executable instructions further cause the processor 10 to: when the BFD session is in the PRE-UP state, After receiving the BFD packet sent by the peer device and indicating the INIT state, the BFD session is maintained in the PRE-UP state.
  • the machine executable instruction further causes the processor 10 to: when the BFD session is in the PRE-UP state, if a BFD packet indicating the DOWN state sent by the peer device is received, or If the BFD session sent by the peer device is not received, the BFD session is switched to the DOWN state.
  • the preset time range is [T-t1, T+t2], where T represents the transmission time interval of the BFD message, and t1 and t2 represent the preset time interval error.
  • first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information without departing from the scope of the present disclosure.
  • second information may also be referred to as first information.
  • word "if” as used herein may be interpreted as "when” or “when” or “in response to a determination.”
  • the device embodiment since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the present disclosure. Those of ordinary skill in the art can understand and implement without any creative effort.

Abstract

The present disclosure provides a BFD session connection establishment method and a network device. The method comprises: when a BFD session is in a DOWN state, if a BFD packet that is sent by a peer-end device and that indicates an INIT state is received, a network device switches the BFD session to a PRE-UP state; if the BFD session is in the INIT state, if a BFD packet that is sent by the peer-end device and that indicates the INIT state or an UP state is received, the network device still switches the BFD session to the PRE-UP state; when the BFD session is in the PRE-UP state, the network device sends, to the peer-end device, a packet indicating the UP state; and if a preset condition is satisfied, the network device further switches the BFD session to the UP state, the preset condition being a condition in which N BFD packets indicating the UP state being continuously received from the peer-end device and the reception time interval between two adjacent BFD packets falling within a preset time range.

Description

BFD会话连接建立BFD session connection establishment
相关申请的交叉引用Cross-reference to related applications
本专利申请要求于2016年7月15日提交的、申请号为201610575334.0、发明名称为“BFD会话连接建立方法及装置”的中国专利申请的优先权,该申请的全文以引用的方式并入本文中。The present application claims priority to Chinese Patent Application No. 201610575334.0, entitled "BFD Session Connection Establishment Method and Apparatus", filed on July 15, 2016, the entire disclosure of which is hereby incorporated by reference. in.
背景技术Background technique
BFD(Bidirectional Forwarding Detection,双向转发检测)是一种通用的、标准化的、介质无关、协议无关的快速故障检测机制,BFD在两台设备上建立会话,用来监测这两台设备间的双向转发路径,为上层协议服务。BFD协议上规定了BFD会话连接建立的三种状态:DOWN(未就绪)、INIT(已就绪)和UP(已建立)。BFD (Bidirectional Forwarding Detection) is a general-purpose, standardized, medium-independent, protocol-independent fast fault detection mechanism. BFD establishes sessions on two devices to monitor bidirectional forwarding between the two devices. Path, which serves the upper layer protocol. The BFD protocol specifies three states for establishing a BFD session connection: DOWN (not ready), INIT (ready), and UP (established).
附图说明DRAWINGS
图1是本公开一示例性实施例示出的BFD会话连接建立的状态转换图;FIG. 1 is a state transition diagram of a BFD session connection establishment according to an exemplary embodiment of the present disclosure; FIG.
图2是本公开一示例性实施例示出的确定满足预设条件的方法的流程图;2 is a flowchart showing a method of determining that a preset condition is satisfied, according to an exemplary embodiment of the present disclosure;
图3是本公开一示例性实施例示出的BFD会话连接建立过程的报文交互示意图;FIG. 3 is a schematic diagram of message interaction of a BFD session connection establishment process according to an exemplary embodiment of the present disclosure;
图4是本公开一示例性实施例示出的BFD会话连接建立装置所应用的网络设备的硬件结构示意图;4 is a schematic diagram of a hardware structure of a network device to which a BFD session connection establishing apparatus is applied according to an exemplary embodiment of the present disclosure;
图5是本公开一示例性实施例示出的该网络设备的一种结构示意图;FIG. 5 is a schematic structural diagram of the network device according to an exemplary embodiment of the present disclosure;
图6是本公开一示例性实施例示出的该网络设备的另一种结构示意图。FIG. 6 is another schematic structural diagram of the network device according to an exemplary embodiment of the present disclosure.
具体实施方式detailed description
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。 Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. The following description refers to the same or similar elements in the different figures unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with aspects of the present disclosure as detailed in the appended claims.
为了实现快速检测,BFD可与其它上层协议进行联动,一种典型的应用就是通过BFD联动PW(Pseudowire,伪线)来检测PW是否正常。假设有两个PE(Provider Edge,服务提供商网络边缘)设备PE1和PE2,在PE1与PE2之间的物理链路上建立有PW,该PW绑定一个BFD会话,在PE1和PE2上该BFD会话的初始状态都为DOWN。PE1与PE2之间可通过如下处理来建立BFD会话连接。In order to implement fast detection, BFD can be associated with other upper-layer protocols. A typical application is to detect whether the PW is normal through BFD-linked PW (Pseudowire). Assume that there are two PEs (Provider Edges, service provider network edge) devices PE1 and PE2, and a PW is established on the physical link between PE1 and PE2. The PW is bound to a BFD session, and the BFD is on PE1 and PE2. The initial state of the session is DOWN. A BFD session connection can be established between PE1 and PE2 through the following processing.
首先,PE1可发送表示BFD会话为DOWN状态的BFD报文给PE2。First, PE1 can send a BFD packet indicating that the BFD session is in the DOWN state to PE2.
然后,PE2接收到表示DOWN状态的BFD报文之后,将BFD会话切换为INIT状态,然后,发送表示BFD会话为INIT状态的BFD报文给PE1。Then, after receiving the BFD packet indicating the DOWN state, the PE2 switches the BFD session to the INIT state, and then sends the BFD packet indicating that the BFD session is in the INIT state to the PE1.
PE1接收到表示INIT状态的BFD报文之后,将BFD会话切换为UP状态,然后,再发送表示BFD会话为UP状态的BFD报文给PE2。PE2接收到该表示UP状态的BFD报文之后,将BFD会话切换为UP状态。After receiving the BFD packet indicating the INIT state, the PE1 switches the BFD session to the UP state, and then sends the BFD packet indicating that the BFD session is in the Up state to PE2. After receiving the BFD packet indicating the UP state, the PE2 switches the BFD session to the UP state.
在上述过程中,PE1与PE2交互的BFD报文均需要上送CPU(Central Processing Unit,中央处理单元)进行判断和处理。当其中任一设备的CPU处理性能变差,例如PE2由于处理工作量较大,因此导致处理性能下降时,就可能发生以下情况。In the above process, the BFD packets exchanged between PE1 and PE2 need to be sent to the CPU (Central Processing Unit) for judgment and processing. When the CPU processing performance of any of the devices deteriorates, for example, when PE2 has a large processing workload, resulting in a decrease in processing performance, the following may occur.
在PE2接收到PE1发来的表示UP状态的BFD报文之后,上送给CPU,但是,由于PE2的CPU处理性能下降,导致该BFD报文无法及时处理而被丢弃。在检测时间到达后,PE2上的BFD会话会从INIT状态切换为DOWN状态,PE1的状态也会在检测时间到达后从UP状态切换为DOWN状态。后续,PE1和PE2还会再次尝试发起BFD会话连接建立,可能仍然会出现PE2的CPU丢弃BFD报文的情况。从而在经历了震荡过程后PE1和PE2上的BFD会话才会最终均到达UP状态。在该过程中,由于PE2的CPU处理性能下降而导致BFD会话的状态发生了震荡,进而会导致BFD会话所联动的上层协议也发生震荡,例如,导致上层的路由协议的邻居关系发生震荡。After receiving the BFD packet in the UP state, the PE2 sends the BFD packet to the CPU. The CPU fails to process the BFD packet and is discarded. After the detection time is reached, the BFD session on PE2 is switched from the INIT state to the DOWN state. The state of PE1 is also switched from the UP state to the DOWN state after the detection time is reached. Afterwards, PE1 and PE2 will try to initiate a BFD session connection again. The CPU of PE2 may still discard BFD packets. Therefore, after the oscillating process, the BFD session on PE1 and PE2 will eventually reach the UP state. In this process, the state of the BFD session is oscillated due to the degraded CPU processing performance of the PE2. As a result, the upper-layer protocol that is associated with the BFD session is also flapped. For example, the neighbor relationship of the upper-layer routing protocol flaps.
为了解决上述存在的BFD会话可能会发生震荡,进而引起该BFD会话所联动的上层协议也发生震荡的问题,本公开以下实施例中提供了一种BFD会话连接建立方法,以及一种可以应用该方法的网络设备。The BFD session connection establishment method is provided in the following embodiment, and the BFD session connection establishment method is provided in the following embodiment, and the method can be applied to the BFD session connection. Method of network equipment.
本公开实施例中,在BFD协议规定的BFD会话连接建立的三种状态DOWN(未就绪)、INIT(已就绪)和UP(已建立)的基础上,引入了一种新的状态PRE-UP(准UP),PER-UP代表的是一种尚未完全UP、可能还会发生变动的非稳定状态。In the embodiment of the present disclosure, a new state PRE-UP is introduced on the basis of three states DOWN (not ready), INIT (ready), and UP (established) established by the BFD session. (quasi-UP), PER-UP represents an unsteady state that has not been fully UP and may change.
在本公开示例中,以PE设备作为网络设备的示例来描述该BFD会话连接建立方法,但 是该方法的应用不限于PE设备,还可以是可以运行BFD协议的其他网络设备。In the example of the present disclosure, the BFD session connection establishment method is described with a PE device as an example of a network device, but The application of the method is not limited to the PE device, and may be other network devices that can run the BFD protocol.
BFD会话的状态转换如图1所示,具体说明如下:The state transition of a BFD session is shown in Figure 1. The details are as follows:
101、当PE设备上的BFD会话为DOWN状态时,若PE设备接收到了对端设备发来表示DOWN状态的BFD报文,则将该BFD会话切换为INIT状态。When the BFD session on the PE device is in the DOWN state, if the PE device receives the BFD packet sent by the peer device to indicate the DOWN state, the BFD session is switched to the INIT state.
102、当该BFD会话为INIT状态时,若PE设备接收到了对端设备发来的表示INIT或UP的状态的BFD报文,则将该BFD会话切换为PRE-UP状态。102. When the BFD session is in the INIT state, if the PE device receives the BFD packet sent by the peer device and indicates the status of the INIT or the UP, the BFD session is switched to the PRE-UP state.
103、当该BFD会话为PRE-UP状态时,若PE设备接收到了对端设备发来的表示INIT或UP状态的BFD报文,则将该BFD会话维持为PRE-UP状态。103. When the BFD session is in the PRE-UP state, if the PE device receives the BFD packet sent by the peer device and indicates the INIT or the UP state, the BFD session is maintained in the PRE-UP state.
104、当该BFD会话为PRE-UP状态时,PE设备在判断出满足预设条件时,将该BFD会话切换为UP状态。When the BFD session is in the PRE-UP state, the PE device switches the BFD session to the UP state when it determines that the preset condition is met.
其中,上述预设条件为:连续接收到了对端设备发来的N(N为正整数)个状态为UP的BFD报文、并且这N个BFD报文中的相邻2个BFD报文之间的接收时间间隔在预设时间范围内。具体的,该预设时间范围可以表示为[T-t1,T+t2],其中,T表示BFD报文的发送时间间隔,t1和t2表示预设的时间间隔误差。在实际实施过程中,t1和t2可以相同,也可以不同,例如,t1和t2可以均预设为20%T。The foregoing preset condition is: the N (N is a positive integer) BFD packets sent from the peer device, and the two adjacent BFD packets in the N BFD packets are continuously received. The interval between receptions is within a preset time range. Specifically, the preset time range may be expressed as [T-t1, T+t2], where T represents a transmission time interval of the BFD message, and t1 and t2 represent preset time interval errors. In actual implementation, t1 and t2 may be the same or different. For example, both t1 and t2 may be preset to 20%T.
例如,T=100ms,t1=t2=20%T=20ms,N=5,则在BFD会话切换为PRE-UP状态后,若连续接收到了对端设备发来的5个表示UP状态的BFD报文,并且这5个BFD报文中相邻2个BFD报文的接收时间间隔在80ms~120ms之间,才会将该BFD会话从PER-UP状态切换为UP状态。For example, if T=100ms, t1=t2=20%T=20ms, N=5, after the BFD session is switched to the PRE-UP state, if five BFD reports indicating the UP status are received continuously from the peer device, The BFD session is switched from the PER-UP state to the UP state, and the interval between the two BFD packets in the five BFD packets is between 80ms and 120ms.
具体的,可以通过计数器来对接收到的表示UP状态的BFD报文进行计数,该计数器的计数值i的初始值为0。这样,在BFD会话切换为PRE-UP状态后,确定是否满足上述预设条件的方法可以如图2所示,包括以下步骤。Specifically, the received BFD packet indicating the UP state may be counted by a counter, and the initial value of the counter value i of the counter is 0. After the BFD session is switched to the PRE-UP state, the method for determining whether the foregoing preset condition is met may be as shown in FIG. 2, and includes the following steps.
步骤S201,PE设备判断是否接收到了要建立BFD会话的BFD报文,若是,则执行步骤S202,否则,返回步骤S201。In step S201, the PE device determines whether the BFD packet of the BFD session is to be established. If yes, the process proceeds to step S202. Otherwise, the process returns to step S201.
步骤S202,PE设备判断该BFD报文是否表示UP状态,若是,则执行步骤S203,否则,执行步骤S209。In step S202, the PE device determines whether the BFD packet indicates the UP state. If yes, step S203 is performed. Otherwise, step S209 is performed.
步骤S203,PE设备记录接收到该表示UP状态的BFD报文的时间,将计数器的计数值 加1,即,令i=i+1。Step S203, the PE device records the time when the BFD packet indicating the UP state is received, and the counter value of the counter is recorded. Add 1 to get i=i+1.
步骤S204,PE设备判断计数器的计数值是否大于1,即,判断i是否大于1,若是,则执行步骤S205,否则,返回步骤S201。In step S204, the PE device determines whether the counter value of the counter is greater than 1, that is, determines whether i is greater than 1, and if so, proceeds to step S205, otherwise, returns to step S201.
步骤S205,PE设备计算接收到该表示UP状态的BFD报文的时间与记录的接收到前一个表示UP状态的BFD报文的时间的差值A,之后执行步骤S206。In step S205, the PE device calculates a difference A between the time when the BFD packet indicating the UP state is received and the time when the BFD packet indicating the UP state is received, and then the step S206 is performed.
步骤S206,PE设备判断A是否在预设时间范围[T-t1,T+t2]内,若是,则执行步骤S207,否则,执行步骤S209。In step S206, the PE device determines whether A is within the preset time range [T-t1, T+t2]. If yes, step S207 is performed; otherwise, step S209 is performed.
步骤S207,PE设备判断计数器的计数值是否等于N,即,判断i是否等于N,若是,则执行步骤S208,否则,返回步骤S201。Step S207, the PE device determines whether the counter value of the counter is equal to N, that is, determines whether i is equal to N, and if so, proceeds to step S208, otherwise, returns to step S201.
步骤S208,PE设备确定满足上述预设条件,则将计数器的计数值清空为0,即,令i=0;之后退出本流程。Step S208, the PE device determines that the preset condition is met, and then clears the counter value of the counter to 0, that is, makes i=0; then exits the process.
步骤S209,PE设备将计数器的计数值清空为0,即,令i=0;之后退出本流程。In step S209, the PE device clears the counter value of the counter to 0, that is, makes i=0; then exits the flow.
105、当该BFD会话为PRE-UP状态时,PE设备若接收到了对端设备发来的表示DOWN状态的BFD报文,或者在检测时间内没有接收到对端设备发来的BFD报文,则将该BFD会话切换为DOWN状态。105. When the BFD session is in the PRE-UP state, the PE device receives the BFD packet sent by the peer device, and does not receive the BFD packet from the peer device. The BFD session is switched to the DOWN state.
106、当该BFD会话为DOWN状态时,PE设备若接收到了对端设备发来的表示INIT状态的BFD报文,则将该BFD会话切换为PRE-UP状态。106. When the BFD session is in the DOWN state, the PE device switches the BFD session to the PRE-UP state if it receives the BFD packet sent by the peer device and indicates the INIT state.
107、当该BFD会话的状态为UP时,PE设备若接收到了对端设备发来的表示DOWN状态的BFD报文,或者在检测时间内没有接收到对端设备发来的表示UP状态的BFD报文,则将该BFD会话切换为DOWN状态。107. When the status of the BFD session is Up, the PE device receives the BFD packet indicating the DOWN state sent by the peer device, or does not receive the BFD indicating the UP state sent by the peer device within the detection time. If the packet is received, the BFD session is switched to the DOWN state.
108、当该BFD会话为DOWN状态时,PE设备若接收到了对端设备发来的表示UP状态的BFD报文,则将该BFD会话维持为DOWN状态。108. When the BFD session is in the DOWN state, the PE device maintains the BFD session in the DOWN state if it receives the BFD packet from the peer device.
109、当该BFD会话为INIT状态时,PE设备若接收到了对端设备发来的表示DOWN状态的BFD报文,则将该BFD会话维持为INIT状态。109. When the BFD session is in the INIT state, the PE device maintains the BFD session in the INIT state if it receives the BFD packet in the DOWN state sent by the peer device.
110、当该BFD会话为UP状态时,PE设备若接收到了对端设备发来的表示INIT或UP状态的BFD报文,则将该BFD会话维持为UP状态;If the BFD session is in the UP state, the PE device maintains the BFD session in the UP state if it receives the BFD packet in the INIT or the UP state.
111、当该BFD会话为INIT状态时,PE设备若在检测时间内没有接收到对端设备发来的 BFD报文,则将该BFD会话切换为DOWN状态。111. When the BFD session is in the INIT state, the PE device does not receive the peer device during the detection time. The BFD session is switched to the DOWN state.
其中,在该BFD会话为DOWN状态时,PE设备向对端设备发送表示DOWN状态的BFD报文;在该BFD会话为INIT状态时,向对端设备发送表示INIT状态的BFD报文;在该BFD会话为PRE-UP状态时,向对端设备发送表示UP状态的BFD报文;在该BFD会话为UP状态时,向对端设备发送表示UP状态的BFD报文。When the BFD session is in the DOWN state, the PE device sends a BFD packet indicating the DOWN state to the peer device. When the BFD session is in the INIT state, the device sends a BFD packet indicating the INIT state to the peer device. When the BFD session is in the PRE-UP state, the BFD packet indicating the UP state is sent to the peer device. When the BFD session is in the Up state, the BFD packet indicating the UP state is sent to the peer device.
在本公开上述实施例的方法中,引入了一种新的BFD会话连接建立状态PRE-UP。其中,在BFD会话为DOWN状态时,诸如PE设备的网络设备若接收到了对端设备发来的表示INIT状态的BFD报文,则不会直接将该BFD会话切换为UP状态,而是切换为PRE-UP状态。在该BFD会话为INIT状态时,网络设备若接收到了对端设备发来的表示INIT或UP状态的BFD报文,则不会直接将该BFD会话切换为UP状态,而是切换为PRE-UP状态;而在BFD会话进入PRE-UP状态后,会向对端设备发送表示UP状态的BFD报文,并且,在接收到对端设备发来的表示UP状态的BFD报文,并且满足预设条件时,才会将该BFD会话切换为UP状态。该预设条件为:连续接收到了N个表示UP状态的BFD报文、并且相邻2个表示UP状态的BFD报文之间的接收时间间隔在预设时间范围内。通过设置上述预设条件,在判断出对端设备的CPU能够连续发出N个表示UP状态的BFD报文、并且相邻2个表示UP状态的BFD报文之间的接收时间间隔在预设时间范围内时,表明对端设备的CPU的处理性能是稳定的、有序的、正常的,不存在乱序、丢包、或时延较大等问题,从而可以进入UP状态,而不会发生BFD会话的状态发生震荡的问题,也不会引起该BFD会话所联动的上层协议发生震荡的问题。In the method of the above embodiment of the present disclosure, a new BFD session connection establishment state PRE-UP is introduced. If the BFD session is in the DOWN state, the network device, such as the PE device, does not directly switch the BFD session to the UP state but switches to the BFD session. PRE-UP status. When the BFD session is in the INIT state, the network device does not directly switch the BFD session to the UP state but switches to the PRE-UP if it receives the BFD packet from the peer device indicating the INIT or the UP state. After the BFD session enters the PRE-UP state, the device sends a BFD packet indicating the UP state to the peer device, and receives the BFD packet from the peer device. The BFD session is switched to the UP state when the condition is met. The preset condition is that the receiving time intervals between the N BFD packets indicating the UP state and the BFD packets indicating the UP state are consecutively within a preset time range. By setting the foregoing preset conditions, it is determined that the CPU of the peer device can continuously send N BFD packets indicating the UP state, and the receiving time interval between two adjacent BFD packets indicating the UP state is at a preset time. In the range, it indicates that the processing performance of the CPU of the peer device is stable, orderly, and normal. There are no problems such as out-of-order, packet loss, or large delay, so that the UP state can be entered without occurrence. The problem that the state of the BFD session is oscillating does not cause the upper-layer protocol associated with the BFD session to oscillate.
仍然以通过BFD联动PW来检测PW是否正常为例进行说明。两个PE设备PE1和PE2之间的物理链路上建立有PW,该PW绑定一个BFD会话。PE2的CPU由于处理工作量较大,因此,处理性能较差。在PE1和PE2上该BFD会话的初始状态都为DOWN。如图3所示,PE1与PE2之间的BFD会话连接建立过程包括以下步骤。The description of whether the PW is normal or not is detected by the BFD linkage PW. A PW is established on the physical link between the two PEs, PE1 and PE2. The PW is bound to a BFD session. The CPU of PE2 has a large processing workload, so the processing performance is poor. The initial state of the BFD session on both PE1 and PE2 is DOWN. As shown in Figure 3, the BFD session connection establishment process between PE1 and PE2 includes the following steps.
步骤S301,PE1发送表示DOWN状态的BFD报文给PE2。In step S301, the PE1 sends a BFD packet indicating the DOWN state to the PE2.
步骤S302,PE2接收到该表示DOWN状态的BFD报文之后,将BFD会话切换为INIT状态,然后,发送表示INIT状态的BFD报文给PE1。Step S302: After receiving the BFD packet indicating the DOWN state, the PE2 switches the BFD session to the INIT state, and then sends the BFD packet indicating the INIT state to the PE1.
步骤S303,PE1接收到该表示INIT状态的BFD报文之后,将BFD会话切换为PRE-UP状态,然后,发送表示UP状态的BFD报文给PE2。Step S303: After receiving the BFD packet indicating the INIT state, the PE1 switches the BFD session to the PRE-UP state, and then sends the BFD packet indicating the UP state to the PE2.
步骤S304,PE2接收到该表示UP状态的BFD报文之后,将BFD会话切换为PRE-UP 状态,然后,发送表示UP状态的BFD报文给PE1。Step S304, after receiving the BFD packet indicating the UP state, the PE2 switches the BFD session to the PRE-UP. Status, and then send a BFD packet indicating the UP status to PE1.
在BFD会话为PRE-UP状态时,PE1与PE2按照发送时间间隔向对方发送表示UP状态的BFD报文。When the BFD session is in the PRE-UP state, PE1 and PE2 send BFD packets indicating the UP state to the peer according to the interval.
步骤S305,PE1在判断出满足预设条件时,将BFD会话切换为UP状态。In step S305, the PE1 switches the BFD session to the UP state when it determines that the preset condition is met.
步骤S306,PE2在判断出满足预设条件时,将BFD会话切换为UP状态。In step S306, the PE2 switches the BFD session to the UP state when it determines that the preset condition is met.
与前述BFD会话连接建立方法的实施例相对应,本公开还提供了网络设备的实施例。Corresponding to the foregoing embodiment of the BFD session connection establishment method, the present disclosure also provides an embodiment of a network device.
如图4所示,网络设备40可包括处理器10、存储有机器可执行指令的机器可读存储介质20。处理器10与机器可读存储介质20可经由系统总线30通信。并且,通过读取并执行机器可读存储介质20中与BFD会话建立控制逻辑对应的机器可执行指令,处理器10可执行上文描述的BFD会话连接建立方法。As shown in FIG. 4, network device 40 can include a processor 10, a machine readable storage medium 20 that stores machine executable instructions. Processor 10 and machine readable storage medium 20 are communicable via system bus 30. And, by reading and executing the machine executable instructions in the machine readable storage medium 20 corresponding to the BFD session establishment control logic, the processor 10 can perform the BFD session connection establishment method described above.
本文中提到的机器可读存储介质20可以是任何电子、磁性、光学或其它物理存储装置,可以包含或存储信息,如可执行指令、数据,等等。例如,机器可读存储介质可以是:RAM(Radom Access Memory,随机存取存储器)、易失存储器、非易失性存储器、闪存、存储驱动器(如硬盘驱动器)、固态硬盘、任何类型的存储盘(如光盘、dvd等),或者类似的存储介质,或者它们的组合。The machine-readable storage medium 20 referred to herein can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as a hard disk drive), solid state drive, any type of storage disk. (such as a disc, dvd, etc.), or a similar storage medium, or a combination thereof.
如图5所示,从功能上划分,上述BFD会话连接建立控制逻辑可以包括:接收模块501、第一切换模块502、第二切换模块503、发送模块504和第三切换模块505,其中:As shown in FIG. 5, the BFD session connection establishment control logic may include: a receiving module 501, a first switching module 502, a second switching module 503, a sending module 504, and a third switching module 505, where:
接收模块501,用于接收BFD会话的对端设备发来的BFD报文;The receiving module 501 is configured to receive a BFD packet sent by the peer device of the BFD session.
第一切换模块502,用于在该BFD会话为DOWN状态时,若接收模块501接收到了对端设备发来的表示INIT状态的BFD报文,则将该BFD会话切换为PRE-UP状态;The first switching module 502 is configured to: when the BFD session is in the DOWN state, if the receiving module 501 receives the BFD packet sent by the peer device and indicates the INIT state, the BFD session is switched to the PRE-UP state;
第二切换模块503,用于在该BFD会话为INIT状态时,若接收模块501接收到了对端设备发来的表示INIT或UP状态的BFD报文,则将该BFD会话切换为PRE-UP状态;The second switching module 503 is configured to: when the BFD session is in the INIT state, if the receiving module 501 receives the BFD packet sent by the peer device and indicates the INIT or the UP state, the BFD session is switched to the PRE-UP state. ;
发送模块504,用于在该BFD会话为PRE-UP状态时,向对端设备发送表示UP状态的BFD报文;The sending module 504 is configured to: when the BFD session is in the PRE-UP state, send a BFD packet indicating the UP state to the peer device;
第三切换模块505,用于在该BFD会话为PRE-UP状态时,若满足预设条件,则将该BFD会话切换为UP状态,该预设条件为连续接收到了N个表示UP状态的BFD报文、并且这N个表示UP状态的BFD报文中的相邻2个BFD报文之间的接收时间间隔在预设时间范围内,其中,N为正整数。 The third switching module 505 is configured to switch the BFD session to the UP state when the BFD session is in the PRE-UP state, if the preset condition is met, the preset condition is that the N BFDs indicating the UP state are continuously received. The receiving time interval between the two adjacent BFD packets in the BFD packet indicating the UP state is within a preset time range, where N is a positive integer.
另外,如图6所示,该BFD会话连接建立控制逻辑还包括:维持模块506,用于在该BFD会话为PRE-UP状态时,若接收模块501接收到了对端设备发来的表示UP状态的BFD报文,并且不满足预设条件,则将该BFD会话维持为PRE-UP状态。In addition, as shown in FIG. 6, the BFD session connection establishment control logic further includes: a maintenance module 506, configured to: when the BFD session is in the PRE-UP state, if the receiving module 501 receives the UP status sent by the peer device The BFD session is maintained in the PRE-UP state if the BFD packet is not met.
另外,维持模块506,还用于在该BFD会话为PRE-UP状态时,若接收模块501接收到了对端设备发来的表示INIT状态的BFD报文,则将该BFD会话维持为PRE-UP状态。In addition, the maintenance module 506 is further configured to: when the BFD session is in the PRE-UP state, if the receiving module 501 receives the BFD packet sent by the peer device and indicates the INIT state, the BFD session is maintained as the PRE-UP. status.
另外,如图6所示,该BFD会话连接建立控制逻辑还包括:第四切换模块507,用于在该BFD会话为PRE-UP状态时,若接收模块501接收到了对端设备发来表示DOWN状态的BFD报文,或者,接收模块501在检测时间内没有接收到对端设备发来的BFD报文,则将该BFD会话切换为DOWN状态。In addition, as shown in FIG. 6, the BFD session connection establishment control logic further includes: a fourth switching module 507, configured to: when the BFD session is in the PRE-UP state, if the receiving module 501 receives the peer device, the DOWN indicates that the DOWN is sent. If the receiving module 501 does not receive the BFD packet sent by the peer device within the detection time, the BFD session is switched to the DOWN state.
其中,上述预设时间范围为[T-t1,T+t2],其中,T表示BFD报文的发送时间间隔,t1和t2表示预设的时间间隔误差。The preset time range is [T-t1, T+t2], where T represents the transmission time interval of the BFD message, and t1 and t2 represent the preset time interval error.
处理器10通过执行机器可读存储介质20中的与上述BFD会话连接建立控制逻辑对应的机器可执行指令,被促使:The processor 10 is caused to execute by executing machine executable instructions in the machine readable storage medium 20 corresponding to the BFD session connection establishment control logic described above:
在网络设备上的BFD会话为未就绪DOWN状态并接收到了对端设备发来的表示已就绪INIT状态的BFD报文时,将所述BFD会话切换为准已建立PRE-UP状态;When the BFD session on the network device is in the inactive DOWN state and the BFD packet sent by the peer device indicating that the INIT state is ready is received, the BFD session is switched to the established PRE-UP state.
在所述BFD会话为INIT状态并接收到了所述对端设备发来的表示INIT状态或已建立UP状态的BFD报文,则将所述BFD会话切换为所述PRE-UP状态;After the BFD session is in the INIT state and receives the BFD packet sent by the peer device to indicate the INIT state or the UP state, the BFD session is switched to the PRE-UP state;
在所述BFD会话为所述PRE-UP状态时,When the BFD session is in the PRE-UP state,
向所述对端设备发送表示所述UP状态的BFD报文;Sending a BFD packet indicating the UP state to the peer device;
若满足预设条件,则将所述BFD会话从所述PRE-UP状态切换为所述UP状态,If the preset condition is met, the BFD session is switched from the PRE-UP state to the UP state.
其中,所述预设条件为从对端设备连续接收到了N个表示所述UP状态的BFD报文、并且所述N个表示所述UP状态的BFD报文中的相邻2个BFD报文之间的接收时间间隔在预设时间范围内,其中,所述N为正整数。The preset condition is that the two BFD packets indicating the UP state are continuously received from the peer device, and the two adjacent BFD packets in the BFD packet indicating the UP state are consecutively received. The receiving time interval is within a preset time range, wherein the N is a positive integer.
处理器10还被所述机器可执行指令促使:在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示UP状态的BFD报文,并且不满足所述预设条件,则将所述BFD会话维持为所述PRE-UP状态。The processor 10 is further caused by the machine executable instruction to: when the BFD session is in the PRE-UP state, if a BFD packet indicating the UP state sent by the peer device is received, and the method is not satisfied The preset condition is to maintain the BFD session in the PRE-UP state.
处理器10还被所述机器可执行指令促使:在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示INIT状态的BFD报文,则将所述BFD会话维持为所述PRE-UP状态。 The processor 10 is further caused by the machine executable instruction to: when the BFD session is in the PRE-UP state, if the BFD packet sent by the peer device indicating the INIT state is received, The BFD session is maintained in the PRE-UP state.
处理器10还被所述机器可执行指令促使:在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示DOWN状态的BFD报文,则将所述BFD会话切换为DOWN状态。The processor 10 is further caused by the machine executable instruction to: when the BFD session is in the PRE-UP state, if the BFD packet indicating the DOWN state sent by the peer device is received, The BFD session is switched to the DOWN state.
处理器10还被所述机器可执行指令促使:在所述BFD会话为所述PRE-UP状态时,若在检测时间内没有接收到所述对端设备发来的BFD报文,则将所述BFD会话切换为DOWN状态。The processor 10 is further caused by the machine executable instruction to: when the BFD session is in the PRE-UP state, if the BFD packet sent by the peer device is not received within the detection time, The BFD session is switched to the DOWN state.
其中,所述预设时间范围为[T-t1,T+t2],其中,T表示BFD报文的发送时间间隔,t1和t2表示预设的时间间隔误差。The preset time range is [T-t1, T+t2], where T represents the transmission time interval of the BFD message, and t1 and t2 represent the preset time interval error.
根据本公开的示例,还提供了一种包括机器可执行指令的机器可读存储介质,例如图4中的机器可读存储介质20,所述机器可执行指令可由网络设备40中的处理器10执行以实现以上描述的BFD会话连接建立方法。According to an example of the present disclosure, there is also provided a machine readable storage medium comprising machine executable instructions, such as machine readable storage medium 20 of FIG. 4, which may be processor 10 in network device 40 Executed to implement the BFD session connection establishment method described above.
具体地,通过调用并执行机器可读存储介质20中与BFD会话连接建立控制逻辑对应的机器可执行指令,处理器10可执行以下操作:Specifically, by invoking and executing machine executable instructions in the machine readable storage medium 20 corresponding to the BFD session connection establishment control logic, the processor 10 can perform the following operations:
在BFD会话为表示未就绪DOWN状态并接收到了对端设备发来的表示已就绪INIT状态的BFD报文时,则将所述BFD会话切换为准已建立PRE-UP状态;When the BFD session is in the DOWN state and the BFD packet is sent to the peer device, the BFD session is switched to the PRE-UP state.
在所述BFD会话状态为INIT状态并接收到了所述对端设备发来的表示INIT状态或已建立UP状态的BFD报文,则将所述BFD会话切换为所述PRE-UP状态;And the BFD session is switched to the PRE-UP state, when the BFD session is in the INIT state and the BFD packet is sent to the peer device to indicate the INIT state or the UP state.
在所述BFD会话为所述PRE-UP状态时,When the BFD session is in the PRE-UP state,
向所述对端设备发送表示所述UP状态的BFD报文;Sending a BFD packet indicating the UP state to the peer device;
若满足预设条件,则将所述BFD会话从所述PRE-UP状态切换为所述UP状态,If the preset condition is met, the BFD session is switched from the PRE-UP state to the UP state.
其中,所述预设条件为连续从对端设备接收到了N个表示所述UP状态的BFD报文、并且所述N个表示所述UP状态的BFD报文中的相邻2个BFD报文之间的接收时间间隔在预设时间范围内,其中,所述N为正整数。The preset condition is that the two BFD packets indicating the UP state are continuously received from the peer device, and the two adjacent BFD packets in the BFD packet indicating the UP state are consecutively received. The receiving time interval is within a preset time range, wherein the N is a positive integer.
所述机器可执行指令还促使所述处理器10:在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示UP状态的BFD报文,并且不满足所述预设条件,则将所述BFD会话维持为所述PRE-UP状态。The machine executable instruction further causes the processor 10 to: if the BFD session is in the PRE-UP state, if a BFD packet indicating the UP state sent by the peer device is received, and the method is not satisfied The preset condition maintains the BFD session in the PRE-UP state.
所述机器可执行指令还促使所述处理器10:在所述BFD会话为所述PRE-UP状态时,若 接收到了所述对端设备发来的表示INIT状态的BFD报文,则将所述BFD会话维持为所述PRE-UP状态。The machine executable instructions further cause the processor 10 to: when the BFD session is in the PRE-UP state, After receiving the BFD packet sent by the peer device and indicating the INIT state, the BFD session is maintained in the PRE-UP state.
所述机器可执行指令还促使所述处理器10:在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示DOWN状态的BFD报文,或者,在检测时间内没有接收到所述对端设备发来的BFD报文,则将所述BFD会话切换为DOWN状态。The machine executable instruction further causes the processor 10 to: when the BFD session is in the PRE-UP state, if a BFD packet indicating the DOWN state sent by the peer device is received, or If the BFD session sent by the peer device is not received, the BFD session is switched to the DOWN state.
其中,所述预设时间范围为[T-t1,T+t2],其中,T表示BFD报文的发送时间间隔,t1和t2表示预设的时间间隔误差。The preset time range is [T-t1, T+t2], where T represents the transmission time interval of the BFD message, and t1 and t2 represent the preset time interval error.
在本公开使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开。在本公开和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terms used in the present disclosure are for the purpose of describing particular embodiments only, and are not intended to limit the disclosure. The singular forms "a", "the" and "the" It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, the first information may also be referred to as second information without departing from the scope of the present disclosure. Similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to a determination."
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本公开方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。For the device embodiment, since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment. The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the present disclosure. Those of ordinary skill in the art can understand and implement without any creative effort.
以上所述仅为本公开的较佳实施例而已,并不用以限制本公开,凡在本公开的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本公开保护的范围之内。 The above description is only the preferred embodiment of the present disclosure, and is not intended to limit the disclosure, and any modifications, equivalents, improvements, etc., which are made within the spirit and principles of the present disclosure, should be included in the present disclosure. Within the scope of protection.

Claims (15)

  1. 一种双向转发检测BFD会话连接建立方法,包括:A bidirectional forwarding detection BFD session connection establishment method includes:
    网络设备在所述网络设备上的BFD会话为未就绪DOWN状态、并接收到了对端设备发来的表示已就绪INIT状态的BFD报文时,则将所述BFD会话切换为准已建立PRE-UP状态;When the BFD session of the network device in the network device is not in the DOWN state, and the BFD packet sent by the peer device indicating that the INIT state is ready is received, the BFD session is switched to the pre-established PRE- UP status;
    所述网络设备在所述BFD会话为INIT状态、并接收到了所述对端设备发来的表示INIT状态或已建立UP状态的BFD报文,则将所述BFD会话切换为所述PRE-UP状态;The network device switches the BFD session to the PRE-UP after the BFD session is in the INIT state, and the BFD packet is sent to the peer device to indicate the INIT state or the UP state. status;
    在所述BFD会话为所述PRE-UP状态时,When the BFD session is in the PRE-UP state,
    所述网络设备向所述对端设备发送表示所述UP状态的BFD报文;Sending, by the network device, a BFD packet indicating the UP state to the peer device;
    若满足预设条件,则所述网络设备将所述BFD会话从所述PRE-UP状态切换为所述UP状态,If the preset condition is met, the network device switches the BFD session from the PRE-UP state to the UP state.
    其中,所述预设条件为连续接收到了所述对端设备发来的N个表示所述UP状态的BFD报文、并且所述N个表示所述UP状态的BFD报文中的相邻2个BFD报文之间的接收时间间隔在预设时间范围内,其中,所述N为正整数。The preset condition is that the N BFD packets indicating the UP state sent by the peer device are consecutively received, and the N neighboring BFD packets indicating the UP state are consecutively received. The receiving time interval between the BFD packets is within a preset time range, where the N is a positive integer.
  2. 根据权利要求1所述的方法,还包括:The method of claim 1 further comprising:
    在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示所述UP状态的BFD报文,并且不满足所述预设条件,则所述网络设备将所述BFD会话维持为所述PRE-UP状态。When the BFD session is in the PRE-UP state, if the BFD packet sent by the peer device indicating the UP state is received, and the preset condition is not met, the network device will The BFD session is maintained in the PRE-UP state.
  3. 根据权利要求1所述的方法,还包括:The method of claim 1 further comprising:
    在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示所述INIT状态的BFD报文,则所述网络设备将所述BFD会话维持为所述PRE-UP状态。When the BFD session is in the PRE-UP state, if the BFD packet sent by the peer device indicating the INIT state is received, the network device maintains the BFD session as the PRE -UP status.
  4. 根据权利要求1所述的方法,还包括:The method of claim 1 further comprising:
    在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示DOWN状态的BFD报文,则所述网络设备将所述BFD会话切换为所述DOWN状态。When the BFD session is in the PRE-UP state, if the BFD packet indicating the DOWN state sent by the peer device is received, the network device switches the BFD session to the DOWN state.
  5. 根据权利要求1所述的方法,还包括:The method of claim 1 further comprising:
    在所述BFD会话为所述PRE-UP状态时,若在检测时间内没有接收到所述对端设备发来的BFD报文,则所述网络设备将所述BFD会话切换为所述DOWN状态。When the BFD session is in the PRE-UP state, if the BFD packet sent by the peer device is not received within the detection time, the network device switches the BFD session to the DOWN state. .
  6. 根据权利要求1所述的方法,其中,The method of claim 1 wherein
    所述预设时间范围为[T-t1,T+t2],The preset time range is [T-t1, T+t2],
    其中,T表示BFD报文的发送时间间隔,Where T is the interval at which BFD packets are sent.
    t1和t2表示预设的时间间隔误差。 T1 and t2 represent preset time interval errors.
  7. 一种网络设备,包括处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令,所述处理器被所述机器可执行指令促使:A network device comprising a processor and a machine readable storage medium storing machine executable instructions executable by the processor, the processor being caused by the machine executable instructions:
    在网络设备上的双向转发检测BFD会话为未就绪DOWN状态并接收到了对端设备发来的表示已就绪INIT状态的BFD报文时,将所述BFD会话切换为准已建立PRE-UP状态;When the bidirectional forwarding on the network device detects that the BFD session is in the DOWN state and receives the BFD packet sent by the peer device indicating that the INIT state is ready, the BFD session is switched to the established PRE-UP state.
    在所述BFD会话为INIT状态并接收到了所述对端设备发来的表示INIT状态或已建立UP状态的BFD报文,则将所述BFD会话切换为所述PRE-UP状态;After the BFD session is in the INIT state and receives the BFD packet sent by the peer device to indicate the INIT state or the UP state, the BFD session is switched to the PRE-UP state;
    在所述BFD会话为所述PRE-UP状态时,When the BFD session is in the PRE-UP state,
    向所述对端设备发送表示所述UP状态的BFD报文;Sending a BFD packet indicating the UP state to the peer device;
    若满足预设条件,则将所述BFD会话从所述PRE-UP状态切换为所述UP状态,If the preset condition is met, the BFD session is switched from the PRE-UP state to the UP state.
    其中,所述预设条件为连续接收到了所述对端设备发来的N个表示所述UP状态的BFD报文、并且所述N个表示所述UP状态的BFD报文中的相邻2个BFD报文之间的接收时间间隔在预设时间范围内,其中,所述N为正整数。The preset condition is that the N BFD packets indicating the UP state sent by the peer device are consecutively received, and the N neighboring BFD packets indicating the UP state are consecutively received. The receiving time interval between the BFD packets is within a preset time range, where the N is a positive integer.
  8. 根据权利要求7所述的网络设备,其中,所述处理器还被所述机器可执行指令促使:在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示UP状态的BFD报文,并且不满足所述预设条件,则将所述BFD会话维持为所述PRE-UP状态。The network device according to claim 7, wherein said processor is further caused by said machine executable instructions to: when said BFD session is in said PRE-UP state, if said peer device is received If the BFD packet is in the Up state, and the preset condition is not met, the BFD session is maintained in the PRE-UP state.
  9. 根据权利要求7所述的网络设备,其中,所述处理器还被所述机器可执行指令促使:在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示INIT状态的BFD报文,则将所述BFD会话维持为所述PRE-UP状态。The network device according to claim 7, wherein said processor is further caused by said machine executable instructions to: when said BFD session is in said PRE-UP state, if said peer device is received The BFD packet indicating the INIT state maintains the BFD session in the PRE-UP state.
  10. 根据权利要求7所述的网络设备,其中,所述处理器还被所述机器可执行指令促使:在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示DOWN状态的BFD报文,则将所述BFD会话切换为DOWN状态。The network device according to claim 7, wherein said processor is further caused by said machine executable instructions to: when said BFD session is in said PRE-UP state, if said peer device is received The BFD session in the DOWN state switches the BFD session to the DOWN state.
  11. 根据权利要求7所述的网络设备,其中,所述处理器还被所述机器可执行指令促使:The network device of claim 7 wherein said processor is further caused by said machine executable instructions:
    在所述BFD会话为所述PRE-UP状态时,若在检测时间内没有接收到所述对端设备发来的BFD报文,则将所述BFD会话切换为DOWN状态。When the BFD session is in the PRE-UP state, if the BFD packet sent by the peer device is not received within the detection time, the BFD session is switched to the DOWN state.
  12. 根据权利要求7所述的网络设备,其中,所述预设时间范围为[T-t1,T+t2],其中,T表示BFD报文的发送时间间隔,t1和t2表示预设的时间间隔误差。The network device according to claim 7, wherein the preset time range is [T-t1, T+t2], wherein T represents a transmission time interval of BFD packets, and t1 and t2 represent preset time intervals. error.
  13. 一种机器可读存储介质,存储有机器可执行指令,在被处理器调用和执行时,所述机器可执行指令促使所述处理器:A machine readable storage medium storing machine executable instructions that, when invoked and executed by a processor, cause the processor to:
    在网络设备上的双向转发检测BFD会话为未就绪DOWN状态并接收到了对端设备发来的表示已就绪INIT状态的BFD报文时,将所述BFD会话切换为准已建立PRE-UP状态; When the bidirectional forwarding on the network device detects that the BFD session is in the DOWN state and receives the BFD packet sent by the peer device indicating that the INIT state is ready, the BFD session is switched to the established PRE-UP state.
    在所述BFD会话为INIT状态并接收到了所述对端设备发来的表示INIT状态或已建立UP状态的BFD报文时,将所述BFD会话切换为所述PRE-UP状态;When the BFD session is in the INIT state and receives the BFD packet sent by the peer device, indicating that the INIT state is set or the UP state is set, the BFD session is switched to the PRE-UP state.
    在所述BFD会话为所述PRE-UP状态时,When the BFD session is in the PRE-UP state,
    向所述对端设备发送表示所述UP状态的BFD报文;Sending a BFD packet indicating the UP state to the peer device;
    若接收到了所述对端设备发来的表示所述UP状态的BFD报文,并且满足预设条件,则将所述BFD会话从所述PRE-UP状态切换为所述UP状态,And if the BFD packet sent by the peer device and indicates the UP state is received, and the preset condition is met, the BFD session is switched from the PRE-UP state to the UP state.
    其中,所述预设条件为连续接收到了N个表示UP状态的BFD报文、并且所述N个表示UP状态的BFD报文中的相邻2个BFD报文之间的接收时间间隔在预设时间范围内,其中,所述N为正整数。The preset condition is that the receiving time interval between the two adjacent BFD packets in the BFD packet indicating the UP state is received in advance, and the receiving time interval between the two adjacent BFD packets in the BFD packet indicating the UP state is Set a time range in which the N is a positive integer.
  14. 根据权利要求13所述的机器可读存储介质,其中,所述机器可执行指令促使所述处理器:The machine readable storage medium of claim 13 wherein the machine executable instructions cause the processor to:
    在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示UP状态的BFD报文,并且不满足所述预设条件,则将所述BFD会话维持为所述PRE-UP状态。When the BFD session is in the PRE-UP state, if the BFD packet indicating the UP state sent by the peer device is received, and the preset condition is not met, the BFD session is maintained as The PRE-UP state.
  15. 根据权利要求13所述的机器可读存储介质,其中,所述机器可执行指令促使所述处理器:The machine readable storage medium of claim 13 wherein the machine executable instructions cause the processor to:
    在所述BFD会话为所述PRE-UP状态时,若接收到了所述对端设备发来的表示INIT状态的BFD报文,则将所述BFD会话维持为所述PRE-UP状态。 When the BFD session is in the PRE-UP state, if the BFD packet indicating the INIT state sent by the peer device is received, the BFD session is maintained in the PRE-UP state.
PCT/CN2017/092337 2016-07-15 2017-07-10 Bfd session connection establishment WO2018010614A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610575334.0A CN107623607B (en) 2016-07-15 2016-07-15 BFD session connection establishment method and device
CN201610575334.0 2016-07-15

Publications (1)

Publication Number Publication Date
WO2018010614A1 true WO2018010614A1 (en) 2018-01-18

Family

ID=60952805

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/092337 WO2018010614A1 (en) 2016-07-15 2017-07-10 Bfd session connection establishment

Country Status (2)

Country Link
CN (1) CN107623607B (en)
WO (1) WO2018010614A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111478851A (en) * 2020-02-29 2020-07-31 新华三信息安全技术有限公司 Message processing method and device
WO2022022366A1 (en) * 2020-07-30 2022-02-03 中兴通讯股份有限公司 Tunnel bfd session establishment method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101170459A (en) * 2007-11-28 2008-04-30 中兴通讯股份有限公司 Failure detection and link recovery method based on bidirectional forward link
CN101340380A (en) * 2008-08-11 2009-01-07 中兴通讯股份有限公司 Method and apparatus for uninterrupted forwarding of bi-directional forwarding detection in master-slave switch implementation
CN102075390A (en) * 2011-02-16 2011-05-25 华为技术有限公司 Transmission state detection method and related device thereof
US20150244605A1 (en) * 2012-10-12 2015-08-27 Alcatel Lucent Method for exchanging information for establishing a path between two nodes of a communication network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101170459A (en) * 2007-11-28 2008-04-30 中兴通讯股份有限公司 Failure detection and link recovery method based on bidirectional forward link
CN101340380A (en) * 2008-08-11 2009-01-07 中兴通讯股份有限公司 Method and apparatus for uninterrupted forwarding of bi-directional forwarding detection in master-slave switch implementation
CN102075390A (en) * 2011-02-16 2011-05-25 华为技术有限公司 Transmission state detection method and related device thereof
US20150244605A1 (en) * 2012-10-12 2015-08-27 Alcatel Lucent Method for exchanging information for establishing a path between two nodes of a communication network

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111478851A (en) * 2020-02-29 2020-07-31 新华三信息安全技术有限公司 Message processing method and device
CN111478851B (en) * 2020-02-29 2022-05-27 新华三信息安全技术有限公司 Message processing method and device
WO2022022366A1 (en) * 2020-07-30 2022-02-03 中兴通讯股份有限公司 Tunnel bfd session establishment method and device

Also Published As

Publication number Publication date
CN107623607A (en) 2018-01-23
CN107623607B (en) 2020-04-03

Similar Documents

Publication Publication Date Title
US9705735B2 (en) System and method using RSVP hello suppression for graceful restart capable neighbors
US10749993B2 (en) Path selection using TCP handshake in a multipath environment
US10868754B2 (en) High availability input/output management nodes
WO2017054547A1 (en) Bidirectional forwarding detection method and apparatus
US20140355421A1 (en) Link Aggregation Control Protocol (LACP) Loop Detection
EP3991041B1 (en) Bidirectional forwarding detection (bfd) offload in a virtual network interface controller
US20140181298A1 (en) Method and apparatus for managing a plurality of sessions in a multi-path routing based network
WO2016095322A1 (en) Vrrp-based data transmission method and apparatus
WO2015149353A1 (en) Oam packet processing method, network device and network system
US11310139B2 (en) Fault detection for LACP packet timeout
US20150381466A1 (en) Micro-OAM for Link Groups
WO2016206635A1 (en) Lacp-based forwarding detection method and system
WO2018010614A1 (en) Bfd session connection establishment
US9866469B2 (en) Shutdown response system
US11277342B2 (en) Lossless data traffic deadlock management system
US11223559B2 (en) Determining connectivity between compute nodes in multi-hop paths
WO2015172745A1 (en) Bidirectional forwarding detection
EP2787699A1 (en) Data transmission method, device, and system
US20150032815A1 (en) Message forwarding in data center network
WO2016061943A1 (en) Method and apparatus for implementing spanning tree protocol protection switching, and computer storage medium
WO2014000509A1 (en) Transmission monitoring method and device
WO2017032147A1 (en) Method and apparatus for switching internet small computer system interface session link
US11245742B2 (en) Apparatus, system, and method for flow-level switchover of video streams
US20200244580A1 (en) Automated recovery from network traffic congestion
JP2010041385A (en) Router and congestion control method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17826950

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17826950

Country of ref document: EP

Kind code of ref document: A1