Link-state advertisement

From HandWiki

The link-state advertisement (LSA) is a basic communication means of the OSPF routing protocol for the Internet Protocol (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 original IPv4-only OSPFv2 and the newer IPv6-compatible OSPFv3 have broadly similar LSA types.

Types

The LSA types defined in OSPF are as follows:

OSPF link state advertisements
LS type LS name Generated by Distance LSA description
1 Router-LSAs Each internal router within an area area-local Originated by all routers.

The link-state ID of the type 1 LSA is the originating router ID.

2 Network-LSAs Designated router (DR) area-local Originated for broadcasts and NBMA networks by the Designated Router. This LSA contains the list of routers connected to the network.The link-state ID of the type 2 LSA is the IP interface address of the DR.
In OSPFv3 Network-LSAs have no address information and are network protocol independent.
3 Summary-LSAs (OSPFv2)

Inter-Area-Prefix-LSAs (OSPFv3)

Area Border Router (ABR) routing domain an Area Border Router (ABR) takes information it has learned on one of its attached areas and summarizes it before sending it out on other areas it is connected to. Each summary-LSA describes a route to a destination outside the area, yet still inside the AS (i.e., an inter-area route). 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, helping scalability.
In OSPFv3 Inter-Area-Prefix-LSAs have been renamed.
4 ASBR-Summary (OSPFv2)

Inter-Area-Router-LSAs (OSPFv3)

Area Border Router (ABR) routing domain This is needed because Type 5 External LSAs are flooded to all areas with the source as the Autonomous System Boundary Router's (ASBR) router ID, but router IDs are not advertised between areas. This is solved by an Area Border Router flooding the information of the ASBR where the type 5 originated. The link-state ID is the router ID of the described ASBR for type 4 LSAs.
In OSPFv3 Inter-Area-Router-LSAs have been renamed.
5 AS-external-LSAs Autonomous System Boundary Router's (ASBR) routing domain these LSAs contain information imported into OSPF from other routing processes. They are flooded to all areas unchanged (except stub and NSSA areas). For "External Metric Type 1" LSAs the metric sent is the cost from the ASBR to the External destination network and must be added to the OSPF cost to the ASBR advertising the Type 5, while for "External Type 2" LSAs routing decisions are made using the Type 1 metric cost sent as the total cost to get to the external destination including the cost to the ASBR. The link-state ID of the type 5 LSA is the external network number.[1] Default routes for the AS can also be described by AS-external-LSAs.
6 Group Membership LSA This was defined for Multicast extensions to OSPF (MOSPF),[2] a multicast OSPF routing protocol which was not in general use. MOSPF has been deprecated since OSPFv3[3] and is not currently used. It may be reassigned in the future.
7 NSSA External Link-State Advertisements The ASBR, within a Not-so-stubby area Intra-area Type 7-LSAs are identical to type-5 LSAs.
Type-7 LSAs are only flooded within the NSSA.
This are allows routers in NSSA 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.

At the area border router, selected type-7 LSAs are translated into type 5-LSAs and flooded into the backbone.

8

Link-local LSAs (OSPFv3)

Each internal router within an area Link A Type 8 LSA is used to give information about link-local addresses and a list of IPv6 addresses on the link.
  • In OSPFv2, the Type 8 was originally intended to be used as a so-called External-Attributes-LSA for transit autonomous systems where OSPFv2 could replace the internal Border Gateway Protocol (iBGP). In these networks, the BGP destinations would be carried in LSA Type 5 while their BGP attributes would be inserted into LSA Type 8. Most OSPFv2 implementations never supported this feature, and it was never standardised for OSPFv2.
9 link-local "opaque"[3] (OSPFv2)

Intra-Area-Prefix[1] (OSPFv3)

link-local It is the OSPFv3 LSA that contains prefixes for stub and transit networks in the link-state ID. It is also used for IETF NSF (Non-Stop Forwarding).
10 area-local "opaque" [3] (OSPFv2) area-local 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 (MPLS-TE) extensions to OSPF for creating the Traffic Engineering Database (TED), by flooding extra information about links beyond just their metric, such as link bandwidth and color.
11 Autonomous System (AS) "opaque" [3] (OSPFv2) routing domain LSA Type 11 packets serve the same purpose as LSA Type 10 packets but are not flooded into special area types (Stub areas).

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 link-state database (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 as shown in below table:

Link type Description Link ID Link Data
1 point-to-point connection to another router neighboring router ID IP address of the originating's interface to the network
2 connection to a transit network IP address of Designated Router IP address of the originating's interface to the network
3 connection to a stub network IP network/subnet number Subnet mask of the interface
4 virtual link neighboring router ID IP address of the originating's interface to the network

OSPFv2 for IPv4

As per Appendix-A.3.1 of RFC 2328, all OSPF packets start with a common LSA "24-byte header" as shown below.

OSPF v2 packet Header format, field length in bytes
1 1 2 4 4 2 2 8 Variable
Version 2 Type Packet length Router ID Area ID Checksum AuType Authentication Data

For


Options

Options Field , length in bits
1 1 1 1 1 1 1 1
* O DC EA N/P x E *

The Options field is present in:

  • Hello packets
  • Database Description packets
  • all the LSAs

The option field Indicative the feature supported by the source router. In Hello packet, a mismatch, will result in reject of neighbor. for LSA only packet that matches the destination routes willingness is forward.

Options (8 bits)
  • E-Bit: Indicative if area is AS-external capable, or STUBed.
  • x-bit: Set 0, used previously used by MOSPF
  • N/P-bit: Indicative if area is NSSA.
  • EA-bit: Indicative receive and forward External-Attributes-LSAs
  • DC-bit: Indicative router's handling of demand circuits, RFC 1793.
  • O-bit: Indicative router's willingness to receive and forward Opaque-LSAs
  • *: Reserved set 0

Database description DBD

Database description, Field length in bytes
24 2 1 1 4 Variable
Header
Interface MTU Options Flags DD sequence number LSA Data
0 0 0 0 0 I M MS

Database description messages contain descriptions of the topology of the autonomous system or area. They convey the contents of the link-state database (LSDB) for the area from one router to another. Communicating a large LSDB may require several messages to be sent by having the sending device designated as a master device and sending messages in sequence, with the slave (recipient of the LSDB information) responding with acknowledgments.

Interface MTU (16 bits)
the largest IP datagram that can be sent without fragmentation. In bytes.
flags(8 bits)
3 bits are defined.
  • I-Bit: Indicative this is the first packet in the sequence of Database Description Packets.
  • M-Bit: Indicative there is more packet to follow.
  • MS-bit Indicative if source is master during the Database Exchange process.
DD sequence number (32 bits)
Database Description, increments until the complete database description has been sent.

Link state request

Link state request (LSR): Link state request messages are used by one router to request updated information about a portion of the LSDB from another router. The message specifies the link(s) for which the requesting device wants more current information.

Link State request packet , Field length in bytes
24 4 4 4 Variable
Header
LS type Link State ID Advertising Router Data

Link State Update packet

OSPF Link State Update packet , Field length in bytes
24 4 Variable
Header
# LSAs list of LSAs
LSAs
  1. the total number of LSAs included in this update.

Link-state update (LSU) messages contain updated information about the state of certain links on the LSDB. They are sent in response to a link state request message, and also broadcast or multicast by routers on a regular basis. Their contents are used to update the information in the LSDBs of routers that receive them.

Link state acknowledgment

OSPF v2 Link State Acknowledgment, Field length in bytes
24 Variable
Header
list of LSAs

Link-state acknowledgment (LSAck)messages provide reliability to the link-state exchange process, by explicitly acknowledging receipt of a Link State Update message. The LSA acknowledgment, explicitly acknowledged, that it have received a LSA, by mirroring it back.


Common LSA 20-byte Packet Header

LSA 20-byte Packet Header format, field length in bytes
24 2 1 1 4 4 4 2 2 Variable
OSPF Header LS Age Options LS Type Link State ID Advertising Router LS Sequence Number LS Checksum Length DATA

Appendix-A.4.1 of RFC 2328, all LSA packets start with a common LSA "20-byte header" as shown below. Note: These LSA Packet Headers are all preceded by OSPFv2 "24-byte" OSPF Headers.


LS age (16 bits)
The time in seconds since the LSA was created.
LS type (8 bits)
1,2,3,4,5,6 or 7
Link State ID (32 bits)
Identifies the portion of the network environment that is being described by the LSA. The contents of this field depend on the LSA's LS type.
Advertising Router ID (32 bits)
source router, that originally created it.
LS sequence number (32 bits)
sequence number is incremented each time the router originates a new instance of the LSA. used to detect old and duplicate LSAs.
LS Checksum (16 bits)
Checksum of the contents of the LSA.
Length (16 bits)
The length of the LSA, in bytes.

OSPF v3

In 2008, with the introduction of RFC5340 a new standard was set.

Common OSPFv3 packet header 16-byte
Bit 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 Version # Type Packet length
32 Router ID
64 Area ID
96 Checksum AuType
128 Depending on the "OSPF packet types" details of the contents will vary.
(Details of each LS Type are listed below.)
~
~
~
~
~ ...

LSA Packet Header Formats

As per Appendix A.4.2 of RFC 5340, all LSA packets start with a common LSA "20-byte header" as shown below.

Note: These LSA Packet Headers are all preceded by standard "16-byte" OSPF Headers.

Common LSA 20-byte Packet Header

Bit/
Byte
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 LS Age LS Type
32 Link State ID
64 Advertising Router
96 LS Sequence Number
128 LS Checksum Length
160 Depending on the "LS Type" details of the contents will vary.
192
~
~
~
~ ...

As per Appendix A.4 of RFC 5340 (OSPFv3 for IPv6) depending upon the LS Type, there are nine major LSA Packet formats as follows (actually eight as one has been deprecated):

LSA Function Code LS Type Description
1 0x2001 Router-LSA
2 0x2002 Network-LSA
3 0x2003 Inter-Area-Prefix-LSA
Also referred to as Summary-LSA in OSPFv2.
4 0x2004 Inter-Area-Router-LSA
Also referred to as ASBR-Summary-LSA in OSPFv2.
5 0x4005 AS-External-LSA
Also referred to as External-LSA or AS-External-LSA in OSPFv2.
6 0x2006 MOSPF-LSA Deprecated in OSPFv3 (may be reassigned)
Was referred to as Multicast-OSPF-LSA in OSPFv2.
7 0x2007 NSSA-LSA
Also referred to as NSSA-LSA in OSPFv2.
8 0x0008 Link-LSA
9 0x2009 Intra-Area-Prefix-LSA

The nine different formats for each "Type" of LSA packet are listed below (including the deprecated LSA-6):

Type 1: Router LSA Header

Bit/
Byte
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 LS Age 0 0 1 1
32 Link State ID
64 Advertising Router
96 LS Sequence Number
128 LS Checksum Length
160 0 Nt x V E B Options
192 Type 0 Metric
224 Interface ID
256 Neighbor Interface ID
288 Neighbor Router ID
320 ...
~ Type 0 Metric
~ Interface ID
~ Neighbor Interface ID
~ Neighbor Router ID
~ ...

Type 2: Network-LSA Header

Bit/
Byte
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 LS Age 0 0 1 2
32 Link State ID
64 Advertising Router
96 LS Sequence Number
128 LS Checksum Length
160 0 Options
192 Attached Router
~ ...

Type 3: Inter-Area-Prefix-LSA Header

Bit/
Byte
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 LS Age 0 0 1 3
32 Link State ID
64 Advertising Router
96 LS Sequence Number
128 LS Checksum Length
160 0 Metric
192 PrefixLength PrefixOptions 0
224 Address Prefix
256
288 ...

Type 4: Inter-Area-Router-LSA Header

Bit/
Byte
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 LS Age 0 0 1 4
32 Link State ID
64 Advertising Router
96 LS Sequence Number
128 LS Checksum Length
160 0 Options
192 0 Metric
224 Destination Router ID

Type 5: AS-External-LSA Header

Bit/
Byte
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 LS Age 0 1 0 5
32 Link State ID
64 Advertising Router
96 LS Sequence Number
128 LS Checksum Length
160 E F T Metric
192 PrefixLength PrefixOptions Referenced LS Type
224 Address Prefix
...
256
288 Forwarding Address (Optional)
~
~
~
~ External Route Tag (Optional)
~ Referenced Link State ID (Optional)

Type 6: MOSPF LSA Header (Deprecated)

Bit/
Byte
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
N/A This LSA Type is deprecated in OSPF v3 RFC 5340 and thus is not shown here.
~
~

Type 7: NSSA-LSA Header

(Same as Type 5 except for the type number field)

Bit/
Byte
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 LS Age 0 1 0 7
32 Link State ID
64 Advertising Router
96 LS Sequence Number
128 LS Checksum Length
160 E F T Metric
192 PrefixLength PrefixOptions Referenced LS Type
224 Address Prefix
...
256
288 Forwarding Address (Optional)
~
~
~
~ External Route Tag (Optional)
~ Referenced Link State ID (Optional)

Type 8: Link-LSA Header

Bit/
Byte
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 LS Age 0 0 0 8
32 Link State ID
64 Advertising Router
96 LS Sequence Number
128 LS Checksum Length
160 Rtr Priority Options
192 Link-local Interface Address
224
256
288
320 # prefixes
352 PrefixLength PrefixOptions 0
384 Address Prefix
...
~
~ ...
~ PrefixLength PrefixOptions 0
~ Address Prefix
...
~

Type 9: Intra-Area-Prefix LSA Header

Bit/
Byte
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0 LS Age 0 0 0 9
32 Link State ID
64 Advertising Router
96 LS Sequence Number
128 LS Checksum Length
160 # Prefixes Referenced LS Type
192 Referenced Link State ID
224 Referenced Advertising Router
256 PrefixLength PrefixOptions Metric
288 Address Prefix
...
320
352 ...
~ PrefixLength PrefixOptions Metric
~ Address Prefix
...
~

References