- Border Gateway Protocol (BGP) is an inter-autonomous system routing protocol.
- An autonomous system (AS) is a network or a group of routers logically organized and controlled by a common network administration.
- BGP enables routers to exchange network reachability information, including information about other ASs that traffic must traverse to reach other routers in other ASs. In order to implement BGP, the AS number must be specified in the config.
- AS paths are the routes to each destination. Other attributes, such as the path’s origin, the system’s route preference, aggregation, route reflection, and communities included in the AS path are called path attributes. When BGP interprets routing and topology information, loops can be detected and eliminated. Route preference for routes learned from the configured peer(s) can be enabled among groups of routes to enforce administrative preferences and routing policy decisions.
- The Border Gateway Protocol uses the Transmission Control Protocol (TCP) port number 179.
There are two types of BGP peers: internal BGP (IBGP) peers and external BGP (EBGP) peers.
- External neighbors between various autonomous systems are communicated via eBGP.
- Internal neighbors inside the same autonomous system use iBGP.
- Autonomous systems use BGP to share routing information — such as routes to each destination and information about the route or AS path — with other ASs. Routing tables contain lists of known routers, reachable addresses, and associated path cost metrics to each router. BGP uses the information and path attributes to compile a network topology.