Definition under: Definitions

What is the Border Gateway Protocol (BGP)?

Border Gateway Protocol (BGP) is a standardized protocol utilized in computer networks, such as the Internet, to exchange routing and reachability information between routers. It serves as a key mechanism for routers in separate autonomous systems (ASes) to communicate effectively with each other, ensuring the accurate transmission of data between different parts of the network.


Dissecting Border Gateway Protocol (BGP)

Border Gateway Protocol (BGP) was developed in 1989 by Kirk Lougheed and Yakov Rekhter to provide a scalable and robust routing solution for the increasing complexity of inter-domain routing in the late 1980s. This need arose as existing exterior gateway protocols, such as Exterior Gateway Protocol (EGP), proved insufficient for managing the expanding Internet landscape.

BGP's creation aimed to overcome the limitations of previous exterior gateway protocols and enable efficient inter-domain routing. The protocol's core purpose was to empower autonomous systems (ASes) to exchange routing information and make informed routing decisions across different ASes. This requirement emerged due to the dynamic nature of the Internet, characterized by diverse administrative domains and varying routing policies, necessitating a protocol capable of handling intricate routing scenarios.


How it works

To ensure efficient and stable inter-domain routing across the Internet’s autonomous systems, Border Gateway Protocol (BGP) establishes TCP connections between BGP peers, exchanges routing information through Update messages, and uses attributes to select the best routes

  1. Neighbor Discovery and Peering: BGP routers, also known as BGP peers, establish TCP connections with each other. These connections are established manually by network administrators or through the use of routing protocols like OSPF or EIGRP, which advertise the existence of BGP peers. BGP peers are classified as internal peers (within the same AS) or external peers (in different ASes).
  2. BGP Session Initialization: Once a TCP connection is established, BGP peers exchange Open messages. These messages include negotiation parameters such as the BGP version, AS number, and hold timer value.
  3. BGP Route Advertisement: After the session is established, BGP peers exchange Update messages to share routing information. These messages contain attributes that describe the advertised route, such as the destination prefix, AS-Path, Next-Hop, and various other attributes.
  4. Path Vector and Route Selection: BGP uses the path vector routing method, which includes the AS-Path attribute to prevent routing loops. The AS-Path contains a list of autonomous systems the route has traversed. BGP routers maintain a BGP routing table that stores information about routes learned from BGP peers. The route selection process involves comparing attributes to determine the best path for each destination prefix. The BGP best path selection algorithm considers attributes like Local Preference, AS-Path length, Origin, and MED to determine the most optimal route.
  5. BGP Decision Process and Updates: BGP routers continuously receive Update messages containing routing information from BGP peers. The decision process involves comparing received routes to the routes in the BGP routing table. If a received route is better than the existing route, the BGP router updates its routing table and forwards the new route to its neighbors.
  6. BGP Route Propagation: BGP routes are propagated to neighboring BGP routers, both within the same AS (internal peers) and in other ASes (external peers). BGP routers use the Next-Hop attribute to determine the IP address to which the traffic destined for the advertised prefix should be forwarded.
  7. Route Withdrawal and Expiry: If a BGP router no longer has a valid route for a particular prefix (e.g., due to a network outage), it sends a Withdraw message to its peers to notify them that the route is no longer available. BGP routers also implement a hold timer to monitor the health of BGP sessions. If a hold timer expires without receiving updates from a peer, the connection is considered lost, and routes learned from that peer are invalidated.
  8. Loop Prevention and Stability: BGP's path vector approach using the AS-Path attribute helps prevent routing loops by ensuring that routes do not revisit the same autonomous system. BGP routers are configured with various policies to control the flow of traffic, influence route selection, and align with business requirements.


BGP attributes

BGP attributes are pieces of information associated with routes that BGP routers use to make informed routing decisions. These attributes provide valuable metadata about routes, allowing BGP routers to select the best path for forwarding traffic. BGP attributes influence route selection, traffic engineering, policy enforcement, and the overall behavior of inter-domain routing.Some of the key BGP attributes are:

  • AS-Path: The AS-Path attribute lists the sequence of autonomous systems that the route has traversed. It helps prevent routing loops by ensuring that routes do not revisit the same AS. Shorter AS-Paths are generally preferred, as they indicate fewer hops.
  • Next-Hop: The Next-Hop attribute specifies the IP address of the next-hop router that should be used to reach the destination network. BGP routers use this attribute to determine where to forward traffic.
  • Origin: The Origin attribute indicates the source of the BGP route. It can have one of three values:
  • IGP (Interior Gateway Protocol): The route was learned from an Interior Gateway Protocol, such as OSPF or EIGRP.
  • EGP (Exterior Gateway Protocol): The route was learned from an exterior gateway protocol other than BGP.
  • Incomplete: The origin of the route is unknown or not specified.
  • Local Preference: The Local Preference attribute is used within an autonomous system to indicate the preference for a particular route. Higher values typically indicate a higher preference for the route.
  • Multi-Exit Discriminator (MED): The MED attribute is used to influence the path selection of incoming traffic when multiple entry points exist into an AS. It's a hint to neighboring ASes about preferred exit points for traffic leaving the local AS.
  • Weight: While not a standard attribute, the Weight attribute is specific to Cisco routers and is used to locally influence route preference within the router itself. It's not propagated to other BGP routers.
  • Community: The Community attribute is a tag that can be attached to routes. It's used for policy-based routing decisions. ISPs and network administrators can define their own community values to implement specific routing policies.
  • Atomic Aggregate: The Atomic Aggregate attribute indicates that the advertised route represents an aggregation of more specific routes. It helps prevent the propagation of detailed information when summarization occurs.
  • Aggregator: The Aggregator attribute identifies the router that performed route aggregation. It contains the AS number and the IP address of the router.
  • Path Length: Although not a formal BGP attribute, the number of ASes in the AS-Path can be considered a factor in route selection. Shorter AS-Paths are often preferred.
Recently Added Definitions