Monday, April 04, 2005

How the Best Path Algorithm Works in BGP-4

BGP assigns the first valid path as the current best path. It then compares the best path with the next path in
list, until it reaches the end of the list of valid paths. The following is a list of rules used to determine the best
path.
Prefer the path with the highest WEIGHT.
Note: WEIGHT is a Cisco-specific parameter, local to the router on which it's configured.

1.Prefer the path with the highest LOCAL_PREF. Note the following:
Path without LOCAL_PREF is considered as having the value set with the bgp default
local-preference command, or 100 by default.

2.Prefer the path that was locally originated via a network or aggregate BGP subcommand, or through
redistribution from an IGP. Local paths sourced by network or redistribute commands are preferred
over local aggregates sourced by the aggregate-address command.

3.Prefer the path with the shortest AS_PATH. Note the following:
¨ This step is skipped if bgp bestpath as-path ignore is configured.
¨ An AS_SET counts as 1, no matter how many ASs are in the set.
The AS_CONFED_SEQUENCE and AS_CONFED_SET are not included in the AS_PATH length.

4.Prefer the path with the lowest origin type: IGP is lower than EGP, and EGP is lower than INCOMPLETE.

5.Prefer the path with the lowest multi-exit discriminator (MED). Note the following:
This comparison is only done if the first (neighboring) AS is the same in the two paths; any confederation sub-ASs are ignored. In other words, MEDs are compared only if the first AS in the AS_SEQUENCE is the same for multiple paths. Any preceding AS_CONFED_SEQUENCE is ignored.

If bgp always-compare-med is enabled, MEDs are compared for all paths. This option needs to be enabled over the entire AS, otherwise routing loops can occur.

If bgp bestpath med-confed is enabled, MEDs are compared for all paths that consist only of AS_CONFED_SEQUENCE (paths originated within the local confederation).

Paths received from a neighbor with a MED of 4,294,967,295 will have the MED changed to 4,294,967,294 before insertion into the BGP table.

Paths received with no MED are assigned a MED of 0, unless bgp bestpath missing-as-worst is enabled, in which case they are assigned a MED of 4,294,967,294.

Coming up on how-to connect to 2 ISP's or in other words Multi-homing and so too on how-to load balance on links using BGP.

Source : Cisco TechNotes


Nitin :)

0 Comments:

Post a Comment

<< Home