Saturday, June 26, 2010

BGP notes on Multi homing

i)Classes of BGP Attributes

1.Well Known a)Mandatory - AS_PATH, NEXT_HOP, ORIGIN
b)Discretionary - LOCAL_PREFERENCE, ATOMIC_AGGREGATE
2.Optional c)Transitive - AGGREGATOR, COMMUNITY
d)Non Transitive - MED(metric)

The well-known attributes must be recognised by anything that runs BGP. If it’s mandatory, then its value must be included in every BGP Update message sent: discretionary attributes do not have to always be sent. Well-known attributes, if included, must be passed along to the next BGP peer.

BGP implementations do not have to understand optional attributes, however if it’s a transitive attribute, it should still be passed to the next BGP peer, even if this one doesn’t know what to do with it. If it’s marked as non-transitive, then the router can simply ignore it, and shouldn’t pass it on, although if does understand it, it can act on it if it wants to.

ii)Some notes on BGP route selection at the time of Multihoming

1.If the router is of Cisco make , straight away make use of the Weight attribute to influence outgoing path from a branch office(in case multiple paths-from Same or Different ISP- are available and u want to load share) using route-mpas. WEIGHT is known to only the local router.
2.If not cisco make, use the local-preference attribute to influence outgoing path from a branch office. Also make use of local peference to influence the exit path, in case there are multiple exit points in the AS.(more than one router) since the local preference attribute is propagated throughout the local AS.
3.To influence the interface on which packets are coming in use prepend-as, (When multi homed to different ISP's, since AS_PATH is well known mandatory)
4. Use MED to influence incoming packets path only when multihomed to same ISP(since MED is optional "non-transitive"), and the ISP recognises MED. MEDs are advertised throughout the local AS.

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 39-7 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 39-7 BGP no-export Community Attribute

In Figure 39-8, 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 39-8 BGP no-advertise Community Attribute

Figure 39-9 demonstrates the internet community attribute. There are no limitations to the scope of the route advertisement from AS 1.

Figure 39-9 BGP internet Community Attribute

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.

http://www.cisco.com/en/US/docs/internetworking/technology/handbook/bgp.html





refer for BGP and MPLS http://www.netcraftsmen.net/resources/archived-articles/373.html