7

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) ?

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 10 '17 at 1:22
11

A Tale of Three Stubs...

When using Cisco equipment, OSPF calls several things a "stub"... it gets a bit confusing....

  • Stub Host
  • Stub Network
  • Stub Area

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...

CORE01.PUB.DAL02#sh ip ospf interface lo0
Loopback0 is up, line protocol is up
  Internet Address 128.66.62.5/32, Area 0.0.0.0
  Process ID 100, Router ID 128.66.62.5, Network Type LOOPBACK, Cost: 1
  Loopback interface is treated as a stub Host
                                     ^^^^^^^^^
CORE01.PUB.DAL02#

All this is not to be confused with what OSPF refers to as "Stub Network"... which merely means a network without an OSPF neighbor

CORE01.PUB.DAL02#sh ip ospf data router internal
    ...
    Link connected to: a Transit Network                <-------  Broadcast Intf w/ Neighbor
     (Link ID) Designated Router address: 128.66.62.75  <-------
     (Link Data) Router Interface address: 128.66.62.75
      Number of TOS metrics: 0
       TOS 0 Metrics: 10
    ...
    Link connected to: a Stub Network                 <------  Broadcast Intf w/o Neighbor
     (Link ID) Network/subnet number: 128.66.62.32    <------
     (Link Data) Network Mask: 255.255.255.248
      Number of TOS metrics: 0
       TOS 0 Metrics: 1

    Link connected to: a Stub Network                 <------ Loopback interface
     (Link ID) Network/subnet number: 128.66.62.5
     (Link Data) Network Mask: 255.255.255.255
      Number of TOS metrics: 0
       TOS 0 Metrics: 1

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:

2.  The Link-state Database: organization and calculations

      The following subsections describe the organization of OSPF's link-
      state database, and the routing calculations that are performed on
      the database in order to produce a router's routing table.


      2.1.  Representation of routers and networks

                                    ... Networks can be either transit or
            stub networks. Transit networks are those capable of carrying
            data traffic that is neither locally originated nor locally
            destined. A transit network is represented by a graph vertex
            having both incoming and outgoing edges. A stub network's vertex
            has only incoming edges.

The whole point of this distinction between Transit Network and Stub Network is to save resources in the router.

  • Transit Networks must maintain additional memory for neighbor information
  • Stub Networks save memory on the router because no neighbors need to be assigned

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...

9.1.  Interface states

      The various states that router interfaces may attain is
      documented in this section.

      Down
      ...
      Loopback
              ... For this reason, IP packets may
        still be addressed to an interface in Loopback state.  To
        facilitate this, such interfaces are advertised in router-
        LSAs as single host routes, whose destination is the IP
        interface address.[4]
      ...
      Waiting
      ...
      Point-to-point
      ...

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...

  • Stub Area: No Type-5 External LSAs are allowed in this area, which means no route redistribution inside the area. A Type-3 Network LSA is originated at the ABR so no connectivity is lost from Type 5 LSAs which are blocked by the stub feature. OSPF has a E-bit field in Hello packets (E-bit = ExternalRoutingCapability), which is cleared when an area is configured as a Stub Area
  • Totally Stubby Area: No Type-5 External LSAs, and only the Type-3 Network LSA default route is permitted. This is a vendor-specific feature, which is not covered in RFC 2328.
  • Not So Stubby Area: No Type-5 External LSAs are allowed, but redistribution is permitted via a special Type-7 LSA.

Summary

In summary, we talked about...

  • Stub Host: A loopback network-type, which is always advertised as a /32 host route; Cisco calls this a stub host.
  • Stub Network: An OSPF network, which does not have a neighbor attached to it
  • Stub Area: An OSPF area, which does not permit Type-5 External LSAs.

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).

| improve this answer | |
  • 2
    "This is a Cisco feature, which is not covered in RFC 2328." That's actually a fallacy, although not defined in RFC 2328, it's still commonly implemented by most reputable vendors (Juniper, Brocade, HP). You may want to start keeping your posts vendor neutral if not explicitly asked in the OP. – Ryan Foley Apr 22 '14 at 10:20
  • I don't recall saying a Cisco-only feature :-). I apologize for any offense and will endeavor to diversify my lab, which is currently all Cisco + DLink devices. If you or anyone else have some equipment to donate towards the Mike's-Multi-Vendor Lab Foundation, my email address is in my user profile. – Mike Pennington Apr 22 '14 at 10:33
  • Just FYI, secondary IP addresses are also treated as Stub networks. They appear in a Type-1 LSA and retain their network mask. – user Dec 28 '16 at 22:05
  • Looking back on this question; The link-type in router lsa link information would be stub if the interface is passive.(loopbacks are passive by default), which implies that there is no ospf router on that link. If a OSPf link is not passive then OSPF uses link type as transit. Point-to-point and virtual links are explicitly configured and hence the config information can be used to fill in the link-type os router lsa links. Hope this cover all link types. – Hemanth Jul 19 '17 at 10:36
1

Edit after Mike & Saran comment: Stub network LSA (Router ID LSA with Type 3) is added to router LSA for loopback interfaces and any p2p or multipoint interfaces which don't have OSPF neighbors. Additionally, stub network LSAs are added to Router ID for p2p interfaces (links) even when there's existing neighbor to describe the links. Mask on the interface doesn't matter.

Also, OSPF cares only about OSPF neighbors, it can't detect non-OSPF neighbor and then decide it's actually non-stub - OSPF looks at the world from it's own point of view.

(my old answer dealt with stub areas, which was not the actual question - sorry for that!)

| improve this answer | |
  • 1
    Actually he isn't asking about the stub area feature – Mike Pennington Apr 20 '14 at 14:38
  • Yes Mike is right, I'm asking about stub "network" – Hemanth Apr 20 '14 at 15:14
1

The link-type in router lsa link information would be stub if the interface is passive.(loopbacks are passive by default), which implies that there is no ospf router on that link. If a OSPf link is not passive then OSPF uses link type as transit. Point-to-point and virtual links are explicitly configured and hence the config information can be used to fill in the link-type os router lsa links. Hope this cover all link types.

| improve this answer | |
-1

OSPF uses the E-Bit or flag in hello packets to show an area as stub.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.