OSPF loadbalance

4 is the default number of routes that OSPF will include in routing table if more than 4 equal cost routes exist for the same subnet. However, OSPF can include up to 16  equal cost routes in the routing table and  perform load balancing amongst them. In order to configure this feature, you need to use the  OSPF subcommand maximum-paths, i.e. maximum-paths 16.

OSPF uses Link cost as a metric not hop count.

etwork Type Cost
FDDI/Fast Ethernet 1
Token Ring (16Mbps) 6
Ethernet 10
E1 48
T1 64
64 kb/s 1562
56 kb/s 1785

Maximum paths EIGRP defaults to 4 paths for load balancing but the maximum that can be set is 16.

When multiple routes are installed in the routing table, Cisco switch will depends on CEF to pick the route. By default CEF will use src-dst IP pair to select route path, however there might be CEF polarization problem.



Stub/totally stub/nssa/totally nssa

Stub area: LSA type 1/2/3 are allowed, LSA type 4/5/7 are not allowed, no ASBR is allowed default route is injected automatically when stub area is configured on ABR

Totally stub area: LSA type 1/2 are allowed,,a default route is injected automatically, this default route is an only allowed type 3 LSA. LSA type 4/5/7 are not allowed.

Not so stub area: LSA type 1/2/3/7 is allowed, LSA type 4/5 are not allowed, ASBR is allowed. default route need to be configured manually with command: area <area id> nssa default-information originate. This default route will be advertisized as LSA type 7

Totally Not So Stub area: LSA type 3/4/5 is not allowed, LSA type 1/2/7 allowed. default route need to be configured manually with command: area <area id> nssa default-information originate. This default route will be advertisized as LSA type 7

When OSPF do recalculation

1, When there is update of LSA type 1 and type 2, recalculation will be done for the entire routing table,  started with shortest path calculation for each area. not just in the area that link state database has changed.

2, When there is update of LSA type 3, network summary, the recalculation will be done partially. Specially, the destination described in the network summary LSA will be recalculated, if the destination is ABR, it may also need to re-examine all external LSA types.

3, When there is update of LSA type 5 or 7, the destination described in the external LSA will be recalculated.

default-information originate in different routing protocols


To generate a default route into Routing Information Protocol (RIP), use the default-informationoriginate command in router configuration mode. To disable this feature, use the no form of this command.


router rip 
 version 2
 default-information originate route-map condition
route-map condition permit 10
 match ip address 10
 set interface s1/0
access-list 10 permit
setinterface Indicates where to forward packets that pass a match clause of a route map for policy routing.


Default routes injected into a normal area can be originated by any OSPF router. The OSPF router does not, by default, generate a default route into the OSPF domain. In order for OSPF to generate a default route, you must use the default-information originate command.

There are two ways to advertise a default route into a normal area. The first is to advertise into the OSPF domain, provided the advertising router already has a default route. The second is to advertise regardless of whether the advertising router already has a default route. The second method can be accomplished by adding the keyword always to the default-information originate command.


router ospf 2
 network area 1
 network area 0
 default-information originate
ip route

Because it has a default route, Router originates a type 5 LSA with a link ID of This is the result of the default-information originate command in its OSPF configuration.You can also add the always keyword to the default-information originate command to make a router originate a type 5 LSA even if the router does not have a default route in its routing table.


refer to item 6 in


The default-information originate, redistribution from a different source, and network are all similar in the resulting effect: they will inject the default route into BGP RIB and it will be advertised to all BGP neighbors. The difference is in the origin of the default route that is injected into BGP:

  • default-information originate causes the default route to be artificially generated and injected into the BGP RIB, regardlessly of whether it is present in the routing table.
  • Redistribution and network will inject the default route into BGP only if the default route is currently present in the routing table, and additionally in the case of redistribution, if learned by a specific source protocol we are redistributing from.

The neighbor X.X.X.X default-originate is different in that the default route will be advertised only to this specific BGP neighbor and not to all existing BGP neighbors as with the previous approaches. The default route will not be present in the BGP RIB of the router that is configured with the neighbor X.X.X.X default-originate command and so it won’t be generally advertised to all BGP neighbors. At the same time, this command is similar to the default-information originate in that the default route is artificially generated and does not need to be present in the routing table.

Network summary route in different routing protocols

network summary route in different routing protocol


  • auto summary: summary subnets into classful net route
  • ip summary-address: Automatic summary addressing always summarizes to the classful address boundary, while the ip summary-address router configuration command summarizes addresses on a specified interface.
    interface Ethernet1
    ip address
    ip summary-address rip
    no ip split-horizon
  • Automatic summary will override the configured summary address feature on a given interface except when both of the following conditions are true:
    •The configured interface summary address and the IP address of the configured interface share the same major network (the classful, nonsubnetted portion of the IP address).
    •Split horizon is not enabled on the interface.

OSPF is link state routing protocol that works on the concept of areas. All areas must have same LSDB (link state database); hence OSPF summarization can only done on the border routers i.e. on ABR (Area border router) and ASBR (Autonomous system boundary router).

  • Inter Area route summarization:
    To summarize routes towards another area, in ABR we can use the following command:
    area [area-id] range [ ip-address ] [mask ] [advertise | not-advertise |cost {cost}]
    It will remove subnets routes from advertising to other area but a summarized route.
  • External route summarization.
    Use the following command to help reduce the size of the routing table and allow an OSPF Autonomous System Boundary Router (ASBR) to advertise one external route as an aggregate for all redistributed routes that are covered by the address.
    summary-address network netmask

network summary of BGP can be found here

OSPF process in short

1, form adjacency

init: each routers will send out hello packets to ( if network type is broadcast) or unique ip address (if network type is none broadcast);

2-way: router A has received hello packet from B router,  the the hello packet includes its A’s id

extat: select DR/BDR if need, point to point network or point to multipoints networks do not select DR/BDR

exchange: exchanges the LSA

full: adjacency formed

When DR/BDR is presented in the network, all other routers can only form adjacency with DR and BDR, the rest of the routers can not form adjacency with each other, they will stay in 2 way state with each other.  When DR/BDR is not presented in the network ( point to point, or point to mulit points networks), adjacency is formed for each link.

Below is the table describing the process:

ospf adjencency process

2, Each router now has all information, LSA database, it will run dijkstra algorithm to calculate the shortest path towards each network work. That means each router will maintain the whole routing table calculated according to the LSA database. So it is critical for OSPF to guarantee that each router has the same LSA database.

3, OSPF routes will be selected to routing table according to administrative distance value  (110)in Cisco and default preference  (10)according to Juniper.

OSPF network types & OSPF network area types

OSPF network types

1, point to point

2, broadcast

3, one to multi points broadcast

4, one to multi points no broadcast

5, no broadcast

Especially, point to point and one to multi points* do not need select DR and BDR, because, one to multi points (both broadcast and no broadcast) will work in the way like several point-to-point links, there is no need to select DR and BDR. Especially, router with the highest priority will become DR and the router with the second highest priority will become BDR. In Juniper router has default priority of 128, in Cisco router has default priority of 1.

On the other side, both type 2 and type 5 need select DR and BDR in order to reduce the numbers of ospf packets (hello, lsa, etc) in the network.

Normally ospf build up adjacency by broadcasting hello packets to, but in some noethernet network (mostly in frame relay network), broadcasting is not applicable, hello packets are sent out with unique ip address of the peer side.

Network area types

1, Backbone area ( area 0 ) , can receive all LSA types information

2, Standard area, can receive type 3 info from ABR (Area border router)

3, Stub area, can receive normaly LSA type 3 info and a default route as subsitute for all external routes

4, Totally stub area, can receive only one LSA type 3 as default router towards outside of the area

5, Not so stub area, can work as stub area or totally stub area, BUT, can send external routes from  ASBR as type 5 LSA to the other area.

LSA types:

type 1:  router

type2: net route, generated and sent only by DR

type3, net summary route, generated and sent only by ABR in order to reduce the numbers of routes sent to the other area.

type4: serve to advertise the presence of an autonomous system boundary router (ASBR).

type 5:external route that send to other network area from NSSB(not so stub  area)

type 7: external route

Especially, type 1 and type 2 does not cross area border.