OSPF LSAs
LSA components
Sequence number
InitialSequenceNumber = 0x80000001
MaxSequenceNumber= 0x7FFFFFFF
When MaxSequnceNumber is reached, and a new update must be sent, the LSA is flushed by setting the Age to MaxAge and reflooding it over all adjacencies. Then, a new version of the LSA is sent with sequence number set to InitialSequenceNumber
Checksum – Age is not used in checksum since it’s always changing
Age
When a LSA is originated it starts with Age=0. Every time the LSA is flooded out an interface it’s age will be increased with InfTransDelay (1 sec)
LSAs are also aged when they reside in the LSDB.
When the Age reaches MaxAge (3600 sec = 1 hour), the LSA is reflooded and is flushed from the database
When a router needs to flush a LSA it sets the Age to MaxAge
Link State Database – LSDB
When multiple instances of the same LSA are received, a router will:
Compare sequance number – the higher will be considered more recent
Compare checksum – the highest unsigned is considered more recent
Compare Age – Normally, the highest is considered more recent but if the age differs by more than 15 minutes (MaxAgeDiff) the LSA with the lower Age is considered more recent. If one of the LSAs reached MaxAge it is considered more recent. If none of the previous are true, then the LSAs are considered identical
All valid LSAs received by a router are stored in its LSDB. To view the LSDB, use:
Every LSRefreshTime (30min) – the router that originated the LSA floods a new copy of the LSA with an incremented sequence number and an age of zero. Upon receipt, the other OSPF routers replace the old copy of the LSA and begin aging the new copy.
To avoid inefficient LSA updates, LSA group pacing can be enabled. It adds a delay (default 240 sec) to the LSA Update in order to group more LSAs in a single update.(enabled by default)
Reducing LSA Flooding
LSAs are flooded with DoNotAge=1 and will not be refreshed unless they change. The LSA Age will be incremented as it passes from router to router but it will not age while in the LSDB.
Destination Types
A LSA Destination can be a network or a router.
If the destination is a network, it is added to the Routing Table.
If the destination is a router, it is the route to an ABR or an ASBR. They are kept in an internal table:
LSA Types
Router LSA
Network LSA
Network Summary LSA
ASBR Summary LSA
AS External LSA
Group Membership LSA
NSSA External LSA
External Atribuites LSA
Opaque LSA (link-local scope)
Opaque LSA (area-local scope)
Opaque LSA (AS scope)
To better understand the different types of LSAs, we will use the following example
Here, we have The backbone area and 3 non-backbone areas (Area 367, Area 1245 and Area 568). Area 568 is configured as an NSSA area where R8 injects a route to 88.88.88.0 as E1. A virtual link exists between R1 and R5. R6 redistributes OSPF into EIGRP while R7 advertises a default route into OSPF and a route to 77.77.77.0 as E2. The following show commands will be used in the following segment:
Router LSA – Type 1
Type 1 LSAs are generated by every router. On each interface running OSPF, the router will generate a Type 1 – Router LSA which will be flooded to all routers in the same area. The LSA ID of a Type 1 LSA is equal to the Router ID that advertised it. For example, on R5:
On R5 we have 4 Router LSAs in Area 0 (over the Virtual Link to R1), 3 Router LSAs in area 568 and 4 Router LSAs in area 1245. You can see that the Router LSAs are flooded inside the area because R5 has LSAs for R1 and R2 in area 1245 even if they are not directly connected. You can also see that only routers that are inside the area appear in the Router LSAs. A Type 1 – Router LSA, contains information about the links a router has in an area. For example, seen from R4, the links of R5 in area 1245 appear like this
Notice that this LSA is for area 1245, therefor it has no information about R5’s links in other areas. Also notice the different kinds of links:
another router (point-to-point) – Connection to another router (identified by Router ID) over a point-to-point link. Information about the actual subnet used will be found in the following Stub link. On a point-to-multipoint links, only one stub entry is used for all routers, since they share the same subnet information
Stub – contains subnet information regarding point-to-point or loopback links
Transit Network – contains information regarding the DR on a multi-acesss link. Detailed information about this link can be found in a Type 2 – Network LSA generated by the DR
Virtual Link – contains information regarding the other end of a Virtual Link.
You can see the virtual link in area 0:
Network LSA – Type 2
Network LSAs are generated by the DR on every multi-access network. The LSA ID is equal to the IP address of the DR that advertised it. This type of LSA is similar to the Router LSA because it is flooded to all routers in an area. You can verify this on R5:
In each area where R5 is part of, we have a multi-access network. Therefor we have one Network LSA in Area 0 (over the virtual link), one network LSA in area 568(because we used the default NON_BROADCAST network type), and 2 Network LSAs in area 1245 (because we use ethernet connections on the links from R1 to R4 and R5). This information is flooded to all routers in the area. Here’s a detailed look at one Type 2 LSA:
The LSA contains the attached routers along with subnet information (Link State ID + Network Mask). There is no cost information, because this information is found on each of the Type 1 LSAs generated by the Attached Routers.
Network Summary LSA – Type 3
Network Summary LSAs are originated only by ABRs. An ABR has connections in Area 0 and and at least one non-backbone area. The ABR will advertise intra-area routes of the non-backbone area inside area 0, and will advertise intra-area and inter-area routes from area 0 to the non-backbone areas. For example, on R7:
You can see that the ABR (R3) is advertising Summary LSAs into Area 367 with information regarding all known routes in area 0, except those internal to Area 367. In the same time, in Area 0, R3 advertise Summary LSAs with information regarding Intra-Area routes of Area 367:
Also in Area 0, R1, R2 and R5 advertise Summary LSAs for their non-backbone areas.
When an ABR originates a type 3 LSA, it includes the cost from itself to the destination LSA it is advertising. If an ABR knows multiple routes to a destination, it originates a single type 3 LSA with the lowest cost of the multiple routes. Here’s how a Type 3 LSA looks like:
When another router receives a type 3 LSA, it will not run SPF and will insert the route in the routing table with a cost equal to the cost included in the LSA plus the cost of the route to the ABR.
You can see that the route to 4.4.4.4 has a metric of 31 in the routing table, but it was advertised in the LSA with a metric of 21.
ASBR Summary LSA – Type 4
A Type 4 LSA – ASBR Summary advertises an ASBR, not a subnet. To advertise external destinations, the Type 5 LSAs are used. They advertise external routes with an ASBR as the next hop. This ASBR can be found in the Type 4 LSAs. Each ASBR advertises a Type 4 LSA with its own Router ID as the LSA ID. These LSAs are flooded by the ABRs in all areas (except stub areas). You will find the LSA generated by R7 on R4, beeing advertised by the 2 ABRs in area 1245:
Here’s a detailed look at this LSA:
AS External LSA – Type 5
AS External LSAs are also originated by ASBRs. They advertise a destination external to the OSPF domain or an external default route. They are flooded throughout the AS. The ASBR creates one LSA for each prefix that it injects into OSPF, inluding, if necessary, one for the default route. The LSA-ID is the injected prefix.
Here’s a detailed view of one of them:
The Forward Address contains the next hop address for the destination. Normally, it is set to 0.0.0.0 which means that the Advertising Router should be used as a next hop. The exception occurs when a Type 7 LSA is translated to a Type 5 LSA, which by default sets the Next Hop Address to the ASBR that first advertised the prefix. Also notice the Metric Type information. When the metric type is set to 2, then the router will use the metric in the LSA to compute the route metric:
When the metric type is set to 1, the router will add the metric to the ASBR to the metric in the Type 5 LSA.
NSSA External LSA – Type 7
NSSA External LSAs are originated by ASBRs in NSSAs. They are flooded only within the NSSA area in which it was originated. The ABRs will translate to Type 5 AS Summary LSA before flooding to area 0. Such a LSA can be seen on R5:
Type 7 LSAs differ from Type 5 LSAs in that they set the Next Hop to the ASBR address instead of 0.0.0.0 – which means use the Advertising Router’s address. This will propagate by default into the translate Type 5 LSAs that go into area 0. We can observe this by looking first at the Type 7 LSA:
Here, we have the Forward address set to the ASBR ID. When the ABR translates it into a Type 5 LSA, it will have the same forward address:
This behavior can be changed if we use:
This will suppress the ASBR address in the Forward Address field and replace it with 0.0.0.0, meaning “use the advertising router”. This can be useful in situation where the ASBR cannot be reached from outside its area. Also notice that this route was injected with a metric type of 1. This means that in the routing table, the metric in this LSA will be added to the metric to the ASBR. Here’s the proof: the route has a metric of 149. 20 represent the LSA and 129 represent the distance to the ASBR.
Last updated