BGP next hop notifications
A BGP next hop notification is a dynamic route monitoring mechanism that
-
triggers updates to BGP route processing when a change in next hop reachability, connectivity, locality, or IGP metric is detected
-
distinguishes between critical and noncritical event types for efficient network response, and
-
supports policy-based filtering and batching to minimize route oscillation and ensure stable routing.
|
Feature Name |
Release Information |
Feature Description |
|---|---|---|
|
BGP Next Hop Tracking |
Release 24.4.1 |
Introduced in this release on: Fixed Systems (8200 [ASIC: P100], 8700 [ASIC: P100])(select variants only*); Modular Systems (8800 [LC ASIC: P100])(select variants only*) *This feature is supported on:
|
|
BGP Next Hop Tracking |
Release 24.3.1 |
Introduced in this release on: Fixed Systems (8200 [ASIC: Q200, P100], 8700 [ASIC: P100])(select variants only*); Modular Systems (8800 [LC ASIC: Q100, Q200, P100])(select variants only*) The BGP next-hop tracking feature allows refined route resolution, avoiding aggregate routes and oscillation risks by filtering based on prefix length and source protocols, configurable through the nexthop trigger-delay and nexthop route-policy commands. * The BGP next hop tracking functionality is now extended to:
|
Event classification and handling
BGP classifies next hop events into two types:
-
Critical events: These include changes in reachability (reachable or unreachable), connectivity (connected or disconnected), and locality (local or nonlocal). Critical events are processed and sent to BGP immediately to minimize convergence time.
-
Noncritical events: These are changes in IGP metrics. Noncritical events are collected and sent in batches every three seconds. This batching helps minimize route churn and maintain network stability.
Events that trigger notifications
BGP receives next hop notifications when any of these events occur:
-
A next hop becomes reachable or unreachable.
-
A next hop becomes connected, unconnected, local, or nonlocal.
-
The first hop IP address or interface changes.
-
The recursed IGP metric for the next hop changes (e.g., due to network congestion or topology updates).
Configuration options for event handling
Several commands are available to fine-tune how BGP handles next hop notifications:
-
nexthop trigger-delay : Adjusts the batching interval for noncritical events, per address family, allowing network operators to balance convergence speed with network stability.
-
nexthop route-policy : Enables policy-based filtering of notifications to control which next hop changes are significant for BGP processing.
Example Scenarios:
-
Critical Event: If an interface fails and a next hop becomes unreachable, BGP receives an immediate notification and recalculates the best path.
-
Noncritical Event: When the IGP metric to a next hop increases due to network congestion, BGP receives a noncritical notification and may update its path selection after batching the event.
How BGP next hop notifications work
Summary
The key components involved in the process are:
-
Routing Information Base (RIB): A database that continuously monitors the status and attributes of all next hops used by BGP.
-
BGP process: A process that receives notifications from the RIB and updates routing information and neighbor relationships as needed.
-
Network events: Events that trigger changes, such as interface status or IGP metric adjustments, that require BGP response.
The RIB continuously monitors BGP next hops and notifies BGP of any status changes. BGP then evaluates the event’s impact, updates path selection, and recalculates next hop values to ensure correct routing.
Workflow
These stages describe the BGP next hop notifications process:
- Monitoring: The RIB tracks all BGP next hops, continuously monitoring their reachability, connectivity, locality, and associated IGP metrics.
- Detection: The RIB detects a change in next hop status such as an interface going down, a next hop becoming unconnected, or an IGP metric update.
- Notification: Upon detecting a change, the RIB immediately notifies the BGP process about the specific event and affected next hop.
- Evaluation: The BGP process verifies the new state of the next hop and determines whether the event is critical (immediate action needed) or noncritical (batching possible).
- Update: BGP updates its path selection, recalculates outgoing next hop values for all affected routes, and checks or re-establishes neighbor connectivity as required.
Next hop determination (IPv4 and IPv6)
BGP uses a set of rules to determine the next hop address for prefixes exchanged between BGP peers. The determination logic differs depending on whether the prefixes are IPv4 or IPv6 and on the interface and neighbor configurations.
Next hops as IPv6 addresses of peering interfaces
When BGP is used for IPv6 routing, the next hop for IPv6 prefixes can be set to the IPv6 address of the peering interface. This behavior is defined as follows:
-
Assignment:
The IPv6 address of the peering interface is assigned as the next hop for IPv6 prefixes exchanged over an IPv4 BGP session.
-
Automatic application:
This assignment is automatically applied when no nexthop policy is configured but either an IPv6 neighbor or an IPv6 update-source interface is present.
-
Default behavior:
If neither an IPv6 neighbor interface nor an IPv6 update-source interface is configured, the next hop defaults to an IPv4-mapped IPv6 address.
IPv6 prefix transport over IPv4 BGP sessions
BGP supports the transport of IPv6 prefixes over IPv4 sessions. The determination of the next hop in these cases is controlled by the presence or absence of specific interface configurations and policies:
-
With IPv6 neighbor or update-source configured:
If an IPv6 neighbor interface or IPv6 update-source interface is configured, BGP uses the IPv6 address of that interface as the next hop.
-
Without IPv6 neighbor or update-source:
If neither interface is configured, BGP sets the next hop as an IPv4-mapped IPv6 address.
Table-policy for global IPv6 next hop
By default, BGP switches to a link-local IPv6 address for the next hop when ECMP links change, which may cause transient traffic loss. To maintain consistent load balancing and avoid these issues, configure a BGP table-policy to set a global IPv6 next hop.
Configure a BGP table-policy to set the global IPv6 next hop
Ensure BGP uses a global IPv6 address as the next hop and prevent traffic loss during ECMP path changes.
Before you begin
-
Ensure you have access to the BGP route-policy configuration on your device.
-
Ensure you have identified the destination prefixes that require consistent load balancing and global IPv6 next hop assignment.
Procedure
|
Define a new route-policy to set the global IPv6 address as the next hop. Example:
|
Route resolution policies
Route resolution policies in BGP provide mechanisms to control how next hops are resolved and which routes are considered valid for advertisement or installation in the routing table. These policies offer fine-grained control over routing decisions and help prevent issues such as route oscillation or unwanted route propagation.
Policy criteria
BGP allows the creation and application of route policies that can specify:
-
Prefix length requirements: For example, only allowing next hop routes with a prefix length greater than a configured value.
-
Source protocol requirements: Requiring that next hop routes be learned from specific routing protocols (such as Intermediate System to Intermediate System (IS-IS), Open Shortest Path First (OSPF), or connected routes) to ensure routing stability.
Enabling route policy filtering
Enable route policy filtering in BGP using the nexthop route-policy command. You can apply this command globally, to specific address families, or at the VRF level, depending on your network design needs.
Scoped IPv4 table walks
A scoped IPv4 table walk is a route lookup mechanism that
-
receives next-hop notifications to trigger address family processing
-
uses gateway context information to determine which address families share the gateway context, and
-
localizes processing to the IPv4 unicast address family table using a next-hop mask.
Identifying the address family from next-hop notifications
When a next-hop notification is received, the system first de-references the gateway context associated with that next hop. It then examines the gateway context to determine which address families are using it.
Gateway context sharing among IPv4 unicast address families
IPv4 unicast address families share the same gateway context, as they are registered with the IPv4 unicast table in the Routing Information Base (RIB). Each next-hop entry includes a mask to show whether it belongs to the IPv4 unicast address family.
Scoped table walk for efficient processing
Whenever a next-hop notification for IPv4 unicast is received from the RIB, the system processes only the global IPv4 unicast table. This scoped table walk ensures that updates or lookups are performed only in the relevant address family table, improving efficiency by avoiding unnecessary processing of unrelated address families.
Address family processing order
When a next-hop notification batch is received, the software reorders the address family processing in this order:
-
IPv4 tunnel
-
VPNv4 unicast
-
IPv4 labeled unicast
-
IPv4 unicast
-
IPv4 multicast
-
IPv6 unicast
This order determines how address family tables are walked based on their numeric value, ensuring efficient routing table updates in response to notifications.
Critical-event thread for BGP next hop processing
Configuration and commands
BGP provides a variety of configuration and operational commands to help users manage, monitor, and troubleshoot next hop processing. These commands allow you to control next hop handling in BGP updates, gather statistical information, and perform diagnostic analysis of next hop-related events.
Common BGP next hop commands
Show commands:
- show bgp nexthops :
Displays statistical information about next hop notifications, processing time, and details about each next hop registered with the RIB. Use this command to monitor the status and performance of next hop processing.
Clear commands:
-
clear bgp nexthop performance-statistics : Clears the cumulative statistics related to BGP next hop notification processing. Use this command when you want to reset the counters and start a new monitoring interval.
-
clear bgp nexthop registration : Performs asynchronous registration of the next hop with the RIB. Use this command to reset and re-register next hops in case of inconsistencies or for troubleshooting purposes.
Debug commands:
-
debug bgp nexthop : Provides diagnostic information on next hop processing.
-
The out keyword gives debug information about BGP registration of next hops with the RIB.
-
The in keyword displays debug information about next hop notifications received from the RIB.
-
If the out keyword is repeated, it displays debug information about next hop notifications sent to the RIB.
-
Disable next-hop processing on BGP updates
Ensure all BGP updates sent to a neighbor use the local router's address as the next hop, preventing automatic recalculation of next-hop values.
Disabling BGP next-hop processing is required when you want your router to appear as the next hop for all advertised routes to a peer. This is useful in designs where control over routing paths is necessary.
Before you begin
-
Obtain your autonomous system (AS) number and the neighbor’s IP address.
Procedure
|
Configure the router to advertise itself as the next hop for all routes sent to the neighbor. Example:
You can also disable next-hop processing for a neighbor group or an address family group, depending on your network design requirements. |
Feedback