OSPF

=Introduction=


 * Attributes:


 * OSPF Hello Packet has TTL=1. It cannot cross a hop.


 * Change AD in OSPF:
 * 1) router ospf 1
 * 2) distance 250 		  (useful in Protocol Migration)
 * 3) distance 255             (invalid; do not use these routes)


 * Various Packet types in OSPF:


 * OSPF has 3 databases which are used to create 3 Tables:

The DR serves as a common point for all adjacencies on a multiaccess segment The BDR also maintains adjacencies with all routers in case the DR fails Election does not occur on point-to-point or multipoint links Default priority (0-255) is 1 Highest priority wins 0 cannot be elected In case of tie, Router with Highest Router ID wins election DR preemption will not occur unless the current DR is reset
 * DR/BDR Election

Tunnel formed to join two areas across an intermediate Both end routers must share a common area At least one end must reside in area 0 Cannot traverse stub areas area 2 virtual-link 10.0.34.2
 * Virtual Links


 * Metric Formula

This can be modifiable with cmd: ospf auto-cost reference-bandwidth

ip ospf cost
 * To change route cost in OSPF:


 * What is a Demand Circuit?

=Area Summary=
 * Standard areas can contain LSAs of type 1, 2, 3, 4, and 5, and may contain an ASBR. The backbone is considered a standard area.
 * Stub areas can contain type 1, 2, and 3 LSAs. A default route is substituted for external routes.
 * Totally stubby areas can only contain type 1 and 2 LSAs, and a single type 3 LSA. The type 3 LSA describes a default route, substituted for all external and inter-area routes.
 * Not-so-stubby areas implement stub or totally stubby functionality yet contain an ASBR. Type 7 LSAs generated by the ASBR are converted to type 5 by ABRs to be flooded to the rest of the OSPF domain.

=LSA=


 * LSA Details:


 * LSA as per Areas :-

=Adjacency=


 * OSPF neighbor requirements:
 * 1) Router should be in same area
 * 2) Router should have same authentication config
 * 3) Router should be on same subnet
 * 4) Router have same hello/dead interval
 * 5) Router have matching stub flags


 * Difference between Adjacency & Neighbor:
 * 1) Only Adjacent Routers can sync Link State DB
 * 2) Point-to-Point Links: If Neighbors, Adjcency automatically established
 * 3) Broadcast Link: Adjacency established with DR & BDR only, rest are in 2-way state
 * 4) Point-to-Multipoint:_________
 * 5) Neighbor means Physical Connectivity(Direct)
 * 6) Adjacency means Database Syncronization
 * 7) Neighbor Requirements:
 * 8) Hello exchange => Subnet Mask, Subnet Number, Hello/Dead Interval, Area ID, Authentication must match.
 * 9) Exchange hellos but not LSAs(2-Way State).
 * 10) Adjacency Requirements:
 * 11) Exchange LSAs
 * 12) Both routers are in Stable(Full) State.
 * 13) Still final LSDB is same even in Neighbors as well as Adjacent routers.

Neighbor States
=LAB=

Troubleshooting

 * If OSPF is stuck in INIT State, check Netmask, Hello/Dead Timer, Area ID, Authentication password.


 * On a shared/ethernet network, only 2 router, DR & BDR will form full relationship, all others will stay in 2-way state.

Matching MTU is not a Adjacency Requirement, but is required to successfully pass Database Descriptor Packets
 * If OSPF is stuck in ExStart State, MTU mismatch may be the cause, as it is requirement to successfully pass DBD Packets.

Mar 1 00:10:09.535: %OSPF-5-ADJCHG: Process 1, Nbr 10.10.10.1 on Ethernet0/0 from EXSTART to DOWN, Neighbor Down: Too many retransmissions
 * In OSPF, MTU Mismatch causes neighbors swinging between ExStart state to Down state

Complete OSPF Lab

 * OSPF Neighbor Establishment Debug
 * OSPF MTU Mismatch Debug
 * Packet Captures

=References=