Overview
Open Shortest Path First (OSPF) is a link-state routing protocol that is designed to work with larger more complex networks. OSPF is a classless routing protocol that supports VLSM and CIDR and uses the Shortest Path First (SPF) algorithm to calculate the best path to a network.
The Cisco CCNA curriculum requires students to know how to implement and configure only a single-area OSPF network.
OSPF has some similarities to EIGRP, especially in regards to configuration, like requiring a process-id number, using wildcard bits for the subnet mask, hello packets, neighbor relationships or adjacencies, triggered updates and the use of multiple tables like the neighbor and topology tables.
Characteristics
- Algorithm - Dijsktra's SPF algorithm
- Metric - Cost, which is based on the bandwidth of a link
- Administrative Distance - 110
- Process-ID number - declared when OSPF is started/configured needs to match all OSPF routers in the area (see commands below)
- Wildcard bits - the inverse of a network's subnet mask (e.g. 255.255.255.0 is 0.0.0.255). It is declared after the network number in the network command (see commands below)
- Area number - a number from <0-255> declared at the end of the network command after the wildcard bits, the area number needs to match other routers in the area (see commands below)
- Hello Interval - 10 seconds by default. The hello interval needs to match all OSPF routers in the area
- Dead Interval - 40 seconds by default, it should be 4 times the hello interval, and needs to match all OSPF routers in the area
- Multiple Tables - Routing Table, Topology Table, and Neighbor Adjacency Table
- DR and BDR Elections - In broadcast multi-access networks, routers in the OSPF area will elect a Designated Router (DR) and a Backup Designated Router (BDR). The DR will be the receiver and distributor of Link-State Packets to other routers in the OSPF area. The BDR will wait, and be ready to take over the duties of the DR in case it fails.
Commands
router(config)#router ospf <process-id>
router(config-router)#network <network number> <wildcard bits> <area number>
router(config-router)#passive-interface <interface number>
router(config-router)#default-information originate //this will distribute a default route to other OSPF area routers
router(config-router)#end
router#show ip ospf neighbor
Example:
router(config)#router ospf 1
router(config-router)#network 192.168.0.0 0.0.0.255 area 0
router(config-router)#network 192.168.50.0 0.0.0.255 area 0
router(config-router)#passive-interface fa0/1
router(config-router)#default-information originate
router(config-router)#end
router#show ip ospf neighbor
Analyzing Show Commands
Example OSPF Network
router#show ip ospf neighbors
In the "show ip ospf neighbor" command above you can see that the router R0 has established three neighbor relationships or adjacencies with the other routers. The "Neighbor ID" above is the neighbor router's Router ID#. The Router ID# can be different than the neighbor router's IP address on the network. In the example above the first router listed has a Router or Neighbor ID of 200.10.10.253 but its IP address on the network is 192.168.50.1. You can also see that router at 192.168.50.3 (R3) is the current BDR or Backup Designated router and that the "Pri" or Router Priority Number has been changed from the default number of 1 to 50. The "State" shows that all three routers have current "FULL" adjacency or neighbor relationships. DROTHER routers will only form FULL adjacencies with DR and BDR routers and 2WAY adjacencies with each other. You can see this in the image of R1's "show ip ospf neighbor" output above. Even if we only look at the output of R0's show command above (top router output image) we can infer that the Designated Router or DR must be the router that issued the command (R0), because of the fact that there is no neighbor listed as a DR, only a BDR and two DROTHERs.
router#show ip route
In the image above, the "show ip route" command has been issued, displaying router R0's routing table. From the routing table we can tell that the R0 router has two connected networks "c 192.168.0.0 on FastEthernet0/1" and "c 192.168.50.0 on FastEthernet0/0" and that it has learned from OSPF about routes to three additional "o" networks: 192.168.1.0, 192.168.3.0, and a "o*E2" 0.0.0.0 candidate default route/gateway of last resort.
| < Prev | Next > |
|---|






Hello teacher!!
Just wondering on this article when you say in the Characteristics section, "Process-ID number - declared when OSPF is started/configured needs to match all OSPF routers in the area (see commands below)"
If I recall well, this process ID number DOES NOT have to match right? In other words, I can put process id 1 on one router, and process id 60 at the othe router and they will exchange info each other right?? this is what I have read in some books!! correct me please if Im wrong!!!