BGP support a wide variety of path attribute, BGP chooses a route to a network based on the attributes of its path.
Four categories of attributes exist are as follows:-
- Well-know mandatory
- Well-known discretionary
- Optional transitive
- Optional non-transitive
Well-known mandatory attribute must be recognized by all BGP routers, present in all BGP updates, and passed on to other BGP routers. AS path, origin, and next hop.
Well-known discretionary must be recognized by all BGP routers and passed on to other BGP routers but need not be present in an update. Local preference
Optional transitive might or might not be recognized by a BGP router but is passed on to other BGP routers.
If not recognized, it is marked as partial. Aggregation, community.
Optional non-transitive If the BGP process does not recognize the attribute then it can ignore the update and not advertise the path to its peer. Multi-exit discriminator (MED), originator ID
AS_Path attribute- this particular path attribute lists the autonomous system numbers in the end-to-end path.BGP uses AS_Path as its primary loop-prevention tool.
AS_Path attribute is a well-known mandatory attribute. its list of AS through which updates are coming. The shortest AS_PATH list is more desirable.
Next_hop is a well-known, mandatory attribute next hop means IP address to reach next autonomous system because BGP is AS by AS routing protocol.
origin informs all AS in internetwork how network got introduced into BGP.
(i) represent IGP
(e) represent EBGP
(?) represent incomplete
Weight Attribute is a cisco’s attribute. its tell how to exit the AS, path with the highest weight is more desirable. weight is partial attribute, by default weight 0 learn route 32,769 for locally injected routes. its local to the router not advertise to any BGP peers.
Local Preference Attribute
Local preference define how to data traffic should exit from an Autonomous system. path with highest preference value is more desirable by default is 100, and the range 0 through 232 local preference is well known, discretionary attribute it is advertise only to iBGP neighbor within an Autonomous system.
R3#show ip bgp
BGP table version is 5, local router ID is 22.214.171.124
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i – IGP, e – EGP, ? – incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
r>i 10.0.0.0 126.96.36.199 0 100 0 i
r>i 188.8.131.52 184.108.40.206 0 100 0 i
*> 220.127.116.11 0.0.0.0 0 32768 i
r>i 18.104.22.168 22.214.171.124 0 100 0 i