OSPF Design in a Campus Network: Area Structure and Convergence Settings

How is OSPF designed on a campus network? We cover the single- vs. multi-area decision, basic settings, summary routes, authentication and adjacency diagnosis.
Technical summary
Technology
OSPFv2 (RFC 2328), BFD (RFC 5880), Cisco IOS/IOS XE
Topic
Designing and operating dynamic routing in the campus core
Level
Intermediate–advanced
Prerequisites
  • Knowledge of IP subnets and routing tables
  • Inter-VLAN routing and L3 switch configuration
  • A drawing of the campus L3 topology
In this article8 sections

The fiber between buildings is up, the port is green, but the core on the other side doesn’t respond; the static route, meanwhile, still pushes traffic down that path. As long as a campus network consists of a single core switch and a single firewall, a few static routes are enough. When the L3 boundary moves down to the distribution layer, or a second building or second firewall is added, static routes become both a management burden and a failure risk. Below we cover the decision to move to OSPF within the campus, area design, Cisco IOS configuration examples, convergence settings and the diagnostic order for adjacency problems.

When does static routing fall short?

Static routing isn’t wrong; in a small, unchanging topology it’s the most predictable solution. Consider dynamic routing if any of these applies:

  • There’s more than one path: With two cores or two fiber routes between buildings, a static route can keep using a path even when the link is up but the far device is unreachable.
  • The number of L3 devices is growing: Adding routes by hand to all L3 devices for each new VLAN increases the chance of error.
  • Automatic failover to a backup path is needed: It can be done with floating static routes and IP SLA, but setting up separate tracking for each destination doesn’t scale.
  • Route information between the firewall and the core changes: When the segments behind the firewall change, you want the routes to be distributed automatically.

OSPF is an open standard (RFC 2328 for OSPFv2), supported by most enterprise switches, routers and firewalls, and it’s the most common choice for routing within a campus (IGP). How VLAN routing at the edge is set up is in the inter-VLAN routing article; here we focus on route distribution between these devices.

OSPF basics: areas, LSAs, DR/BDR

OSPF is a link-state protocol: each router advertises its links with its neighbors as LSAs (Link State Advertisements), all routers in the same area build the same database, and each calculates the shortest path itself with the SPF algorithm.

Concept Meaning Importance on campus
Area 0 Backbone area All other areas connect to it
ABR Router between two areas Where inter-area summary routes are generated
ASBR Router that injects external routes into OSPF Usually the internet/WAN edge
LSA type 1 / 2 Router and network LSAs Intra-area topology
LSA type 3 / 5 Inter-area summary and external routes Summary routes and the default route
DR/BDR Representative elected on a multi-access segment Unnecessary on a point-to-point link

DR/BDR election was designed to reduce LSA traffic when there are many routers on the same Ethernet segment. On a campus, however, an uplink between two L3 switches has only two ends; here, DR election delays adjacency formation and produces an unnecessary network LSA. Set the network type on L3 uplinks to point-to-point.

Single area or multiple areas on a campus?

Area design is the most over-engineered topic in OSPF. A practical approach:

  • Single area (area 0 only): The first choice on a single-building or few-building campus with a limited number of L3 devices. Configuration is simple, there’s no need for summary routes and troubleshooting is easy.
  • Multiple areas: The distribution layer of each building or region becomes an ABR; the core-to-distribution links are in area 0, and in-building L3 access links stay in the building’s area. The building address block is advertised as a single prefix at the ABR; a link change in one building doesn’t trigger an SPF calculation in other buildings.

The prerequisite for multiple areas is the address plan: each building must have been given a single block with aligned boundaries (for example 10.1.0.0/16 for building A, 10.2.0.0/16 for building B). If a building’s VLANs are scattered across the address space, a single prefix can’t be advertised at the ABR and splitting into areas doesn’t give the expected benefit. No address plan, no area design. Addressing and where the L3 boundary sits depend on the layer decision explained in the core–distribution–access architecture article.

Cisco IOS configuration example: router-id, passive-interface, p2p

In the switch installation example below, a distribution switch connects to the core with two routed uplinks, and user VLANs terminate on this switch as SVIs:

interface Loopback0
 ip address 10.255.255.11 255.255.255.255
 ip ospf 1 area 0
!
interface TenGigabitEthernet1/1/1
 description CORE-SW1
 no switchport
 ip address 10.255.1.1 255.255.255.252
 ip ospf network point-to-point
 ip ospf 1 area 0
!
interface TenGigabitEthernet1/1/2
 description CORE-SW2
 no switchport
 ip address 10.255.1.5 255.255.255.252
 ip ospf network point-to-point
 ip ospf 1 area 0
!
interface Vlan10
 ip address 10.1.10.1 255.255.255.0
 ip ospf 1 area 0
!
router ospf 1
 router-id 10.255.255.11
 auto-cost reference-bandwidth 100000
 passive-interface default
 no passive-interface TenGigabitEthernet1/1/1
 no passive-interface TenGigabitEthernet1/1/2

Points to note, line by line:

  • router-id is written explicitly. If it isn’t, the device chooses the highest loopback or interface IP; an interface added later can change the router-id after a reload. Two devices with the same router-id cause constant recalculation and inconsistent routing tables. In the field, this can be seen in configurations duplicated by copy-paste.
  • passive-interface default prevents hellos from being sent on user VLANs; the network is still advertised, but no adjacency can form on the end-user segment. This is the right default in terms of security and resources.
  • auto-cost reference-bandwidth: Because the default reference is 100 Mbps, 1G, 10G and 40G links are calculated with the same cost (1); OSPF can’t tell the fast path from the slow one. The value is in Mbps; in the example it’s set to 100 Gbps. It must be the same on all OSPF routers.
  • Default route: It’s advertised with default-information originate on the device at the internet exit. The command works if the device has a default route in its own routing table; the always parameter removes this condition but carries the risk of attracting traffic to itself when there’s no exit path.

Convergence: timers and BFD

OSPF’s reaction time to a failure has two parts: detecting the failure and calculating the new path.

Detection

When a directly connected fiber breaks, the interface goes down and OSPF drops the adjacency immediately. The problem is cases where the link stays physically up but traffic doesn’t pass (a media converter, carrier line or L2 switch in between). In this case, OSPF waits until the dead interval expires; for broadcast and point-to-point network types the defaults are hello 10 seconds, dead 40 seconds. Forty seconds is a long time. Lowering the hello/dead values is possible; the more scalable solution is BFD (RFC 5880): as a lightweight, fast liveness protocol, it detects failures at the millisecond level and notifies OSPF.

interface TenGigabitEthernet1/1/1
 bfd interval 300 min_rx 300 multiplier 3
 ip ospf bfd

Worked example: with a 300 ms interval and a multiplier of 3, detection time is about 900 ms. Before going to more aggressive values, check whether the platform processes BFD in hardware or software; BFD processed in software can produce false failure notifications when the CPU is busy.

Calculation

SPF throttle timers determine how fast the calculation is done on the first change and how long to wait for consecutive changes (timers throttle spf). Because defaults vary by platform and version, first see the current values in the show ip ospf output, then set a consistent profile across the whole campus. The syntax of LSA throttle commands differs between IOS and IOS XE versions.

Authentication and summary routes

Authentication prevents a device added accidentally or maliciously from injecting routes into the OSPF area. The first defense is passive-interface default; also enable authentication on backbone links. MD5 is old but widely supported; on versions that support it, prefer HMAC-SHA (RFC 5709):

key chain OSPF-KC
 key 1
  key-string <STRONG-KEY>
  cryptographic-algorithm hmac-sha-256
!
interface TenGigabitEthernet1/1/1
 ip ospf authentication key-chain OSPF-KC

! On older versions that support only MD5:
! interface TenGigabitEthernet1/1/1
!  ip ospf authentication message-digest
!  ip ospf message-digest-key 1 md5 <STRONG-KEY>

Summary routes can be generated at only two points: at the ABR for inter-area routes with area 10 range 10.10.0.0 255.255.0.0, and at the ASBR for external routes with summary-address. Summarization can’t be done within an area. If a need for summary routes arises in a single-area design, it’s a sign that it’s time to consider multiple areas.

Diagnosing adjacency problems

Adjacency states progress in the order Down, Init, 2-Way, ExStart, Exchange, Loading and Full. On a point-to-point link the target is always Full; on a multi-access segment, 2-Way is normal between non-DR routers. The state where the adjacency gets stuck often tells you directly where the fault is:

Symptom Likely cause
The neighbor never appears Passive interface, ACL, different subnet or area number, hello/dead mismatch, authentication mismatch
Stuck in Init One-way communication; the other side isn’t receiving hellos
Stuck in ExStart/Exchange MTU mismatch
The adjacency forms and then drops Physical errors (CRC, optics), lost hellos due to CPU load, BFD session drop, conflicting router-id
Full but routes missing or incomplete Network type mismatch (one end point-to-point, the other broadcast)
Route exists but isn’t preferred Cost, reference bandwidth difference, administrative distance

The order to check on the console:

show ip ospf neighbor
show ip ospf interface brief
show ip ospf interface TenGigabitEthernet1/1/1
show ip ospf database
show ip route ospf
show bfd neighbors
show logging | include OSPF

The show ip ospf interface output gives the network type, cost, hello/dead values and authentication status on a single screen. Put the outputs from both ends side by side; most mismatches are visible at first glance. Repeated %OSPF-5-ADJCHG messages in the log point to an unstable adjacency; in that case, also look at interface error counters and the BFD session. Use debug commands on a live core only filtered and briefly.

Do the move from static routes to OSPF in a change window: first build OSPF in parallel, verify the administrative distance of the routes, then remove the static routes. For a step plan, see the network change window article. For support with campus routing design, see our VLAN, routing and network segmentation service page.

Frequently asked questions

Can EIGRP be used instead of OSPF on a campus?

If all L3 devices are Cisco, EIGRP is also a functional option. If firewalls and switches from different vendors will join the routing domain, OSPF is the more flexible choice because it’s an open standard and supported on almost all enterprise devices.

The adjacency is stuck in the ExStart state; why?

The most common reason is an MTU mismatch between the two interfaces. OSPF compares the interface MTU in database description packets; if they differ, the exchange doesn’t complete. Match the IP MTU value on both sides; ip ospf mtu-ignore is only a temporary workaround.

On directly connected fiber uplinks, a failure is already detected quickly as a link drop. BFD delivers its real benefit on paths with a media converter, a carrier line or an L2 device in between, where the link can stay physically up while traffic is cut. Aggressive timers carry CPU load and false alarm risk; go by the platform recommendations.

How many OSPF areas does a campus need?

Most campuses work fine with a single area, i.e. only area 0. Multiple areas are considered when you need to advertise summary routes per building or region, limit the impact of topology changes or manage a large number of L3 devices.

Support

Contact us for support or a discovery session on this topic.

Contact form
[email protected]

Eretek Network

We build switching, routing, cabling and wireless networks with VLAN segmentation and redundant uplinks, and provide regular maintenance and fault support.

Knowledge Center

Other articles