Before a BGP peer forming neighborship with a remote BGP peer, it must pass through several states:
- Idle
- Connect
- Active
- OpenSent
- OpenConfirm
- Established
To view the state of local router, use command:
In Active state, R1 is trying to send TCP request to R2, if connection establishes successfully, R1 will send Open message and transitions to OpenSent state.
When R1 reaches OpenSent state, it will send to R2 Open message, if valid Open message received, Keepalive message will be sent to negotiate session parameters and R1 goes to OpenConfirm state.
In OpenConfirm state, R1 keeps sending Keepalive message, and when it received Keepalive from R2, final state Established reached.
BGP choose route highily based on the values of path attributes. This post considers some well-known attributes which router must regconize.
- Origin: this attribute states out the originally of route, maybe the route from IGP - i, or EGP - e, or undetermined - ?. i < e < ? and lower value is prefered.
- AS Path: lists all traversed AS, used to choose the best route and prevents routing loop. This value is only changed when advertised through eBGP.
- Next hop: next hop address, only modified when received from an eBGP peer. Must appear in routing table.
- Multiple Exit Discriminator (MED): optional, nontransitive, eBGP advertises to iBGPs to help choosing route when multiple routes exist. iBGP does not readvertise to eBGP.
- Local Preference: locally value, never advertised to eBGP. This value is used to consider routes in the same AS. Higher value is prefered.
The route selection process depends on each vendor. For Cisco, it is:
- Weight - highest (Cisco proprietary)
- Local preference - highest
- locally originated
- AS Path - shortest
- Origin (i
- MED - lowest
- eBGP>iBGP
- IGP metric - lowest
- oldest route
- neighbor with lowest RID
- neighbor with lowest IP address.
- Highest Local preference
- AS Path - shortest
- Origin - smallest
- MED - smallest
- eBGP > iBGP
- IGP metric - smallest
No comments:
Post a Comment