Load Balancing with OSPF

Load balancing is a standard functionality of Cisco IOS Software that is available across all router platforms. It is inherent to the forwarding process in the router, and it enables a router to use multiple paths to a destination when it forwards packets. The number of paths used is limited by the number of entries that the routing protocol puts in the routing table. Four entries is the default in Cisco IOS Software for IP routing protocols except for BGP. BGP has a default of one entry. The maximum number of paths you can configure is 16.

Figure 4-6 shows an example of configuring an OSPF router to load balance across six equal-cost paths.

Figure 4-6 OSPF Equal-Cost Load Balancing

Figure 4-6 OSPF Equal-Cost Load Balancing

The cost (or metric) of an interface in OSPF indicates the overhead that is required to send packets across a certain interface. The cost of an interface is inversely proportional to its bandwidth. A higher bandwidth indicates a lower cost. By default, Cisco routers calculate the cost of an interface based on the bandwidth. However, you can force the cost of an interface with the command ip ospf cost {value} in interface configuration mode.

If equal-cost paths exist to the same destination, the Cisco implementation of OSPF can keep track of up to 16 next hops to the same destination in the routing table (which is called load balancing). By default, the Cisco router supports up to four equal-cost paths to a destination for OSPF. Use the maximum-paths command under the OSPF router process configuration mode to set the number of equal-cost paths in the routing table, as shown in Example 4-8.

Example 4-8 Setting the Number of Equal-Cost Paths in the Routing Table

RouterX(config)

#router ospf 1

RouterX(config-

router)#maximum

paths ?

<1-16> Number

of paths

RouterX(config-

router)#maximum-

paths 3

You can use the show ip route command to find equal-cost routes. Following is an example of the show ip route command output for a specific subnet that has multiple routes available in the routing table. Example 4-9 shows three equal-cost paths to the 194.168.20.0 network.

Example 4-9 Finding Equal-Cost Routes with the show ip route Command

RouterX#show ip route 194.168.20.0

Routing entry for 194.168.20.0/24

Known via "ospf 1", distance 110, metric 74, type intra area

Redistributing via ospf 1

Last update from 10.10.10.1 on Seriall, 00:00:01 ago

Routing Descriptor Blocks:

* 20.20.20.1, from 204.204.204.1, 00:00:01 ago

via Serial2

Route metric is 74, traffic share count is

1

30.30.30.1, from 204.204.204.1, 00:00:01 ago

via Serial3

Route metric is 74, traffic share count is

1

10.10.10.1, from 204.204.204.1, 00:00:01 ago

via Seriall

Route metric is 74, traffic share count is

1

Notice the three routing descriptor blocks. Each block is one available route. Also note the asterisk (*) next to one of the block entries. The asterisk corresponds to the active route that is used for new traffic. The term "new traffic" corresponds to a single packet or an entire flow to a destination, depending on whether the router is performing per-destination or per-packet load balancing.

Was this article helpful?

+15 -6

Responses

  • amina
    How many equal cost paths can be load balanced in ospf?
    1 year ago
  • Uta
    How to uniqeule cost load balancing in ospf?
    1 year ago
  • Roberto
    How add routing table route using load balancer?
    7 months ago
  • Marie Vogel
    How many paths can ospf load balance?
    6 months ago
  • KRISTIN
    Does ospf support load balancing?
    5 months ago
  • Balbo
    How does load balancing is handled in ospf protocol?
    4 months ago
  • kieron
    How many equals cost path does ospf support?
    4 months ago
  • DAVID
    What do we call routes in the routing table with same cost?
    1 month ago
  • kaisa piili
    Is equal cost load balancing enabled by default in ospf3?
    1 month ago
  • mezan
    How to configure ospf for unequal cost load balancing?
    1 month ago
  • karolin
    How to check ospf load balancing?
    12 days ago
  • Pupa
    What is loadbalancing ospf?
    6 hours ago

Post a comment