OSPF (Open Shortest Path First)

ospf-routing-protocol

What is OSPF?

OSPF (Open Shortest Path First) is an open source dynamic routing protocol based on Link State Routing Algorithm for IP Networks. It has a Protocol Type/Class which is based on IP/Link-State. OSPF uses an Algorithm called SPF (Dijkstra) to determine the shortest path. It is an IGP (Interior Gateway Protocol) Type of protocol and it uses Cost (Bandwidth) as its metric value. OSPF has 5 no. of packet types and has an Admin Distance of 110. It has a Reference Bandwidth of 108 and has a defined Standard of IETF RFC2328 (OSPFv2), IETF RFC2740 (OSPFv3/IPv6) for OSPF versions 2 and 3. Its Multicast Address is 224.0.0.5, 224.0.0.6 (01:00:5E:00:00:05/06) and has an IP protocol number 89

 

 

ospf-ir-abr-asbr-1

 

 

Practice Lab of OSPF (Open Shortest Path First)

You can practice OSPF Multi-area Lab through our labs in Cisco packet tracer

ospf-multi-area-lab-packet-tracer-1

 

 

OSPF (Open Shortest Path First) Router ID and Router ID Selection Criteria:

OSPF Router ID is a 32-bit number (like an IP address) that uniquely identifies a router in the Autonomous System Most routers (including Cisco) derive the Router ID in the following precedence order: Manually configured Router ID, Highest Loopback address, and Highest Physical IP address on the router

 

OSPF (Open Shortest Path First) Router Types

OSPF (Open Shortest Path First) has four Router types, which are IR, BR, ABR, and ASBR

ospf-router-types-1

Problems OF DR/BDR  in OSPF and its Solution

There is a high number of Adjacencies and Excessive LSA flooding. These problems can be solved through the DR/BDR Model

 

ospf-dr-bdr-3                               ospf-dr-bdr-1

 

DR/BDR Election Criteria

The Election Criteria of DR is Highest OSPF Interface Priority, and Highest Router ID (if OSPF interface priorities are equal). While the Election Criteria of BDR is: Router with the Second Highest OSPF Interface Priority

 

OSPF (Open Shortest Path First) Priority

The OSPF Priority Range is: 0 – 255

1 = Default Priority

0 = Means the Router will never become DR/BDR

 

Practice Lab of DR/BDR in OSPF

This is our practice lab of DR/BDR in OSPF using Cisco packet tracer

ospf-dr-bdr-election-lab

 

OSPF (Open Shortest Path First) Cost (metric)

OSPF uses cost as its metric to judge a path’s feasibility (when multiple paths exist for the same destination)

ospf-cost-formula-1

 

OSPF (Open Shortest Path First) Cost Commands:

R# ip ospf cost 1

R# show ip ospf interface fa0/0 | include Cost
Process ID 100, Router ID 10.1.1.2, Network Type BROADCAST, Cost: 10

R# show ip ospf interface brief
Interface    PID   Area     IP Address/Mask    Cost   State  Nbrs F/C
Fa0/0        100   0        10.1.1.2/24         10    BDR    1/1

OSPF (Open Shortest Path First) Timers (OSPF Intervals)

OSPF uses two timers:

Hello Timer:  The hello timer controls how often the router sends routine messages to its neighbors simply by indicating that it is still up

Dread Timer:  If the neighbors don’t hear any hello messages for a length of time defined by the dead interval, they assume that the router is no longer reachable and drop it from the adjacency table

OSPF (Open Shortest Path First) Timers (OSPF Intervals) – Troubleshooting & Configuration

R1#show ip ospf interface FastEthernet 0/0 | include intervals

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit




R1(config)#interface FastEthernet 0/0

R1(config-if)#shutdown

 

After shutting the interface on R1 you will see the following message on R2 after 40s

R2# Aug 30 17:57:40.863: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.12.1 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired

 

We can also improve the convergence time of OSPF on a particular interface by reducing the hello and dead timers:

R1 & R2

(config)#interface FastEthernet 0/0

(config-if)#ip ospf hello-interval 1

(config-if)#ip ospf dead-interval 3

 

OSPF (Open Shortest Path First) Security

OSPF supports 3 authentication types for security: Null (No Authentication), Simple Password Authentication, and MD5 Authentication

ospf-open-shortest-path-first-authentication-types-1

 

OSPF (Open Shortest Path First) Packet Types

OSPF has five Packet types, which are HELLO, DBD (Database Descriptor), LSR (Link State Request), LSU (Link State Update), and LSAck (Link State Ack)

 

OSPF (Open Shortest Path First) Neighbor Process

To become OSPF neighbors, OSPF routers must agree on: Area ID, Same subnet (only for multi-access segments), Hello Interval and Dead Interval, Area Type (Stub, NSSA), Authentication (Optional), and Router IDs must be unique

 

ospf-open-shortest-path-first-neighbor-process-1

 

OSPF (Open Shortest Path First) Route Types

OSPF Route Types consists of O, O IA, E1/E2, and N1/N2

ospf-open-shortest-path-first-route-types-1

 

OSPF (Open Shortest Path First) Area Types

There are five types of OSPF Areas: Backbone Area, Standard/Normal Area, Stub Area, TSA (Totally Stub Area), and NSSA (Not So Stub Area)

ospf-open-shortest-path-first-area-types-1

In Stub Area, no routes from other AS are allowed. Instead of propagating external routes (LSA5/LSA4), ABR injects an LSA3 containing a default route into the stub area. This ensures that routers in the stub area will still be able to route traffic to external destinations without having to maintain all of the individual external routes.

In Totally Stub Area, instead of propagating all routes (LSA5/LSA4/LSA3), ABR injects only a single default route into the area

In NSSA Area, we can have the flexibility of importing external routes into the area while it also tries to retain the stub characteristic. Assume that one of the routers in the stub area is connected to an external AS running a different routing protocol, it now becomes the ASBR, and hence the area can no more be called a stub area. However, if the area is configured as an NSSA, then the ASBR generates an NSSA external link-state advertisement (LSA7) which can be flooded throughout the NSSA area. These LSA7 are converted into LSA5 at the NSSA ABR and flooded throughout the OSPF domain

 

Practice Lab of OSPF Area Types

This is our practice lab of OSPF Area Types in Cisco packet tracer

ospf-open-shortest-path-first-area-types-lab-packet-tracer-1

 

OSPF (Open Shortest Path First) LSA Types

The OSPF LSA type help defines the different types. The OSPF LSA Types include LSA Type1, LSA Type2, LSA Type3, LSA Type4, LSA Type5, LSA Type6, LSA Type7, LSA Type8, LSA Type 9/10/11

ospf-open-shortest-path-first-lsa-types-1

 

  • Standard Areas(may) contain LSA Type 1, 2, 3, 4 and 5
  • Stub Areascontain LSA Type 1, 2, and 3. A default route is substituted for external routes
  • Totally Stubby Areas can only contain type 1, 2 LSAs, and a single Type 3 LSA
  • NSSA (Not-so-stubby Areas)implement stub or totally stubby functionality yet contain an ASBR. Type 7 LSAs generated by the ASBR are converted to type 5 by ABRs to be flooded to the rest of the OSPF domain

 

OSPF (Open Shortest Path First) Network/Interface Types

There are three OSPF Network or Interface types: Point-to-Point, Broadcast, and NBMA – Non-Broadcast

ospf-open-shortest-path-first-network-interface-types-1

 

 

OSPF (Open Shortest Path First) Multicast Addresses

OSPF Multicast Address consists of 224.0.0.5 and 224.0.0.5

ospf-open-shortest-path-first-multicast-addresses-1

 

OSPF (Open Shortest Path First) Tables

There are three kinds of OSPF tables, which are: Neighbour table, Topology table, and Routing table. These tables are built and maintained by OSPF routers to store routing and topology information

ospf-open-shortest-path-first-table-types-1

 

OSPF (Open Shortest Path First) Packet Format

The five types of OSPF packets have the same packet header format. The major fields of the OSPF packet header are: Version, Type, Length, Router ID, Area ID, Checksum, Auth Type, and Authentication

ospf-open-shortest-path-first-packet-format-1

 

OSPF (Open Shortest Path First) Virtual Links

All areas in an OSPF autonomous system must be physically connected to the backbone area (area 0). In some cases where this physical connection is not possible, you can use virtual links to connect two parts of a partitioned backbone through a non-backbone area. We can use virtual links to connect two parts of a partitioned backbone through a non-backbone area

The transmit area cannot be a stub area

ospf-open-shortest-path-first-virtual-links-1

 

 

 

-End-

 

 

 

You might also be interested in our free Online Quizzes on all IT topics including Cisco CCNA, Cyber Security, Python Programming, Linux & Ethical Hacking:

OSPF Study Notes Cheatsheet – Part 1

 

OSPF Study Notes Cheatsheet – Part 2

OSPF Study Notes Cheatsheet – Part 3

OSPF Study Notes Cheatsheet – Part 4

OSPF Study Notes Cheatsheet – Part 5

OSPF Interview Questions & Answers

OSPF (CCNA Online Quiz)

OSPF Online Quiz (ENCOR, CCNP)

Follow our Facebook Page & YouTube Channel for more updated Cheatsheets & Quizzes:

 

 

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments