TTR Networks

Intermediate · BGP Fundamentals · section 1 of 9

Why BGP exists

✓ Lab-tested 17 October 2026 on FRR 10.2.1

How the Border Gateway Protocol glues the internet together: autonomous systems, sessions, path attributes, best-path selection, iBGP scaling and a hands-on eBGP lab with real FRR configuration.

By the end you will be able to:

  • Explain why the internet needs an inter-domain routing protocol and what an autonomous system is
  • Walk through BGP session establishment and recognise each finite state machine state
  • Describe the key path attributes and how AS_PATH prevents loops
  • Predict which route BGP will select using the best-path algorithm
  • Explain the iBGP split-horizon rule and how route reflectors scale iBGP
  • Configure, filter and verify an eBGP session in FRRouting

Prerequisites: OSPF Fundamentals

The internet is not one network. It is roughly 75,000 independently operated networks — ISPs, clouds, universities, enterprises, content providers — that have agreed to exchange traffic. No single organisation controls it, and none of them would let a stranger's router decide how traffic flows through their infrastructure.

Inside a single network, an Interior Gateway Protocol (IGP) such as OSPF or IS-IS does the routing. IGPs assume every router is trusted and cooperative, and they pick the mathematically shortest path. That works when one team owns everything.

Between networks those assumptions break down:

  • Trust — you must not blindly accept whatever another network tells you.
  • Policy — the "best" path is a business decision. A free peering link beats a paid transit link even if it is longer.
  • Scale — the global table holds over a million IPv4 and IPv6 prefixes. Flooding link-state for the whole internet is impossible.

The Border Gateway Protocol (BGP, currently version 4, RFC 4271) solves this. It is a path-vector protocol: rather than advertising link costs, each network advertises which prefixes it can reach and the list of networks the path traverses. Every receiver applies its own policy to decide what to accept, which path to use, and what to tell its neighbours.

BGP is no longer only for the internet edge. The same protocol carries:

  • Data-centre fabrics (eBGP as the IGP in leaf-spine designs, RFC 7938)
  • MPLS L3VPNs and EVPN overlays (multiprotocol BGP)
  • Cloud and Kubernetes networking (Calico, MetalLB, cloud VPN gateways)
Diagram: Four autonomous systems — Each autonomous system runs its own IGP internally and speaks BGP at its borders. Step through to see which protocol does what.
  1. Inside an AS: the IGP. Each network runs its own interior gateway protocol (OSPF, IS-IS) to find the shortest path between its own routers. IGPs trust every router they talk to and optimise for speed of convergence.
  2. Between ASes: BGP. At the borders, networks run BGP. These links connect different organisations with different business relationships, so BGP is built around policy rather than shortest path.
  3. The content network announces its prefix. AS 64499 tells both of its transit providers "203.0.113.0/24 lives here".
  4. You receive two paths and choose. Your edge router hears the prefix from both ISPs. BGP picks one best path using attributes and your policy — maybe ISP A is cheaper, maybe ISP B has a shorter path.