Skip to content

Border Gateway Protocol (BGP)

An Autonomous System (AS) is a fundamental concept in networking. It represents a collection of IP networks and routers under the control of a single entity (such as an Internet Service Provider, a large organization, or a government) that presents a common routing policy.

RFC 4271 describes the Border Gateway Protocol (BGP), the Internet's core routing protocol. BGP is designed to exchange routing and reachability information among autonomous systems (ASes) on the Internet. This section focuses on Internal BGP (iBGP), one aspect of BGP specifically used for exchanging routing information within a single AS.

1.0 Internal BGP (iBGP)

iBGP is a version of the BGP protocol used to exchange routing information within an autonomous system (AS). Unlike its counterpart, External BGP (eBGP), which is used for routing between different ASes, iBGP manages how packets are routed within the AS. It is crucial to maintain a consistent and efficient routing policy across all routers within the AS.

1.1 Key Characteristics of iBGP

  • Route Propagation: iBGP does not change the routing information as it passes it along. This characteristic helps prevent routing loops within the AS.

  • Full Mesh Requirement: In traditional iBGP configurations, every router needs to establish a peering relationship with every other router within the AS. This requirement ensures that all routers have complete routing information. However, this can lead to scalability issues in large networks, which are often addressed through route reflectors or confederations.

  • Path Selection: iBGP participates in the BGP path selection process, which determines the most efficient route to reach a destination network. Path attributes like AS_PATH, NEXT_HOP, and others are considered in this process.

2.0 BGP Best Path Algorithm

The Border Gateway Protocol (BGP) Best Path Algorithm is a critical process BGP routers use to determine the most efficient and reliable path to reach a particular network destination among multiple available routes. This decision-making process is vital for ensuring optimal data flow.

BGP uses a series of criteria, applied sequentially, to select the best path to a destination. BGP moves to the following criterion if two paths are considered equal at any step in the process. The process ends when one path is chosen as the best. The criteria are as follows:

  1. Highest Weight: This is a Cisco-specific criterion, where routes with a higher weight are preferred. The weight is assigned locally on a router and is not advertised to other routers.

  2. Highest Local Preference (Local_Pref): The route with the highest local preference is preferred. This attribute is used to prefer one path over others and is exchanged only between routers in the same AS.

  3. Prefer the route originated by the local router: A route originated by the BGP router itself is preferred over routes from other sources.

  4. Shortest AS Path: The route with the shortest AS path (fewest AS hops) is preferred, as it's usually considered to be the most efficient.

  5. Lowest Origin Type: The preference is given in the order of IGP over EGP and EGP over Incomplete. This criterion is based on how BGP learned about the route.

  6. Lowest MED (Multi-Exit Discriminator): The MED attribute is used to convey the preferred path into an AS to external neighbors. The lower the MED value, the more the path is preferred.

  7. eBGP over iBGP: Routes learned via eBGP are preferred over those learned via iBGP because it helps to use external paths and avoid using internal bandwidth.

  8. Shortest IGP path to BGP next hop: The path with the shortest internal path to the next hop is preferred, as it likely offers the best internal route.

  9. Oldest route for eBGP paths: Among eBGP paths, older routes are preferred because they are considered more stable.

  10. Prefer the path with the lowest router ID: If all else is equal, the route advertised by the BGP router with the lowest router ID is chosen.

  11. Prefer the path with the lowest neighbor IP address: As a final tiebreaker, if all other attributes are equal, the route from the neighbor with the lowest IP address is chosen.