OSPF – Why are Router LSA P2P links so complicated?

OSPF – Why are Router LSA P2P links so complicated?

I earned my CCNA a good few years back,  but I still remember all the pencilled notes in the OSPF LSA section of my Todd Lammle study guide. I found the Router LSA information hard to learn, mainly because I didn’t understand why it was so complex.   In this post we’re going to take a closer look at the Router LSA,  specifically the point-to-point (P2P) link.  On completion, you should better understand why the Router LSA seems complex and you will better understand the role of the Router LSA.

OSPF has a complex view of the network

Let’s take an example of the P2P between Router_A and Router_B.  In your network diagram you might draw the network below, with the P2P link in blue:

The CLI output from Router A (below) shows the self-originated Router LSA.  The section highlighted in the blue box describes the RouterA to RouterB (A-B) link. Note that this link was pre-configured using “ip ospf network point-to-point”. 

Pretty heavy;  two stanzas to describe the A-B link.  It might be easier to understand if we re-align our diagram with the way OSPF sees the network.   In the updated diagram below, each router represents the A-B link in the Router LSA using a point-to-point (link-type 1) and a stub network (link-type 3).

Okay, so the diagram now matches the CLI output, but why are we describing the A-B link twice.  To understand that, we need to better understand the purpose of the Router LSA.

Router LSA  – Working a double-shift

Each OSPF router needs to build complete view of the interconnected nodes (or routers) and links within an area, before running the SPF algorithm.  It relies upon the flooded Router LSAs to provide the full link-state within that area.
Ideally the router LSA would be a purist; describing only it’s link-state information.  But it has a dual-role and also describes it’s locally connected prefixes [1].  The Router LSA is thus describing topology (or link-state) information and prefixes as defined below.
1) Local topology – What routers am I connected to, over which links. e.g. P2P, transit or virtual links. 
2) Prefixes – What are my locally connected subnets. OSPF calls these ‘stub networks‘.    I still find the name confusing though, I like to think of stub networks as ‘IP destinations’

But why have a stub link?

RouterA uses a P2P link type and a stub network link type for the A-B link as it is both part of the OSPF topology and it is a destination.
If I wanted to ping the RouterA link interface from a remote router then I need its subnet to be advertised.  Both routers can reach the 192.168.1.0/24 subnet, so they both advertise it using a stub-network link-type.
Wrap-up
The two main takeaways from this post are:

  • The Router LSA describes P2P links using two links; a P2P link-type describing the topology and a stub network link-type describing the subnet (or prefix).
  • The stub network is included so that you can reach the P2P link ip addresses from remote routers.
This is a foundational post that I will build upon in later posts.
Let me know in the comments if you have any follow on questions?

 
[1] In OSPFv3 the prefix information has been split off into a new LSA type;  the Intra-Area-Prefix LSA.
[2] I’ve excluded unnumbered links from this example as I don’t want to overcomplicate things. 

13 thoughts on “OSPF – Why are Router LSA P2P links so complicated?

    1. Thanks Peter. I’m planning to use this post as a lead into exploring the OSPF ‘stub-router’ and ‘prefix-suppression’ features.

  1. How about a write up on IS-IS? OSPF has too many enterprise-y features (virtual-links being one). IS-IS seems really more suited to serious network operators who care about Loopbacks only being in the IGP.

    1. Hi Minou, Thanks for the feedback. IS-IS is definitely used by many large carriers, and has a great reputation for stability. The bulk of my experience is with OSPF however, so I’ll continue with the OSPF series for now. I’m not a big fan of virtual links either, but they are a nice tool to have in your back pocket when needs must.

    1. Hey Dovydas,
      Thanks for the comment. I’m glad I could help. I’m planning a few more OSPF posts. Let me know if there’s anything else about OSPF that you find confusing, and I’ll see if I can work them into the series.

  2. Nice article John, indeed.
    I would appreciate your comments on one related topic – advertisement of loopback interfaces in router LSA. Are all the loopback interfaces created on the router by default advertised in router LSA or some additional configuration is needed? Secondly, does it make any difference in advertisement if one of the loopback interfaces is also getting used as router-id?
    Also, I would like to repeat my first question for directly connected subnets (router interfaces on which ospf is not enabled i.e. no “network” command is given, so basically they are pure stub networks).
    Regards
    jitendra

    1. Hey Jtendra,
      There’s no automatic advertisement of loopbacks or any other directly connected networks in OSPF. For Cisco you’ve got a few options as to how to configure a set of interfaces. The router-id is just a node identifier, the use of the loopback is mainly because it’s the interface least likely to change. But I’ve seen devices with RIDs where the loopback it sourced it’s ID from was removed years earlier (device hadn’t rebooted).
      If you want an interface to appear in a router LSA, you must OSPF enable that interfaces in OSPF. You can set passive-interface default if you wish. Let me know if that answers your questions.

  3. I think it’ll be better if you provide the transit link explanation compared with p2p link case. That way the audience can get a clear picture of why non-p2p link doesn’t have two type-1 LSAs to describe the existence of a router.
    Bo

  4. Nice Article john. It clears lot of ospf hidden details.
    can you please post article related to Network LSA, which is different from Router LSA.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.