OSPF (Open Shortest Path First) is an open standards routing protocol that’s been implemented by a wide variety of network vendors including cisco.
If we have multiple routers and not all of them are cisco, then we can’t use EIGRP, so our remaining options are basically RIP V1, RIP V2, or OSPF. But if it’s a large network, then really we have options are OSPF or something called route redistribution. This works by using the Dijkstra Algorithm.
OSPF Converges quickly, although perhaps not as quickly as EIGRP and it supports multiple equal cost routes to the same destination. But unlike EIGRP, it only supports IP routing.
OSPF Provides Following Features
- Consists of areas and autonomous systems.
- Minimize routing update traffic.
- Allows scalability.
- Supports VLSM/CIDR.
- Has unlimited hop count.
- Allows multi-vendor deployment.
To see each router connects to the backbone – called area 0, or the backbone area. OSPF must have an area 0, and all routers should connect to this area if at all possible, but routers that connect other areas to the backbone within an AS are called Area Border Routers (ABRs).
OSPF runs inside an autonomous system, but can also connect multiple autonomous systems together. The Router that connects these ASes together is called an Autonomous System Boundary router (ASBR).
- Link: A link is a network or router interface assigned to any given network.
- Router ID (RID): An IP address used to identify the router. Cisco Chooses the router ID by using the highest IP address of all configured loopback interfaces.
- Neighbors: Neighbors are two or more routers that have an interface on a common network, such as two routers connected on a point- to – point serial link.
- Adjacency: An adjacency is a relationship between two OSPF routers that permits the direct exchange of route updates.
- Hello Protocol: The OSPF hello protocol provides dynamic neighbor discovery and maintains neighbor relationship. Hello packet are addressed to 188.8.131.52.
- Neighborship Database: The neighborship database is a list of all OSPF routers for which Hello packets have been seen.
- Topology Database: The topology database contains information from all of the link state advertisement packets that have been received for an area.
- Designated Router: A designated router is elected whenever OSPF routers are connected to the same multi-access network.
- Back up Designated Router: A backup designated router (BDR) is a hot standby for the DR on multi access links.
- OSPF Areas: An OSPF area is a grouping of contiguous networks and routers. All routers in the same area share a common Area ID. Because a router can be a member of more than one area at a time, the area ID is associated with specific interfaces on the router. This would allow some interfaces to belong to area 1, while the remaining interfaces can belong to area 0. All of the routers within the same area have the same topology table. When configuring OSPF, you have got to remember that there must be an area o, and that this is typically configured on the routers that connect to the backbone of the network. Areas also play a role in establishing a hierarchical network organization.
Types of Network OSPF
Broadcast (Multi access)
Broadcast Multi-access networks such as Ethernet allow multiple devices to connect to the same network, as well as provide a broadcast ability in which a single packet is delivered to all nodes on the network.
NBMA networks are types such as Frame Relay, X.25, and Asynchronous Transfer mode (ATM). These networks allow for multi-access, but have no broadcast ability like Ethernet so, NBMA networks require special OSPF configuration to function properly and neighbor relationships must be defined.
Point–to–Point refers to a type of network topology consisting of a direct connection between two routers that provides a single communication path.
Point to multipoint refers to a type of network topology consisting of a series of a connection between a single interface on one router and multiple destination routers. All of the interfaces on all the routers sharing the point -to- multipoint connection belong to the same network.
SPF Tree Calculation
Within an area, each router calculates the best/shortest path to every network in that same area. This calculation is based up on the information collected in the topology database and an algorithm called shortest path first.
An interface set with a bandwidth of 64000 would have a default cost of 1563.
These two elements are the basic elements of OSPF configuration:
- Enabling OSPF (Router OSPF?)
- Configuring OSPF areas.
A value in the range 1 to 65,535
The OSPF process ID is needed to identify a unique instance ofan OSPF database and is locally significant.
We can create 0 to 4.2 billion areas.
OSPF use wild card mask.
Verifying OSPF Configuration
#sh ip route
The Show IP OSPF command is used to display OSPF information for one or all OSPF processes running on the router.
#sh ip ospf
The show ip ospf database command indicates the number of links and the neighboring routers ID and is the topology database mentioned earlier.
#show ip ospf database
#show ip ospf interface
#sh ip ospf neighbor
#show ip protocol
Loop back Interfaces are logical interfaces, which are virtual, software- only interfaces. Using loopback interfaces with your ospf configuration ensures that an interface is always active for ospf processes.
Let’s say that you are not using loopback interfaces and the serial interface of your router is the RID of the router because it has the highest IP address of active interfaces. If this interface goes down, then a re-election must occur on who is going to be the DR and BDR on the network. Not necessarily a big deal but what happens if this is a flapping link (going up /down). The routers will not converge because the election is never completed. This is obviously a problem with OSPF. Loopback interfaces solve this problem because they never go down and the RID of the router never changes.
The highest IP address of any logical interface will always become a routers ID.
Router (config)#int lo 0
#ip add 172.16.30.1 255.255.255.255
I am sure that you are wondering, what the IP address mask of 255.255.255.255 /32 means and why we don’t just use 255.255.255.0 instead. Well, either mask works, but the /32 mask is called a host mask and works fine for loop back interfaces.
To verify loopback addresses use show run
Verify the new RIDs of each router
#sh ip ospf database
#sh ip ospf interface
#sh ip ospf
An important thing to keep in mind is that the new RIDs didn’t show p after setting the loopback interface on each router until I rebooted the routers.
It’s important to remember that although the IP address on the interface is higher than the loopbacks address the highest loopback address always beats any physical interface.
- AD – 110
- It supports unlimited hop count
- Metric = Cost + 108 /Bandwidth
- It supports load balancing with equal paths.
- It supports manual summarization.
- It supports Area System
- It use Multicast
- It supports incremental updates when any changes occur in the network.
R1 (config) #router ospf 10
#network 10.0.0.0 0.255.255.255 area 0
#network 184.108.40.206 0.255.255.255 area 0
R2 (config) #router ospf 10
#network 220.127.116.11 0.255.255.255 area 0
#network 18.104.22.168 0.255.255.255 area 0