OSPF Single Area - Open Shortest Path First

OSPF is an open standard routing protocol that has been impemented by a wide variety of network vendors. OSPF works on Dijkastra algorithm to construct a shortest path tree and follows that by populating the routing table with resulting best path. EIGRP’s convergence time may be blindingly fast, but OSPF isn’t that far behind, and its quick convergence is another reason it’s a favorite. Another two great advantages OSPF offers are that it supports multiple, equal-cost routes to the same destination, and like EIGRP, it also supports both IP and IPv6 routed protocols.

Read MultiArea OSPF Click Here

  • Protocol number of OSPF is 89.
  • AD value of EIGRP is 110.
  • It is default classless.
  • Supports CIDR and VLSM.
  • Multicast address is &
  • Has a 2 TImer: Hello (10 sec) and Down(40 sec).
  • It supports unlimited hop count.
  • It's metric is cost of link and bandwidth.
  • OSPF runs SPF / Dijkastra Algorithm.
  • In OSPF Hierarchial model runs, so we must define Area.
  • In Hierarchial model, 50-55 router can be given in a single area.
  • Maintains 3 tables : Neighbor Table, Database Table & Routing Table

Configuring OSPF

r#config t
r#router ospf 10

(10 is process id and is used to distinguish networks)
r#network area 1
(here is network id and is Wildcard mask & area 1 defines that the network lies within which area and must be same to form neighbourship)
[Note:] Simply if you are confuse about subnetmask and wildcard mask then you can remember that Wildcard mask is opposite of subnet mask. If you have network with subnet mask and you want to know wildcard mask then: subract from and resulted is Wildcard mask

OSPF Neighbourship & Condition

OSPF forms neighbor relationships, called adjacencies, with other routers in the same Area by exchanging Hello packets to multicast address Only after an adjacency is formed can routers share routing information.
Each OSPF router is identified by a unique Router ID. The Router ID can be determined in one of three ways:
• The Router ID can be manually specified.
• If not manually specified, the highest IP address configured on any Loopback interface on the router will become the Router ID.
• If no loopback interface exists, the highest IP address configured on any Physical interface will become the Router ID.

By default, Hello packets are sent out OSPF-enabled interfaces every 10 seconds for broadcast and point-to-point interfaces, and 30 seconds for nonbroadcast and point-to-multipoint interfaces. OSPF also has a Dead Interval, which indicates how long a router will wait without hearing any hellos before announcing a neighbor as “down.” Default for the Dead Interval is 40 seconds for broadcast and point-to-point interfaces, and 120 seconds for non-broadcast and point-to-multipoint interfaces. Notice that, by default, the dead interval timer is four times the Hello interval.

These timers can be adjusted on a per interface basis:
Router(config-if)# ip ospf hello-interval 15
Router(config-if)# ip ospf dead-interval 60

OSPF routers will only become neighbors if the following parameters within a Hello packet are identical on each router:
- Area ID must Match
- Hello Deat timer must match
- Authentication must match
- Subnet mask must match
- Must have different router ID

OSPF and Loopback Interfaces

Loopback interfaces are logical interfaces, which means they’re virtual, software-only interfaces, not actual, physical router interfaces. A big reason we use loopback interfaces with OSPF configurations is because they ensure that an interface is always active and available for OSPF processes. Loopback interfaces also come in very handy for diagnostic purposes as well as for OSPF configuration. Understand that if you don’t configure a loopback interface on a router, the highest active IP address on a router will become that router’s RID during bootup.

Configuring Loopback Interfaces
router(config)#int loopback 0
router(config-if)#ip address
The IP scheme really doesn’t matter here, but each one being in a separate subnet does. By using the /32 mask, we can use any IP address we want as long as the addresses are never the same on any two routers.

Verifying OSPF Configuration

There are several ways to verify proper OSPF configuration and operation.
The show ip ospf Command : The show ip ospf command is what you’ll need to display OSPF information for one or all OSPF processes running on the router. Information contained therein includes the router ID, area information, SPF statistics, and LSA timer information.

The show ip ospf database Command : Show ip ospf database command will give you information about the number of routers in the internetwork (AS) plus the neighboring router’s ID—the topology database I mentioned earlier. Unlike the show ip eigrp topology command, this command reveals the OSPF routers, but not each and every link in the AS like EIGRP does.

The show ip ospf interface Command : The show ip ospf interface command reveals all interface-related OSPF information. Data is displayed about OSPF information for all OSPF-enabled interfaces or for specified interfaces.

The show ip ospf neighbor Command : The show ip ospf neighbor command is super-useful because it summarizes the pertinent OSPF information regarding neighbors and the adjacency state. If a DR or BDR exists, that information will also be displayed.

The show ip protocols Command : The show ip protocols command is also highly useful, whether you’re running OSPF, EIGRP, RIP, BGP or any other routing protocol that can be configured on your router.

Read MultiArea OSPF Click Here