OSPF - Open Shortest Path First

What is OSPF?

OSPF (Open Shortest Path First) is a link-state routing protocol used to find the best path for packets as they pass through a set of connected networks.

How does OSPF work?

OSPF routers exchange link-state advertisements (LSAs) to build a complete map of the network topology. Each router then uses Dijkstra’s algorithm to compute the shortest path to each destination.

What are the different OSPF areas?

  • Backbone Area (Area 0): The core of an OSPF network.

  • Regular Area: Connects to Area 0 and can contain routers and networks.

  • Stub Area: Limits external route advertisements.

  • Totally Stubby Area: Further restricts routing information.

  • NSSA (Not-So-Stubby Area): Allows limited external routes.

What are OSPF router types?

  • Internal Router: All interfaces in the same area.

  • Backbone Router: At least one interface in Area 0.

  • Area Border Router (ABR): Connects two or more areas.

  • Autonomous System Boundary Router (ASBR): Connects OSPF to other routing protocols.

  • In this section, you are going to learn

  • Terminology

  • Version Info

Version & RFC Details

OSPF Version

RFC Version

Year

Core Idea / Contribution

OSPFv2

RFC 2328

1998

Defines OSPFv2, a link-state routing protocol for IPv4. It introduces areas, LSAs, DR/BDR elections, and SPF calculations. It supports fast convergence, equal-cost multipath, and authentication mechanisms.

OSPFv3

RFC 5340

2008

Specifies OSPFv3, adapting OSPF for IPv6. It removes IPv4-specific semantics, introduces new LSA types for IPv6, supports multiple instances per link, and relies on IPv6 security (IPsec) instead of built-in authentication.

RFC 5838

2010

Extends OSPFv3 to support multiple address families (AFs), including IPv4. It maps each AF to a unique Instance ID, allowing OSPFv3 to carry both IPv4 and IPv6 routes using separate instances.

RFC 7166

2014

Builds on RFC 5838 by defining how OSPFv3 can carry IPv4 and IPv6 routes simultaneously. It formalizes the use of Address Families in OSPFv3 and standardizes the behavior for dual-stack environments.

  • Setup

  • Setup

OSPF Hello Packet

S.No

Protocol Packets

Description

Size(bytes)

1

Hello

Used to discover and maintain neighbor relationships.

~44 to 80 bytes

Network Mask

Subnet mask of the interface sending the Hello packet.

4

Hello Interval

Time (in seconds) between Hello packets.

2

Options

Bit flags indicating optional capabilities (e.g., OSPF extensions).

1

Router Priority

Used in DR/BDR election; higher value = higher priority.

1

Router Dead Interval

Time (in seconds) before declaring a neighbor down if no Hello is received.

4

Designated Router (DR)

IP address of the current Designated Router on the network.

4

Backup Designated Router (BDR)

IP address of the current Backup Designated Router.

4

Neighbor List

List of Router IDs of neighbors seen by the sender (N = number of neighbors).

4 N

OSPF Database Description (DBD) Packet

S.No

Protocol Packets

Description

Size(bytes)

2

Database Description (DBD)

Summarizes the routers link-state database to a neighbor.

~100 to 150 bytes

Interface MTU

Maximum transmission unit of the interface.

2

Options

Optional capabilities supported.

1

Flags

Indicates Master/Slave, More, and Initial bits.

1

DD Sequence Number

Sequence number for DBD exchange.

4

LSA Headers

Summary of LSAs (only headers, not full LSAs).

20 N

OSPF Link-State Request (LSR) Packet

S.No

Protocol Packets

Description

Size(bytes)

3

Link-State Request (LSR)

Requests specific LSAs from a neighbor.

~60 to 100 bytes

LSA Type

Type of LSA being requested.

1

Link State ID

Identifies the specific LSA.

4

Advertising Router

Router ID of the router that originated the LSA.

4

OSPF Link-State Update (LSU) Packet

S.No

Protocol Packets

Description

Size(bytes)

4

Link-State Update (LSU)

Carries one or more LSAs to update neighbors databases.

Variable

Number of LSAs

Number of LSAs included in the packet.

4

LSAs

One or more complete LSAs (Type 15, 7, etc.).

Variable

OSPF Link-State Acknowledgment (LSAck) Packet

S.No

Protocol Packets

Description

Size(bytes)

5

Link-State Acknowledgment (LSAck)

Acknowledges received LSAs to prevent retransmission.

~60 to 100 bytes

LSA Headers

Acknowledges receipt of LSAs using their headers.

20 N

OSPF - Use Cases

S.no

Use Case

Description

1

Enterprise Network Routing

OSPF is widely used in large enterprise networks to efficiently route IPv4/IPv6 traffic within an organization.

2

Multi-Area Network Design

OSPF supports hierarchical design using areas, reducing routing overhead and improving scalability.

3

Fast Convergence

OSPF quickly recalculates routes using SPF algorithm when a topology change occurs, minimizing downtime.

4

Redundant Path Utilization

Supports equal-cost multi-path (ECMP) routing, allowing traffic to be load-balanced across multiple links.

5

Interoperability in Multi-Vendor Environments

As an open standard protocol, OSPF works across devices from different vendors (e.g., Cisco, Juniper, etc.).

6

IPv6 Routing with OSPFv3

OSPFv3 enables routing in IPv6 networks, supporting modern dual-stack deployments.

7

Stub and NSSA Areas

Used to limit external route propagation in specific areas, optimizing performance and security.

8

Data Center Fabric Routing

OSPF is used in spine-leaf architectures for fast, loop-free routing in data centers.

9

Campus Network Segmentation

OSPF areas help segment large campus networks into manageable zones.

10

Backup Link Activation

OSPF can automatically reroute traffic through backup links in case of primary link failure.

OSPF - Basic Features

S.no

Features

Description

1

Link-State Protocol

Each router maintains a map of the network and calculates the shortest path using Dijkstras algorithm.

2

Hierarchical Design

Supports areas (e.g., backbone Area 0) to optimize routing and reduce overhead.

3

Fast Convergence

Quickly adapts to network changes by recalculating routes.

4

Cost-Based Metric

Uses interface bandwidth to calculate path cost.

5

Supports VLSM and CIDR

Efficient IP address usage with variable-length subnet masks.

6

Multicast Updates

Sends routing updates using multicast addresses (e.g., 224.0.0.5).

7

Authentication Support

Provides security through plain text or MD5 authentication (OSPFv2).

8

DR/BDR Election

Reduces traffic on broadcast/multicast networks by electing Designated and Backup Routers.

9

Equal-Cost Multipath (ECMP)

Supports load balancing across multiple paths with equal cost.

10

Scalable and Extensible

OSPFv3 supports IPv6 and multiple address families.

Link-State Protocol - Testcases

Link-State Protocol - Test Cases

#

Test Case

Description

Expected Result

1

Enable OSPF on router

Start OSPF process

OSPF process starts successfully

2

Configure OSPF on interface

Assign OSPF to interface

Interface joins OSPF area

3

Verify OSPF neighbor formation

Establish adjacency

Neighbor state reaches FULL

4

Generate Router LSA

Bring up OSPF interface

Router LSA is generated

5

Generate Network LSA

Form DR on broadcast link

Network LSA is generated

6

Generate Summary LSA

Use ABR between areas

Summary LSA is advertised

7

Generate ASBR Summary LSA

Configure ASBR

ASBR Summary LSA is generated

8

Generate External LSA

Redistribute external route

Type 5 LSA is generated

9

Generate NSSA External LSA

Redistribute in NSSA

Type 7 LSA is generated

10

LSA flooding

Trigger topology change

LSAs flood to all neighbors

11

LSA aging

Wait for LSA to age out

LSA is refreshed or removed

12

LSA refresh

Wait for refresh interval

LSA is refreshed automatically

13

LSA checksum validation

Corrupt LSA checksum

LSA is discarded

14

LSA sequence number wrap

Force sequence wrap

LSA is flushed and regenerated

15

SPF calculation

Trigger topology change

SPF recalculates and updates RIB

16

SPF delay tuning

Configure SPF timers

SPF runs according to timers

17

SPF throttling

Enable SPF backoff

SPF runs are throttled

18

SPF optimization

Enable incremental SPF

Only affected routes are recalculated

19

OSPF convergence

Measure convergence time

Convergence within expected time

20

OSPF route installation

Verify route in RIB

Route appears with OSPF metric

21

OSPF route removal

Withdraw route

Route is removed from RIB

22

OSPF route preference

Compare with other protocols

OSPF route is preferred by default

23

OSPF metric change

Modify interface cost

SPF recalculates and updates route

24

OSPF hello interval change

Change hello timer

Hello packets reflect new interval

25

OSPF dead interval change

Change dead timer

Adjacency drops after new timeout

26

OSPF passive interface

Set interface to passive

No hello packets sent

27

OSPF authentication

Enable authentication

Adjacency forms only with valid key

28

OSPF area mismatch

Configure different areas

Adjacency fails to form

29

OSPF router ID change

Change router ID

New LSAs generated with new ID

30

OSPF DR/BDR election

Use broadcast network

DR and BDR are elected

31

OSPF over point-to-point

Use P2P link

No DR/BDR election occurs

32

OSPF over loopback

Advertise loopback

Loopback appears in LSAs

33

OSPF over virtual link

Configure virtual link

Adjacency forms over virtual link

34

OSPF area types

Configure stub area

Type 5 LSAs are blocked

35

OSPF NSSA configuration

Configure NSSA

Type 7 LSAs are allowed

36

OSPF totally stubby area

Block summaries and externals

Only default route is advertised

37

OSPF LSA filtering

Apply LSA filters

Filtered LSAs are not advertised

38

OSPF route summarization

Summarize routes on ABR

Summary LSA is generated

39

OSPF external route summarization

Summarize on ASBR

External summary LSA is generated

40

OSPF route redistribution

Redistribute static/BGP

External LSAs are generated

41

OSPF route tag

Tag redistributed routes

Tag appears in LSAs

42

OSPF max-metric router LSA

Set max-metric

Router appears unreachable

43

OSPF graceful restart

Enable GR

Adjacency maintained during restart

44

OSPF BFD integration

Enable BFD

Fast failure detection occurs

45

OSPF LSA pacing

Tune LSA pacing timers

LSAs are sent in controlled bursts

46

OSPF LSA group pacing

Tune group pacing

LSAs are grouped and paced

47

OSPF LSA retransmission

Drop LSA ACK

LSA is retransmitted

48

OSPF LSA delay flood

Enable delay flood

LSAs are delayed before flooding

49

OSPF LSA max age

Set LSA to max age

LSA is flushed from database

50

OSPF database overflow

Simulate large topology

OSPF handles large LSDB gracefully

Hierarchical Design - Testcases

Hierarchical Design - Test Cases

#

Test Case

Description

Expected Result

1

Configure Area 0

Set up backbone area

OSPF Area 0 is established

2

Configure non-backbone area

Set up Area 1

Area 1 is created and operational

3

Connect Area 1 to Area 0

Use ABR between areas

ABR forms adjacency in both areas

4

Configure multiple areas

Add Area 2 and Area 3

All areas are reachable via ABRs

5

Verify intra-area routes

Check routes within Area 1

Only Area 1 routes are visible

6

Verify inter-area routes

Check routes from Area 1 to Area 0

Inter-area routes are visible

7

Configure ABR

Set up router in two areas

ABR advertises summary LSAs

8

Verify ABR LSA generation

Check summary LSAs

ABR generates Type 3 LSAs

9

Configure ASBR in Area 1

Redistribute static routes

ASBR generates Type 5 LSAs

10

Verify ASBR summary LSA

ABR generates Type 4 LSA

Type 4 LSA is visible in Area 0

11

Configure stub area

Set Area 2 as stub

Type 5 LSAs are blocked

12

Configure totally stubby area

Block Type 3 and 5 LSAs

Only default route is advertised

13

Configure NSSA

Set Area 3 as NSSA

Type 7 LSAs are generated

14

NSSA to Type 5 translation

ABR translates Type 7 to Type 5

External routes appear in backbone

15

Verify route summarization on ABR

Summarize routes from Area 1

Summary route appears in Area 0

16

Verify route summarization on ASBR

Summarize external routes

Summarized external routes appear

17

Area ID mismatch

Use different Area IDs

Adjacency fails to form

18

Area type mismatch

One side stub, other normal

Adjacency fails

19

Area authentication mismatch

Different auth keys

Adjacency fails

20

Area range overlap

Overlapping summary ranges

Routes summarized correctly

21

Area range conflict

Conflicting summaries

Most specific summary is preferred

22

Area 0 disconnection

Break backbone continuity

Inter-area routing fails

23

Virtual link configuration

Restore Area 0 via virtual link

Inter-area routing restored

24

Virtual link failure

Break virtual link

Inter-area routing fails again

25

Area border router failure

Shut down ABR

Inter-area routes are withdrawn

26

Area convergence time

Measure convergence in Area 1

Convergence within expected time

27

Inter-area convergence time

Measure convergence across areas

Convergence within expected time

28

Route preference between areas

Prefer Area 0 over Area 1

Shortest path via backbone is used

29

Route redistribution into Area 1

Redistribute static routes

Routes appear as external in other areas

30

Route filtering on ABR

Filter summary LSAs

Filtered routes not advertised

31

Route filtering on ASBR

Filter external LSAs

Filtered routes not advertised

32

LSA flooding within area

Trigger topology change

LSAs flood only within area

33

LSA flooding across areas

ABR floods summary LSAs

LSAs visible in other areas

34

LSA aging in multi-area

Wait for LSA to age out

LSA is refreshed or removed

35

LSA refresh in multi-area

Wait for refresh interval

LSA is refreshed automatically

36

SPF calculation in area

Trigger SPF in Area 1

SPF runs only for Area 1

37

SPF calculation across areas

Trigger inter-area change

SPF runs in all affected areas

38

Max-metric on ABR

Set max-metric on ABR

ABR is avoided in SPF

39

Max-metric on ASBR

Set max-metric on ASBR

External routes are avoided

40

Area-specific hello/dead timers

Use different timers per area

Timers respected per interface

41

Area-specific authentication

Use different keys per area

Auth works independently

42

Area-specific cost tuning

Adjust interface cost

SPF reflects new path cost

43

Area-specific route tag

Tag routes in Area 1

Tags preserved across areas

44

Area-specific route map

Apply route map on ABR

Routes filtered or modified

45

Area-specific logging

Enable logging per area

Logs show area-specific events

46

Area-specific BFD

Enable BFD in Area 2

Fast failure detection in Area 2

47

Area-specific passive interface

Set passive in Area 3

No hello packets sent

48

Area-specific summarization policy

Apply summarization policy

Summary routes follow policy

49

Area-specific redistribution policy

Apply redistribution policy

External routes follow policy

50

Area-specific LSA pacing

Tune LSA timers per area

LSAs paced as configured

Fast Convergence - Testcases

Fast Convergence - Test Cases

#

Test Case

Description

Expected Result

1

Enable OSPF fast convergence

Enable timers and features

Fast convergence settings applied

2

Reduce hello interval

Set hello interval to 1s

Faster neighbor failure detection

3

Reduce dead interval

Set dead interval to 3s

Adjacency drops quickly on failure

4

Enable BFD on OSPF interface

Use BFD for failure detection

BFD detects failure in milliseconds

5

Verify BFD-triggered convergence

Simulate link failure

OSPF converges via BFD trigger

6

Tune SPF delay

Set SPF delay to 0ms

SPF runs immediately on trigger

7

Tune SPF hold time

Set hold time to 200ms

SPF runs are spaced appropriately

8

Tune SPF maximum wait

Set max wait to 1000ms

SPF throttling is bounded

9

Enable incremental SPF

Recalculate only affected routes

Partial SPF runs successfully

10

Verify full SPF fallback

Trigger full topology change

Full SPF runs correctly

11

Simulate link down

Shut interface

OSPF recalculates and converges

12

Simulate link up

Bring interface up

OSPF recalculates and installs route

13

Simulate router reboot

Reboot OSPF router

Neighbors detect and reconverge

14

Simulate LSA change

Modify LSA metric

SPF recalculates and updates RIB

15

Simulate LSA flooding

Trigger LSA flood

LSAs flood quickly and reliably

16

LSA pacing tuning

Reduce LSA pacing timers

LSAs are sent faster

17

LSA group pacing tuning

Tune group pacing

LSA bursts are controlled

18

LSA retransmission tuning

Reduce retransmit interval

Retransmits occur faster

19

LSA delay flood tuning

Reduce delay flood timer

LSAs flood immediately

20

LSA refresh tuning

Reduce refresh interval

LSAs refreshed more frequently

21

LSA aging validation

Wait for LSA to age out

LSA is removed or refreshed

22

LSA checksum error handling

Inject bad checksum

LSA is discarded

23

LSA sequence number wrap

Force sequence wrap

LSA is flushed and regenerated

24

SPF run under CPU load

Simulate high CPU usage

SPF completes within limits

25

SPF run under memory pressure

Simulate memory stress

SPF completes without crash

26

SPF run with large topology

Use 100+ routers

SPF completes within expected time

27

SPF run with 10,000 routes

Advertise large number of routes

SPF handles route load

28

SPF run with route flap

Simulate route flapping

SPF throttling prevents overload

29

SPF run with interface flap

Flap interface

SPF runs and routes update

30

SPF run with DR/BDR change

Trigger DR election

SPF recalculates correctly

31

SPF run with area change

Move router to new area

SPF recalculates and routes update

32

SPF run with ABR failure

Shut ABR

Inter-area routes are withdrawn

33

SPF run with ASBR failure

Shut ASBR

External routes are withdrawn

34

SPF run with virtual link failure

Break virtual link

Backbone connectivity lost

35

SPF run with stub area change

Change area type

SPF recalculates and LSAs update

36

SPF run with NSSA change

Change NSSA config

Type 7 LSAs updated

37

SPF run with route summarization

Apply summary

SPF recalculates and summary appears

38

SPF run with route redistribution

Redistribute static route

SPF recalculates and route appears

39

SPF run with route filtering

Apply filter

SPF recalculates and route removed

40

SPF run with max-metric router

Set max-metric

SPF avoids router

41

SPF run with max-metric link

Set high cost

SPF chooses alternate path

42

SPF run with route tag change

Change tag

SPF recalculates and tag updates

43

SPF run with route preference change

Change preference

SPF selects new path

44

SPF run with LSA type mismatch

Inject invalid LSA

LSA is ignored

45

SPF run with LSA flooding storm

Simulate LSA storm

SPF throttling prevents overload

46

SPF run with hello packet loss

Drop hello packets

Adjacency drops and SPF runs

47

SPF run with dead timer expiry

Wait for dead timer

Adjacency drops and SPF runs

48

SPF run with BFD session down

Drop BFD packets

BFD triggers SPF

49

SPF run with BFD session flap

Flap BFD session

SPF runs and routes update

50

SPF run with graceful restart

Enable GR

SPF suppressed during restart

Cost-Based Metric - Testcases

Cost-Based Metric - Test Cases

#

Test Case

Description

Expected Result

1

Default OSPF cost

Verify default cost on interface

Default cost (based on bandwidth) is applied

2

Manual cost configuration

Set custom cost on interface

Custom cost overrides default

3

Cost-based path selection

Configure lower cost path

OSPF selects lower cost route

4

Equal cost multipath (ECMP)

Configure equal cost paths

OSPF installs multiple routes

5

Unequal cost multipath

Configure unequal costs

Only lowest cost path is used

6

Cost change triggers SPF

Change interface cost

SPF recalculates and updates RIB

7

Cost change convergence

Measure convergence time

Convergence occurs within expected time

8

Cost-based route preference

Compare two paths

Path with lower cost is preferred

9

Cost-based route backup

Configure backup with higher cost

Backup used when primary fails

10

Cost on loopback interface

Set cost on loopback

Loopback advertised with correct cost

11

Cost on passive interface

Set cost on passive interface

Cost is advertised, no hello packets sent

12

Cost on point-to-point link

Set cost on P2P interface

Cost is used in SPF calculation

13

Cost on broadcast link

Set cost on broadcast interface

DR/BDR election unaffected, cost used in SPF

14

Cost on virtual link

Set cost on virtual link

Cost affects backbone reachability

15

Cost on tunnel interface

Set cost on GRE/IPSec tunnel

Tunnel path used based on cost

16

Cost on VLAN interface

Set cost on SVI

VLAN path used based on cost

17

Cost on subinterface

Set cost on subinterface

Subinterface participates in SPF

18

Cost on unnumbered interface

Set cost on unnumbered link

Cost is used in SPF

19

Cost with redistribution

Redistribute static with metric

External route uses specified cost

20

Cost with route summarization

Summarize routes with cost

Summary route uses lowest component cost

21

Cost with route filtering

Filter route with high cost

Filtered route not installed

22

Cost with route tag

Tag route with cost

Tag preserved in LSAs

23

Cost with max-metric router LSA

Set max-metric on router

Router appears unreachable

24

Cost with max-metric link

Set high cost on interface

Path avoided in SPF

25

Cost with stub area

Use cost in stub area

Default route cost used

26

Cost with NSSA

Use cost in NSSA

Type 7 LSAs reflect correct cost

27

Cost with totally stubby area

Default route cost used

All traffic uses default route

28

Cost with area summarization

Summarize with metric

Summary LSA uses configured cost

29

Cost with external summarization

Summarize external routes

Summary uses lowest cost

30

Cost with Type 5 LSA

Redistribute with metric

External LSA shows correct cost

31

Cost with Type 7 LSA

Redistribute in NSSA

Type 7 LSA shows correct cost

32

Cost with Type 3 LSA

ABR advertises summary

Summary LSA shows correct cost

33

Cost with Type 4 LSA

ABR advertises ASBR summary

Type 4 LSA shows correct cost

34

Cost with DR/BDR election

Set cost on broadcast link

DR/BDR election not affected

35

Cost with BFD

Use BFD for fast failure

Cost-based path switches quickly

36

Cost with graceful restart

Restart router

Cost-based paths preserved

37

Cost with LSA pacing

Tune LSA timers

Cost changes reflected in LSAs

38

Cost with SPF throttling

Tune SPF timers

Cost changes trigger SPF within limits

39

Cost with LSA refresh

Wait for refresh

Cost remains consistent

40

Cost with LSA aging

Wait for LSA to age out

Cost removed with LSA

41

Cost with LSA flooding

Change cost

LSA floods to neighbors

42

Cost with LSA checksum error

Corrupt LSA

Cost not updated

43

Cost with LSA sequence wrap

Force wrap

Cost preserved in new LSA

44

Cost with route flap

Flap interface

Cost-based path recalculated

45

Cost with interface bandwidth change

Change bandwidth

Default cost recalculated

46

Cost with interface shutdown

Shut interface

Cost removed, SPF recalculates

47

Cost with interface recovery

Bring interface up

Cost re-advertised

48

Cost with ECMP hash

Test traffic distribution

Traffic balanced across equal-cost paths

49

Cost with route redistribution policy

Apply metric in route-map

Cost applied to redistributed route

50

Cost with route preference policy

Prefer lower cost route

Policy honors cost-based selection

Supports VLSM and CIDR - Testcases

Supports VLSM and CIDR - Test Cases

#

Test Case

Description

Expected Result

1

Configure /30 subnet

Use 255.255.255.252 mask

OSPF advertises /30 prefix

2

Configure /31 subnet

Use 255.255.255.254 mask

OSPF supports and advertises /31

3

Configure /32 loopback

Use 255.255.255.255 mask

OSPF advertises /32 prefix

4

Configure /29 subnet

Use 255.255.255.248 mask

OSPF advertises /29 prefix

5

Configure /28 subnet

Use 255.255.255.240 mask

OSPF advertises /28 prefix

6

Configure /27 subnet

Use 255.255.255.224 mask

OSPF advertises /27 prefix

7

Configure /26 subnet

Use 255.255.255.192 mask

OSPF advertises /26 prefix

8

Configure /25 subnet

Use 255.255.255.128 mask

OSPF advertises /25 prefix

9

Configure /23 subnet

Use 255.255.254.0 mask

OSPF advertises /23 prefix

10

Configure /22 subnet

Use 255.255.252.0 mask

OSPF advertises /22 prefix

11

Configure /21 subnet

Use 255.255.248.0 mask

OSPF advertises /21 prefix

12

Configure /20 subnet

Use 255.255.240.0 mask

OSPF advertises /20 prefix

13

Configure /19 subnet

Use 255.255.224.0 mask

OSPF advertises /19 prefix

14

Configure /18 subnet

Use 255.255.192.0 mask

OSPF advertises /18 prefix

15

Configure /17 subnet

Use 255.255.128.0 mask

OSPF advertises /17 prefix

16

Configure /16 subnet

Use 255.255.0.0 mask

OSPF advertises /16 prefix

17

Configure /15 subnet

Use 255.254.0.0 mask

OSPF advertises /15 prefix

18

Configure /14 subnet

Use 255.252.0.0 mask

OSPF advertises /14 prefix

19

Configure /13 subnet

Use 255.248.0.0 mask

OSPF advertises /13 prefix

20

Configure /12 subnet

Use 255.240.0.0 mask

OSPF advertises /12 prefix

21

Configure /11 subnet

Use 255.224.0.0 mask

OSPF advertises /11 prefix

22

Configure /10 subnet

Use 255.192.0.0 mask

OSPF advertises /10 prefix

23

Configure /9 subnet

Use 255.128.0.0 mask

OSPF advertises /9 prefix

24

Configure /8 subnet

Use 255.0.0.0 mask

OSPF advertises /8 prefix

25

Advertise multiple subnets

Use different masks

All prefixes are advertised correctly

26

Summarize routes on ABR

Summarize /24s into /16

Summary LSA shows /16

27

Summarize external routes

Summarize /28s into /20

External summary LSA shows /20

28

Redistribute VLSM routes

Redistribute static with /30, /28

OSPF advertises all prefixes

29

Redistribute CIDR routes

Redistribute BGP CIDR routes

OSPF advertises classless prefixes

30

Filter specific subnet mask

Filter /30 routes

Filtered routes not advertised

31

Filter based on prefix length

Filter prefixes longer than /24

Only shorter prefixes advertised

32

Verify route selection by cost

Prefer /24 over /16

More specific route is selected

33

Verify longest prefix match

Use overlapping /24 and /16

/24 is preferred in RIB

34

Verify route aggregation

Aggregate /25s into /23

Summary route appears

35

Verify disaggregation

Break /16 into /24s

All /24s advertised

36

Verify route tag with VLSM

Tag /30 route

Tag appears in LSA

37

Verify route tag with CIDR

Tag /20 route

Tag appears in LSA

38

Verify route redistribution with tags

Redistribute tagged routes

Tags preserved in LSAs

39

Verify route preference with CIDR

Prefer /24 over /16

More specific route used

40

Verify route preference with VLSM

Prefer /30 over /28

Shortest match used

41

Verify route summarization suppression

Suppress summary

Only specific routes advertised

42

Verify route summarization with overlap

Summarize overlapping prefixes

Summary route is correct

43

Verify route summarization with holes

Summarize with missing subnets

Summary still advertised

44

Verify route summarization with tags

Tag summary route

Tag appears in summary LSA

45

Verify route summarization with cost

Assign cost to summary

Summary LSA shows correct cost

46

Verify route summarization with policy

Use route-map for summary

Policy applied to summary

47

Verify route summarization with filter

Filter specific subnet

Filtered route excluded from summary

48

Verify route summarization with redistribution

Redistribute summarized route

Summary appears in external LSAs

49

Verify route summarization with NSSA

Summarize in NSSA

Type 7 summary LSA appears

50

Verify route summarization with stub area

Summarize in stub

Default route used in stub

Multicast Updates - Testcases

Multicast Updates - Test Cases

#

Test Case

Description

Expected Result

1

Verify multicast address 224.0.0.5

Check OSPF Hello packets

Hello packets sent to 224.0.0.5

2

Verify multicast address 224.0.0.6

Check DR/BDR communication

Updates sent to 224.0.0.6

3

Verify Hello packet on broadcast

Use Ethernet interface

Hello sent to 224.0.0.5

4

Verify Hello packet on P2P

Use point-to-point link

Hello sent to 224.0.0.5

5

Verify Hello packet on NBMA

Use NBMA interface

Unicast Hello sent

6

Verify DR sends multicast updates

DR sends LSAs

Sent to 224.0.0.5

7

Verify BDR receives multicast

BDR listens on 224.0.0.6

BDR receives updates

8

Verify DROTHER receives multicast

DROTHER listens on 224.0.0.5

DROTHER receives updates

9

Verify multicast join on interface

Check IGMP group

Interface joins 224.0.0.5/6

10

Verify multicast MAC address

Check Ethernet frame

MAC is 01:00:5e:00:00:05/06

11

Verify multicast TTL

Check IP TTL

TTL is 1

12

Verify multicast packet type

Check IP protocol

Protocol is OSPF (89)

13

Verify multicast packet size

Check Hello packet size

Within expected limits

14

Verify multicast on loopback

Send Hello on loopback

No multicast sent

15

Verify multicast on passive interface

Set interface passive

No Hello or multicast sent

16

Verify multicast suppression

Disable multicast

OSPF fails to form adjacency

17

Verify multicast with ACL

Block 224.0.0.5

OSPF adjacency fails

18

Verify multicast with QoS

Apply QoS to multicast

Multicast traffic prioritized

19

Verify multicast with IGMP snooping

Enable IGMP snooping

Switch forwards multicast correctly

20

Verify multicast with PIM

Enable PIM on interface

OSPF multicast unaffected

21

Verify multicast with VRF

Use VRF instance

Multicast scoped to VRF

22

Verify multicast with VLAN

Use VLAN interface

Multicast sent correctly

23

Verify multicast with GRE tunnel

Use GRE over IP

Multicast encapsulated

24

Verify multicast with IPSec

Use IPSec tunnel

Multicast encrypted

25

Verify multicast with MPLS

Use MPLS core

OSPF multicast tunneled

26

Verify multicast with NAT

NAT interface

Multicast not translated

27

Verify multicast with firewall

Block multicast

OSPF fails to form adjacency

28

Verify multicast with L2 switch

Use unmanaged switch

Multicast flooded to all ports

29

Verify multicast with L3 switch

Use routed port

Multicast routed correctly

30

Verify multicast with wireless

Use Wi-Fi interface

Multicast sent if supported

31

Verify multicast with IPv6 disabled

IPv6 off

OSPFv2 multicast unaffected

32

Verify multicast with IPv6 enabled

IPv6 on

OSPFv2 multicast still uses IPv4

33

Verify multicast with OSPFv3

Use OSPFv3

Uses FF02::5 and FF02::6

34

Verify multicast with MTU mismatch

MTU too small

OSPF adjacency fails

35

Verify multicast with checksum error

Corrupt packet

Packet discarded

36

Verify multicast with DR election

DR sends multicast

DROTHERs receive updates

37

Verify multicast with BDR election

BDR listens on 224.0.0.6

Receives multicast updates

38

Verify multicast with LSA flooding

Trigger LSA

LSA flooded via multicast

39

Verify multicast with SPF recalculation

Trigger SPF

Multicast LSAs received

40

Verify multicast with LSA retransmission

Drop ACK

LSA retransmitted via multicast

41

Verify multicast with LSA pacing

Tune pacing

Multicast LSAs sent in bursts

42

Verify multicast with LSA delay flood

Enable delay

LSAs delayed before multicast

43

Verify multicast with LSA refresh

Wait for refresh

Refreshed LSAs sent via multicast

44

Verify multicast with LSA max age

Wait for max age

LSA flushed via multicast

45

Verify multicast with route summarization

Summarize routes

Summary LSAs sent via multicast

46

Verify multicast with route redistribution

Redistribute static

External LSAs sent via multicast

47

Verify multicast with authentication

Enable auth

Multicast packets authenticated

48

Verify multicast with BFD

Enable BFD

Multicast Hello still used

49

Verify multicast with graceful restart

Enable GR

Multicast continues during restart

50

Verify multicast with fast convergence

Tune timers

Multicast updates speed up convergence

Authentication Support - Testcases

Authentication Support - Test Cases

#

Test Case

Description

Expected Result

1

Enable OSPF authentication globally

Enable authentication in OSPF process

Authentication is enabled successfully

2

Configure simple password authentication

Set password on interface

Adjacency forms with matching password

3

Configure MD5 authentication

Set MD5 key on interface

Adjacency forms with matching MD5 key

4

Mismatched simple passwords

Use different passwords on neighbors

Adjacency fails to form

5

Mismatched MD5 keys

Use different MD5 keys

Adjacency fails to form

6

Configure multiple MD5 keys

Use keychain with multiple keys

Highest valid key is used

7

Expired MD5 key

Use expired key in keychain

Adjacency fails to form

8

Future MD5 key

Use key not yet valid

Adjacency fails to form

9

Key rollover with keychain

Change key in keychain

Adjacency remains stable

10

Key ID mismatch

Use different key IDs

Adjacency fails to form

11

Key string mismatch

Use different key strings

Adjacency fails to form

12

Null key string

Use empty key

Adjacency fails to form

13

Long key string

Use long key string

Adjacency forms if key matches

14

Special characters in key

Use special characters

Adjacency forms if key matches

15

Unicode characters in key

Use Unicode in key

Adjacency forms if supported

16

Invalid characters in key

Use invalid characters

Configuration fails or ignored

17

Authentication on broadcast network

Enable on Ethernet

DR/BDR and DROTHERs authenticate successfully

18

Authentication on point-to-point link

Enable on P2P interface

Adjacency forms with valid key

19

Authentication on NBMA network

Enable on Frame Relay

Adjacency forms with valid key

20

Authentication on loopback

Apply on loopback

No effect, loopback doesnt form adjacency

21

Authentication on passive interface

Enable on passive interface

No hello packets sent

22

Authentication with hello interval change

Change hello timer

Authentication remains functional

23

Authentication with dead interval change

Change dead timer

Authentication remains functional

24

Authentication with MTU mismatch

Mismatch MTU

Adjacency fails regardless of auth

25

Authentication with area mismatch

Different area IDs

Adjacency fails regardless of auth

26

Authentication with router ID change

Change router ID

New LSAs generated with auth

27

Authentication with DR/BDR election

Enable auth on broadcast

DR/BDR elected with valid auth

28

Authentication with LSA flooding

Trigger LSA update

Authenticated LSAs accepted

29

Authentication with LSA checksum error

Corrupt LSA

LSA is discarded

30

Authentication with LSA sequence wrap

Force wrap

LSA is flushed and regenerated

31

Authentication with LSA refresh

Wait for refresh

LSA is refreshed with auth

32

Authentication with LSA max age

Wait for max age

LSA is removed

33

Authentication with SPF recalculation

Trigger SPF

Auth does not interfere

34

Authentication with route summarization

Summarize routes

Summary LSAs authenticated

35

Authentication with route redistribution

Redistribute static

External LSAs authenticated

36

Authentication with stub area

Enable in stub area

Adjacency forms with valid key

37

Authentication with NSSA

Enable in NSSA

Type 7 LSAs authenticated

38

Authentication with totally stubby area

Enable auth

Default route authenticated

39

Authentication with virtual link

Enable on virtual link

Adjacency forms with valid key

40

Authentication with max-metric router

Set max-metric

Authenticated LSAs still valid

41

Authentication with BFD

Enable BFD

Authenticated adjacency monitored

42

Authentication with graceful restart

Enable GR

Authenticated adjacency maintained

43

Authentication with LSA pacing

Tune pacing

Authenticated LSAs sent in bursts

44

Authentication with LSA delay flood

Enable delay

Authenticated LSAs delayed

45

Authentication with LSA retransmission

Drop ACK

Authenticated LSA retransmitted

46

Authentication with route tag

Tag route

Tag preserved in authenticated LSA

47

Authentication with route filtering

Filter route

Authenticated LSA not advertised

48

Authentication with route summarization policy

Apply policy

Summary LSAs authenticated

49

Authentication with route redistribution policy

Apply policy

External LSAs authenticated

50

Authentication logging and debug

Enable logging

Logs show auth success/failure

DR BDR Election - Testcases

DR/BDR Election - Test Cases

#

Test Case

Description

Expected Result

1

DR/BDR election on broadcast network

Use Ethernet interface

DR and BDR are elected

2

DR/BDR election on NBMA network

Use Frame Relay or ATM

DR and BDR are elected

3

No DR/BDR on point-to-point link

Use P2P interface

No DR/BDR election occurs

4

No DR/BDR on point-to-multipoint

Use P2MP interface

No DR/BDR election occurs

5

Highest priority becomes DR

Set highest priority on one router

That router becomes DR

6

Second highest becomes BDR

Set second highest priority

That router becomes BDR

7

Priority 0 prevents election

Set priority 0

Router does not participate in election

8

All routers priority 0

Set all to 0

No DR/BDR elected, adjacency remains 2-way

9

DR failure triggers BDR promotion

Shut DR

BDR becomes DR

10

New router joins after election

Add router with higher priority

DR/BDR do not change

11

DR preemption not supported

Add higher priority router

DR remains unchanged

12

DR/BDR election with same priority

Equal priority routers

Highest router ID wins

13

DR/BDR election with same router ID

Duplicate router ID

Election may fail or behave unpredictably

14

DR/BDR election with loopback router ID

Use loopback as router ID

Loopback ID used in election

15

DR/BDR election with interface IP as router ID

No router ID set

Highest interface IP used

16

DR/BDR election with passive interface

Set interface passive

No election occurs

17

DR/BDR election with authentication

Enable auth

Election proceeds if auth matches

18

DR/BDR election with mismatched timers

Different hello/dead timers

Adjacency fails, no election

19

DR/BDR election with mismatched subnet

Different subnet masks

Adjacency fails, no election

20

DR/BDR election with mismatched area

Different OSPF areas

Adjacency fails, no election

21

DR/BDR election with mismatched network type

One broadcast, one P2P

Adjacency fails

22

DR/BDR election with MTU mismatch

Different MTUs

Adjacency fails

23

DR/BDR election with hello interval change

Change hello timer

Election still occurs

24

DR/BDR election with dead interval change

Change dead timer

Election still occurs

25

DR/BDR election with interface flap

Flap interface

Election may reoccur

26

DR/BDR election with router reboot

Reboot DR

BDR becomes DR

27

DR/BDR election with BFD

Enable BFD

Fast failure detection triggers election

28

DR/BDR election with graceful restart

Enable GR

DR/BDR roles maintained

29

DR/BDR election with LSA flooding

Trigger LSA

DR floods LSAs to 224.0.0.5

30

DR/BDR election with multicast suppression

Block 224.0.0.6

DROTHERs fail to receive updates

31

DR/BDR election with ACL

Block OSPF packets

Election fails

32

DR/BDR election with VLAN

Use VLAN interface

Election occurs within VLAN

33

DR/BDR election with VRF

Use VRF instance

Election scoped to VRF

34

DR/BDR election with GRE tunnel

Use GRE over IP

No DR/BDR on P2P tunnel

35

DR/BDR election with IPSec tunnel

Use IPSec

No DR/BDR on P2P tunnel

36

DR/BDR election with MPLS

Use MPLS core

DR/BDR election unaffected

37

DR/BDR election with route summarization

Summarize routes

Election not affected

38

DR/BDR election with route redistribution

Redistribute static

Election not affected

39

DR/BDR election with route filtering

Filter routes

Election not affected

40

DR/BDR election with max-metric router

Set max-metric

Router still participates in election

41

DR/BDR election with logging

Enable OSPF logs

Election events logged

42

DR/BDR election with debug

Enable OSPF debug

Election process visible in debug

43

DR/BDR election with SNMP monitoring

Use SNMP

DR/BDR status visible via MIBs

44

DR/BDR election with route tag

Tag routes

Election not affected

45

DR/BDR election with route summarization policy

Apply policy

Election not affected

46

DR/BDR election with redistribution policy

Apply policy

Election not affected

47

DR/BDR election with LSA pacing

Tune timers

Election not affected

48

DR/BDR election with LSA delay flood

Enable delay

Election not affected

49

DR/BDR election with LSA retransmission

Drop ACK

DR retransmits LSAs

50

DR/BDR election with interface priority change

Change priority

New election occurs only after DR/BDR failure

Equal-Cost Multipath (ECMP) - Testcases

Equal-Cost Multipath (ECMP) - Test Cases

#

Test Case

Description

Expected Result

1

Configure two equal-cost paths

Add two paths with same cost

Both paths installed in RIB

2

Configure three equal-cost paths

Add three equal-cost routes

All paths installed in RIB

3

Configure unequal-cost paths

Add paths with different costs

Only lowest-cost path installed

4

Change cost to equalize paths

Adjust cost to match

ECMP activated

5

Remove one ECMP path

Shut one interface

Remaining paths stay in RIB

6

Restore ECMP path

Bring interface back up

Path re-added to RIB

7

Verify ECMP in routing table

Check RIB entries

Multiple next-hops listed

8

Verify ECMP in forwarding table

Check FIB entries

Multiple next-hops programmed

9

Verify ECMP load balancing

Send traffic

Traffic distributed across paths

10

Verify per-packet load balancing

Enable per-packet mode

Packets alternate across paths

11

Verify per-flow load balancing

Enable per-flow mode

Flows pinned to specific paths

12

Verify ECMP with static route

Add static ECMP routes

Static ECMP works as expected

13

Verify ECMP with redistributed route

Redistribute BGP/Static

ECMP applies to redistributed routes

14

Verify ECMP with route summarization

Summarize routes

ECMP still applies to summary

15

Verify ECMP with route filtering

Filter one path

Only remaining paths used

16

Verify ECMP with route tag

Tag ECMP routes

Tags preserved

17

Verify ECMP with route-map

Apply route-map

ECMP behavior follows policy

18

Verify ECMP with max-paths limit

Set max-paths to 2

Only 2 paths installed

19

Verify ECMP with max-paths = 1

Disable ECMP

Only one path installed

20

Verify ECMP with max-paths = 0

Invalid config

No ECMP, default to single path

21

Verify ECMP with BFD

Enable BFD

Failed path removed quickly

22

Verify ECMP with interface flap

Flap one path

Path removed and restored

23

Verify ECMP with router reboot

Reboot router

ECMP restored after convergence

24

Verify ECMP with SPF recalculation

Trigger SPF

ECMP paths recalculated

25

Verify ECMP with LSA flooding

Trigger LSA update

ECMP paths updated

26

Verify ECMP with LSA refresh

Wait for refresh

ECMP remains stable

27

Verify ECMP with LSA max age

Wait for LSA expiry

ECMP path removed if LSA expires

28

Verify ECMP with DR/BDR change

Trigger election

ECMP unaffected

29

Verify ECMP with area border

Use ABR

ECMP applies across areas

30

Verify ECMP with ASBR

Redistribute external routes

ECMP applies to external routes

31

Verify ECMP with NSSA

Use NSSA area

ECMP applies to Type 7 LSAs

32

Verify ECMP with stub area

Use stub area

ECMP applies to default route

33

Verify ECMP with virtual link

Use virtual link

ECMP applies if multiple links exist

34

Verify ECMP with GRE tunnel

Use GRE tunnels

ECMP applies to tunnel paths

35

Verify ECMP with IPSec tunnel

Use IPSec tunnels

ECMP applies to secure paths

36

Verify ECMP with MPLS

Use MPLS core

ECMP applies to labeled paths

37

Verify ECMP with VLAN

Use VLAN interfaces

ECMP applies across VLANs

38

Verify ECMP with VRF

Use VRF instances

ECMP scoped per VRF

39

Verify ECMP with QoS

Apply QoS policy

Traffic balanced with QoS preserved

40

Verify ECMP with ACL

Apply ACL on one path

Filtered path excluded from ECMP

41

Verify ECMP with NAT

Use NAT on one path

ECMP applies if NAT allows

42

Verify ECMP with multicast

Send multicast traffic

ECMP not used for multicast

43

Verify ECMP with IPv6

Use OSPFv3

ECMP works with IPv6 routes

44

Verify ECMP with IPv4

Use OSPFv2

ECMP works with IPv4 routes

45

Verify ECMP with route preference

Lower preference path

Not included in ECMP

46

Verify ECMP with administrative distance

Different distances

Only lowest distance used

47

Verify ECMP with redistribution metric

Match metrics

ECMP applies to redistributed routes

48

Verify ECMP with route aging

Wait for route timeout

Aged-out path removed from ECMP

49

Verify ECMP with logging

Enable logs

ECMP events logged

50

Verify ECMP with SNMP

Use SNMP MIBs

ECMP paths visible via SNMP

Scalable and Extensible - Testcases

Scalable and Extensible - Test Cases

#

Test Case

Description

Expected Result

1

Scale to 100 routers

Deploy OSPF in a 100-router topology

OSPF converges and routes are stable

2

Scale to 500 routers

Deploy OSPF in a 500-router topology

OSPF maintains stability and convergence

3

Scale to 1000 routers

Deploy OSPF in a 1000-router topology

OSPF remains operational with acceptable convergence time

4

Scale to 10,000 prefixes

Advertise 10,000 routes

All routes are propagated and reachable

5

Scale to 50,000 prefixes

Advertise 50,000 routes

OSPF handles route load without crashing

6

LSA database size

Measure LSDB size with 1000 routers

LSDB size is within expected bounds

7

Route table size

Measure RIB size with 50,000 routes

RIB handles all entries correctly

8

FIB programming time

Measure time to program FIB

FIB updates within acceptable time

9

SPF performance under scale

Measure SPF time with 1000 routers

SPF completes within expected time

10

Incremental SPF under scale

Enable incremental SPF

Only affected routes are recalculated

11

LSA flooding under scale

Observe LSA flooding in large topology

Flooding is efficient and controlled

12

Adjacency formation at scale

Form adjacencies in large mesh

All adjacencies form successfully

13

Adjacency teardown at scale

Simulate mass link failure

Adjacencies tear down and recover correctly

14

Route convergence at scale

Measure convergence after failure

Convergence within acceptable limits

15

CPU usage under scale

Monitor CPU usage with 1000 routers

CPU remains within operational range

16

Memory usage under scale

Monitor memory usage with 50,000 routes

Memory usage is stable and efficient

17

Multi-area scalability

Deploy multiple OSPF areas

Area boundaries respected and routes exchanged

18

Multi-level hierarchy

Use ABRs and ASBRs

Hierarchical routing works correctly

19

Route summarization at ABR

Summarize routes between areas

Summary routes reduce LSA size

20

External route summarization

Summarize external routes at ASBR

Summary routes reduce LSA size

21

Route filtering at ABR

Apply filters to inter-area routes

Filtered routes are not advertised

22

Route filtering at ASBR

Apply filters to external routes

Filtered routes are not advertised

23

Stub area configuration

Configure stub area

Type 5 LSAs are blocked

24

Totally stubby area

Block Type 3 and 5 LSAs

Only default route is advertised

25

NSSA configuration

Configure NSSA

Type 7 LSAs are allowed

26

NSSA to Type 5 translation

ABR translates Type 7 to Type 5

External routes appear in backbone

27

Virtual link scalability

Use virtual links to connect areas

Backbone continuity maintained

28

OSPF over tunnels

Use GRE/IPSec tunnels

OSPF adjacencies form over tunnels

29

OSPF over MPLS

Run OSPF over MPLS core

OSPF operates correctly

30

OSPF over VPNs

Run OSPF over VRFs

OSPF operates correctly in isolated instances

31

OSPFv3 extensibility

Use OSPFv3 for IPv6

OSPFv3 handles IPv6 routes

32

OSPFv3 with address families

Use AF support

IPv4 and IPv6 handled in OSPFv3

33

Graceful restart support

Enable GR

Adjacency maintained during restart

34

BFD integration

Use BFD for fast failure detection

BFD triggers OSPF convergence

35

Max-metric router LSA

Set max-metric on router

Router appears unreachable

36

Max-metric on ABR

Set max-metric on ABR

ABR is avoided in SPF

37

LSA pacing under load

Tune LSA pacing timers

LSAs are sent in controlled bursts

38

LSA group pacing

Tune group pacing

LSAs are grouped and paced

39

LSA refresh interval

Tune refresh interval

LSAs refreshed at configured interval

40

LSA aging

Verify aging of LSAs

LSAs age out correctly

41

LSA checksum validation

Inject checksum error

LSA discarded and regenerated

42

LSA sequence number wrap

Simulate sequence number wrap

LSA handled correctly

43

Route redistribution scalability

Redistribute large number of routes

OSPF handles redistribution efficiently

44

Route tag scalability

Tag thousands of routes

Tags are preserved and visible

45

Policy-based routing with OSPF

Apply route-maps

Policies applied correctly

46

SNMP monitoring at scale

Monitor OSPF via SNMP

SNMP data is accurate and timely

47

Logging and telemetry

Enable logging on all routers

Logs are generated without overload

48

OSPF MIB scaling

Query OSPF MIBs under load

MIBs respond correctly

49

ECMP scaling

Use multiple equal-cost paths

OSPF installs all valid paths

50

Interoperability with extensions

Use OSPF extensions (e.g., TE, SR)

OSPF remains stable and extensible

  • Reference links