The OSPF protocol is based on link-state technology, which is a departure from the Bellman-Ford vector based algorithms used in traditional Internet routing protocols such as RIP. OSPF has introduced new concepts such as authentication of routing updates, Variable Length Subnet Masks or VLSM route summarization, and so forth.
Open Shortest Path First Algorithm
- Dijkstra Shortest Path First Algorithm
- OSPFv2 Supports only IPv4 address family
- OSPFv3 Supports both IPv4, and IPv6 address families
- OSPFv3 The control plan runs over IPv6
- RFC 2323 – OSPFv2
- RFC 5340 – OSPFv3
- RFC 5250 – Opaque LSAs
Features
- No limitation on the hop count
- Supports Variable Length Subnet Masks
- Communicates via Multicast to send Link State Advertisements
- Routing updates are propagated immediately
- Process ID are used as opposed to AS numbers 1 – 65535
- Load Balancing
- Area routing
- Authentication
- Route Tagging
- Layer 4 Protocol 89
- Topology Leaf – Spine – Leaf
- Extensibility in the form of Opaque LSAs
- Control Plane FIB
- Data Plane RIB
Link Local Multicast
- OSPFv2: All Shortest Path First Routers 224.0.0.5
- OSPFv3: All Shortest Path First Routers FF02::5
- OSPFv2: DR / BDR 224.0.0.6
- OSPFv3: DR / BDR FF02::6
Interface Network Types
- Broadcast: Specify broadcast multi-access network
- Non Broadcast: Specify NBMA network
- Point To Multipoint: Specify point-to-multipoint network
- Point To Point: Specify point-to-point network
Default Timers
- Hello = 10 seconds – Timer must match between Neighbors
- Dead = 40 seconds – Timer must match between Neighbors
- Summary Exchange every 30 minutes
- Link state max age 60 minutes
Neighbor Adjacency State Machine
DOWN
No hello packets have been received from the neighbor, however hello packets can still be sent
INIT
Hello packets from neighbors, but the receiving router’s ID was not included in the hello packet
2-WAY
The beginning of bi-directional communication has been established between routers
EXSTART
The DR and BDR begin the election processes to determine the DR / BDR or DROTHER relationship
EXCHANGE
The exchange processes is the beginning stage of the database descriptor or DBD packets
LOADING
The exchanging of Link State information begins based on the previous exchange of DBD’s
FULL
All Link State information has been exchanged and the databases have been fully synchronized
Tables
- The Neighbor table stores information about neighbors
- The Topology table stores information about network
Database
The Database Description or DD packets are type 2 LSA’s. These packets are exchanged when an adjacency is being initialized. They describe the contents of the topological database.
Areas
- Topology: Leaf – Spine – Leaf
- Backbone Area 0 commonly referred to as the Spine
- Stub Area
- Not So Stubby Area – NSSA
- OSPF will inject a default route into the NSSA
Backbone Area or Area 0
OSPF has special restrictions when multiple areas are involved. If more than one area is configured, one of these areas has to be area 0. This special area ( Spine ) often referred to as the backbone area is required for OSPF operation. When designing networks it is good practice to start with area 0 and then expand into other areas later on.
Router ID or RID
- Use the Router ID (RID) configured under OSPF
- Use the highest numerical IP on any Interface
- Use the highest numerical IP on any Loopback Interface
Priority
In short the priority helps determine the DR and BDR on the network to which this interface is connected. The Priority is an 8 bit field based on which DRs and BDRs are elected. The router with the highest priority becomes the DR. If the priorities are the same, the router with the highest router ID becomes the DR. By default, priorities are set to 1.
- Router: neighbor x.x.x.x priority x – The default is 0
- Interface: ip ospf priority x
Common Routing Decision
- Prefer the route with the longest Prefix Length
- Prefer the route with the lowest Metric
- Prefer the route with the lowest Administrative Distance
Cost
The cost (also called metric) of an interface in OSPF is an indication of the overhead required to send packets across a certain interface. The cost of an interface is inversely proportional to the bandwidth of that interface. ip ospf cost #. The default reference bandwidth to 100 or 100 Mbps.
cost = reference bandwidth / interface bandwidth
The Cost for T1 – 1544 kbps 100 / 1.544 = 64
The Cost for Ethernet – 10,000 kbps 100 / 10 = 10
The Cost for Fast Ethernet – 100,000 kbps 100 / 100 = 1 – The default reference bandwidth
The Cost for Gigabit Ethernet – 1,000,000 kkps 100 / 1000 = 0.1 – Round up to the default
The Cost for 10 Gigabit Ethernet – 10,000,000 kbps 100 / 10000 = 0.01 – Rounds up to the default
The Cost for 100 Gigabit Ethernet – 100,000,000 kbps 100 / 100000 = 0.001 – Rounds up to the default
Router Types
- The DR is the designated router for the area.
- The BDR is the backup designated router for the area.
- The DROTHER is a router that is neither the DR or BDR for the area.
- The ABR router connects one or more areas to the backbone area 0.
- The BR router has at least one interface in the backbone area 0.
- The ASBR connects one or more autonomous systems together.
The DR & BDR Election
DR and BDR election is done via the Hello messages. These Hello packets are exchanged via IP multicast packets using 224.0.0.5, and 224.0.0.6 on each area segment. The Router with the highest OSPF priority on a segment will become the DR for that segment. The same process is repeated for the BDR. In case of a tie, the router with the highest RID will win. The default for the interface OSPF priority is one. Remember that the DR and BDR concepts are per multi-access segment.
LSA Types
- Type 1: Generated by all Routers in their area to describe their links – O
- Type 2: Generated by the DR or BDR to described connected neighbors – O
- Type 3: Generated by ABR to to describe routes to neighbors outside the area – O IA
- Type 4: Generated by ABR to describe route to ASBR outside the area
- Type 5: Generated by the ASBR to describe redistributed E1, and E2 routes – E1 / E2
- Type 6: Currently undefined
- Type 7: Generated by ASBR to describe redistributed NSSA – N1 / N2
Intra-Area ( O )
Inter-Area ( O IA )
External Type 1 ( E1 )
External Type 2 ( E2 )
NSSA Type 1 ( N1 )
NSSA Type 2 ( N2 )
External Routes
- E1: The type 1 cost / metric is in addition of the external + internal
- E2: The type 2 cost / metric is always the external cost before redistribution
Loopback Interfaces
The loopback interfaces are considered host routes in OSPF world, and they are advertised with a /32. If the ip ospf network point-to-point command is configured under loopback interface, OSPF advertises the loopback subnet as the actual subnet.
Routing Switching Voice Firewall Wireless