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:
| Cause | Control-plane mechanism | Typical symptom |
|---|---|---|
| Mis-configured static routes | Static next-hop points to another router that has a static route back | Persistent traceroute loops |
| Routing protocol redistribution loops | Mutual redistribution without route-tags or filters causes routes to be re-advertised | Routes appear/disappear, high CPU |
| Asymmetric withdrawal timing | An aggregate route is withdrawn before its more-specifics (or vice-versa) while the FIB is still being updated | Transient loops lasting milliseconds to seconds |
| Next-hop recursion failure | A route’s next-hop is unreachable, causing the router to fall back to a less-specific route that points back | Micro-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:
- Packet loss – packets circulating exceed the TTL and are dropped, causing application-level retransmissions.
- Increased latency – each loop hop adds propagation and processing delay; observed RTT can spike from sub-millisecond to tens of milliseconds.
- Control-plane load – routers generate ICMP Time-Exceeded messages, increasing CPU utilization and potentially triggering route-flap dampening.
- Congestion – duplicated traffic consumes link bandwidth, especially problematic on low-speed access links. Operators typically detect loops via traceroute, increased loss in monitoring tools, or spikes in CPU/ICMP counters. Understanding the precise control-plane transition that creates the loop is essential for mitigation.
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:
- Attribute inheritance – the aggregate inherits attributes (AS-PATH, MED, community) from the contributing more-specifics unless overridden.
- Suppression – contributing more-specifics may be suppressed from advertisement to peers (optional).
- Next-hop – the aggregate’s next-hop is typically the router that originated the aggregate (or a designated next-hop if using
next-hop-self). Example (Cisco IOS):
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:
- Static configuration (
ip route 10.0.1.0 255.255.255.0 <next-hop>) - IGP redistribution (OSPF, IS-IS)
- BGP advertisements from peers or route-reflectors They may carry distinct attributes (different AS-PATH, local-pref, MED) enabling traffic engineering.
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:
- LPM invariant – for any destination address d, the selected route is the one with the longest prefix length among all RIB entries matching d.
- 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.
- Withdrawal propagation delay – depends on BGP hold timers, route-refresh, or IGP LSA/LSP throttling (typically seconds).
- Local FIB update delay – the time between RIB deletion and FIB reprogramming (often sub-second on modern ASICs, but can be tens of milliseconds on software-based forwarding).
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).
- More-specific withdrawal may be faster – many implementations treat each prefix as an independent UPDATE; a flap of a /24 may be processed before the aggregate’s UPDATE is generated.
- Aggregate may be suppressed – if the aggregate is configured
summary-only, the more-specifics are not advertised, but they still exist locally for forwarding.
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:
- Protocol process (BGP, OSPF, IS-IS, static) receives an UPDATE/LSA/LSP or local configuration change.
- RIB update – the route is inserted, modified, or deleted in the Routing Information Base.
- RIB→FIB notification – the routing daemon signals the forwarding plane (e.g., via Netlink, netlink-based
rtnetlink, or vendor-specific IPC). - FIB reprogramming – the ASIC or software datapath updates the forwarding tables (LPM trie, hash buckets).
- 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
- Traceroute / MPLS trace – look for repeated hops or increasing TTL values.
- ICMP Time-Exceeded counters – spikes on interfaces indicate packets looping and exceeding TTL.
- Flow-sampling / NetFlow – observe flows with identical source/destination appearing multiple times on the same interface.
- CPU utilization spikes may indicate control-plane overload due to looping packets.