OSPF LSA in pictures

Theme of OSPF dynamic routing protocol has not once raised Habré . However, the question of what LSAs are and what they are, it seems to me, is not transparent enough. And I would like to talk about this without reference to a specific manufacturer and console commands.

Let me briefly recall that when using the OSPF protocol, routers exchange information about the network topology. Then, based on this information, Dijkstra's algorithm calculates a routing table. So LSA 1and there are pieces of the information from which the router adds up the network diagram. Traditionally, when describing them, you can see the message format tables, but I propose to consider LSA as puzzle pieces, from which the router collects a complete graph of network 2 .

So:

LSA type 1 - “pieces with routers”

each router reports its own unique “router-id”, and a detailed list of interfaces.
for each interface it is indicated:
IP address (if there is 3 )
the interface type
“router-id” with which the adjacency state is set on this interface.
image
If adjacencies are not installed on the interface, then the net mask for the IP address is written in the field for “router-id” and this side of the slice can be considered “flat” (no longer routers).

If the link type is a point-to-point or virtual connection, then now you need to find another piece, with the famous “router-id” in the middle and combine the corresponding connections.
image
If the type of interface is Broadcast or NBMA (multiple access network), then on the other end there can be many different routers and here we need

LSA type 2 - “pieces with nets”

In networks with multiple access (and regular ethernet is just one of those), routers choose from their number a “manager” (DR), with which they establish an adjacency 4. 4. So, each such “manager” sends out messages that can be drawn like this :
image
in the middle, the DR IP address in this network with a mask, and a complete list of connected routers. Fill in the blanks:
image
That's all, now repeating the steps from Figures 2 and 4, the router collects the complete network topology from pieces and can run the SPF algorithm. e have known the best way to all routers and networks.
puzzle topology Area we have already laid down. However, because the IP network is not always limited to only one Area and protocol OSPF, the LSA is not yet over.

LSA type 3 - “routes to another area" 5

we draw this component as a green box attached to the router, with information about the network from another Area and the cost of the connection. The router to which we connect them is called ABR. Interfaces to which we hook the “frame” are not indicated, because they belong to another area.

LSA type 5 - “routes of other routing domains”

similarly to the previous one, it can be imagined as an orange box attached to a router, with information about which networks it can send packets to, regardless of the OSPF protocol. The router that sends such LSAs is called ASBR.
image
LSA type 4 - long tail.

What should I do if the router to which I want to attach the networks from the previous item is in a different Area? Especially for this, devices located on the border of 2x Area transmit not only “LSA type 3” but also “LSA type 4” in which they announce about all known routes to ASBR from other Area, and their cost. Draw such an ASBR in green. A particularly interesting case considered in this article can be depicted as an orange square attached to a green one.

It turns out that in the last figure:
blue routers with interfaces it is LSA type 1
cloud with a prefix - LSA type 2
green boxes - LSA type 3
orange boxes it is LSA type 5
green router - LSA type 4
green and orange connecting lines carry information about the cost of the corresponding connection.
yyyy and zzzz routers - ABR (they include green lines)
kkkk and wwww routers - ASBR (they include orange lines)

LSA type 6 is actually not used anywhere and is not implemented by the main vendors. Therefore, we skip.

LSA type 7 is actually a complete analogue of LSA type 5 for NSSA types of Area. When crossing the border of the Area, they turn into them.

The remaining LSAs are not connected with IP routes, so I will not consider them.

A small summary:

The SFP process that calculates the cost of routes using the Dijkstra algorithm starts only with changes in LSA 1 or 2 (required for any changes).
The cost to the routes announced in other LSAs is obtained by simply adding up the cost to ABR / ASBR and the metrics of the green and / or orange “links”.
The router can be ABR and ASBR at the same time.

When does the puzzle not add up?


Quite often there is a situation when you cannot add up a complete picture from all the pieces available. This is due to the fact that in Link State protocols there is no way to immediately discard the “disappeared” LSA.
Consider the last figure.
For example, on the yyyy router, the interface fell in the direction of bbbd (gray cloud). Then yyyy generates a new LSA of type1 (with the same ID, but with a higher serial number), where the disconnected interface is no longer there. zzzz installs a new LSA in LSDB, recounts the routing table ... But it still stores in memory all LSAs received from gggg, mmmm and kkkk, the connection with which has already been lost. those. there were extra pieces left. Similarly, if “router-id” suddenly changes at the router, then all the others for some time keep 2 copies of the LSA: with the old and the new ID.
Each router has a “router-id” and it must be unique. What happens if there are duplicates depends on the vendor and settings, but one thing can be assured confidently - there will be problems. As the simplest example: 2 routers broadcast mutually exclusive LSAs; the rest will install LSAs with a large serial number, and networks connected to another device will be lost and inaccessible. This can be compared to the loss of a piece of the puzzle.
Similarly, there should not be DRs with the same IP addresses.

I dare to hope that the community will find this writing style interesting.

  1. - Link State Advertisement. LSAs are elements of an adjacency list for a network graph; this list itself is called LSDB (Link State Database).
  2. - in fact, only those Area to which
  3. - if the interface is “Unnambered” or “Virtual Link” then just its number is transmitted.
  4. - it turns out as if all routers of the segment are directly connected to DR, and the cost of links for DR is zero.
  5. -Region = Area is a piece of our OSPF routing domain, in each such piece the topology is calculated independently.

Also popular now: