This is part 1 of 2. My shortish summarized version of OSPF Path Selection Order of Preference and Summarization.
Open Shortest Path First (OSPF) Basics:
- Use protocol number 89
- Use bandwidth-based cost metric
- Use highest IP on interfaces in UP/UP state as Router-ID by default
- Broadcast Networks:
- 126.96.36.199 – ALL OSPF Routers – Used for Hello packets. Used by DR/BDR for LS-Updates and LS-Acks
- 188.8.131.52 – ALL DR/BDR Routers – Used by ALL routers except DR/BDR to send LS-Updates and LS-Acks to DR/BDR
- Point-to-Point Networks:
- 184.108.40.206 – Used by ALL for ALL OSPF “messages”
- Non-Broadcast Networks:
- NO multicast – Destination IP of Hello / Link State packets is unicast IP of a specific neighbor.
- Neighbor IP is a required part of OSPF configuration for Non-Broadcast links.
- OSPFv2 Supports cleartext and MD5 authentication
- Supports MPLS-TE via “Opaque” LSA’s (9-link-local, 10-area-local, 11-AS)
- If equal cost routes exist, uses CEF load balancing.
Neighbors MUST agree on following to become adjacent:
- Area Number
- Hello and Dead intervals
- Stub area flag
- Neighbors MUST use compatible network types
- MUST be on same subnet. ONLY on Point-to-Point links rule does not apply. (
These rules apply in THIS order even if the OSPF link metric (Cost value) is changed.
- Intra Area Routes (O)
- Inter Area Routes (O IA)
- External Type 1 (E1)
- External Type 2 (E2)
- NSSA Type 1 (N1)
- NSSA Type 2 (N2)
Interface cost is derived from the bandwidth. The formula is:
Cisco default, Reference = 100000 (Kb/s), 100 (Mbps)
Cost = Reference bandwidth / Interface bandwidth. (Rounded down to the closest integer)
Modify reference bandwidth:
ospf auto-cost reference-bandwidth
Verify reference bandwidth:
show ip ospf | include Reference
Verify interface cost:
show ip ospf interface Gi0/0 | include Cost
- SPF calculations are ONLY performed for Intra-Area routing. ABR advertised information is trusted for Inter-Area and External calculations.
- Changing cost values, you need to use the
ip ospf cost <COST_VALUE>command on the interface and NOT the
bandwidthcommand is also used for other traffic minipulation techniques like QoS and will break those.
- ONLY point-to-multipoint and point-to-multipoint non-broadcast support OSPF cost value on a per-neighbor basis. (
neighbor x.x.x.x cost x)
- Hello messages can ONLY be suppressed on point-to-point and point-to-multipoint network types. (
ip ospf demand-circuit)
On FastE, GigE, TenGigE and 100GigE the default OSPF cost will be “1”, so you WILL want to change this!
All routers inside the area MUST have exactly the same LSDB to be able to summarize!
Summarization can ONLY be done:
- between areas (ABR) with
area <SOURCE_AREA> range <ADDRESS> <MASK>
- during redistribution (ASBR) from another protocol with
summary-address <ADDRESS> <MASK>
It is possible to ‘black hole’ the traffic or sub-optimal route within the domain with OSPF summarization. OSPF will AUTO create a discard route with the Null0 interface as the next-hop to prevent the router from using a shorter match (0.0.0.0), if the more specific destination network is not present in the routing table. This behavior can be disabled with
no discard-route <INTERNAL|EXTERNAL>.