LSA types

Into any given OSPF area, a router will originate several LSAs. Each router originates a router-LSA. If the router is also the Designated Router for any of the areas networks, it will originate network-LSAs for those networks. Area border routers originate a single summary-LSA for each known inter-area destination. AS boundary routers originate a single AS-external-LSA for each known AS external destination. Destinations are advertised one at a time so that the change in any single route can be flooded without reflooding the entire
collection of routes. During the flooding procedure, many LSAs can be carried by a single Link State Update packet.

In previous article I mentioned LSA header and LSA types. Now lets focus on these LSAs types.

Type 1 – Router LSA

A router originates a router-LSA for each area that it belongs to. Such an LSA describes the collected states of the router’s links to the area. The LSA is flooded throughout the particular area, and no further. A router also indicates whether it is an area border router, or an AS boundary router, by setting the appropriate bits (bit B and bit E, respectively) in its router-LSAs.

router-lsa

  • bit V When set, the router is an endpoint of one or more fully adjacent virtual links having the described area as Transit area (V is for virtual link endpoint).
  • bit E When set, the router is an AS boundary router (E is for external).
  • bit B When set, the router is an area border router (B is for border).
  • # links The number of router links described in this LSA. This must be the total collection of router links (i.e., interfaces) to the area.

The following fields are used to describe each router link (i.e., interface). Each router link is typed (see the below Type field). The Type field indicates the kind of link being described. It may be a link to a transit network, to another router or to a stub network. The values of all the other fields describing a router link depend on the link’s Type. For example, each link has an associated 32-bit Link Data field. For links to stub networks this field specifies the network’s IP address mask. For other link types the Link Data field specifies the router interface’s IP address.

Type – A quick description of the router link. One of the following:

                 Type   Description
                 __________________________________________________
                 1      Point-to-point connection to another router
                 2      Connection to a transit network
                 3      Connection to a stub network
                 4      Virtual link

Link ID – Identifies the object that this router link connects to. Value depends on the link’s Type. When connecting to an object that also originates an LSA (i.e., another router or a transit network) the Link ID is equal to the neighboring LSA’s Link State ID. This provides the key for looking up the neighboring LSA in the link state database during the routing table calculation. See Section 12.2 for more details.

Type   Link ID
                       ______________________________________
                       1      Neighboring router's Router ID
                       2      IP address of Designated Router
                       3      IP network/subnet number
                       4      Neighboring router's Router ID
Link Data – Value again depends on the link’s Type field. For connections to stub networks, Link Data specifies the network’s IP address mask. For unnumbered point-to-point connections, it specifies the interface’s MIB-II [Ref8] ifIndex value. For the other link types it specifies the router interface’s IP address. This latter piece of information is needed during the routing table build process, when calculating the IP address of the next hop. See Section 16.1.1 for more details.
# TOS – The number of different TOS metrics given for this link, not counting the required link metric (referred to as the TOS 0 metric in [Ref9]). For example, if no additional TOS metrics are given, this field is set to 0.
metric – The cost of using this router link.

Type 2 – Network LSA

Network-LSAs are the Type 2 LSAs. A network-LSA is originated for each broadcast and NBMA network in the area which supports two or more routers. The network-LSA is originated by the network’s Designated Router. The LSA describes all routers attached to the network, including the Designated Router itself. The LSA’s Link State ID field lists the IP interface address of the Designated Router. The distance from the network to all attached routers is zero. This is why metric fields need not be specified in the network-LSA.

network-lsa
Network Mask –  The IP address mask for the network.
Attached Router –  The Router IDs of each of the routers attached to the network. Actually, only those routers that are fully adjacent to the Designated Router are listed. The Designated Router includes itself in this list.

Type 3,4 – Summary LSA

Summary-LSAs are the Type 3 and 4 LSAs. These LSAs are originated by area border routers. Summary-LSAs describe inter-area destinations. In summary-LSAs Link State ID field is an IP network number. When the destination is an AS boundary router, a Type 4 summary-LSA is used, and the Link State ID field is the AS boundary router’s OSPF Router ID. Why it is important to advertise the location of each ASBR? When the router get the EXTERNAL LSA he decides if the LSA is valid based on many conditions. One of the conditions is that we must know where ASBR is located – how to reach ASBR. Why? Because External LSA contain advertising router field which is our very IP address of ASBR.
Other than the difference in the Link State ID field, the format of Type 3 and 4 summary-LSAs is identical.
summary lsa
Consider next pictures.
LSA-type-4
In figure ASBR sends a type 1 router LSA with e-bit set to identify itself as an ASBR. Type 1 LSA stay within an area, however when the ABR (identified by the b-bit set) receives this type of LSA, it builds a type 4 LSA and floodds it to the backbone, area 0. Subsequent ABRs regenerate a type 4 LSA to flood into their areas.
A type 4 summary LSA is generated by ABR only when ASBR exists within an area. A type 4 LSA identifies the ASBR and provides a way how to reach it by providing the Advertising router field, which is our very ABR. See? You need to know how to reach  ASBR so the External LSA is not dropped. All traffic destined for an external autonomous system requires routing table knowledge of the ASBR that originated the external routes. The link-state ID is the ASBRs router ID.

Type 5 – External LSA

AS-external-LSAs are the Type 5 LSAs. These LSAs are originated by AS boundary routers, and describe destinations external to the AS. For these LSAs the Link State ID field specifies an IP network number

  • Network Mask The IP address mask for the advertised destination.
  • bit E The type of external metric. If bit E is set, the metric specified is a Type 2 external metric. This means the metric is considered larger than any link state path. If bit E is zero, the specified metric is a Type 1 external metric. This means that it is expressed in the same units as the link state metric (i.e., the same units as interface cost).
  • metric The cost of this route. Interpretation depends on the external type indication (bit E above).
  • Forwarding address Data traffic for the advertised destination will be forwarded to this address. If the Forwarding address is set to 0.0.0.0, data traffic will be forwarded instead to the LSA’s originator (i.e., the responsible AS boundary router).
  • External route tag – tagging the route for preventing routing loops when redistributing

type-5 lsa format