In RFC 2328 it mentions that link-state information of all Loopback interfaces and all interfaces with network mask as /32 (host ip addresses) are advertised as stub network type. Now what about the cases where a interface with /24 mask is connected to a network and this is the only router interface connected to that network. Technically these are also stub networks right? So how does OSPF determine these /24 interface links as stub or not? Will it look for a OSPF neighbor-ship via that /24 interface and decide if that is a stub network? If that is the case what will be the decision for cases where there is another router connected the same network but doesn't run OSPF.
I hope the question is clear hence have not added any diagrams in case anyone needs some clarification please let me know i'll add diagrams to explain my question.
Making long question short:- While generating Router LSAs how does OSPF decide to choose the link-type(p2p, stub, transit, Virtual-link) ?
Best Answer
A Tale of Three Stubs...
When using Cisco equipment, OSPF calls several things a "stub"... it gets a bit confusing....
The meanings are very different for each term; even more confusing is the reality that you can potentially apply multiple stub terms to a single OSPF interface. I'll elaborate more below.
Background
Let's clear up some terminology... The question starts off asking about what Cisco is calling a "Stub Host"... OSPF automatically assigns Loopback interfaces to this category...
All this is not to be confused with what OSPF refers to as "Stub Network"... which merely means a network without an OSPF neighbor
Then, of course, we have an OSPF Stub Area. Let's consider where all this comes from...
OSPF Stub Network vs OSPF Transit Network
Transit and Stub networks are discussed in RFC 2328: OSPFv2 - Section 2.1:
The whole point of this distinction between Transit Network and Stub Network is to save resources in the router.
When we start scaling to potentially thousands of LSAs, even small memory savings are important. Note that OSPF hellos are still sent on a stub networks, and they are capable of forming neighbors / transitioning to a transit network unless the interface has been administratively marked as a passive interface.
OSPF Host Routes - Cisco's "Stub Host"
So now we still have the original discussion about the Stub Host, which also happens to be an OSPF Stub Network. This concept comes from RFC 2328: OSPFv2 - Section 9.1, where it discusses various interface states...
The RFC requires Loopback network types to be advertised as a /32 host route. What Cisco calls a Stub Host in
show ip ospf interface
output is really just the Loopback interface type, which OSPF allocates automatically as a /32 host route within OSPF.OSPF Stub Area
Stub areas are covered in RFC 2328: OSPFv2 - Section 3.6. There are several categories of OSPF stub areas...
ExternalRoutingCapability
), which is cleared when an area is configured as a Stub AreaSummary
In summary, we talked about...
If you really want to wrap your mind around all this, consider an OSPF router, which has a loopback interface; this router is completely contained in a single OSPF stub area. Technically, you could apply all three of the OSPF "stub" terms to this Loopback (Stub Host, Stub Network, Stub Area).