NET · Series · BGP, in context · Part 3 of 3

BGP in the service provider core: from full mesh to route reflectors, MP-BGP and RPKI

How BGP scales inside a service provider: the iBGP split horizon rule, the full mesh problem, route reflectors and confederations, next-hop-self, a BGP-free core with MPLS, MP-BGP for L3VPN and EVPN, communities, peering and security with RPKI and MANRS.

Route reflector (RFC 4456) at the center of the core, with five PE routers as iBGP clients
Illustration: The House of Routing

In the first two parts of this series we looked at BGP from the outside: the protocol that connects the Internet's autonomous systems. Today I close the series inside the operator's house: the core of a service provider, where BGP is no longer one session with your ISP but hundreds of sessions that have to scale without loops.

Maybe you're at point A: you bring up an eBGP peering, see the prefix in the table and feel you've got BGP down. Point B is different: understanding why an iBGP router doesn't pass on what it learns, when to use a route reflector or a confederation, and how an operator protects the global table.

Why doesn't iBGP pass on what it learns from another iBGP neighbor?

Inside a single AS, the AS_PATH doesn't change. If a route looped between iBGP routers, BGP would have no way to detect it. That's why there's a rule many people call iBGP split horizon: what a router learns from an iBGP neighbor, it doesn't advertise to another iBGP neighbor.

The consequence is immediate. For every router to know every external route, each one needs an iBGP session with all the others: a full mesh. RFC 4456 puts a number on it: with n routers you need n(n-1)/2 iBGP sessions.

  • 10 routers: 45 sessions.
  • 50 routers: 1,225 sessions.
  • 100 routers: 4,950 sessions.

And every new router means touching the configuration of all the existing ones. The RFC says it plainly: this requirement doesn't scale when there are many iBGP speakers.

How does a provider scale without a full mesh?

Route reflector (RFC 4456, April 2006)

A route reflector (RR) breaks the rule on purpose, in a controlled way. It splits its iBGP neighbors into clients and non-clients. A route from a non-client is reflected to the clients. A route from a client is reflected to everyone. So clients no longer need a full mesh among themselves.

To prevent loops, the RFC adds two optional, non-transitive attributes: ORIGINATOR_ID, carrying the router ID of whoever originated the route in the AS, and CLUSTER_LIST, listing the clusters the route has already crossed. If an RR sees its own cluster in the list, it drops the route.

Confederation (RFC 5065, August 2007)

A confederation splits the AS into several member-ASes. From the outside, you see a single AS: the confederation identifier. Inside, sessions between member-ASes behave almost like eBGP: the AS_PATH records the hop with AS_CONFED_SEQUENCE or AS_CONFED_SET. Unlike real eBGP, NEXT_HOP and MED can travel unchanged between member-ASes, and LOCAL_PREF is sent.

CriterionFull meshRoute reflectorConfederation
iBGP sessionsn(n-1)/2: 4,950 with 100 routersEach client talks only to its RR (or RR pair)Full mesh only inside each member-AS, plus the sessions between member-ASes
Loop preventioniBGP split horizonORIGINATOR_ID and CLUSTER_LISTAS_CONFED_SEQUENCE and AS_CONFED_SET
Paths each router seesEvery path from every edgeOnly the best path the RR picksThe best path from each neighboring member-AS
Design impactNone, but it grows with every routerOnly the RR configuration changesYou renumber the internal AS into member-ASes
Where it fitsFew routers and labsLarge cores and VPNv4 control planesSeparate domains, even with a different IGP in each member-AS

Neither option is free. RFC 5065 warns that confederations and route reflectors, by hiding paths, can cause permanent oscillation between candidate routes. Watch your MED and tie-breaking rules.

What role do the IGP and next-hop-self play?

BGP decides which route to use; the IGP decides how to reach its NEXT_HOP. In a provider, that IGP is usually OSPF or IS-IS, and its job is simple and critical: advertise the core's loopbacks and links. iBGP sessions run between loopbacks, so they survive a physical link failure.

Here's a classic mistake. When an edge router learns a route over eBGP, the NEXT_HOP is the external neighbor's IP. If it's advertised over iBGP unchanged, the other routers receive a NEXT_HOP their IGP doesn't know: the route is unusable.

  • Option 1: neighbor 10.0.0.1 next-hop-self on the edge router. It advertises itself as the NEXT_HOP, and its loopback is already in the IGP.
  • Option 2: advertise the external link's subnet in the IGP as a passive network.

One detail to watch: RFC 4456 says an RR should not modify the NEXT_HOP when it reflects. That's why next-hop-self goes on the edge routers, not on the reflector. When I review a core with «valid» routes nobody uses, show ip bgp and the NEXT_HOP are the first things I check.

What is a BGP-free core, and where does MP-BGP come in?

If the core runs MPLS, the P routers don't need BGP. The ingress PE pushes a label toward the loopback of the egress PE, which is the BGP NEXT_HOP, and the core just switches labels. RFC 4364 frames it this way for VPNs: core routers don't need to know the VPN routes.

On top of that transport, BGP goes multiprotocol (MP-BGP) and carries much more than IPv4:

  • L3VPN (VPNv4). RFC 4364 defines the VPN-IPv4 address family: a 12-byte address made of an 8-byte route distinguisher (RD) plus the IPv4 prefix. The RD makes overlapping customer networks unique. The route target travels as an extended community and decides which VRF imports each route. The same RFC has a section on using route reflectors for VPNs.
  • EVPN. RFC 7432 brings the same idea to Ethernet: PEs learn MAC addresses in the control plane and advertise them with MP-BGP, along with an MPLS label.

If you read the MPLS series, this closes the loop: the underlay is IGP plus MPLS; the overlay is MP-BGP, often backed by route reflectors.

How does a customer control its own policy with communities?

A community is a tag that travels with the route. RFC 1997 (August 1996) defines it as a 32-bit value that, by convention, is written as AS:value: the first 2 octets are the AS, and that AS defines the last 2. It also sets well-known communities every router must honor:

  • NO_EXPORT (0xFFFFFF01): not advertised outside the AS or the confederation.
  • NO_ADVERTISE (0xFFFFFF02): not advertised to any BGP peer.
  • NO_EXPORT_SUBCONFED (0xFFFFFF03): doesn't even leave toward another member-AS.

With 4-octet ASNs, the 2-octet format fell short. RFC 8092 (February 2017) created large communities: 12 octets, with a 4-octet Global Administrator and two 4-octet fields defined by the operator.

What's all this for? So the customer can decide without opening a ticket. A provider publishes its community catalog, and the customer tags its routes to, for example, lower their LOCAL_PREF and use them as backup, or keep them from going out to certain neighbors. RFC 7454 adds some hygiene: don't strip the communities a route carries, especially NO_EXPORT.

A case from the ticket workshop

In the ticket workshop I built in 2021 for the Masterclass, one requirement reads: «R6 must receive prefix 33.33.33.33 with the INTERNET community and community 444:5000». Another asks R4 to prefer the exit toward R2 only for 11.11.11.11/32, with WEIGHT 25000, and tag the route with 444:6000. That's what real work looks like: a per-prefix policy, documented with communities and verified with show ip bgp 33.33.33.33.

Peering or transit? The provider's edge

At the edge, an operator has three kinds of neighbor: customers, who pay it to reach the Internet; transit providers, which it pays; and peers, with which it exchanges traffic for their own networks and their customers. RFC 7454 defines a Tier 1 transit provider as one that can reach any network on the Internet without buying transit.

Many peerings happen at an IXP (Internet Exchange Point): a shared network where many operators connect once and open sessions with each other. Each kind of neighbor gets its own policy:

  • Customer: accept only its prefixes, and send it the full table, just a default route or both, depending on what it asks for.
  • Peer: accept its prefixes and its customers', never the whole Internet. RFC 7454 recommends a maximum-prefix below the size of the global table, so the session drops if the peer leaks it by mistake.
  • IXP: don't accept more-specific prefixes of the IXP's own LAN.

How does an operator protect the global table?

BGP is trusting by design. A neighbor can announce a prefix that isn't theirs, by mistake or on purpose, and the rest of the Internet may believe it. Three layers reduce that risk.

  1. Filtering (RFC 7454, BCP 194, February 2015). Filter non-routable and overly specific prefixes, cap the number of prefixes per session, and protect directly connected sessions with GTSM (TTL security).
  2. RPKI and ROV (RFC 6811, January 2013). With RPKI certificates, the router checks whether the AS originating a prefix is authorized to do so. Each route gets a state: Valid, Invalid or NotFound. What to do with Invalid routes is a local policy you define.
  3. MANRS. A set of baseline practices that a group of network operators created in 2014 as a voluntary initiative. It asks for 4 actions: filtering, anti-spoofing, coordination (up-to-date contacts in Whois, IRR and PeeringDB) and global validation (publishing your prefixes and policies).

AI already helps review long prefix-lists and spot odd announcements. But the filter that goes on a production peering is yours to approve. AI proposes; you decide.

What you take away

  • The iBGP split horizon rule prevents loops, but it forces a full mesh of n(n-1)/2 sessions.
  • Route reflectors (RFC 4456) and confederations (RFC 5065) solve that scaling problem with different loop-prevention mechanisms.
  • The IGP carries the loopbacks; next-hop-self on the edge makes the NEXT_HOP reachable, and the RR leaves it unchanged.
  • With MPLS, the core can be BGP-free, and MP-BGP carries VPNv4 (RFC 4364) and EVPN (RFC 7432).
  • Communities (RFC 1997 and RFC 8092) give customers control over policy without opening a ticket.
  • Filtering, RPKI with ROV and MANRS are the foundation of edge security.

This part wraps up the «BGP, in context» series. The next step is yours: join the BGP Masterclass, configure it with me router by router and solve the workshop tickets.

Take BGP from theory to the console

THoR's BGP Masterclass was recorded live on Cisco routers across two marathons: the first covers eBGP and iBGP, messages and states, and filtering and routing policies; the second covers iBGP scalability with route reflectors and confederations, best path selection and communities. It ends with a ticket workshop that emulates real-world requests. It comes with free readings: the first one is open, and you unlock the rest with a free sign-up.

Want the free PDF guide «The 30 BGP commands»? Send BGP to @thehouseofrouting on Instagram (comment or direct message) and we'll email it to you.

Go to the BGP Masterclass

Sources

Text by Jesús Espinoza, prepared with AI assistance and reviewed by him. Original illustration by The House of Routing.

↑ Start of the article