OSPF is a standards based Link State Routing Protocol described in RFC 2328. It was developed to satisfy the need of routing beyond 15 Routers .
As before OSPF , RIP was only able to scale not beyond 15 routers . It was proposed by IETF in 1998 and it is classless routing protocol that works with link state advertisements.
What is OSPF
OSPF is a Routing protocol which is used to find the best path between the Source and Destination Hops by using its own Shortest Path First (SPF) algorithm.
OSPF is developed by the International Engineering Task Force (IETF) for Interior Gateway Protocol which is designed to run in a large autonomous system or routing domain.
OSPF is a network layer protocol which works on protocol number 89 and it uses 22.214.171.124 multicast IP address for normal communication where as it uses 126.96.36.199 for update to DR( Designated Router) and BDR (Backup Designated Router).
OSPF Administrative Distance (AD) value is 10 and to calculate the metric or cost we use the below formulae
Metric = Cost = (108/Bandwidth in BPS)
There are 2 version of OSPF
- OSPF V2 and
- OSPF V3
Where as OSPF V2 is for IPv4 while OSPF works with IPv6.
There are plenty of features that OSPF Routing Protocol supports
- Supports VLSM
- Fast Convergence
- Supports Large Network Size
- Uses Shortest Path for Routing
- Supports 3 Authentications ( Null , Plain-text ,MD5)
- Uses Dijkstra‘s SPF Algorithm to select the shortest path between Source and Destination
- Route Summarization and Load Balancing
OSPF uses Bandwidth efficiently As in OSPF any Routing Update will only occur when there is any Routing changes there unlike others periodic updates .
OSPF works in large network size areas as it supports unlimited hop count means that it doesn’t matter what number of routers are there.
OSPF send periodic updates at long interval such as every 30 seconds
Open Shortest Path First Routing Protocol maintains 3 types of Routing tables that are-
- Neighbor Table
- Database Table
- Routing Information Table
Neighbor Table– Neighbor table contains information about the directly connected OSPF neighbors that are forming adjacencies.
That means in the neighbor table only that neighbors will be there which directly connected networks are forming adjacency and you know that only the same network address establishes the adjacency.
Database Table– Database table contains information about the entire view of the topology with respect to each router
Routing Information Table– Routing table contains information about the best path calculated by the shortest path first algorithm in the database table.
For routers to establish the OSPF routing protocol there are certain conditions that is important to match are-
- It Should be in same area
- Router ID must be unique
- Subnet Mask should be same
- Dead and Hello timer should be same
- Authentication type and credentials must match
OSPF Timer and Messages
Hello Timer – Hello timer is an interval in which OSPF routers send a hello message on an interface and it is 10 seconds by default.
Dead Timer– When Routers send the hello packet to the neighbor if it don’t send the packet back to the router then after a time it is declared as dead .
It is 40 seconds by default. and usually 4 times the hello interval but can be configured manually according to the need.
OSPF uses certain messages to communicate to the routers
Hello Message– These are keep alive type message used for neighbor discovery. This message is exchanged in every 10 seconds .Hello message includes following information :
- Router I’d
- Hello/dead interval
- Area I’d
- Router priority
- DR and BDR IP address
- authentication data.
Database description (DBD) – It contains the topology of an area or AS. It is simply the routes of the routers.
Link State Request (LSR) – When a router send the DBD then other routers compared it with its own DBD and if the DBD has more updates than its own then it sents LSR to its neighbor.
Link State Updates (LSU)– When a routers receives the LSR then it send the LSU with the details requested by the routers using LSR.
Link State Acknowledgement -This provides reliability to the link state exchange process and sent as the acknowledgement of LSU. If any packet mismatch or missed than router again request for it using LSR.
Link State Advertisement (LSA) – It is a type of OSPF packets that contains the routing information and only shared between those routers for which there is an adjacencies formed
To enable OSPF on a Cisco router and advertise interfaces, the following tasks are required on every connected routers : let’s suppose there is 10.0.0.0 network
|Step 1||Use the command router ospf process ID to start OSPF.|
|ex-||R1(config)# router ospf <1-65535>|
|Step 2||Use the network command to enable the interfaces with |
area assignments and the mask will be inverse wildcard
|ex-||R1(config-router)# network 10.0.0.0 0.255.255.255 area <0-4294967295>|
|Step 3||(Optional) Assign the router ID.|
Note– OSPF uses the following criteria to select the router ID:
- Manual configuration of the router ID.
- Highest IP address on a loopback interface.
- Highest IP address on a non-loopback interface.
There are some disadvantages of OSPF like it uses more CPU/Ram resources for setting up the adjacency topology and it is likely to be more complex to set it up as compared to RIP routing.