I am interested to know what is the point of having Type 2 LSA's.
My understanding is that a Type 2 LSA will provide details of attached routers to a subnet - usually generated by the DR.
However every router will generate a Router Type 1 LSA, covering the links, neighbor ID or DR ID, Interface address. Surely a whole picture of a network within an area can be determined from Type 1's without the need for Type 2's.
I am obviously missing something, but I cannot tell what
you are right about type 1 LSAs being sufficient to generate a full picture of the network. The issue with type 2 LSAs is that they are generated by the DR, and all routers in the are only have a full adjacency with the DR (and the BDR actually). So in a network where a DR is elected, the DR needs to originate these type 2 LSAs and send them out so all other routers have a full picture of the network.
Thanks for the reply. I think you may have got to the heart of the matter.
A router on a multiaccess network, if it is not a DR, will generate an LSA type 1. This, as I understand will be propagated through the whole of the network(area), not just to the DR.
For example we have Router 1 (DRother), Router 2 (DRother) and Router 3 (DR) and Router 4 (Point to point with Router 3).
Router 1 generates an LSA type 1, sends it to the DR. This LSA will describe it's DR IP address, its Router ID and its connected interface.
The DR will then send this LSA type 1 to all other DRothers (in this case router 2) and to point to point Router 4.
Now all routers have a picture of what Router 1 is connected to. Why the need to generate an LSA type 2 to explain what routers are attached to the DR network. This can be deduced from the LSA type 1's that have been propogated.
One other reason for the type 2 is that yes you can build the spf without the type 2. However before adding an OSPF route, OSPF checks that the connection is two way. Having a router LSA from router1 saying that it can connect to DR1 is only one way information. If the link to R1 is down, and R1 is cutoff from the OSPF domain, without the type2 from the DR withdrawing its connection to R1, SPF would never know that R1 has gone away. The type 2 also is a convenient way to provide the subnet mask of the segment.
I've spent a considerable amount of time contemplating the same question you posed. I've setup a lab in effort to identify a few advantages of network LSAs when used to convey the network topology.
Let's stipulate an Ethernet network (with 4 routers) that can be configured as either PTMP or Broadcast. Let’s compare the different types of LSAs that will be generated depending on the type of network the OSPF interface is configured for.
When an interface that is participating in OSPF is configured for PTMP, an adjacency is formed with each neighbor and the router LSA will contain the following for Router R4:
When configuring the router’s interface for PTMP, the router LSA will contain Point to Point links (to describe each neighbor) and a single stub network to convey the subnet information. Each router will have to generate this Router LSA which can be used to deduce the topology – as you correctly stated in your post. However, if the network is capable of using broadcast, it is advantageous to configure it accordingly. The implication is that both type 1 and type 2 LSAs will be generated (this may lead you to believe that there is additional overhead however we will quantify how it is actually more efficient doing so). Let’s discuss the broadcast network type and how the LSAs are generated.
When the interface(s) are configured for broadcast, a DR (as well as a BDR) will be elected for the network. Each router will then generate a Type 1 however ONLY the DR will generate the type 2 LSA.
The routers will generate a router LSA that is 36 bytes that include 1 link – Transit (type 2). The Link ID will be the IP of the DR, and the Link Data will be the IP of the Router. The network LSA that is generated is associated to Link ID of this Router LSA.
The network LSA contains 24 bytes of header information and 4 bytes for each attached router. This is a total of 40 bytes.
When comparing the total of bytes to convey the same information, network LSAs are much more efficient (more efficient as the number of routers for that segment increase). In this topology with four routers, utilizing network LSAs in conjunction with the Router LSAs is 51% of the size of the router LSAs. This reduces the bandwidth when sending LSUpdates as well as memory utilization for the OSPF Database. Ultimately, this is conducive for convergence when SPF algorithm executes.
I hope this provides some insight for those who have had the same inquiry.
Hi Matchung ,
your explanation is very elaborate but i have one question ,
in case we have multiple router connected to a broadcast network. how DR others communicate their cost to the the other routers in the area which are not there in the same broadcast network,
Type-2 generated bt DR has no cost field and Dr others will generate type 1 lsa which can only be given to DR since it has no full adjacencies with any other router , how then DR communicates it to the rest of the network in the area surely not via type 2