Posted on August 7, 2020 7:56 pm
 |  Asked by Andreas Agrafiotis
 |  141 views
Tags:
RESOLVED
0
0
Print Friendly, PDF & Email

Hello,

In a switch configured for ECMP, what is the difference between ECMP head and ECMP paths?

sh ip bgp

* >Ec …
* ec …

0
Answered on August 8, 2020 5:59 am

Hi Andreas,

Thank you for contacting us.

When you have configured BGP ECMP(maximum-paths <m> ecmp <n>) under router bgp configuration mode  to do load-balancing on your switch, that BGP route which is marked as "ECMP head"(Ec) is chosen as the best route by the BGP agent on the local switch and is advertised to the other BGP neighbors.

Below is a lab setup example of the same.we have two devices switch1 and its eBGP neighbor switch2.

switch1#show ip bgp summ
BGP summary information for VRF default
Router identifier 57.99.50.35, local AS number 65001
Neighbor Status Codes: m - Under maintenance
Neighbor V AS MsgRcvd MsgSent InQ OutQ Up/Down State PfxRcd PfxAcc
30.30.30.35 4 65001 50 44 0 0 00:07:06 Estab 1 1
172.20.65.35 4 65001 50 42 0 0 00:07:04 Estab 1 1
210.210.210.53 4 65002 36 43 0 0 00:07:09 Estab 0 0       >>This is the eBGP neighbor i.e switch2.

switch1#show run sec bgp
router bgp 65001
maximum-paths 2 ecmp 2
neighbor 30.30.30.35 remote-as 65001
neighbor 30.30.30.35 maximum-routes 12000
neighbor 172.20.65.35 remote-as 65001
neighbor 172.20.65.35 maximum-routes 12000
neighbor 210.210.210.53 remote-as 65002      >>>> this ebgp neighbor (210.210.210.53) is switch2 as you can see below
neighbor 210.210.210.53 send-community

switch2#show ip int brief | in 210.210.210.53
Ethernet4 210.210.210.53/24 up up 1500

Now switch1 gets 2 iBGP default routes from its iBGP peers :

switch1#show ip bgp
BGP routing table information for VRF default
Router identifier 57.99.50.35, local AS number 65001
Route status codes: s - suppressed, * - valid, > - active, # - not installed, E - ECMP head, e - ECMP
S - Stale, c - Contributing to ECMP, b - backup, L - labeled-unicast
Origin codes: i - IGP, e - EGP, ? - incomplete
AS Path Attributes: Or-ID - Originator ID, C-LST - Cluster List, LL Nexthop - Link Local Nexthop

Network Next Hop Metric LocPref Weight Path
* >Ec 0.0.0.0/0 30.30.30.35 0 100 0 ?
* ec 0.0.0.0/0 172.20.65.35 0 100 0 ?

As can be seen above there are 2 default routes received from different iBGP neighbors on switch1 which are used for load-balancing

switch1#show ip bgp 0.0.0.0/0
BGP routing table information for VRF default
Router identifier 57.99.50.35, local AS number 65001
BGP routing table entry for 0.0.0.0/0
Paths: 2 available
Local
30.30.30.35 from 30.30.30.35 (3.3.3.3)
Origin INCOMPLETE, metric 0, localpref 100, IGP metric 1, weight 0, received 00:08:31 ago, valid, internal, ECMP head, ECMP, best, ECMP contributor
Community: 65001:10
Rx SAFI: Unicast
Local
172.20.65.35 from 172.20.65.35 (3.3.3.3)
Origin INCOMPLETE, metric 0, localpref 100, IGP metric 1, weight 0, received 00:08:29 ago, valid, internal, ECMP, ECMP contributor
Community: 65001:20
Rx SAFI: Unicast

The default route from the neighbor 30.30.30.35  is marked as ECMP head which means that its determined to be the best route by the bgp agent on the device(i.e on switch1 here).

switch1#show ip route 0.0.0.0

VRF: default
Codes: C - connected, S - static, K - kernel,
O - OSPF, IA - OSPF inter area, E1 - OSPF external type 1,
E2 - OSPF external type 2, N1 - OSPF NSSA external type 1,
N2 - OSPF NSSA external type2, B I - iBGP, B E - eBGP,
R - RIP, I L1 - IS-IS level 1, I L2 - IS-IS level 2,
O3 - OSPFv3, A B - BGP Aggregate, A O - OSPF Summary,
NG - Nexthop Group Static Route, V - VXLAN Control Service,
DH - DHCP client installed default route, M - Martian,
DP - Dynamic Policy Route, L - VRF Leaked

Gateway of last resort:
B I 0.0.0.0/0 [200/0] via 30.30.30.35, Ethernet3
via 172.20.65.35, Ethernet4

 

Though both default routes are installed in the routing table since ECMP is configured, only the route marked as best, ie 1 of them will be advertised to the other BGP neighbors by switch1 as you can see below :

switch1#show ip bgp neighbors 210.210.210.53 advertised-routes >>>>>> routes sent to the eBGP neighbor i.e switch2
BGP routing table information for VRF default
Router identifier 57.99.50.35, local AS number 65001
Route status codes: s - suppressed, * - valid, > - active, # - not installed, E - ECMP head, e - ECMP
S - Stale, c - Contributing to ECMP, b - backup, L - labeled-unicast
Origin codes: i - IGP, e - EGP, ? - incomplete
AS Path Attributes: Or-ID - Originator ID, C-LST - Cluster List, LL Nexthop - Link Local Nexthop

Network Next Hop Metric LocPref Weight Path
* >Ec 0.0.0.0/0 210.210.210.36 - - - 65001 ?

switch2#show ip bgp 0.0.0.0
BGP routing table information for VRF default
Router identifier 50.50.50.53, local AS number 65002
BGP routing table entry for 0.0.0.0/0
Paths: 1 available
65001
210.210.210.36 from 210.210.210.36 (57.99.50.35)
Origin INCOMPLETE, metric -, localpref 100, weight 0, valid, external, best
Community: 65001:10

switch2 receives that BGP route that was marked by switch1 as ECMP head(Ec) or in other words best, and installs it in its routing table.

In short,

* >Ec 0.0.0.0/0 30.30.30.35 0 100 0 ?      ------>ECMP Head(Marked as Best route)  ----->Advertised to BGP peers
* ec 0.0.0.0/0 172.20.65.35 0 100 0 ?         ------->ECMP contributor                               ----->Not-advertised to BGP peers.

 

Thanks,

Bhavana.

Post your Answer

You must be logged in to post an answer.