Skip to content
LinkState
Go back

Aggregate withdrawal races that create transient loops

Introduction to Forwarding Loops

Definition and Causes of Forwarding Loops

A forwarding loop occurs when a packet is repeatedly forwarded between two or more routers without making progress toward its destination. In the control-plane view, a loop appears when the next-hop resolution for a destination resolves to a router that, in turn, resolves the same destination back to the original router (or to a set of routers that form a cycle). Common causes include:

CauseControl-plane mechanismTypical symptom
Mis-configured static routesStatic next-hop points to another router that has a static route backPersistent traceroute loops
Routing protocol redistribution loopsMutual redistribution without route-tags or filters causes routes to be re-advertisedRoutes appear/disappear, high CPU
Asymmetric withdrawal timingAn aggregate route is withdrawn before its more-specifics (or vice-versa) while the FIB is still being updatedTransient loops lasting milliseconds to seconds
Next-hop recursion failureA route’s next-hop is unreachable, causing the router to fall back to a less-specific route that points backMicro-loops during convergence
The focus of this article is the withdrawal-timing scenario: how the order in which an aggregate prefix and its more-specific children are removed from the RIB/FIB can create a brief forwarding loop even when the final, intended policy is correctly configured.

Impact of Forwarding Loops on Network Performance

Even a short-lived loop can have disproportionate effects:

Aggregate and More-Specific Routing

Aggregate Routing Overview

An aggregate route summarizes a set of more-specific prefixes into a single, less-specific entry. In BGP, this is created with the aggregate-address command (Cisco) or aggregate policy (Juniper). In OSPF/IS-IS, summarization is configured via summary-address (OSPF) or summary (IS-IS). Key properties:

router bgp 65001
 aggregate-address 10.0.0.0 255.255.0.0 summary-only

The above advertises only 10.0.0.0/16 and suppresses the individual /24s.

More-Specific Routing Overview

A more-specific route is any prefix that is a strict subset of an aggregate (e.g., 10.0.1.0/24 is more-specific than 10.0.0.0/16). More-specifics are preferred in the forwarding decision because of the longest-prefix match (LPM) rule: the router selects the route with the greatest mask length that matches the destination address. More-specifics can be learned via:

Interaction Between Aggregate and More-Specific Routes

When both an aggregate and its more-specifics exist in the RIB, the FIB will install the more-specific for any address falling inside its range, and the aggregate for the remainder. The interaction is governed by two invariants:

  1. LPM invariant – for any destination address d, the selected route is the one with the longest prefix length among all RIB entries matching d.
  2. Next-hop consistency invariant – the next-hop of a route must be reachable via the current FIB (i.e., its own next-hop resolves without recursion failure). If either invariant is temporarily violated during an update, a forwarding loop can arise.

Withdrawal Timing and Forwarding Loops

Aggregate Withdrawal Timing

When an aggregate route is withdrawn, the router sends a BGP UPDATE (or LSA/LSP) that removes the aggregate prefix from its peers’ RIBs. The local router also removes the aggregate from its own RIB and schedules an FIB update.

More-Specific Withdrawal Timing

Analogously, withdrawing a more-specific prefix removes that entry from the RIB/FIB. If the more-specific is withdrawn while the aggregate remains, traffic for that prefix will now match the aggregate (assuming the aggregate covers the address space).

Interplay Between Aggregate and More-Specific Withdrawal Timing

A forwarding loop can appear when the order of withdrawals creates a temporary state where neither the aggregate nor the appropriate more-specific is present in the FIB for a given destination, causing the router to select a route that points back to the sender.

Control-Plane Transitions and Forwarding Loops

Route Installation and Withdrawal

The control-plane to data-plane pipeline (simplified) is:

  1. Protocol process (BGP, OSPF, IS-IS, static) receives an UPDATE/LSA/LSP or local configuration change.
  2. RIB update – the route is inserted, modified, or deleted in the Routing Information Base.
  3. RIB→FIB notification – the routing daemon signals the forwarding plane (e.g., via Netlink, netlink-based rtnetlink, or vendor-specific IPC).
  4. FIB reprogramming – the ASIC or software datapath updates the forwarding tables (LPM trie, hash buckets).
  5. Packet forwarding – subsequent packets consult the FIB. A transient inconsistency occurs between steps 2 and 4: the RIB reflects the new state, but the FIB still holds the old entry (or vice-versa).

Troubleshooting Forwarding Loops

Identifying Forwarding Loops

  1. Traceroute / MPLS trace – look for repeated hops or increasing TTL values.
  2. ICMP Time-Exceeded counters – spikes on interfaces indicate packets looping and exceeding TTL.
  3. Flow-sampling / NetFlow – observe flows with identical source/destination appearing multiple times on the same interface.
  4. CPU utilization spikes may indicate control-plane overload due to looping packets.

Share this post on:

Previous Post
Failed policy test with three plausible causes
Next Post
Tcpdump Cut the Ceiling in Half