Single area OSPF

1. OSPF Protocol

  • IP port 89
  • Uses areas for scalability
  • Full Classless
  • Cost is based on bandwidth
  • Uses Multicast ( and ff02::5/6) for Broadcast networks and Unicast for NBMA
  • Administrative Distance 110
  • Link-state protocol: requires that all routers know about the paths reachable by all other routers in the network. Link-state information is flooded throughout the link-state domain (an area in OSPF or IS-IS) to ensure all routers posses a synchronized copy of the area’s link-state database. From this common database, each router constructs its own relative shortest-path tree, with itself as the root, for all known routes.

2. Link State functionality

  1. Every router learns directly connected routes.
  2. Every router creates LSPs (link state packages) that contain information about the directly connected routes (neighbor ID, link type, bandwidth).
  3. Every router floods LSPs to its neighbors and keeps received LSPs into a database. Neighbors flood the received LSPs to their neighbors.
  4. Every router calculates best routes to every destination based on the information received.

3. Router Types:

  • Backbone routers BR – routers that are in area 0.
  • Internal routers IR – routers that are part of an area.
  • Area Border Routers ABR – routers that are part of multiple areas.
  • Autonomous System Border Routers ASBR – routers used for redistribution.

4. Timers

  • HelloInterval (10 seconds for Point-to-point and 30 seconds for Broadcast and NBMA)
  • RouterDeadInterval (40 seconds for Point-to-point and 120 seconds for Broadcast and NBMA)
R(config)#interface Serial0/2
R(config-if)#ip ospf hello-interval 10
R(config-if)#ip ospf dead-interval 40

5. Metric and Path Selection

Metric = Σ costs
where the default cost=10^8/BW

Route priorities:

  1. O – Intra Area Route (LSA1 & LSA2)
  2. OIA – Inter Area Route (LSA3 & LSA4)
  3. E1 – External Route type 1 (LSA5), metric = the redistributed cost plus the cost to the ASBR
  4. E2 – External Route type 2 (LSA5), metric = the redistributed cost
  5. N1 – NSSA type 1 (LSA7), metric = the redistributed cost plus the cost to the ASBR
  6. N2 – NSSA type 2 (LSA7), metric = the redistributed cost
Router(config-router)#redistribute eigrp 1 metric-type 1   
//Redistributes routes learned from EIGRP autonomous system 1.
//Routes will be advertised as E1 routes.

6. LSP Types

  1. Hello Packet – used to establish and maintain adjacencies with other routers. Hello packets are used to ellect DR and BDR. They contain:Network Mask, HelloInterval, Options, Rtr Pri, RouterDeadInterval, Designated Router, Backup Designated Router, Neighbor.
  2. Database Descriptor(DBD) – a DBD is a short list of the entire link-state database.The contents of the DBD received are compared to the information contained in the routers link-state database to check if new or more current link-state information is available with the neighbor.
  3. Link State Request(LSR) – routers that receive a DBD and want more information about a route send a LSR.
  4. Link State Update(LSU) – is used to advertise new changes and to respond to a LSR. A LSU can contain multiple Link State Advertisments(LSA).
  5. Link State Acknowledgements(LSACK) – used to acknowledge receiving a LSU.

7. LSA Types

  1. Router LSA – the router announces its presence and lists the links to other routers or networks in the same area, together with the metrics to them. Type 1 LSAs are flooded across their own area only.
  2. Network LSA – the designated router (DR) on a broadcast segment lists which routers are joined together by the segment. Type 2 LSAs are flooded across their own area only.
  3. Summary LSA – an Area Border Router (ABR) takes information it has learned on one of its attached areas and summarizes it before sending it out on other areas it is connected to.
  4. ASBR Summary LSA – other routers need to know where to find the ASBR. This is why the ABR will generate a summary ASBR LSA which will include the router ID of the ASBR in the link-state ID field.
  5. External LSA – these LSAs contain information imported into OSPF from other routing processes. They are flooded to all areas. The external LSAs are generated by the ASBR.
  6. Multicast OSPF LSA – deprecated and not used.
  7. Type 7 for NSSA – Routers in a Not-so-stubby-area (NSSA) do not receive external LSAs, but are allowed to send external routing information for redistribution. They use type 7 LSAs to tell the ABRs about these external routes, which the ABR then translates to type 5 external LSAs and floods as normal to the rest of the OSPF network.
  8. External attribute for BGP
  9. Link Local Flooding Scope (for OSPFv3)
  10. Area Local Flooding Scope (for OSPFv3)
  11. Autonomous System Flooding Scope (for OSPFv3)

8. OSPF Message exchange:


9. DR/BDR Election

The routers on Broadcast or NBMA elect a designated router (DR) and backup designated router (BDR), which centralizes communications for all routers connected to the segment.

On a Broadcast or NBMA network, the router with the highest priority (default is 1) becomes the DR, and the one with the next highest priority becomes the BDR. If the priority values are equal, the router with the highest OSPF router ID becomes the DR, and the one with the next highest OSPF router ID becomes the BDR. A router with a priority that is set to 0 cannot become the DR or BDR. A router that is not the DR or BDR is called a DROTHER.

R1(config)# interface ethernet 0/1 
R1(config-if)# ip ospf priority 100
R4# clear ip ospf process

10. OSPF Network types

  1. Broadcast – uses DR and BDR
  2. Non-broadcast – uses DR and BDR
  3. Point-to-multipoint – does not use DR and BDR
  4. Point-to-multipoint Non-broadcast – does not use DR and BDR
  5. Point-to-point – does not use DR and BDR

11. Conditions for adjacency

  • Unique attributes: Router ID, IP address.
  • Identical attributes: Area ID, Hello and dead time, Network type, interface MTU, authentication.

12. OSPF Summarization

All areas must have the same LSDB (link state database), so summarization is done between areas. Thus OSPF summarization can only be configured on the border routers (ABR and ASBR) and not on other routers.

R(config-router)#area  range  

13. OSPF Redistribution

  • default metric = 20
  • default metric-type = E2.
  • “Subnet” parameter must be used to redistribute classless networks.
R(config-router)#default-information originate always   //used to propagate a default route
R(config-router)#redistribute  metric/metric-type/route-map/subnets/include-connected

14. OSPF Stub Areas

In a stub area the LSA is filtered at the ABR. Stub area types:


  • area 0 cannot be stub
  • allows LSA1, LSA2, LSA3, default LSA3
  • ABR generates a default route(LSA3)
  • configuration is required on all area routers

2.Totally Stubby Area

  • allows LSA1, LSA2, default LSA3
  • ABR generates a default route(LSA3)
  • a stub area is extended to a totally stubby area by configuring all of its ABRs with the no-summary parameter
 stub no-summary

3.Not So Stubby Area(NSSA)

  • allows ASBR routers in the area
  • allows LSA1, LSA2, LSA3, LSA7
  • default LSA3 is not generated automatically, default route must be configured manually
  • configuration is required on all area routers
 nssa [default-information-originate]
//default-information-originate will generate a default route(LSA7)

4.Not So Totally Stubby Area

  • allows ASBR routers in the area
  • allows LSA1, LSA2, LSA3 default, LSA7
  • ABR generates a default route(LSA3)
  • to expand an NSSA to function as a totally stubby area, all of its ABRs must be configured with the no-summary parameter
 nssa no-summary

15. OSPF Process configuration

R(config)#router ospf 
R(config-router)#network   area


OSPFv2 Example

Configure OSPF for IPv4:

R(config)#router ospf 10
R(config-router)#network area 0
R(config-router)#passive-interface fa0/0

Adjusting the cost for:

R(config)#router ospf 10
R(config-router)#auto-cost reference-bandwidth 1000     //Gigabit Ethernet
R(config-router)#auto-cost reference-bandwidth 10000     //10 Gigabit Ethernet

Set OSPF Priority and change DR/BDR:

R(config)#interface fa0/0
R(config-if)#ip ospf priority 2     //use ipv6 for OSPFv3
R#clear ip ospf process     //renegociate DR and BDR

Propagate/Redistribute route:

R(config)#router ospf 10
R(config-rtr)#default-information originate always     //used only to propagate a default route
R(config-rtr)#redistribute static subnet     //used to redistribute a static route, not default
R(config-rtr)#redistribute eigrp 1 subnets      //used for EIGRP redistribution

Configure MD5 Authentication:

//Global Authentication

R(config)#router ospf 10
R(config-rtr)# area 0 authentication message-digest
R(config)#interface fa0/0
R(config-if)#ip ospf message-digest-key 1 md5 cisco

//Per-interface Authentication

R(config)#interface fa0/0
R(config-if)#ip ospf message-digest-key 1 md5 cisco
R(config-if)# ip ospf authentication message-digest

OSPFv3 Example

Enable IPv6 routing:

R(config)#ipv6 unicast-routing

Configure OSPF for IPv6:

R(config)#ipv6 router ospf 10
R(config-rtr)#auto-cost reference-bandwidth 1000
R(config-rtr)#passive-interface fa0/1

Enable OSPFv3 on every interface(including loopbacks):

R(config)#interface fa0/1
R(config-if)#ipv6 ospf 10 area 0


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s