TransWikia.com

Why does Junos find multiple next hops only for the active prefix in case BGP multipath is enabled?

Network Engineering Asked on October 12, 2020

I have a Juniper router named r3 with one established eBGP session to router t1(172.16.0.14) and with second established eBGP session to router t2(172.16.0.18). BGP configuration of r3 can be seen below:

root@r3> show configuration protocols bgp group t1-t2    
type external;
peer-as 65222;
multipath;
neighbor 172.16.0.14;
neighbor 172.16.0.18;

root@r3> 

r3 receives the 1.1.1.1/32 prefix over both sessions:

root@r3> show route receive-protocol bgp 172.16.0.14 1.1.1.1/32    

inet.0: 71 destinations, 84 routes (60 active, 0 holddown, 11 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 1.1.1.1/32              172.16.0.14                             65222 I

root@r3> show route receive-protocol bgp 172.16.0.18 1.1.1.1/32    

inet.0: 71 destinations, 84 routes (60 active, 0 holddown, 11 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
  1.1.1.1/32              172.16.0.18                             65222 I

root@r3> 

Thanks to multipath configuration option both the 172.16.0.14 and 172.16.0.18 are next-hops for the 1.1.1.1/32 prefix in case of the active route announced by the t1(172.16.0.14) which has the lower RID than the t2. However, only the active route has two next hops calculated:

root@r3> show route 1.1.1.1 detail 

inet.0: 71 destinations, 84 routes (60 active, 0 holddown, 11 hidden)
1.1.1.1/32 (2 entries, 1 announced)
        *BGP    Preference: 170/-101
                Next hop type: Router, Next hop index: 0
                Address: 0xb634310
                Next-hop reference count: 10
                Source: 172.16.0.14
                Next hop: 172.16.0.14 via ge-0/0/4.0, selected
                Session Id: 0x0
                Next hop: 172.16.0.18 via ge-0/0/7.0
                Session Id: 0x0
                State: <Active Ext>
                Local AS: 65000 Peer AS: 65222
                Age: 2:42 
                Validation State: unverified 
                Task: BGP_65222.172.16.0.14+40876
                Announcement bits (4): 0-KRT 4-BGP_RT_Background 5-Resolve tree 1 7-BGP_RT_Background 
                AS path: 65222 I 
                Accepted Multipath
                Localpref: 100
                Router ID: 4.4.4.4
         BGP    Preference: 170/-101
                Next hop type: Router, Next hop index: 0
                Address: 0xd2ecab0
                Next-hop reference count: 9
                Source: 172.16.0.18
                Next hop: 172.16.0.18 via ge-0/0/7.0, selected
                Session Id: 0x0
                State: <NotBest Ext>
                Inactive reason: Not Best in its group - Active preferred
                Local AS: 65000 Peer AS: 65222
                Age: 6:54 
                Validation State: unverified 
                Task: BGP_65222.172.16.0.18+58923
                AS path: 65222 I 
                Accepted MultipathContrib
                Localpref: 100
                Router ID: 5.5.5.5

root@r3> 

Is this some sort of optimization in Junos that the recursive next hops are found only for the active route?

One Answer

If you do show route 1.1.1.1/32 extensive you should see another field Junos calls protocol next-hop which may be less confusing. In the output you've pasted, it is listing all selected, adjacent next-hops, which are determined by resolving the next-hops to the protocol next-hop.

For example, if the protocol next-hop 198.51.100.100 is several layer-3 hops away, and the RIB contains two equal OSPF-learnt routes to 198.51.100.100, the type of display you've pasted would include those two OSPF-learnt next-hops in the active route stanza.

It would be better if Junos labeled these fields differently. We always have to keep in mind next-hop has a complex meaning in the context of BGP.

Answered by Jeff Wheeler on October 12, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP