Sunday 6 April 2014

OSPF Link Count and the Stub Network Issue:



This is a quick and dirty blog on an issue I came across when discussing the relationship between the number of physical interfaces and ospf link counts I hope it’s useful.

Understanding link counts can be critical to ospf troubleshooting, if you don’t understand how the link count is generated and its relationship to the physical link count then you can’t accurately predict how many LSA’s you should be seeing!

Examine the output below:


Core_3#show ip ospf database
Link ID         ADV Router      Age         Seq#       Checksum Link count
10.1.1.1        10.1.1.1        1767        0x80000005 0x006047 4
10.1.2.1        10.1.2.1        1001        0x80000008 0x002A9B 5
10.1.3.1        10.1.3.1        1766        0x80000005 0x00790A 3
10.1.4.1        10.1.4.1        1001        0x80000004 0x00DE64 3

Note there is a link count of 15 (we will look at this more closely)

Looking at the links for 10.1.3.1 Core_3  we can see that there is a link count of 3 but this router actually has only 2 physical?

 Whats going on??

To understand this take a look at the interfaces on core_3:

Core_3#show ip ospf interface
Serial1/0 is up, line protocol is up
  Internet Address 10.1.123.3/24, Area 0
  Process ID 1, Router ID 10.1.3.1, Network Type POINT_TO_MULTIPOINT, Cost: 64
  Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
    oob-resync timeout 120
    Hello due in 00:00:25
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 2/2, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 10.1.1.1
  Suppress hello for 0 neighbor(s)
Loopback3 is up, line protocol is up
  Internet Address 10.1.3.1/24, Area 0
  Process ID 1, Router ID 10.1.3.1, Network Type POINT_TO_POINT, Cost: 1
  Transmit Delay is 1 sec, State POINT_TO_POINT
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)

We can see that there is a point to multipoint interface and a point to point interface.

Now let’s have a look at the interfaces on another router called Core_2

Examining the interfaces on core 2 you will find there are three physical links 2 x point to point and 1 x point to multipoint but again this router is showing  a link count of 5 and this is your first clue as to what is going on, remember each link is described by an LSA.

If we look closer at the LSA’s generated for point-to-point links you will find that a point to point link is described by two LSA’s one LSA describes the link to another router (point-to-point) and another that describes the subnet between them as a stub network, we can better understand this by examining the link as follows:

CORE_2#show ip ospf database router self-originate

            OSPF Router with ID (10.1.2.1) (Process ID 1)

                Router Link States (Area 0)

  LS age: 518
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 10.1.2.1
  Advertising Router: 10.1.2.1
  LS Seq Number: 80000006
  Checksum: 0x2E99
  Length: 84
  Number of Links: 5

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 10.1.4.1
     (Link Data) Router Interface address: 10.1.124.2
      Number of TOS metrics: 0
       TOS 0 Metrics: 64

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 10.1.124.0
     (Link Data) Network Mask: 255.255.255.0
      Number of TOS metrics: 0
       TOS 0 Metrics: 64

From the above you can see that for the link to 10.1.4.1 two lsa’s are generated describing the link to the other router and the network itself as a stub network. One more point, you may not be aware that there are several types of “TYPE 1 LSA’s” here’s a handy reference table for them:

LSA Type 1 (Router LSA)
Link Type
Description
Link ID Field contents
1
Point to point link to another router
Neighboring routers id
2
Link to a transit area
DR’s interface address
3
Link to a stub network
Network/Subnet number
4
Virtual Link
Neighboring router ID


I like to think of it this way, if you have only one choice of where you enter and where you leave the network and no election is held then ospf describes it as a stub.   If there is an election held and there are multiple exits (shared subnet) then it is described as a transit network.

This is an important concept to grasp, talking with others who are studying ospf they get really confused when there links don’t tally up, so keep that in your head point-to-point links take two LSA’s to describe them and the number of physical links do not equal the number of LSA link counts.

No comments:

Post a Comment