Table of Contents

OSPF Training

06:18:51 Hours
27 Lectures


CCIE Enterprise Infrastructure Training

117:12:56 Hours
287 Lectures


Cisco CCIE Service Provider Training

96:02:27 Hours
242 Lectures


OSPF Load Balancing

OSPF Load Balancing is to place multiple next-hops into the Routing and Forwarding table for a given IP destination prefix. In this post, we will look at OSPF Load Balancing, OSPF Load Sharing, OSPF ECMP, OSPF UCMP, where we should use it, where we shouldn't use it, and what can be dangerous if we have OSPF Load balancing will be explained.

OSPF Equal Cost Load Balancing - OSPF ECMP

What is OSPF Equal Cost Load Balancing let's have a look at the below topology and let's try to understand?

In the above topology, the network is connected to Router D. As a link-state routing protocol, OSPF routers in the network would know that the subnet is connected to Router D. And they would run SPF/Dijkstra algorithm to calculate the shortest path to this destination. In the above topology, Interface costs are shown. When we look at Router A to subnet, we have two paths. A-B-D and A-C-D. Both of the paths' total cost is 10+10 = 20.

Thus, Router A can do load balancing for that destination prefix. When OSPF has two paths, we don't need to enter manually any command, it installs the next hops into the routing table automatically. So, in the above topology, Router A installs both Router B and Router C into its routing table as the next hops for the destination subnet

This is called OSPF ECMP - OSPF Equal Cost Multipath, OSPF Load Balancing, or OSPF Load Sharing, basically all are the same thing. It is called ECMP, because both paths' total cumulative costs are equal, which is 20 in the above topology.

OSPF Unequal Cost Multi Path

This time, let's have a look at OSPF UCMP, Unequal Cost Multi-Path. OSPF doesn't normally support UCMP. In the IEFT there was a Draft for it but never got implemented. Today, if you have an OSPF network and want to use available paths but their cumulative costs are not the same, you can do PBR - Policy-Based routing, you can deploy RSVP or Segment Routing Traffic Engineering to push the traffic to the non-shortest paths as well. Otherwise, if cumulative costs are not the same, only the shortest path is used.

Created by
Orhan Ergun

Orhan Ergun, CCIE/CCDE Trainer, Author of Many Networking Books, Network Design Advisor, and Cisco Champion 2019/2020/2021

He created OrhanErgun.Net 10 years ago and has been serving the IT industry with his renowned and awarded training.

Wrote many books, mostly on Network Design, joined many IETF RFCs, gave Public talks at many Forums, and mentored thousands of his students.  

Today, with his carefully selected instructors, OrhanErgun.Net is providing IT courses to tens of thousands of IT engineers. 

View profile