In this Cisco CCNA training tutorial, you’ll learn about Equal Cost Multi Path, ECMP.
Cisco Equal Cost Multi Path ECMP Video Tutorial
Neil personally went out of his way to help me get the most out of this course, even when the same course was purchased elsewhere. Thank you Neil.
If multiple paths to a destination network have an equal metric, the router will enter all of those paths into the routing table, and it will load balance the outbound traffic to that destination network over those available multiple equal cost paths.
All IGP routing protocols will perform Equal Cost Multi Path by default. They can learn multiple paths to get to the same destination. If those paths have the same cost and it's the best path, it will put them all in the routing table and load balance across all of those paths.
EIGRP is the only routing protocol that is able of Unequal Cost Multi Path if configured manually. EIGRP will not do unequal cost load balancing by default, but it can do it if you.
In our example below, we have R1 on the right and R4 on the left. Let’s take a look at how R4 is going to get to the 10.0.1.0/24 network behind R1. All of the links are the same bandwidth of 100 Mbps, and both paths have to go through three 100 Mbps links.
All of our different routing protocols would see these two paths, top and bottom, as being an equal cost path. In that case, R4 will install two routes into the routing table for the 10.0.1.0 /24 and 10.0.2.0 /24 networks in this example. Half of the traffic will take the path R4 > R3 > R2 > R1, and the other half will take R4 > R5 > R6 > R1.
You can also achieve load balancing with static routes as well. To do that, just configure two different static routes, both for the same subnet and the same subnet mask but in two different next-hops.
That will install two different routes into the routing table and traffic will be load-balanced over both of them. You can have more than two routes if you wanted to. If you put in three routes, it would load-balance over all three.
With our static routes and our IGP routing protocols, the traffic is not going to be load balanced round robin for the same flow. If it gets load balanced to R1, all traffic for that single flow will go through the same router.
But if you've got a different source host talking to a different destination, that will be load balanced onto a different link. The same flow always goes through the same router, but different flows will get load balanced through the different routers.
The reason it does this is that we don't want packets for the same flow going over different paths. It could cause the packets to arrive out of order if there's a longer delay on one path than the other. It can also cause some applications to fail. Thus, a single flow always goes over the same path.
Cisco Equal Cost Multi Path ECMP Configuration Example
This configuration example is taken from my free ‘Cisco CCNA Lab Guide’ which includes over 350 pages of lab exercises and full instructions to set up the lab for free on your laptop.
- Enter the commands below on each router to provision a basic RIPv1 configuration and enable RIP on every interface.
2. Debug the routing protocol updates on R1 with the ‘debug ip rip’ command. Observe the updates being sent and received. What kind of traffic is used (unicast, broadcast or multicast)?
The updates are being sent on the broadcast address 255.255.255.255. All hosts on the subnet must process the packets.
R1#debug ip rip
RIP protocol debugging is on
R1#RIP: sending v1 update to 255.255.255.255 via FastEthernet0/0 (10.0.0.1)
RIP: build update entries
network 10.0.1.0 metric 1
network 10.0.2.0 metric 1
3. Enter the commands below to enable RIPv2 on every router.
4. What kind of traffic is used for the updates now?
The updates are being sent on the RIPv2 multicast address 22.214.171.124. Only RIPv2 routers will process the packets beyond layer 3.
RIP: sending v2 update to 126.96.36.199 via FastEthernet1/0 (10.0.2.1)
5. Turn off all debugging on R1.
All possible debugging has been turned off
6. Check that RIP routes have been added to R1 and it has a route to every subnet in the lab.
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 12 subnets, 2 masks
C 10.0.0.0/24 is directly connected, FastEthernet0/0
L 10.0.0.1/32 is directly connected, FastEthernet0/0
C 10.0.1.0/24 is directly connected, FastEthernet0/1
L 10.0.1.1/32 is directly connected, FastEthernet0/1
C 10.0.2.0/24 is directly connected, FastEthernet1/0
L 10.0.2.1/32 is directly connected, FastEthernet1/0
C 10.0.3.0/24 is directly connected, FastEthernet1/1
L 10.0.3.1/32 is directly connected, FastEthernet1/1
R 10.1.0.0/24 [120/1] via 10.0.0.2, 00:00:08, FastEthernet0/0
R 10.1.1.0/24 [120/2] via 10.0.0.2, 00:00:08, FastEthernet0/0
[120/2] via 10.0.3.2, 00:00:24, FastEthernet1/1
R 10.1.2.0/24 [120/2] via 10.0.3.2, 00:00:24, FastEthernet1/1
R 10.1.3.0/24 [120/1] via 10.0.3.2, 00:00:24, FastEthernet1/1
7. Why are there two routes to the 10.1.1.0/24 network in the routing table?
Two paths to 10.1.1.0/24 have an equal metric – a hop count of 2. Both routes are installed in the routing table and the router will perform Equal Cost Load Balancing between the next hops of 10.0.3.2 and 10.0.0.2.
How to configure equal-cost multi-path in OSPF: https://www.techrepublic.com/article/how-to-configure-equal-cost-multi-path-in-ospf/
Text by Libby Teofilo, Technical Writer at www.flackbox.com
With a mission to spread network awareness through writing, Libby consistently immerses herself into the unrelenting process of knowledge acquisition and dissemination. If not engrossed in technology, you might see her with a book in one hand and a coffee in the other.