Link-state routing protocols utilize more internal resources in favor of reducing bandwidth consumption.
All OSPF routers in an area share the same Link State Database (LSDB).
Link State Advertisements (LSAs) are flooded to all neighboring routers.
Routers multicast hellos to 126.96.36.199 every 10 seconds on a broadcast link and every 30 seconds on a nonbroadcast link.
Once hellos are exchanged, neighboring routers add one another to their neighbor tables.
Contents of a hello packet:
Router ID – 32-bit unique number (IP address)
Hello/dead intervals – Timers
Neighbor list – List of neighboring router IDs
Priority – Used in electing the DR and BDR
DR and BDR
Authentication (if enabled)
Stub Area Flag – On if this is a stub area
Attempt – Used for manually configured neighbors on an NBMA link; unicast hellos sent to neighbor from which hellos have stopped being received
Init – Hello packet received from neighbor, but without the recipient’s router ID
2-Way – Bi-directional communication has been established
Exstart – The DR and BDR have been elected, link-state exchange starting
Exchange – Exchange of database descriptor (DBD) packets
Loading – Exchange of link-state information
Full – Full adjacency established
Example OSPF packet capture
Cisco OSPF will load balance over up to four equal-cost links; configurable up to six.
Neighbors on a broadcast segment elect a designated router (DR) and backup designated router(BDR), which peer with all other routers on the segment. All non-designated routers peer only with the DR and BDR.
188.8.131.52 – All OSPF routers
184.108.40.206 – All designated OSPF routers (DR and BDR only)
DRs are chosen based on priority (0 – 255). 1 is default; routers with 0 priority will never be elected.
Priority ties are broken by choosing the higher router ID.
DRs are elected on point-to-point Ethernet links even though this is unnecessary (Ethernet is always seen as a broadcast medium). Interfaces can be configured to operate in point-to-point mode to prevent this.
(B)DRs are not preempted. New election will take place only when a current (B)DR goes offline or its
OSPF process is administratively restarted.
All routers in an area maintain an identical topological database.
Areas are defined to logically segment a network and reduce routing table size and complexity.
All areas connect to area 0 (the backbone area).
Backbone routers – Routers in area 0
Area Border Routers (ABRs) – Routers in multiple areas
Autonomous System Boundary Routers (ASBR) – Routers which redistribute information from another AS
Internal – Routers which have all interfaces in a single area
Routers can fill multiple roles.
OSPF is IP protocol 89.
Hello – Used to establish communication with directly connected neighbors
Database Descriptor (DBD) – Lists router IDs from which the router has an LSA and its current sequence number
Link State Request (LSR) – Request for an LSA
Link State Update (LSU) – Reply to an LSR with the requested information
Link State Acknowledgment (LSAck) – Used to confirm receipt of link-state information
Version – Version of OSPF being run
Authentication type (none/plaintext/md5)
Configuring OSPF in a Single Area
OSPF process ID (locally significant)
Configure Included Networks
A single interface can be specified by supplying its IP address and a null wildcard mask: network 192.168.0.1 0.0.0.0 area 0
If no router ID has been administratively declared, a router will choose the highest loopback IP address.
If no loopback addresses are present, the highest IP address of the first active interface will be used.
A router ID can be manually specified:
Best practice dictates the creation of a loopback address to be used as the router ID for stability and continuity:
Link cost is a 16-bit value (0-65535); default cost is calculated as 100Mbps/interface bandwidth.(Interfaces 100Mbps and faster are assigned a cost of 1.)
OSPF cost can be manually specified per interface:
An alternative to defining static costs per interface is to change the numerator bandwidth (default100Mbps):
Reference speed is a 32-bit value (1 – 4294967). If reference speed is modified, the same modification should be performed on all routers within the area.
Default DR election priority is 1, and a router with a priority of 0 will not become a DR. Priority range is 0 – 255.
Verifying OSPF Configuration
show ip ospf – OSPF process details
show ip ospf database – Contents of the topology database
show ip ospf interface – Interfaces participating in OSPF
show ip ospf neighbor – Neighbor information
show ip protocols – Displays all active routing protocols
show ip route
debug ip ospf events
debug ip packet