Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

Number of Links in OSPF network

Greetings!

Please, look through the following output and help me out.  The network topology is equally attached.

R2(config-router)#do show ip ospf database router 192.168.1.254

            OSPF Router with ID (192.168.1.253) (Process ID 1000)

                Router Link States (Area 1)

  Routing Bit Set on this LSA
  LS age: 195
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 192.168.1.254
  Advertising Router: 192.168.1.254
  LS Seq Number: 80000003
  Checksum: 0xF82
  Length: 48
  Area Border Router
  Number of Links: 2

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 192.168.1.253
     (Link Data) Router Interface address: 192.168.1.254
      Number of TOS metrics: 0
       TOS 0 Metrics: 10

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 192.168.1.2
     (Link Data) Router Interface address: 192.168.1.1
      Number of TOS metrics: 0
       TOS 0 Metrics: 10
R2(config-router)#

I have no questions about the above as it is pretty clear.

R5(config-router)#do show ip ospf database router 192.168.1.254

            OSPF Router with ID (10.1.1.2) (Process ID 1000)

                Router Link States (Area 0)

  Routing Bit Set on this LSA
  LS age: 151
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 192.168.1.254
  Advertising Router: 192.168.1.254
  LS Seq Number: 80000005
  Checksum: 0xA44A
  Length: 72
  Area Border Router
  Number of Links: 4

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

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

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

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 10.1.1.0
     (Link Data) Network Mask: 255.255.255.252
      Number of TOS metrics: 0
       TOS 0 Metrics: 64
R5(config-router)#

Please, I need to understand how OSPF interpreted the two physical serial links and came up with four links. How does the stub network come into this matter?  Really, how does an interface connect to a network?  I thought an interface always connects to another interface.

Thanks for your help.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Number of Links in OSPF network

I have been thinking about the original question and I'd like to try a short summing up:

Generally, when something in OSPF seems to be complicated, the reason for that is often that the developers wanted to achieve more efficiency (CPU, memory, protocol network traffic).

At the time when OSPF was developed, the use of unnumbered interfaces was very common. So the structure of the type-1 LSA was optimized for this kind of  links, because router LSAs can contain a huge amount of links and this is directly related to the packet size. So a unnumbered interface can be represented compactly as a single point-to-point link without wasting any fields of the data structure.

The problem with the use of numbered interfaces now is, that the network information cannot be stored in that structure. They solved that problem by a second link whose only purpose is to exchange that additional information. The use of the Link ID and Link Data fields depend on the network type and a stub provides the network number and the subnetmask in this two fields.

Hope that helps in demystifying.

Best regards

Rolf

6 REPLIES

Re: Number of Links in OSPF network

Hi,

in OSPF, every IP-numberd point-to-point network is represented in 2 (sub-)links:

1)

Link Type: Point-to-Point

Link ID: The neighbor's Router-ID

Link Data: IP-Address of the local interface

2)

Link Type: Stub Network

Link ID: ID of the network

Link Data: subnetmask

It is interesting to examine how this looks like when you use unnumbered interfaces instead.

In google books you can find John Moy's "Anatomy of an Internet Routing Protocol", read the answer to "Q: Why is the representation of point-to-point links in OSPF so strange?" and the very last one "Q: If you could design OSPF again from scratch, what would you do differently?" in the FAQ section for all the details!

Hope that helps

Rolf

Cisco Employee

Re: Number of Links in OSPF network

Hi Rolf,

Allow me to join ... I had a discussion about this here -  perhaps the thread will be interesting to the original poster.

https://supportforums.cisco.com/thread/2171889

Best regards,

Peter

Re: Number of Links in OSPF network

Hi Peter,

I have to admit that I wasn't very happy with my answer and I'm glad that you've shared the link to this great discussion.

It's always a pleasure reading your postings and I'd like to thank you for the extraordinary work you're doing here!

Best regards

Rolf

Cisco Employee

Re: Number of Links in OSPF network

Hi Rolf,

Oh, please do not belittle your answers! It is you who is doing a great work on CSC, and we all are lucky to have you among us. I certainly did not post the link to the other discussion to show off It's just that I am myself sometimes going to my own answers for a refresher. It's often that I do an extensive research when answering a new topic, write an answer that, frankly, I am myself satisfied with (though I should stop being that as it indicates towards my egocentrism), and if new threads arise that basically ask the same or a similar question, I forward the people to the original thread.

Thank you. I am honored by your kind words.

Best regards,

Peter

Re: Number of Links in OSPF network

I have been thinking about the original question and I'd like to try a short summing up:

Generally, when something in OSPF seems to be complicated, the reason for that is often that the developers wanted to achieve more efficiency (CPU, memory, protocol network traffic).

At the time when OSPF was developed, the use of unnumbered interfaces was very common. So the structure of the type-1 LSA was optimized for this kind of  links, because router LSAs can contain a huge amount of links and this is directly related to the packet size. So a unnumbered interface can be represented compactly as a single point-to-point link without wasting any fields of the data structure.

The problem with the use of numbered interfaces now is, that the network information cannot be stored in that structure. They solved that problem by a second link whose only purpose is to exchange that additional information. The use of the Link ID and Link Data fields depend on the network type and a stub provides the network number and the subnetmask in this two fields.

Hope that helps in demystifying.

Best regards

Rolf

Cisco Employee

Number of Links in OSPF network

Rolf,

That is an awesome summary of what has been said/written so far.

You are absolutely correct that OSPF designers wanted to optimize it as much as possible. In fact, OSPF ended up being overoptimized in several places, limiting its own scalability. The funny thing is that when you start improving OSPF structurally, you will come to IS-IS in the end

Best regards,

Peter

448
Views
0
Helpful
6
Replies
CreatePlease to create content