Friday 13 March 2015

BGP (Cont.)

Origin Attribute

The origin attribute indicates how BGP learned about a particular route. The origin attribute can have one of three possible values:
  • IGP - The route is interior to the originating AS. This value is set when the network router configuration command is used to inject the route into BGP.
  • EGP - The route is learned via the Exterior Border Gateway Protocol (EBGP).
  • Incomplete - The origin of the route is unknown or learned in some other way. An origin of incomplete occurs when a route is redistributed into BGP.
The origin attribute is used for route selection and will be covered in the next section.

AS_path Attribute

When a route advertisement passes through an autonomous system, the AS number is added to an ordered list of AS numbers that the route advertisement has traversed. Figure: BGP AS-path Attribute shows the situation in which a route is passing through three autonomous systems.
Figure: BGP AS-path Attribute
CT843905.jpg
AS1 originates the route to 172.16.1.0 and advertises this route to AS 2 and AS 3, with the AS_path attribute equal to {1}. AS 3 will advertise back to AS 1 with AS-path attribute {3,1}, and AS 2 will advertise back to AS 1 with AS-path attribute {2,1}. AS 1 will reject these routes when its own AS number is detected in the route advertisement. This is the mechanism that BGP uses to detect routing loops. AS 2 and AS 3 propagate the route to each other with their AS numbers added to the AS_path attribute. These routes will not be installed in the IP routing table because AS 2 and AS 3 are learning a route to 172.16.1.0 from AS 1 with a shorter AS_path list.

Next-Hop Attribute

The EBGP next-hop attribute is the IP address that is used to reach the advertising router. For EBGP peers, the next-hop address is the IP address of the connection between the peers. For IBGP, the EBGP next-hop address is carried into the local AS, as illustrated in Figure: BGP Next-Hop Attribute.
Figure: BGP Next-Hop Attribute
CT843906.jpg
Router C advertises network 172.16.1.0 with a next hop of 10.1.1.1. When Router A propagates this route within its own AS, the EBGP next-hop information is preserved. If Router B does not have routing information regarding the next hop, the route will be discarded. Therefore, it is important to have an IGP running in the AS to propagate next-hop routing information.

Community Attribute

The community attribute provides a way of grouping destinations, called communities, to which routing decisions (such as acceptance, preference, and redistribution) can be applied. Route maps are used to set the community attribute. Predefined community attributes are listed here:
  • no-export - Do not advertise this route to EBGP peers.
  • no-advertise - Do not advertise this route to any peer.
  • internet - Advertise this route to the Internet community; all routers in the network belong to it.
Figure: BGP no-export Community Attribute illustrates the no-export community. AS 1 advertises 172.16.1.0 to AS 2 with the community attribute no-export. AS 2 will propagate the route throughout AS 2 but will not send this route to AS 3 or any other external AS.
Figure: BGP no-export Community Attribute
CT843907.jpg
In Figure: BGP no-advertise Community Attribute, AS 1 advertises 172.16.1.0 to AS 2 with the community attribute no-advertise. Router B in AS 2 will not advertise this route to any other router.
Figure: BGP no-advertise Community Attribute
CT843908.jpg

Figure: BGP internet Community Attribute demonstrates the internet community attribute. There are no limitations to the scope of the route advertisement from AS 1.

Figure: BGP internet Community Attribute
CT843909.jpg

BGP Path Selection: - 
BGP could possibly receive multiple advertisements for the same route from multiple sources. BGP selects only one path as the best path. When the path is selected, BGP puts the selected path in the IP routing table and propagates the path to its neighbors. BGP uses the following criteria, in the order presented, to select a path for a destination:
  • If the path specifies a next hop that is inaccessible, drop the update.
  • Prefer the path with the largest weight.
  • If the weights are the same, prefer the path with the largest local preference.
  • If the local preferences are the same, prefer the path that was originated by BGP running on this router.
  • If no route was originated, prefer the route that has the shortest AS_path.
  • If all paths have the same AS_path length, prefer the path with the lowest origin type (where IGP is lower than EGP, and EGP is lower than incomplete).
  • If the origin codes are the same, prefer the path with the lowest MED attribute.
  • If the paths have the same MED, prefer the external path over the internal path.
  • If the paths are still the same, prefer the path through the closest IGP neighbor.
  • Prefer the path with the lowest IP address, as specified by the BGP router ID.

No comments:

Post a Comment