BGP (Border Gateway Protocol)

Contributor(s): John Burke

BGP (Border Gateway Protocol) is the protocol underlying the global routing system of the internet. It manages how packets get routed from network to network through the exchange of routing and reachability information among edge routers. BGP directs packets between autonomous systems (AS), which are networks managed by a single enterprise or service provider.

Content Continues Below

BGP creates network stability by guaranteeing routers can adapt to route failures: when one path goes down, a new path is quickly found. BGP makes routing decisions based on paths, defined by rules or network policies set by network administrators.

How does BGP work?

Each router maintains a routing table controlling how packets are directed. Routing table information is generated by the BGP process on the router, based on incoming information from other routers, and information in the BGP routing information base (RIB), which is a data table stored on a server on the BGP router. The RIB contains information both from directly connected external peers, as well as internal peers, and based on policies for what routes should be used and what information should be published, continually updates the routing table as changes occur.

What is BGP used for?

BGP offers network stability that guarantees routers can quickly adapt to send packets through another reconnection if one internet path goes down. BGP makes routing decisions based on paths, rules or network policies configured by a network administrator. Each BGP router maintains a standard routing table used to direct packets in transit. BGP uses client-server topology to communicate routing information, with the client-server initiating a BGP session by sending a request to the server.

BGP routing basics

BGP sends updated router table information only when something changes, and only the affected information. BGP has no automatic discovery mechanism, which means connections between peers must be set up manually, with peer addresses programmed in at both ends.

BGP makes best-path decisions based on current reachability, hop counts and other path characteristics. In situations where multiple paths are available -- as within a major hosting facility -- BGP policies communicate an organization's preferences for what path traffic should follow in and out. BGP community tags can control route advertisement behavior among peers.

BGP in networking is based on TCP/IP. It operates on the OSI Transport Layer (Layer 4) to control the Network Layer (Layer 3). As described in RFC4271 and ratified in 2006, the current version of BGP-4 supports both IPv6 and Classless Inter-Domain Routing (CIDR), which enables the continued viability of IPv4. Use of the CIDR is a way to have more addresses within the network than with the current IP address assignment scheme.

BGP enables backbone route sharing

Common BGP issues

Common issues with BGP include information exchange failures. Information exchanges don't always succeed as information can be improperly formatted or contain incorrect data. Routers can run out of memory or storage, or be too slow to respond to updates. Routers send error codes and subcodes to communicate problems including timeouts, malformed requests and processing problems.

BGP security

BGP is also vulnerable to attacks based on misinformation. Malicious actors can flood a router with bad packets in a denial-of-service attack, for example. They can also claim to be the source of routing information for an AS, and (temporarily) control where traffic headed from that AS goes, a practice known as BGP hijacking.

Difference between internal and external BGP, OSPF

When BGP is used to route within a single AS, it is called internal BGP, or iBGP. When used to connect one AS to others, it is called external BGP, or eBGP.

The OSPF (Open Shortest Path First) protocol is used only in internal networks. OSPF is focused on finding the shortest route available between nodes, and on failing over to that shortest route as quickly as possible. BGP is slower to fail to a new route but is more scalable. OSPF is essentially hierarchical in structure, while BGP is a mesh. Some networks are replacing OSPF with iBGP.

This was last updated in June 2020

Continue Reading About BGP (Border Gateway Protocol)

Dig Deeper on Telecommunication networking

Join the conversation


Send me notifications when other members comment.

Please create a username to comment.

What's a reason you would not want automatic discovery of BGP peers?
Probably because it runs in the core of the internet and any accidental connections to misconfigured routers which advertise paths to networks they are not really connected to could take down large parts of the internet.  Also malicious use is possible then.  Suppose I set my router up to advertise that it has a really fast path to Google's networks, and make it a peer of my ISP's router - then the ISP would see my router as the best path to google and send everyone's google traffic to me - but since I don't actually have a path to google's network all the traffic would not be delivered... this is why peering is not automatic
How does BGP work even in the time of any regular traffic path will down?


File Extensions and File Formats

Powered by: