Related: BGP operates between Autonomous Systems (ASNs).

What is BGP?

Border Gateway Protocol (BGP) is basically the routing protocol that lets different networks talk to each other and share information about what IP addresses they can reach. It's what decides which paths your traffic takes when it moves between networks.

Why BGP exists

Here's the thing-the internet is made up of thousands of independent networks. And they all need a way to tell each other "hey, we can reach this IP range" and set their own routing rules. That's what BGP does.

Core BGP attributes

Download CSV
AttributeDescriptionWhy it mattersExample
AS_PATHThe list of ASNs that a route travels throughStops routing loops from happeningShorter paths get picked first
NEXT_HOPThe next router in the path for a routeTells the router where to send trafficNeighbor IP
LOCAL_PREFA preference value used internallyControls how traffic gets routed outboundHigher number wins
MEDMulti-exit discriminatorHints at the best inbound pathLower number wins
ORIGINShows how the route was originally learnedHelps you know if it's trustworthyIGP is preferred
COMMUNITYTags attached to routesLets you control routing policiesNo-export
PREFIXThe IP range being advertisedWhere traffic is actually headed203.0.113.0/24
PEERINGThe BGP neighbor relationshipHow routes get exchangedIXP peering

How BGP selects routes

  1. Highest LOCAL_PREF
  2. Shortest AS_PATH
  3. Lowest ORIGIN type
  4. Lowest MED
  5. Lowest IGP cost to NEXT_HOP

BGP and security risks

The problem is that BGP basically trusts what its neighbors tell it. So if someone misconfigures something or announces a route they shouldn't, traffic can get hijacked or just disappear into a black hole.

How BGP relates to IP reputation and abuse

Related tools

Authoritative references