This section describes the BFD session management, including session establishment mode and session establishment process.
Static BFD session with a manually designated discriminator
You need to set BFD session parameters manually, including the configuration of My Discriminator and Your Discriminator, and deliver a BFD session establishment request manually.
Manual configuration errors may occur in this mode, for example, the incorrect configuration of My Discriminator and Your Discriminator results in the failure of the BFD session. Meanwhile, the establishment and deletion of the BFD session is manually triggered, and lacks flexibility.
The interworking between BFD and PBR, or DHCP requires the static BFD session with manually designated discriminators. In the application of interworking between BFD and static routes, you can choose the static BFD session with manually designated discriminators or the static BFD session with negotiated discriminators according to the network status.
Static BFD session with an automatically negotiated discriminator
You need to manually establish the BFD session, but do not need to configure My Discriminator and Your Discriminator. Both discriminators are negotiated through the BFD session.
In the application of interworking between BFD and static routes, the BFD session with an automatically negotiated discriminator is required in the scenario where the device at the peer end does not support static BFD session, and the dynamic BFD session is adopted; meanwhile, the local device is routable to the peer end, and ensures the application of interworking between BFD and static routes.
Dynamic BFD session triggered by protocols
Dynamic BFD session triggered by protocols refers to the BFD session dynamically triggered by routing protocols.
Dynamically assigning My Discriminator
When an application program triggers the dynamic establishment of BFD sessions, the system assigns a value from the dynamic session discriminators as the My Discriminator of the BFD session. The system sends a BFD control packet with the value of Your Discriminator as 0 (the value of My Discriminator is the assigned value, and the state is Down) to the peer system to negotiate a session.
The system distinguishes static BFD session and dynamic BFD session according to the classification of discriminators. The value of My Discriminator for static BFD session ranges from 1 to 8191, and the value of My Discriminator for dynamic BFD session ranges from 8192 to 16,383.
Self-learning Your Discriminator
Upon receiving the BFD control packet with the value of Your Discriminator as 0, the system on one end of the BFD session determines whether the packet matches the local BFD session according to the quadruplet (source IP address, destination IP address, outbound interface, and VPN index). If yes, the system learns the value of My Discriminator in the received packet to obtain the value of Your Discriminator.
BFD establishes a session by using three-way handshake. When sending the BFD control packet, the sender fills the Sta field with the current session status on the local end. The receiver transfers the BFD state machine and establishes the session according to the Sta field of the received BFD control packet and the current session status on the local end. Taking the establishment of BFD session as an example, Figure 1 shows the transference of the state machine.
After the status switches from Down to Init, a timeout timer is enabled on Router_A and Router_B respectively. If the routers do not receive the BFD control packet whose status is Init or Up within the timeout, the BFD session status in the local system automatically switches to Down.