Border Gateway Protocol (BGP)
BGP is the routing protocol of the internet. It allows different Autonomous Systems (AS) to exchange routing and reachability information.
How BGP Works
BGP routers establish peering sessions using TCP (Port 179). They exchange full routing tables and then send updates only when routes change. BGP uses a complex algorithm to select the best path based on attributes like:
- Local Preference: Used to choose the exit path from an AS.
- AS Path Length: Preferring routes that traverse fewer Autonomous Systems.
- Origin Type: How the route was injected into BGP.
- Multi-Exit Discriminator (MED): Used to suggest to an external AS which entry point to use.