Вы находитесь на странице: 1из 16

Technical White Paper for BFD

Huawei Technologies Co., Ltd.


Technical White Paper for BFD

Table of Contents

1 How to Use BFD Technology ....................................................................................................... 1

2 Introduction to BFD Technology ................................................................................................. 2


2.1 Overview of the BFD Protocol .............................................................................................. 2
2.2 Packet Format....................................................................................................................... 2
2.3 Detection Modes ................................................................................................................... 4
2.4 Sending Period and Detection Time ..................................................................................... 5
2.5 Parameter Change ............................................................................................................... 6
2.6 Session Establishment ......................................................................................................... 6
2.6.1 Session Initialization................................................................................................... 6
2.6.2 Session Establishment Process................................................................................. 8

3 Standardized BFD........................................................................................................................ 10

4 Typical Applications of BFD....................................................................................................... 10


4.1 Fast Reroute ....................................................................................................................... 10
4.2 Reliable Connection between Media Gateway and Core Network..................................... 12

5 Conclusion ................................................................................................................................... 13

AppendixA References .................................................................................................................. 14

AppendixB Abbreviations and Acronyms ................................................................................... 14

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. i


http://datacomm.huawei.com
Technical White Paper for BFD

Technical White Paper for BFD

Abstract: Bi-directional Forwarding Detection (BFD) involves a set of international standard

protocols for implementing fast detection, providing a kind of low-load and

short-duration detection. In comparison with other old “HELLO” detection mechanisms,

BFD has many unique advantages. Huawei has realized the BFD technology in its

high-end network products, and is to provide a complete set of solutions in this

respect.

Keywords: BFD, Fast detection

1 How to Use BFD Technology

Network equipment is increasingly required to provide a function of fast detection of

communication failures between adjacent systems, so that alternative channels or other

links can be rapidly used when network failures occur. Currently some pieces of hardware

like SDH can provide this function, but multiple pieces of hardware or software such as

Ethernet cannot. Some pieces of hardware or software such as forwarding engine or

interface cannot implement path detection and end-to-end detection. At present, a network

usually adopts the slow hello mechanism, especially in the route protocol. As a result, it

takes a long time in detection, without the help of hardware (for example, OSPF needs two

seconds while ISIS one second). This is too long for some applications. When it comes to

a data rate of gigabit, the defective detection time will lead to great loss of data and the

nodes not supporting routing protocols cannot detect link states; the existing IP network

does not have an intermittent failure recovery function within one second while the

traditional network has a limited capability to implement accurate failure detection for

real-time applications such as voice. With the wide use of VoIP, fast detection and

recovery of network failures becomes increasingly important.

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 1


http://datacomm.huawei.com
Technical White Paper for BFD

The BFD protocol provides a solution to the above questions. The BFD allows failure

detection on any types of channels between systems, including direct physical link, virtual

circuit, tunneling, MPLS LSP, multi-hop route channel, and indirect channel. Meanwhile,

as the failure detection the BFD implements is simple and single, the BFD can be devoted

to fast detection of forwarding failures to help networks realize the transmission of voice,

video, and other on-demand services with good QoS, and to help service providers offer

VoIP of high reliability and high applicability and other real-time services required by their

customers.

2 Introduction to BFD Technology

2.1 Overview of the BFD Protocol

The BFD protocol is a simple “Hello” protocol. Many of its aspects are similar to the

neighbor detect part of those famous routing protocols. Two systems periodically send and

receive detection packets through a channel established between them. If one system

does receive a detection packet from the other for a long time, it indicates that failures

occur in a certain part of the bi-directional channel between the two adjacent systems.

Under some circumstances, consultation should be conducted on the sending and

receiving rate between the two systems, so as to reduce the load.

2.2 Packet Format

The detection packet the BFD sends is the UDP packet. Two types of packets are defined:

1) Control packet

Its format is as follows:

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 2


http://datacomm.huawei.com
Technical White Paper for BFD

Compulsory

Optional

z Vers: version number of the BFD protocol, currently 1.


z Diag: diagnosis word, indicating the reason for the last session status change of the
local BFD system.
z Sta: local status of the BFD
z P: a flag, when parameters are changed, the sender set this flag in the BFD packet,
and the receiver must respond to this packet at once.
z F: a flag, this flag must be set in the packet responding to flag P.
z C: a forwarding/control separation flag, once this flag is set, control plane variation
does not affect the BFD detection. For example, if the control plane is ISIS, when
the ISIS resets /GR, the BFD can continually monitor the link status.
z A: an authentication flag, if this flag is set, it indicates that the session needs to be
authenticated.
z D: a query request flag, if this flag is set, it indicates that the sender wishes to adopt
a query mode to monitor the link.
z R: preserved bit
z Detect Mult: a detection timeout multiple, it is used in calculating detection timeout
time by the detector.
z Length: a packet length
z My Discriminator: an identifier for the BFD session connecting to the local side
z Your Discriminator: an identifier for the BFD session connecting to the remote side
z Desired Min Tx Interval: the minimum sending interval of the BFD packet supported
by the local side
z Required Min Rx Interval: the minimum receiving interval of the BFD packet
supported by the local side

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 3


http://datacomm.huawei.com
Technical White Paper for BFD

z Required Min Echo RX Interval: the minimum receiving interval of the Echo packet
supported by the local side (it is set to 0 if the local side does not support the Echo
function)
z Auth Type: an authentication type, the current protocol provides:
Simple Password
Keyed MD5Meticulous Keyed MD5
Keyed SHA1
Meticulous Keyed SHA1
z Auth Length: an authentication data length
z Authentication Date: an authentication data area

The authentication section is optional and can be selected in the packet.


Authentication modes include Simple Password, Keyed MD5, Meticulous Keyed MD5,
Keyed SHA1, and Meticulous Keyed SHA1. The number of the UDP destination port
used by the control packet defined by the protocol is 3784.

2) Echo packet

The BFD protocol does not define an echo packet format. But the echo packet format
is only related to the local side. The remote side only needs to return the echo packet
on the return path. The local system must be able to separate corresponding contents
in the packet to corresponding sessions (so the sending and receiving processing of
the echo packet are not defined in the protocol). The number of the UDP destination
port used by the echo packet defined by the protocol is 3785.

2.3 Detection Modes

The BFD protocol describes two bi-directional detection modes: asynchronous mode and

query mode. In addition, an auxiliary echo function can be used together with these two

modes. The difference between asynchronous mode and query mode is the detection

position. Under the asynchronous mode, the local side sends the BFD control packet

periodically and the remote side needs to detect it. Under the query mode, the local

system detects the BFD control packet sent by the local side.

1) Asynchronous mode

Under the asynchronous mode, two systems periodically send the BFD control packet
to each other. If a system does not receive the BFD control packet from the other
within a detection time, it declares that this session is down.
2) Query mode

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 4


http://datacomm.huawei.com
Technical White Paper for BFD

Under the query mode, suppose that each system has an independent method to
determine whether it is connected to another system. Once a BFD session is
established, systems stop sending the BFD control packet unless a system needs to
verify its connection explicitly. If a system needs explicit connection verification, it
sends a short-series BFD control packet. If the system does not receive a response
packet within a detection time, it will declare that the session is down. If the system
receives a response packet from the opposite side, the protocol keeps silence again.
3) Echo function

The local side sends a series of BFD echo packets. The remote system returns them
through its forwarding channel. If the local system does not receive several continual
echo packets, it declares that the session is down. The echo function can be used
together with the above two detection modes. The echo function can be used to
replace the detection task of the BFD control packet to reduce the sending period
(under asynchronous mode) of the control packet or completely cancel the BFD
control packet (under query mode).

2.4 Sending Period and Detection Time

The calculation of the sending period is unrelated to the detection mode. Under any

detection mode, an allowed range is needed since link jitter needs to be considered. The

specific calculation is as follows: If Detect Multi is 1, the sending period = (70%–90%) *

max (bfd.DMTI, received RMRI); if not, the sending period = (75%–100%) * max(bfd.DMTI,

received RMRI).

Since there are two BFD detection modes, the detection time calculations are somewhat

different under these two BFD detection modes. Since two detection modes can use the

echo function, the calculation method of the detection time of the echo packet is not given

and any mechanism for detecting echo packet loss can be used.

1) Asynchronous mode

Under the asynchronous mode, since the detection position is the opposite side, the
detection multiple of the local side will be used in calculating the detection time. The
formula is: detection time = received remote DM * max (bfd.RMRI, received DMTI).
2) Query mode

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 5


http://datacomm.huawei.com
Technical White Paper for BFD

Under the query mode, since the detection position is the local side, the detection
multiple of the local side will be used in calculating the detection time. The formula is:
detection time = bfd.DM * max (bfd.RMRI, received DMTI).

2.5 Parameter Change

Various BFD parameters may dynamically change after a session is established. But this

does not affect the current status of the session. The parameters that can dynamically

change include DMTI, RMRI, enabling or disabling the echo function, enabling or disabling

the query function, and enabling or disabling the authentication function. When the DMTI

is added, the actual sending interval of the local side cannot be changed until a BFD

control packet whose F bit is 1 is received. This ensures that when the sending interval of

the remote system is increased at the local side, its detection time will be updated. When

the RMRI is reduced, the detection time calculated by the remote side cannot be changed

until a BFD control packet whose F bit (See the explanation of packet format fields) is 1 is

received. This ensures that the remote system will have sent the BFD control packet at a

higher speed before the detection time is reduced.

2.6 Session Establishment

Before the BFD detection, it is necessary to establish an equivalent session at the two

sides of the channel. After the session is established, each side sends a BFD control

packet to the other at an agreed speed to implement failure detection. The session

detection path can be a flag switching path, a tunnel of other type , or an Ethernet.

2.6.1 Session Initialization

At the initialization stage of a BFD session establishment process, whether the two sides

are active or passive roles depends on applications. But at least one side is the active role.

So the initialization stage can be divided into two modes:

1) Two sides being active parties

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 6


http://datacomm.huawei.com
Technical White Paper for BFD

When two sides are active roles, the system of each side needs to send a BSFD
control packet whose “Your Discriminator is 0” to the opposite side until each side
receives Discriminator from the opposite side, and then starts to establish the session
(for example, the BFD session established by the OSPF or ISIS can ensure that both
sides are active roles).

When two sides are active parties, since your discriminator is 0, they cannot be
separated to a corresponding session according to the BFD protocol. So initializing
the packet needs other methods:

a) For 1hop:

The separation of the first packet depends on the packet-receiving interface


(whether it is a physical or logical link) while at the same time the received packet
TTL must be 255.

b) For multihop:
z Method 1:

Session pair (source address, destination address) configured on a single BFD is


unique. This method is used when a BFD session is established on the OSPF
virtual link.
z Method 2:

Before the session establishment, first use an outer band mode to get the
Discriminator of the opposite side. This method is used when a session is
established on the LSP of the MPLS.
z Method 3:

Use two unidirectional links. The separation of initialization packet is similar to that
in 1hop. One unidirectional link is an active party before the session. The passive
party separates the BFD control packet whose “Your discriminator is 0” according
to the packet-receiving interface.
2) One party being the active role and the other being the passive role

When one party is the active role and the other is the passive role, who is the active
role or passive role depends on the application. The active party first sends a packet
and then the application carries the discriminator from the opposite party to the active
party. The passive party also starts to send packets after receiving the packet from the
active party. Later your discriminators in the packets sent by both the active and
passive parties are none zero. Each side separates the control packet to a

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 7


http://datacomm.huawei.com
Technical White Paper for BFD

corresponding session in the local side according to a corresponding discriminator


(for example, the BFD session established by LSP-Ping).

2.6.2 Session Establishment Process

The session establishment process is a process with three handshakes. After this process,

the session at the two sides becomes the Up state. In this process the both sides

simultaneously consults their corresponding parameters. The later status is changed

according to defective detection results and the corresponding processing is implemented.

The migration of the state machine is as follows:

up

down init
DOWN

timer down, timer : Control detection time


timer expired
up : Up state in packet
init : Init state in packet
down init,up
down : Down state in packet
init,up
UP : Up state
INIT UP INIT : Init state
DOWN : Down state

Figure 1 BFD state transition diagram

Using the establishment process of BFD session connection as an example, the migration

process of the state machine is introduced as follows:

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 8


http://datacomm.huawei.com
Technical White Paper for BFD

A Packet transmit B
down down
BFD
D OWN

OWN
B FD D down => init
down => init
BFD IN
IT init BFD DOWN : DOWN state in packet

init => up B FD init BFD INIT : INIT state in packet


INIT

B FD
UP init => up BFD UP : UP state in packet

BFD U
P XX => YY : Resault of changing
state (Local)
Point of changing state
: (Local)
Point of changing state
: (in sending packet)

Figure 2 BFD session connection establishment

z Stations A and B start the BFD. Their initial state is “Down”. They send the BFD
packets with the state “Down”.

z State B receives the BFD packet with the state “Down”. Its local state is changed
over to “Init”. It sends the BFD packet with the state “Init”.

z After the local BFD state of station B becomes “Init”, station B receives the packet
with the state “Down” and does not process it.

z The change process of the BFD state of station A is the same as the above.

z State B receives the BFD packet with the state “Init”. Its local state is changed over
to “Up”.

z The change process of the BFD state of station A is the same as the above.

z After the state of stations A and B changes from “Down” to “Init”, a timeout timer will
be started. The timer can be used to prevent the local state from being always “Init”
(may be the connection between A and B is broken and the session cannot be
established normally). If the BFD packet with the state “Init/Up” is still not received
within a defined time, the state is automatically changed over to “Down”.

z The local state UP indicates that the session is successful.

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 9


http://datacomm.huawei.com
Technical White Paper for BFD

3 Standardized BFD

Since July 2004 when the first draft of the BFD standard was introduced, IETF has been in

engaged in discussing how to revise the BFD protocol. Now draft base-00 has been

developed into draft base-03 and version 0 has been upgraded to version 1. The following

diagram shows the development process of the BFD:

• Aug 04 Submit the base protocol specification to the


IESG to be considered as a Proposed Standard.
• Aug 04 Submit BFD encapsulation and usage profile for single-hop IPv 4 and
IPv 6 adj acencies to the IESG to be considered as a Proposed Standard
• Aug 04 Submit BFD encapsulation and usage profile for MPLS
LSPs to the IESG to be considered as a Proposed Standard

Draf t base-00
• Nov 04 Submit BFD MIB to the IESG to be considered as Proposed Standard.
2004.7 • Feb 05 Submit BFD encapsulation and usage profile for multi-hop IPv 4 and
IPv 6 adj acencies to the IESG to be considered as a Proposed Standard
Draf t base-01
2005.2
Draf t base-02
2005.3 Draf t base-03
2005.7

Figure 3 BFD development process

4 Typical Applications of BFD

According to the detection, the BFD is the best solution to communication forwarding

failure detection. Its typical applications are as follows:

4.1 Fast Reroute

With the development of NGN and IPTV, the IP network has to simultaneously bear

multiple services. So it must have high requirements for reliability and security. Currently

many carriers tend to use the MPLS VPN to isolate different services. The MPLS VPN is

characterized by: 1) High security and isolation of resources in the future; 2) Clear

network planning and convenient management and maintenance.

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 10


http://datacomm.huawei.com
Technical White Paper for BFD

A forwarding platform UMG8900


UMG8900
BJ1 SY1
XA1 NJ1 UMG8900
UMG8900

NE40-8 NE40-8
CD1 GZ1
SH1 WH1
NE80 BJ2 SY2 NE80 SoftX3000
XA2 NJ2
SoftX3000
SoftX3000
UMG8900
UMG8900
CD2 GZ2
SH2 WH2

B forwarding platform

Figure 1 NGN networking solution

One of requirements of voice services for the bearer network: When failures occur in the

network, the changeover should be implemented within several hundred milliseconds, 50

ms in the best. Together with the VPN, voice services from one side to another include the

segments: NGN equipmentÆPEÆthe core network of the bearer networkÆPEÆNGN

equipment, where if any segment (including link and equipment) cannot reach the above

requirements, voice services will be affected. The failures include failures occurred on

nodes P and PE.

When failures occur on node P, fast reroute technologies usually are adopted, including

the traditional TE FRR and latest LDP FRR. These two technologies protect the standby

LSP. When the active LSP fails, the standby LSP is changed over before the failure node.

The BFD can provide the capability to fast detect failures of adjacent nodes or links for

node P. When the BFD detects these failures, it will trigger the FRR mechanism to

implement the changeover to ensure that the loss of user data services will be the

minimum.

When failures occur to the PE, the MPLS VPN FRR will be adopted to solve the problem

that the changeover to the standby PE cannot be fast implemented after failures occur at

the original PE. The purpose is that the VPN service can be fast changed over to the

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 11


http://datacomm.huawei.com
Technical White Paper for BFD

standby tunnel and standby PE so that the traffic can be recovered in a very short time.

The major realization means of the MPLS VPN FRR is that when the active tunnel is

available, the forwarding engine is simultaneously provided the forwarding information of

the standby tunnel. When the forwarding engine realizes that the active tunnel is

unavailable, it can directly use the standby tunnel to transfer information without relying on

the convergence of the control panel.

The BFD can provide the fast detection function to the opposite PE for the MPLS VPN

FRR. When the BFD finds that the opposite PE is broken, it will notify the MPLS VPN FRR

to implement the changeover so that the loss of user data services will be the minimum.

4.2 Reliable Connection between Media Gateway and Core


Network

Figure 2 BFD application in a media gateway solution

The communication transmission in such a network architecture that the VoIP media

gateway is connected to the IP core network through a switching Ethernet faces with two

problems: 1. Since the current media gateway keeps a equivalent session relationship at

the IP layer, the whole network is “invisible” and failure detection between a media

gateway and the IP edge router cannot be implemented; 2. When failures occur at a

remote unit in the switching network, the Ethernet has no effective mode to notify the host

or router. Although the detection tool for high-speed link failures plays a very important role

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 12


http://datacomm.huawei.com
Technical White Paper for BFD

in the realization of the high applicability VoIP, it is difficult for it to fast detect network

failures when there is a switch between the host and the router.

Now the BFD protocol is completely integrated with the media gateway platform and is

used to keep the connection between the gateway and the edge router. The BFD can

detect failures in the Ethernet or independent network segment. It can alternatively build

redundant paths between the gateway and the router. Once failures are detected and

confirmed, the BFD can trigger a corresponding changeover mechanism in all routes,

transmission, and tunnel systems to ensure network reliability.

5 Conclusion

The BFD aims at binding more things to the forwarding plane so that they can be out of

specific network protocols and fast defective detection and carrier-level changeover will

become possible. Together with the low cost of the BFD processing, this allows wide

expansion and good applicability for the BFD. The BFD will surely become an important

force in driving the IP network to integrate with the telecom network.

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 13


http://datacomm.huawei.com
Technical White Paper for BFD

AppendixA References
1) Katz, D., and Ward, D., "Bidirectional Forwarding Detection", draft-IETF-bfd-base-02.txt,
March, 2005.
2) Katz, D., and Ward, D., "BFD for IPv4 and IPv6 (Single Hop)",
draft-IETF-bfd-v4v6-1hop-02.txt, March, 2005.
3) Aggarwal, R., and Kompella, K., "BFD for MPLS LSPs", draft-IETF-bfd-mpls-01.txt, March,
2005.
4) Katz, D., and Ward, D., "BFD for Multihop Paths", draft-IETF-bfd-multihop-02.txt, February,
2005.

AppendixB Abbreviations and Acronyms


Abbreviation/ Acronyms Full Spelling

BFD Bidirectional Forwarding Detection

IP Internet Protocol

UDP User Datagram Protocol

DMTI Desired Min TX Interval

RMRI Required Min RX Interval

DM Detect Mult

FRR Fast ReRoute

Copyright ©2007 Huawei Technologies Co., Ltd. All Rights Reserved. 14


http://datacomm.huawei.com

Оценить