Theoretical foundations and architecture

Fast failure detection in the core uses BFD for MPLS LSPs (RFC 5884) and the MPLS Transport Profile (MPLS-TP, RFC 5921). 1. BFD for MPLS LSP extends BFD to monitor labelled paths. The session is bootstrapped through LSP Ping (the Echo Request carries a BFD Discriminator TLV); after that the ingress sends BFD Control packets in asynchronous mode inside the LSP label (127/8 address, UDP 3784, TTL 1) and the egress replies with a plain IP packet; echo mode is not used here. The interval is configurable: usually 100 ms or more on software platforms and down to a few milliseconds on hardware with offload; detection time equals the interval times the multiplier. Only the forward direction of the LSP is monitored, but silent data-plane failures (IGP and LDP healthy while label forwarding is broken) become visible. 2. MPLS-TP is a subset of MPLS with SDH/OTN-like transport behaviour (developed by the IETF together with the ITU-T). The data plane has no IP forwarding, no ECMP and no LSP merging; LSPs and PWs are bidirectional (usually co-routed) and are created by a management system or GMPLS RSVP-TE, not by LDP. OAM runs inside the path over the Generic Associated Channel (G-ACh, RFC 5586) without IP, including BFD for connectivity checks (RFC 6428). Linear protection 1+1 and 1:1 (RFC 6378) uses the PSC protocol between the endpoints; the sub-50 ms switchover target is achievable only with fast detection and a pre-established protection path.

Why BFD when hello timers exist

IGP and LDP hello timers are designed for seconds: OSPF sends hellos every 10 s by default and declares a neighbor dead after 40 s, and an LDP session uses default keepalive/hold timers of 60/180 s on Cisco and 10/30 s on Junos. Services with fast protection (FRR, TI-LFA, VPN redundancy) need a detector that fires within tens or hundreds of milliseconds and does not depend on a particular protocol. That is Bidirectional Forwarding Detection (RFC 5880): a lightweight protocol that checks bidirectional connectivity of the path between two nodes and reports its loss to client applications (OSPF, IS-IS, BGP, static routes, MPLS). After the notification, the client decides what to do: drop the adjacency, start FRR, recompute SPF.

The BFD protocol: packets, states, timers

The mandatory part of BFD Control is 24 bytes: Version (1), Diag, State, flags (P, F, C, A, D, M), Detect Mult, Length, My Discriminator, Your Discriminator, Desired Min TX Interval, Required Min RX Interval, Required Min Echo RX Interval. A single-hop session (RFC 5881) uses destination UDP port 3784, a source port from 49152-65535 and IP TTL 255 (a packet received with another TTL must be discarded, a GTSM-style protection). A multihop session (RFC 5883) uses port 4784, and echo mode uses port 3785. States: AdminDown, Down, Init, Up; the transition to Up follows a three-way exchange, and while the session is not Up, packets are sent no more often than once per second.

The asynchronous mode (the main one): both ends periodically send Control packets. The detection time equals the remote Detect Mult multiplied by the negotiated interval, i.e. the larger of the local Required Min RX and the remote Desired Min TX. For 100 ms and multiplier 3 this is 300 ms; for 50 ms, 150 ms; hardware platforms with offload to the line card reach 3.3 ms x 3, about 10 ms. In echo mode a node sends packets that the neighbor merely reflects with its forwarding plane, so the neighbor's data plane is tested rather than its CPU. Diag codes explain the cause of a failure: 1 - detection time expired, 3 - the neighbor signaled Down, 5 - path down, 7 - administratively down.

BFD in MPLS: what is actually monitored

For ordinary clients BFD is attached to an interface: BFD for OSPF/IS-IS/BGP/static catches a link or neighbor failure within milliseconds, and the LDP session goes down right after because the IGP converges. A separate mechanism is BFD for LSPs (RFC 5884, clarified by RFC 7726): the ingress sends BFD Control inside the LSP label with a destination address from 127/8, UDP port 3784 and TTL 1, while the egress replies with an ordinary IP packet. The session is bootstrapped through LSP ping: a BFD Discriminator TLV (type 15) is added to the Echo Request, the egress learns the ingress discriminator and brings up the reverse half. Only the forward direction of the LSP is monitored: the reverse path follows IP. This kind of BFD detects "silent" data plane failures, where LDP/RSVP and the IGP are healthy but forwarding by label is broken.

For pseudowires there is BFD over VCCV (RFC 5885): the control channel type and the verification type are negotiated when the PW is set up; CV types 0x04 and 0x08 are BFD in IP/UDP (without and with AC/PW status), 0x10 and 0x20 are BFD in PW-ACH. For segment routing there is S-BFD (RFC 7880): a reflector with a pre-provisioned discriminator and no three-way exchange. BFD tests only the path it travels: it knows nothing about the VPN label or the customer VRF table.

MPLS-TP: the transport profile

MPLS-TP (RFC 5921, requirements in RFC 5654) is a subset of MPLS with transport-network behavior in the spirit of SDH/OTN. It has no IP forwarding in the data plane, no ECMP and no LSP merge; paths (LSPs and PWs) are created by a management system manually or by GMPLS RSVP-TE, not by LDP; LSPs are always bidirectional, usually co-routed (both directions follow the same route). Nodes are identified by Global_ID and Node_ID (RFC 6370) rather than by IP address.