OSNTC.055: BGP Route Refresh — Policy Replay, Capabilities and Stale Routes

Photorealistic editorial illustration of network equipment and a laptop in a data center

Open-Source Network Technician Certification • Intermediate • 45 minutes

A network technician may discover that an established BGP session is receiving routes that a revised import policy should accept or reject. Restarting the session is not always necessary: the route refresh capability provides a way to request a fresh advertisement from the peer, without intentionally tearing down the TCP connection.

BGP soft reconfiguration and route refresh: contextual technical walkthrough. Original source.

Prerequisites and learning objectives

Review route leaks, route origin validation, graceful restart and maximum-prefix safeguards. Use a local Python interpreter and fictional prefixes. Distinguish a refresh request from a session reset, explain the address-family constraint, and identify how enhanced refresh handles stale entries.

Requesting a replay

RFC 2918 assigns capability code 2 and BGP message type 5 to Route Refresh. A speaker can request a refresh only from a peer that advertised support. The request specifies an address family and subsequent address family (AFI/SAFI). The responding peer advertises its routes for that family according to its export policy. This is not a request for all routes known to the peer, and it does not bypass either router’s policy.

Network patch panels and structured cabling
Robert.Harker, October 2008, Wikimedia Commons, CC BY-SA 3.0. Contextual photograph, not the simulated network.

Enhanced refresh and stale entries

RFC 7313 introduces capability code 70 and beginning/end markers for an enhanced refresh. Upon receipt of the beginning marker, routes from the relevant peer and family become stale. Replayed entries replace stale versions; the end marker triggers removal of entries that remain stale. These markers are distinct from graceful restart’s End-of-RIB indication. A locally configured stale retention limit may also apply.

A refresh can consume control-plane resources and lead to route withdrawals or best-path changes. Avoid promising zero traffic disruption. A technician should inspect negotiated capabilities, scope the address family, review policy and expected prefix counts, and obtain change authorization before executing any vendor-specific command. Cisco’s soft configuration documentation distinguishes refresh from retaining an additional local copy of received updates.

Historical practitioner discussion of BGP configuration and route refresh; not a protocol specification. Original source.

Laboratory: compare the stale set before and after completion

Save this local reference model as refresh.py. It models one peer and one family; it assumes all replayed routes pass policy and does not send packets:

def refresh_allowed(capability, requested_family, peer_families):
    return capability and requested_family in peer_families

def reconcile(previous, replayed, end_seen):
    # Single peer and family; all replayed routes accepted by policy.
    return set(replayed) if end_seen else set(previous) | set(replayed)

family = (1, 1)
assert refresh_allowed(True, family, {family})
assert not refresh_allowed(False, family, {family})
assert not refresh_allowed(True, (2, 1), {family})
old = {‘192.0.2.0/24’, ‘198.51.100.0/24’}
new = {‘192.0.2.0/24’, ‘203.0.113.0/24’}
assert reconcile(old, new, False) == old | new
assert reconcile(old, new, True) == new
assert reconcile(old, set(), True) == set()
print(‘6/6 model checks passed’)

Run python refresh.py. Six assertions passed in the local Python environment. The model checks capability presence, family support, stale retention during a replay and stale removal when completion occurs. It does not simulate BGP wire encoding, timers, concurrent updates or router behavior. A live lab with authorized equipment is required to validate those details.

Knowledge check

Why can a refresh not recover routes excluded by the peer’s export policy? The peer sends only its relevant outbound advertisements. What happens to the stale routes not refreshed at completion? They are removed for that peer and family. Does a successful refresh guarantee no packet loss? No; route selection and forwarding may still change. Always verify session state, accepted prefixes and downstream reachability after an authorized change.

Editor’s Note: We volunteer daily to ensure the credibility of the information on this platform is Verifiably True. If you would like to support to help further secure the integrity of our research initiatives, please scan the QR code below

BitcoinVersus.Tech donation QR code for 5,000 satoshis

For mobile scanning, open the article on another display and scan the QR code with a Bitcoin wallet. The voluntary donation amount is 5,000 sats. Verify the receiving address 3C9o19EH5HSiwEPyCTmEKzxhNCbo2X6TTb before sending.

BitcoinVersus.Tech publishes technology and financial journalism for informational purposes and does not provide financial, investment, or legal advice.

Leave a Reply