The Link-state advertisement
(LSA) is a basic communication means of the OSPF
routing protocol for IP
. It communicates the router's local routing topology to all other local routers in the same OSPF area. OSPF is designed for scalability, so some LSAs are not flooded out on all interfaces, but only on those that belong to the appropriate area. In this way detailed information can be kept localized, while summary information is flooded to the rest of the network.
The LSA types defined in OSPF are as follows:
- Type 1 - Router LSA - the router lists the links to other routers or networks in the same area, together with the metric. Type 1 LSAs are flooded across their own area only. The link-state ID of the type 1 LSA is the originating router ID.
- Type 2 - Network LSA - the designated router on a broadcast segment (e.g. Ethernet) lists which routers are joined together by the segment. Type 2 LSAs are flooded across their own area only. The link-state ID of the type 2 LSA is the IP interface address of the DR.
- Type 3 - Summary LSA - an Area Border Router (ABR) takes information it has learned on one of its attached areas and it can summarize it (but not by default) before sending it out on other areas it is connected to. This summarization helps provide scalability by removing detailed topology information for other areas, because their routing information is summarized into just an address prefix and metric. The summarization process can also be configured to remove a lot of detailed address prefixes and replace them with a single summary prefix, also helping scalability. The link-state ID is the destination network number for type 3 LSAs.
- Type 4 - ASBR-Summary LSA - this is needed because Type 5 External LSAs are flooded to all areas and the detailed next-hop information may not be available in those other areas. This is solved by an Area Border Router flooding the information for the router (i.e. the Autonomous System Border Router) where the type 5 originated. The link-state ID is the router ID of the described ASBR for type 4 LSAs.
- Type 5 - External LSA - these LSAs contain information imported into OSPF from other routing processes. They are flooded to all areas (except stub areas). For "External Type 1" LSAs routing decisions are made by adding the OSPF metric to get to the ASBR and the external metric from there on, while for "External Type 2" LSAs only the external metric is used. The link-state ID of the type 5 LSA is the external network number.
- Type 6 - Group Membership LSA - this was defined for Multicast extensions to OSPF (MOSPF), a multicast routing protocol which is not in general use.
- Type 7 - Routers in a Not-so-stubby-area (NSSA) do not receive external LSAs from Area Border Routers, but are allowed to send external routing information for redistribution. They use type 7 LSAs to tell the ABRs about these external routes, which the Area Border Router then translates to type 5 external LSAs and floods as normal to the rest of the OSPF network.
- Type 8 - a link-local only LSA for the IPv6 version of OSPF, which is known as OSPFv3. A type 8 LSA is used to give information about link-local addresses and a list of IPv6 addresses on the link. Type 8 is a specialized LSA that is used in internetworking OSPF and Border Gateway Protocol (BGP).
- Type 9 - a link-local "opaque" LSA (defined by RFC2370) in OSPFv2 and the Intra-Area-Prefix LSA in OSPFv3. It is the OSPFv3 LSA that contains prefixes for stub and transit networks in the link-state ID.
- Type 10 - an area-local "opaque" LSA as defined by RFC2370. Opaque LSAs contain information which should be flooded by other routers even if the router is not able to understand the extended information itself. Typically type 10 LSAs are used for traffic engineering extensions to OSPF, flooding extra information about links beyond just their metric, such as link bandwidth and color.
- Type 11 - an "opaque" LSA defined by RFC2370, which is flooded everywhere except stub areas. This is the opaque equivalent of the type 5 external LSA.
The opaque LSAs, types 9, 10, and 11, are designated for upgrades to OSPF for application-specific purposes. For example, OSPF-TE has traffic engineering extensions to be used by RSVP-TE in Multiprotocol Label Switching (MPLS). Opaque LSAs are used to flood link color and bandwidth information. Standard LSDB flooding mechanisms are used for distribution of opaque LSAs. Each of the three types has a different flooding scope.
For all types of LSAs, there are 20-byte LSA headers. One of the fields of the LSA header is the link-state ID.
Each router link is defined as one of four types: type 1, 2, 3, or 4. The LSA includes a link ID field that identifies, by the network number and mask, the object that this link connects to.
Depending on the type, the link ID has different meanings.
| Link type
|| Link ID |
||point-to-point connection to another router
||neighboring router ID |
||connection to a transit network
||IP address of Designated Router |
||connection to a stub network
||IP network/subnet number |
||neighboring router ID |