This section describes the application scenario of interworking between BFD and PBR.
Policy-Based Routing (PBR) is a mechanism, which selects routes based on the customized policy rather than forwards packets by searching the FIB table based on the destination addresses of IP packets. The PBR can be used for the purpose of security or load balancing.
PBR supports route selection based on packet information such as the source IP addresses and packet types of received packets. Packets that meet certain conditions are forwarded according to packet information such as the outbound interface and next hop, and the default outbound interface and next hop.
PBR cannot sense the availability of the link where the PBR is enabled. When the link is unreachable and the device forwards the packet, the packet forwarding may fail.
The BFD-PBR interworking resolves the previous problems, and improves the flexibility of PBR applications and the dynamic network environment sensation of PBR. After the actions of PBR are associated with the static BFD session, the BFD can monitor the reachability of the next hop or outbound interface and dynamically detect the availability of the policy-based routes.
As shown in Figure 1, Router_A serves as the egress gateway of a company. There are two links connecting to the Internet. Normally, the service initiated by Department A travels from Router_A to Router_B. When a fault occurs, the service traffic is switched to the other link.
To ensure that Router_A can rapidly and dynamically sense the availability of PBR, you can create a BFD session between Router_A and Router_B. When the link between Router_B and the Layer-2 switch fails, the BFD can identify the fault and notify Router_A rapidly, and the PBR bound to the BFD session becomes invalid. In this way, Router_A searches for standby routes to ensure service continuity.