← Lessons

quiz vs the machine

Gold1520

Networking

BGP Routing Basics

How independent networks exchange reachability to form the internet.

5 min read · core · beat Gold to climb

The glue of the internet

The internet is a network of networks, each an autonomous system with its own routing policy. BGP, the border gateway protocol, is how these systems tell each other which address ranges they can reach.

How it works

Each autonomous system announces the prefixes, blocks of IP addresses, it owns or can deliver to. Neighbors propagate these announcements, building paths described as sequences of autonomous systems.

  • An AS advertises reachable prefixes to its neighbors.
  • Each hop prepends its own identifier to the path.
  • Routers prefer paths based on policy, then on shorter AS paths.

Policy over math

Unlike interior protocols that pick shortest paths by metric, BGP decisions are driven by policy and business relationships, such as preferring a customer link over a peer. This flexibility is also its weakness, since a mistaken or malicious announcement can cause a route hijack, pulling traffic toward the wrong network. Mechanisms like route filtering and origin validation reduce that risk.

Key idea

BGP lets autonomous systems advertise reachability and choose paths by policy, stitching independent networks into one internet.

Check yourself

Answer to earn rating on the learn ladder.

1. What does an autonomous system advertise over BGP?

2. What primarily drives BGP path selection?

3. What is a route hijack?