BGP Attributes

BGP has a number of complex attributes used to determine a path to a remote network. These attributes allow greater flexibility and enable a complex routing decision to ensure that the path to a remote network is the best possible path.

The network designer can also manipulate these attributes. BGP, when supplied with multiple paths to a remote network, always chooses a single path to a specific destination. (Load balancing is possible with static routes.) BGP always propagates the best path to any peers.

BGP attributes are carried in update packets.

Table 6-1 describes the well-known and optional attributes used in BGP4.

Table 6-1. Well-Known and Optional BGP Attributes

Attribute Description
Origin This attribute is mandatory and defines the origin of the path and can have three different values:
  • IGP indicates the remote path originated from within the AS. Typically, when the network command or redistribution is configured, BGP installs the network with an origin set to IGP.
  • EBG means learned through an External Gateway Protocol.
  • Incomplete means the BGP route was discovered using redistribution or static routers.
AS_Path This attribute describes the sequence of autonomous systems that the packet has traversed.
Next Hop This attribute describes the next hop address taken to a remote path, typically the BGP peer.
Local Preference This attribute indicates to the AS the preferred path to exit the AS. A higher local preference is always preferred.
MED Multiexit Discriminator informs BGP peers in other autonomous systems which path to take to a remote network. A lower MED is always preferred.
Weight This Cisco-only attribute is used in local router selection. Weight is not sent to other BGP peers, and a higher weight value is always preferred. The weight value is between 0–294967295.
Atomic This attribute advises BGP routers that aggregation has taken place and is not used in the router-selection process.
Aggregator This is the router ID responsible for aggregation and is not used in the router-selection process.
Community Communities allow routes to be tagged for use with a group of routers sharing the same characteristics.
Originator ID This attribute is used to prevent routing loops. This information is not used for router selection.
Cluster-List This attribute is used in route-reflector environments. This information is not used for router selection.

Internal BGP (IBGP) and External BGP (EBGP) are the two types of BGP sessions. IBGP is a connection between two BGP speakers in the same AS. EBGP is a connection between two BGP speakers in different autonomous systems.

Figure 6-1 displays a simple three-router BGP topology and the different BGP connection types: IBGP and EBGP.

IBGP peers also make certain that routing loops cannot occur by ensuring that any routes sent to another AS are known through an interior routing protocol, such as Open Shortest Path First (OSPF), before sending the route information. In other words, the routers must be synchronized. The benefit of this additional rule in IBGP TCP sessions is that information is not sent unless the remote path is reachable, which reduces any unnecessary traffic, and, therefore, saves bandwidth. You can disable this feature with the no synchronization command, which is covered later in this chapter.

The BGP routing decision is quite complex and takes into account the attributes listed in Table 6-1.

The process a Cisco router running BGP4 takes is as follows:

  1. If the next hop address is reachable, consider it.
  2. Prefer the route with the highest weight (Cisco IOS routers only).
  3. If the weight is the same, prefer the largest local preference attribute.
  4. If the local preference is the same, prefer the route this local router originated.
  5. Prefer the route with the shortest AS path.
  6. If this is equal, prefer the route with the origin set to originated (through BGP); IGP is preferred to EGP followed by incomplete.
  7. If the origin codes are the same, prefer the route with the lowest MED.
  8. If the MED is the same, prefer EBGP over IBGP.
  9. Prefer the closest path.
  10. Finally, if all paths are equal, prefer the path with lowest BGP router ID.

+ Share This