OSPF

INTERNETWORK EXPERT .ORG

** OSPF NOTES **

 

IP Protocol 89

 

224.0.0.5 is the OSPF All-routers multicast

 

224.0.0.6 is the OSPF All-Designated routers multicast

 

Hello and Dead Timers must match to form adjacency

 

DD (Database Descriptor) packets are acknowledged by sending back an identical DD packet.

 

For the Database Exchange process (ExStart) the router with the higher RID is designated the Master and is responsible for setting the sequence numbers of the DD packets.

 

The DD exchange contains LSA headers and sequence number for each LSA (not full LSAs).

 

If a router does not have an LSA described in a DD packet or has the LSA but with a lower sequence number, the router can request a full copy of the LSA with an LSR (Link State Request).

A router receiveing an LSR responds with a LSU (link state update) that contains a full copy of the LSA requested.  Each LSR/LSU is acknowledged by sending back a duplicate LSR/LSU or by sending an LSAack packet.

During the full LSA updating process the routers are in the “Loading” state.  When finished and all LSA’s are exchanged and updated the routers settle into the “Full” state.

For the DR/BDR election process a routers priority is determined by looking at the priority value recieved in the Hello and comparing it to the priority defined in the ‘neighbor’ statement.

The higher of the two values is used for determining the priority.  If the priority recieved in the Hello is higher than the ‘neighbor’ statement, the neighbor statement will be dynamically changed in the configuration to match the priority recieved in the Hello.

If two routers have the same priority the one with the higher RID wins.

Each LSA will be re-flooded every 30 minutes by default (LSRefresh timer).  The reflood timer is per LSA, so not all LSA’s in the LSDB will necessarily be re-flooded all at the same time.

Each LSA has a MaxAge timer that it must be refreshed within … default is 60 minutes.

Type 2 LSA’s (network) are only created for networks where a DR has been elected.

Type 2 LSA’s are flooded within the area by the DR of the network.

Type 1 LSA’s (router) are created by each router in the area describing itself, its interfaces, and neighbors.

Type 1 and 2 LSA’s contain the most topology detail and are confined to the area.

Type 3 LSA’s provide summary information about Type 1 and 2 LSA’s for other areas.

Type 3 LSA’s have simple information - the subnet, the mask, and the cost as known by the ABR.

When something changes with a Type 3 LSA (cost), only a partial SPF run is needed.  Route summarization at the ABR reduces the amount of Type 3 LSA’s but is not required for partial SPF.

Type 3 LSA’s by themselves provide for partial SPF benefits.

If a network represented by a Type 3 LSA goes down, the ABR refloods the LSA with the OSPF infinite cost so that the route is quickly removed from all other routers which contain that LSA in their LSDB.  The alternative would be to simply stop sending that LSA, however the route would not be removed from the other routers until the LSA aged out (MaxAge - default 60 mintues).

Type 4 LSA’s are generated by ABRs that have an ASBR in an area it touches.  The Type 4 LSA is created by the ABR to describe the ASBR and its costs to reach it.  Type 4 LSA’s are used when an ASBR is redistributing type-1 external routes (E1), which helps routers in other areas calculate the exact metric to reach the external route.  If the ASBR is only redistributing type-2 external routes (E2), no Type 4 LSA will be generated by an ABR.

In an OSPF Stubby area (area x stub), the ABR does not advertise Type-5 LSA’s (External Routes), and advertises a default route instead.  The cost of the default route advertised by the ABR can be set using the ’area x default-cost’ command.

OSPF Totall Stubby areas (area x stub no-summary) do not advertise Type-5 or Type-3 LSA’s, only a default route.

OSFP has the following order of route preference before route cost is even considered:

 

1 - Intra-area routes

2 - Inter-area routes

3 - E1 external routes

4 - E2 external routes

 

Example: OSPF will choose an E1 external route over E2, even if the E2 has a lower cost.

When E2 routes have the same metric, OSPF will check the cost to the advertising ASBR.

 

Type 7 LSA’s stay inside the NSSA area.  The ABR will advertise the Type 7 LSA’s as Type 5 LSA’s

into the backbone area.

 

ABR’s will ignore Type 3-5 LSA’s from other ABR’s over links in the same non-backbone area.  In

other words, and ABR will always prefer its direct connection to area 0, even if there is a lower

cost path through another ABR.

 

The IP address configured in ‘area x virtual-link 1.1.1.1′ is the RID of the other router participating in the virual link.

 

An OSPF virtual link cannot exist in a stub area.

An OSPF “stub router” is one that will only route for traffic to/from directly connected networks.

A stub router will the advertise cost to routes not directly connected as infinite, so it will never

become a transit router.  

 

You can tell an OSPF router to set its own Type-1 router LSA to an infinite metric for a  specific period of time after a router reload, or until BGP converges after a reload - before acting like a normal OSPF router.  This will prevent some black hole situations where an OSPF router is connected to a BGP link.  When the OSPF router reboots, the OSPF process will usually converge much faster than BGP, so you can tell OSPF to wait for BGP to converge before advertising a normal Type-1 LSA.

for X amount of time after reload:  ’max-metric router-lsa on-startup X’

until BGP converges after reload: ‘max-metric router-las on-startup wait-for-bgp’

 

OSPF uses a default metric of 20 when redistributing from an IGP

OSPF uses a default metric of 1 when redistributing from BGP

 

‘area x range’ is used to summarize at an ABR.  The area x is the area containing the component subnets to be summarized.

’summary-address’ is used to summarize external routes at an ASBR.

With either method, ‘not-advertise’ can be added to effectively filter the routes from being advertised.

 

OSPF does not support redistributing a static default route as a means of advertising a default route into OSPF.

‘default-information originate’ must be used to source a default route in OSPF.

essentially redistributes a default route found in the IP routing table (as E2 cost 1)

if not default route is available in the IP routing table the additive ‘always’ can be added.