The abbreviation BGP stands for Border Gateway Protocol. It is a so-called path-vector routing protocol with which the various autonomous systems (AS) of the Internet can be connected to one another and data can be routed across AS boundaries.
According to the reports, an update to BGP software went wrong and it cause the Facebook outage.
The Border Gateway Protocol can be used across AS. Within an AS, it often works with so-called Interior Gateway Protocols (IGP) such as Open Shortest Path First (OSPF) or Intermediate System to Intermediate System (IS-IS).
The Border Gateway Protocol (BGP) is a networking standard that establishes the logical connection paths between autonomous systems through which data passes. The main features of BGP are described in RFC 1163. The currently used version is BGPv4, which is defined in RFCs 4271, 4760, and 4364, among others.
The Border Gateway Protocol is not limited to the routing of IPv4 or IPv6, but can also be used for other protocols or MPLS labels. BGP is designed to scale and be reliable. It’s a difficult routing mechanism to get up and running, and it takes time for the connection paths to converge.
How does the Border Gateway Protocol work?
The Border Gateway Protocol works path vector-based. In order to communicate routing information, the routers establish secure TCP connections with one another. Messages and information are sent and received via these BGP sessions. The port used for this is TCP port 179. Possible message types are:
- OPEN: to start the exchange of information within a session
- KEEPALIVE: to confirm an OPEN message and to maintain the sessions. The sessions are kept alive with regular KEEPALIVE messages from the connected routers
- UPDATE: to inform about path changes
- NOTIFICATION: for terminating a connection and deleting paths, for example, because KEEPALIVE messages are no longer received
The UPDATE messages play a central role within the Border Gateway Protocol. The routers use these notifications to discover out about new routes or to be informed when existing ones have vanished. The router may create a graph that depicts the networking of autonomous systems based on the data received. The procedure for generating the graph disregards loops and is mindful of the characteristics of those paths that were included in the update. Possible attributes of a route are:
- AS_PATH: Information about which AS a target can be reached. The autonomous systems are represented by AS numbers
- Next Hop: IP address of the next intermediate node on the way to a prefix
- IGP metric: Information about the costs through the own network
- Multi-Exit Discriminator (MED): for prioritizing parallel connections
- Routing tags or communities: 32-bit long values with which prefixes can be marked for filtering purposes
- Local Preference: for selecting a path within an AS
- Origin: source of a prefix. Possible values are internal, external, or incomplete
Differentiation between EBGP and IBGP
Not only different autonomous systems can be connected with the Border Gateway Protocol. The routing protocol can also be used to interconnect routers within an AS. Depending on the use, one speaks of external or internal BGP (EBGP or IBGP).
The data is directed through an autonomous system via the routers of an AS connected to IBGP. For this purpose, the routers propagate the routes learned via EBGP within their own AS. This makes it possible to transmit the BGP-specific attributes of the prefixes. BGP sessions must be established between all routers that use the Border Gateway Protocol to communicate.
An Interior Gateway Protocol (IGP) such as OSPF (Open Shortest Path First) or IS-IS is usually required for the actual connection between the routers. Route reflectors are a method used to avoid scaling difficulties resulting from complete mesh in large networks. Each BGP router just needs one connection to the route reflector, which keeps track of all routes received via EBGP and distributes them to all routers in the AS via IBGP.