OSPF LSA Types

Only the router that created the LSA can modify or withdraw it, all other routers can only process or forward it. Each LSA contains the sequence number and max-age timer.
The router that originally advertised an LSA refloods it (after incrementing sequence number by 1) based on a per-LSA link state refresh interval (default 30 mins).
Every router expects to have its LSA refreshed within each LSAs max-age timer (default 60 mins). When max-age is reached the LSA is flushed from the database by setting its age to the max-age (60 min)and flooding it throughout the network.

#show ip ospf database                            Shows LSA info, sequence number, refresh and max-age timers
#show ip ospf database database-summary                 Number of LSAs per type

After checking the Type 1 LSAs the routers will do recursive lookups on Type 2 LSAs searching through all the adjacencies off the DRs until they eventually come to a stub router (the edge of network). There are 3 types of networks attached to a router:
Transit network: A network over which 2 or more OSPF routers become neighbors and a DR is elected.
Another router: A direct P-t-P or P-t-M with an adjacency formed, used if only 2 routers on link.
Stub network:A subnet on which a router has not formed any neighbor relationships, like loopbacks or secondary IPs. Loopbacks are always advertised as /32 even if they have a different mask. To change this make them a network type of P-t-P.

Two very useful commands when troubleshooting OSPF to see why a route you think you are advertising is not in the routing table:
#show ip ospf database self-originate               On router where route is advertised make sure it is in OSPF
#show ip ospf database adv-router <ip>           On neighbor make sure can see it in LSAs from the source

You can see the contents of each individual LSA. Type 1 lists all the links off that router and their metric, Type 2 lists all the Type1 LSAs know by the DR and Type 3 or 5 advertise the prefix, mask, metric and the address of the ABR or ASBR advertising it.

Type 1 and 2 LSAs are only circulated within the area that they are produced.

1 – Router
Produced by every router for each area they are part of. Is flooded throughout the same area describing itself, all its links or interfaces (in that area), the state and outgoing cost of each link and any know OSPF neighbors.
If it says routing bit set on this LSA it means that there is a route to this destination in the routing table Point-to-point are adjacent routers, transit are Adjacent DRs, and Stub are all directly connected networks or loopbacks.

 #show ip opsf databaserouter <lsid>                                     Each router is identified by LSID that is the RID
#show ip opsf databaserouter <lsid> self-originate            Networks this router originates
#show ip opsf database router adv-router <ip>                   See the LSAs being advertised by this router

2 – Network
Created by the DR representing the multi-access network and all attached routers as a pseudonode (virtual router). It has no metric in the LSA as the cost to any route is always 0. The DR role is decided per-interface (network segment) rather than per-router.

 #show ip opsf database network <dr_lsid>                             LSID is the DRs interface address. The attached networks are a list of all Type 1 LSAs connected to the pseudonode

Inside an area OSPF uses link state logic, but between areas it must act like a distance vector protocol. The advertisement of Type 3 LSAs hides the topology in the original area from second area, just listing the destination subnet, metric (cost) and the ABR that advertised it.

3 – Summary
Originated by ABRs and sent into an area to advertise routes outside that area. Flooded only into areas it is originated into by the ABR, it doesn’t traverse any other areas.
It will not forward Type 1 or 2 LSAs, it is just the best route to a destination and the cost to reach that subnet. There is no SPF calculation so is effectively distance vector. If are multiple routes to a destination will have separate LSAs for each with a different advertising router.

 #show ip opsf database summary <lsid>        LSID is subnet address. Includes ABR which advertised it & cost to ABR
#show ip ospf database summary <network> adv-router <ip>          See summary being advertised by specific ABR
#show ip opsf border-routers                                                                     To see cost to reach the ABR

4 – ASBR Summary
Identical to Type 3 LSAs except the destination they advertise is an ASBR rather than a network. Created by the ABR in response to receiving a Type 5 LSA. They are created at the border of each area when a Type 5 LSA is passed on into that area.
They are generated at each area border and are all the possible different routes (via ABRs) to get to the ASBR.
Contains RID of ASBR, ABR that created it and the cost/ metric from the ASBR to the ABR.

#show ip opsf database asbr-summary <lsid>                 LSID is that of the ASBR
#show ip opsf border-routers                                              To see cost to reach the ABRs and ASBRs

 5 – AS External
Originated by the ASBR. Advertises a destination external to the OSPF area such as redistributed routes or routes sourced from another routing protocol. They are flooded throughout the domain to all areas as either E1 (advertised metric includes internal cost) or E2 (advertised metric is just external cost). Within the OSPF database they are situated under the process rather than any area as are external meaning they are not tied to any area.

#show ip opsf database external | begin ASBR                Start from LSA type 4
#show ip opsf database external <lsid>                              LSID is external network. The advertising router is the RID of the ASBR that created it and the forwarding address is 0.0.0.0 meaning forward it to the advertising router RID (ASBR – LSA4) to get to the dst

 #show ip route                    If it is E1 it only shows 1 metricvalue that incorporates both the metric and forwarding metric. If it is E2 shows the metric (metric of only the external route) as well as a Forward metric (cost to the ASBR) which is not used unless as tie-breaker

For any given prefix/length OSPF always prefers E1 over E2 routes. The costs that can be added for external routes are:
-Best intra-area cost to reach the ASBR if the ASBR is in the same area (taken from the areas LSDB)
-The cost from the ABR to the ASBR if the ASBR is in a different area (taken from the Type 4 LSA). Applies only for E1 prefixes
-The external cost for the route (taken from the Type 5 LSA)

E2 is just the seed metric (what redistribution adds) that is advertised to all others. This is never incrementedand is put in routing table on all routers. Within Type 5 LSA that are E2 it will also have a forward metric (although can only view in show ip route) which is the cost to get to the ASBR. It increments depending on how far away the router is from the ASBR. However it only comes into play if there are multiple exit points, routers look at the forwarding metric as the tie breaker it the metrics for the external router are the same.
E1 doesn’t have a forward metric in the LSA, instead its metric value is the result of the metric plus the forward metric and it is this value that is advertised to all other routers in OSPF.

7 – NSSA external
Originated by ASBRs in a NSSA area. Identical to Type 5 LSAs, but rather than been flooded throughout the OSPF domain they are only flooded within the NSSA area in which they were created. At the ABR they are translated from Type 7 to 5 LSAs but no Type 4 LSA is created as the forward address is set to the router in the NSSA area that advertised it (not 0.0.0.0) so other routers will route direct to that.
Uses the same logic as Type 5 metric type but are represented as N1 and N2.

#show ip opsf database external | begin ASBR                       Starts from LSA type 4
#show ip opsf database nssa-external <lsid>                            LSID is external network

Type 5 LSAs will have the forwarding address of 0.0.0.0, meaning route towards the advertising router (ASBR) through ABR who made LSA4. So traffic will always traverse through the ABR that created the LSA4, with the LSA4 representing the cost from the ABR to ASBR.

Type 7 forwarding address will always be the RID of the original advertising router (ASBR). When the Type 7 is converted into a Type 5 no Type 4 is created and the advertising router is changed to that of the ABR that performed the conversion. However the forwarding address is still set as the original ASBR who originated the type 7 LSA (not 0.0.0.0), so traffic can be forwarded over any path rather than always through the ABR that did the Type 7 to 5 translation.

Type 5 and Type 7 Differences

Type 4 LSA: Advertising Router is the RID of ABR who created it.
Type 5 LSA: Advertising Router is the RID of the ASBR (LSA4 created if traverses an area) and the Forward Address of 0.0.0.0 means look in the LSA4 for the ABR address who created it.
Type 5 LSA translated from Type 7: Advertising Router is the ABR who did the translation and the Forward Address is inbound/outbound interface of the ASBR.
Type 7 LSA: Advertising Router is the RID of the ASBR and the Forward Address is inbound/outbound interface of the ASBR.

#show ip route                                                                           is Intra-area
#show ip route | in O IA                                                          Will show only inter-area routes

#show ip ospf database database-summary                     Summary table showing the number of each type of LSA
#show ip opsf database                                                           Displays all LSAs and info such as Link ID (RID) and advertising router
#show ip ospf border-routes                                                The internal route table with paths and costs to ABR and ASBRs

 #show ip ospf <id> <area> database…..                                Can use any of the LSA cmds to look at the LSAs for just a specific area. However remember that LSA5 is shown under the process rather than any specific area they are routes external to OSPF

Leave a comment