OSPF (Open Shortest Path First) is a classless, link-state routing protocol. The current version of OSPF for IPv4 is OSPFv2 introduced in RFC 1247 and updated in RFC 2328 by John Moy. In 1999, OSPFv3 for IPv6 was published in RFC 2740.
OSPF has a default administrative distance of 110, and is denoted in the routing table with a route source code of O. OSPF is enabled with the router ospf process-id global configuration command. The process-id is locally significant, which means that it does not have to match other OSPF routers in order to establish adjacencies with those neighbors.
The network command used with OSPF has the same function as when used with other IGP routing protocols, but with slightly different syntax.
Router(config-router)#network network-address wildcard-mask area area-id
The wildcard-mask is the inverse of the subnet mask, and the area-id should be set to 0.
OSPF does not use a Transport layer protocol, as OSPF packets are sent directly over IP. The OSPF Hello packet is used by OSPF to establish neighbor adjacencies. By default, OSPF Hello packets are sent every 10 seconds on multiaccess and point-to-point segments and every 30 seconds on non-broadcast multiaccess (NBMA) segments (Frame Relay, X.25, ATM). The Dead interval is the period of time an OSPF router will wait before terminating adjacency with a neighbor. The Dead interval is four times the Hello interval, by default. For multiaccess and point-to-point segments, this period is 40 seconds. For NBMA networks, the Dead interval is 120 seconds.
For routers to become adjacent, their Hello interval, Dead interval, network types and subnet masks must match. The show ip ospf neighbors command can be used to verify OSPF adjacencies.
The OSPF router ID is used to uniquely identify each router in the OSPF routing domain. Cisco routers derive the router ID based on three criteria and with the following precedence:
1. Use the IP address configured with the OSPF router-id command.
2. If the router-id is not configured, the router chooses highest IP address of any of its loopback interfaces.
3. If no loopback interfaces are configured, the router chooses highest active IP address of any of its physical interfaces.
RFC 2328 does not specify which values should be used to determine the cost. Cisco IOS uses the cumulative bandwidths of the outgoing interfaces from the router to the destination network as the cost value.
Unlike EIGRP, OSPF is locally significant and does not need to match the other OSPF routers
show interface can be used to verify or determine the bandwidth value of an interface used by the OSPF metric
the command ip ospf cost can be used to modify the OSPF cost without changing the bandwidth value
By default OSPF hello packets are sent every 10 seconds on multiaccess and point to point segments, and every 30 seconds on non broadcast multiaccess segments
These values must match before two routers form an OSPF adjacency; Hello interval, Dead interval, Network type, Subnet masks
Electing a DR nad BDR creates multiple adjacencies, one adjacency for every pair of routers and extensive flooding of LSAs
DRis the router with the highest OSPF interface proirity and the BDR is second. If they are equal the highest router ID is used to decide
When DR fails the BDR becomes the new DR and an election takes place for a new BDR
An OSPF interface priority of 0 means the routers interface is ineligible to become a DR or BDR
the command default-information originate is used to propagate a default route in OSPF
