cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4334
Views
28
Helpful
9
Replies

question about OSPF "show ip ospf database" output command

xine xine
Level 1
Level 1

Hi !

I'm currently prepared my BSCI certification Exam, my studdy process is on OSPF Protocol for now. In my certification documentation the author say the link ID and the advertized ID are generally the same value in " show ip ospf database " output command.

In my fisrt reading on this subject I was understand from this output command I can manually rebuild network desing as it is also possible with the output commande of "show ip EIGRP topology" in case of eigrp routing protocol is use.

I had supposed the link ID was the network adverstized and advertized router the router ID is directly connected to. But today read something different and I also remark in this output command no network mask is advertized with the link ID which make my first understanding incorrect, because OSPF is class we can assume the network mask.

Since my fisrt understanding is now invalidate, I can't understand how the routing table is construct with the information contain in the output of this command, if nothing is mention about the IP network of each router interface's is belong to.

I would also would understand what is the purpose of the link ID and Advertize Router if those as most of the time set as the same value ?

Tthanks a lot in advance !

1 Accepted Solution

Accepted Solutions

Hello,

Don't worry about your rating. We're not here to run for ratings but to help each other.

The terminology in OSPF is hard to read, that's for sure. Also, the OSPF is really an applied chapter from the graph theory (a mathematical discipline). Explaining the OSPF to someone who has had the graph theory subject during his studies is much easier, otherwise, it is necessary to find workarounds around terms and concepts and to basically re-explain the required topics of graph theory in layman terms :) And sometimes, I don't find the shortest or easiest way to do it. Fortunately, you eventually managed to get through my posts.

The area number written as IP number? Well, basically, the area number is a 4B number. You can write any 4B number by its individual bytes even it is not supposed to be interpreted as an IP address. The main reason here is that the dotted-decimal notation is easier to work with and remember for a human than expressing the entire 4B value, be it an IP address or area number or any other number. For example, what would be more easy to remember - 158.193.138.40 or 2663483944? They both express the same IP address:

peterp@pc:~$ ping 2663483944 -c 3

PING 2663483944 (158.193.138.40) 56(84) bytes of data.

64 bytes from 158.193.138.40: icmp_seq=1 ttl=55 time=31.5 ms

64 bytes from 158.193.138.40: icmp_seq=2 ttl=55 time=32.4 ms

64 bytes from 158.193.138.40: icmp_seq=3 ttl=55 time=32.4 ms

--- 2663483944 ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2003ms

rtt min/avg/max/mdev = 31.544/32.172/32.492/0.444 ms

Surely, the dotted-decimal notation is much more readable here. Working with 4B area numbers is pretty much the same. You just simplify their notation by writing out their numbers in dotted-decimal form if that's more convenient for you. If it's not, then you are free to use the linear number. Depending on your addressing customs, you may also make an area number to resemble the IP addressing used in that area, thereby making your area numbering plan easier to read.

But all this basically boils down to the fact that you can write an area number in the dotted-decimal format simply because nobody tells you that you cannot :)

Best regards,

Peter

View solution in original post

9 Replies 9

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

Before I go over the OSPF database, I have one remark regarding the EIGRP: although it has a "topology" table, that name is a poor choice. It has little to do with actual network topology, rather it is only a collection of all known networks as announced by individual neighbors, together with the distances and route states (active, passive and some other). Most certainly, you cannot reconstruct the network topology by looking at EIGRP "topology" table.

Regarding the OSPF database, you have to first distinguish between "Link state ID" (LSID) and "Link ID" (LID). The LSID is contained in the header of each LSA and it uniquely identifies that LSA. Its contents depend on the LSA type:

For LSA1, the LSID is set to the originating router's RID.

For LSA2, the LSID is set to the IP address of the network's Designated router.

For LSA3, the LSID is set to the destination network's IP address.

For LSA4, the LSID is set to the RID of the described ASBR.

For LSA5 and LSA7, the LSID is set to the destination network's IP address.

Network masks, if necessary, are contained in other parts of the LSA.

The LID is present only in the LSA1 (router-LSA) and it identifies the object that this router link connects to. Again, the contents of the LID depend on the link type:

If the link type is point-to-point, the LID is set to neighboring router's RID.

If the link type is a transit multiaccess network, the LID is set to the IP address of the Designated router.

If the link type is a non-transit network, the LID is set to the address of the network.

If the link type is virtual link, the LID is set to the RID of the virtually neighboring router.

Note that the LID in one router-LSA effectively points to the LSID of a different LSA, thereby indicating a topology relation (who is connected to whom and how).

As you can see here, the Advertising router (the originator of the LSA) may get different to the actual LSID value, as the LSID is not always the RID of the originator.

Be careful, as the "show ip ospf database" has a column caled "Link ID" but in fact it is the "Link state ID", causing pretty much confusion.

I know that this is a hard reading but please try first to go over this and feel free to ask further.

Best regards,

Peter

Hi Peter,

If I understanding correctly, you say something really different then the author of my BSCI documentation. The LSID will be most of the time different then the Advertised router column in "show ip ospf command".

for me it is the last part of the text is less clear to me when you starting "Note that the LID in one ..."

As you had tell to me this is now my second reading onthis part of OSPF chapters.... this is pretty much clear then it was in my first reading.... but it still a little bit confuse... for some parts...

other question :

when we number area we can use decimal number or a format simillar then an IP address... how can I convert from one format to the other ? and what is the utility to have area name in IP format notation ?

Hello,

The information I am providing here is taken directly from RFC 2328 where the OSPFv2 is standardized.

The Advertising Router field is always set to the RID of the originating router. There is no exception to this rule. The LSID, on the other hand, has various meanings depending on the LSA type. At the time OSPF was developed, it probably seemed to be a clever idea as it saved some space in LSAs but it also makes things more complicated. The OSPFv3 for IPv6 is somewhat different in this regard (the authors took their lesson).

Regarding the LSID and the LID and having one of them point to other: The LSA1 and LSA2 are used to build the complete topology of an area - router connected to other router, router connected to network, network connected to routers and so on. Now, when a router is connected to other routers and networks, it must somehow indicate that fact in its LSA1. This will be done by writing a proper value in the LID field so that it contains the identificator of the object that the router is connected to.

If a router R1 is connected to another router R2 via a point-to-point link, the LSA1 of R1 will be formatted so that the LID field it will contain the R2's RID. Note that the R2's RID is also the LSID of the R2's LSA1. Simply, R1's LSA1 points to R2's LSA1.

Modelling multiaccess networks is somewhat more complicated. If a router R1 is connected to an Ethernet network with more than one router, it does not indicate each and every neighbor on the Ethernet by listing its LSID in the LID fields as done previously - while it could be done that way, it would require a large number of entries in the LSA1. Rather, the entire network is modelled as a standalone "router" described by LSA2. The R1 (and each router on the segment) will indicate that it is connected to the common network by writing the IP address of the Designated Router for that network in their LSA1 LID field. Note that the DR IP address is actually the LSID of the LSA2 describing the multiaccess network. So again here, the LID in router's LSA points to the LSID of the object that the router is connected to.

I suggest you connect a simple network and try to follow this explanation on the "show ip ospf database" output so you get familiarized with that.

Regarding the conversion between a dotted-decimal and decimal area notation: If you have the area given by notation A.B.C.D, then the decimal value is

A*(256^3) + B*(256^2) + C*256 + D

Conversely, you have a number N and you want to convert it into dotted decimal format A.B.C.D, you will do these calculations:

D = N MOD 256

C = (N DIV 256) MOD 256

B = (N DIV 256^2) MOD 256

A = (N DIV 256^3) MOD 256

Best regards,

Peter

Hi Peter,

I follow your suggestion and I had setup a small OSPF network lab to understanding. With your explanation I think is now clear. I will probable have to read this chapter a other time later to sit my understanding about this.

Excuse-me for the first rating, but after I had read-it I was almost also always confused before your explanation.... same as after I was readed your second posting and before I setup my lab environnement to make my exercice... But both posting with my lab was very useful for my understanding...

I would like to know what is the idea/advantage to specifying area name in IP address format ? for my understanding...

Hello,

Don't worry about your rating. We're not here to run for ratings but to help each other.

The terminology in OSPF is hard to read, that's for sure. Also, the OSPF is really an applied chapter from the graph theory (a mathematical discipline). Explaining the OSPF to someone who has had the graph theory subject during his studies is much easier, otherwise, it is necessary to find workarounds around terms and concepts and to basically re-explain the required topics of graph theory in layman terms :) And sometimes, I don't find the shortest or easiest way to do it. Fortunately, you eventually managed to get through my posts.

The area number written as IP number? Well, basically, the area number is a 4B number. You can write any 4B number by its individual bytes even it is not supposed to be interpreted as an IP address. The main reason here is that the dotted-decimal notation is easier to work with and remember for a human than expressing the entire 4B value, be it an IP address or area number or any other number. For example, what would be more easy to remember - 158.193.138.40 or 2663483944? They both express the same IP address:

peterp@pc:~$ ping 2663483944 -c 3

PING 2663483944 (158.193.138.40) 56(84) bytes of data.

64 bytes from 158.193.138.40: icmp_seq=1 ttl=55 time=31.5 ms

64 bytes from 158.193.138.40: icmp_seq=2 ttl=55 time=32.4 ms

64 bytes from 158.193.138.40: icmp_seq=3 ttl=55 time=32.4 ms

--- 2663483944 ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2003ms

rtt min/avg/max/mdev = 31.544/32.172/32.492/0.444 ms

Surely, the dotted-decimal notation is much more readable here. Working with 4B area numbers is pretty much the same. You just simplify their notation by writing out their numbers in dotted-decimal form if that's more convenient for you. If it's not, then you are free to use the linear number. Depending on your addressing customs, you may also make an area number to resemble the IP addressing used in that area, thereby making your area numbering plan easier to read.

But all this basically boils down to the fact that you can write an area number in the dotted-decimal format simply because nobody tells you that you cannot :)

Best regards,

Peter

Thanks a lot for your explanation and example for windows computer to ping 2663483944....

I did never think we can ping in this a IP address in linear format....

Peter

I think that your first post is an excellent explanation of the link state ID and the link ID (and admittedly hard reading) and deserves much better than the first rating that it received.

HTH

Rick

HTH

Rick

Hello Rick,

Thank you very much! I appreciate it immensely.

Best regards,

Peter

Peter

The first post is refulgent explained.

regards

shivlu jain

http://shivlu.blogspot.com

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card