Saturday, 1 February 2020

Multi-Exit Discriminator


Here R5 getting updates from R3 , R4 and as well as R1.
R5#sh ip bgp
BGP table version is 66, local router ID is 150.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*  6.1.0.0/16       155.1.57.7                             0 100 600 i
*>                         155.1.35.3                             0 100 600 i
*                           150.4.4.4                              0 500 500 500 500 400 100 600 i
*  6.2.0.0/16       155.1.57.7                             0 100 600 i
*>                         155.1.35.3                             0 100 600 i
*                           150.4.4.4                              0 500 500 500 500 400 100 600 i
*  6.3.0.0/16       155.1.57.7                             0 100 600 i
*>                         155.1.35.3                             0 100 600 i
*                           150.4.4.4                              0 500 500 500 500 400 100 600 i

But why R5 choosing R3 as it best and valid path. Lets shutdown the neighbor R3 and lets wait for sometime
R5(config)#router bgp 500
R5(config-router)#neighbor 155.1.35.3 shutdown

R5#sh ip bgp su
BGP router identifier 150.5.5.5, local AS number 500
BGP table version is 23, main routing table version 23
12 network entries using 1404 bytes of memory
17 path entries using 884 bytes of memory
11/4 BGP path/bestpath attribute entries using 1364 bytes of memory
9 BGP AS-PATH entries using 248 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 3900 total bytes of memory
BGP activity 58/46 prefixes, 187/170 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
150.4.4.4       4   400     524     588       23    0    0 00:07:57        8
155.1.35.3      4   100     519     582        0    0    0 00:00:18 Idle (Admin)
155.1.57.7      4   100     209     201       23    0    0 00:08:00        6

Now lets re enable the neighborship.

R5#sh ip bgp
BGP table version is 26, local router ID is 150.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*  6.1.0.0/16        155.1.35.3                             0 100 600 i
*>                          155.1.57.7                             0 100 600 i
*                            150.4.4.4                              0 500 500 500 500 400 100 600 i
*  6.2.0.0/16        155.1.35.3                             0 100 600 i
*>                          155.1.57.7                             0 100 600 i
*                            150.4.4.4                              0 500 500 500 500 400 100 600 i
*  6.3.0.0/16        155.1.35.3                             0 100 600 i
*>                          155.1.57.7                             0 100 600 i
*                            150.4.4.4                              0 500 500 500 500 400 100 600 i

Now its using R7 route as best and valid path but why????
BGP path selection process

Highest Weight
Highest Local Preference
Router originator routes
Shortest AS path
Origin code
Lowest MED
eBGP over iBGP
Shortest IGP metric Note for iBGP
Oldest Path Note for eBGP ==========> Here the tie breaker.

R5#sh ip bgp su
BGP router identifier 150.5.5.5, local AS number 500
BGP table version is 26, main routing table version 26
12 network entries using 1404 bytes of memory
25 path entries using 1300 bytes of memory
11/4 BGP path/bestpath attribute entries using 1364 bytes of memory
9 BGP AS-PATH entries using 248 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 4316 total bytes of memory
BGP activity 58/46 prefixes, 195/170 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
150.4.4.4       4   400     535     599       26    0    0 00:13:48        8
155.1.35.3      4   100     538     600       26    0    0 00:05:40        8
155.1.57.7      4   100     217     211       26    0    0 00:13:51        6


So here we are going to change the metric MED value.

R5#sh ip bgp
BGP table version is 32, local router ID is 150.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 6.1.0.0/16       155.1.35.3                             0 100 600 i
*                            155.1.57.7              50             0 100 600 i
*                            150.4.4.4                              0 500 500 500 500 400 100 600 i
*> 6.2.0.0/16       155.1.35.3                             0 100 600 i
*                            155.1.57.7              50             0 100 600 i
*                             150.4.4.4                              0 500 500 500 500 400 100 600 i
*> 6.3.0.0/16       155.1.35.3                             0 100 600 i
*                             155.1.57.7              50             0 100 600 i
*                             150.4.4.4                              0 500 500 500 500 400 100 600 i

Now R5 started to select R3 as its beat and valid path because the metric MED its getting form R7 is 50 and from R3 its 0 since the lowest metric MED we are getting via R3.

Now look on R7 advertising the prefixes with the metric NULL .
This NULL metric MED is treated 2 ways.
Lets have a look each of them

R5#sh ip bgp
BGP table version is 32, local router ID is 150.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 6.1.0.0/16       155.1.35.3                             0 100 600 i
*                            155.1.57.7              50             0 100 600 i
*                            150.4.4.4                              0 500 500 500 500 400 100 600 i
*> 6.2.0.0/16       155.1.35.3                             0 100 600 i
*                            155.1.57.7              50             0 100 600 i
*                             150.4.4.4                              0 500 500 500 500 400 100 600 i
*> 6.3.0.0/16       155.1.35.3                             0 100 600 i
*                             155.1.57.7              50             0 100 600 i
*                             150.4.4.4                              0 500 500 500 500 400 100 600 i

By default BGP taking the NULL metric MED as Missing MED as best MED.

Now lets change the missing MED as the worst metric.

R5(config)#router bgp 500
R5(config-router)#bgp bestpath med missing-as-worst

R5#sh ip bgp
BGP table version is 37, local router ID is 150.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 6.1.0.0/16       155.1.57.7              50             0 100 600 i
*                             155.1.35.3      4294967295             0 100 600 i
*                              150.4.4.4       4294967295             0 500 500 500 500 400 100 600 i
*> 6.2.0.0/16       155.1.57.7              50             0 100 600 i
*                             155.1.35.3      4294967295             0 100 600 i
*                              150.4.4.4       4294967295             0 500 500 500 500 400 100 600 i
*> 6.3.0.0/16       155.1.57.7              50             0 100 600 i
*                            155.1.35.3      4294967295             0 100 600 i
*                             150.4.4.4       4294967295             0 500 500 500 500 400 100 600 i

Note the metric is changed to the maximum value (i.e) 4294967295

No comments:

Post a Comment