Hotspot Engine Program
OSPF defines different types of LSA, each carrying different network topology information. Helps routers establish a complete topology view to achieve efficient route calculation and data transmission.
Today, I will give you a super practical explanation of dry goods, and use actual cases to explain it to you!
The four routers, R1, R2, R3, and R4, run OSPF.
The device interface interconnection IP is shown in the figure, which is 192168.0.Address ranges that start with 0 16.
All devices are configured with the loopback0 interface and have an IP address of xx.x.x 32, x is the device number. However, only on R1 and R2, the Network Loopback0 interface.
The OSPF routerid of all devices uses the IP address of the loopback0 interface, that is, xx.x.x
In the LAN where R1, R2, and R3 reside, increase the priority of GE0 0 0 port of R3 to DR
Every router running OSPF generates Type 1 LSA, how do I understand Type 1 LSA?
In fact, it is very simple, it is to describe each routerThe situation on their own "doorstep".and will only be told"The whole village" (flooding in the area).
Class 1 LSA PrimaryThere are two functions:
1.Describe the special role of the router, such as:virtual-link、abr、asbr
This is reflected by the set of 1 of the relevant V, B, and E bits in Class 1 LSA, for example, if this device is ABR, then the B bit of the Class 1 LSA it produces will be set to 1.
2.Describes the direct link (interface) and interface cost of the router in a certain area.
For example, in the diagram above, all OSPF routers generate Type 1 LSAs and flood within the area. Let's take R1 as an example, it will generate a type 1 LSA, then in this LSA1, there are two link descriptions, one is used to describe the loopback interface and the cost value of the interface, and the other is to describe the GE0 0 0 interface and the cost value.
This Type 1 LSA will flood within Area1.
Let's start by looking at the lsdb for R1:
[r1] display ospf lsdb
ospf process 1 with router id 1.1.1.1
link state database
area: 0.0.0.1
type linkstate id advrouter age len sequence metric
router 2.2.2.2 2.2.2.2 527 48 80000005 1
router 1.1.1.1 1.1.1.1 562 48 80000006 1
router 3.3.3.3 3.3.3.3 775 36 80000007 1
network 192.168.123.3 3.3.3.3 816 36 80000003 0
sum-net 192.168.34.0 3.3.3.3 771 28 80000001 48
In fact, in Area1, the OSPF router's LSDB for Area1 is the same. In the LSDB above we observed the LSA-like class. Let's focus on R1's own Class 1 LSA:
This is a Class 1 LSA, R2 is roughly similar to a Class 1 LSA in Area1, so what is a Class 1 LSA for R3 flooding?
To summarize, the contents of the Link ID and Link Data fields are different when OSPF Class 1 LSAs describe different link types
In a multi-access MA network (such as Ethernet or Frame Relay network), DR and BDR will be elected, and all DRothers can only establish adjacency relationships with DR and BDR, and DROTHER will not establish full OSPF adjacencies between non-DR and BDR routers.
In a way, DR actually represents the MA network, flooding Type 2 LSAs within the region to represent all the routers in the MA network.
Therefore Type 2 LSAs only exist in areas with MA networks and are sent by DRs to describe all routers (router-ids) in this MA network.
In the above example, the GE0 0 0 port of R3 is 1230 network DR, so R1 and R2 only establish a fully adjacent adjacency relationship with R3.
At this time, R3 becomes the representative of this MA network, which sends a Type 2 LSA, the content of the LSA is shown in the figure, see below for details, note that the Type 2 LSA is only flooded in Area1.
To sum it up:Type 2 LSA, also known as network LSA, is generated by the DR and describes the routerid of all the routers it connects to on that MA network (including the DR itself) and the mask of that MA network.
Category 2 LSAs only flood within the local area and are not allowed to cross the ABR. And only in the MA network.
There is no cost field in a Type 2 LSA (so a Type 1 LSA is required for the SPF algorithm).
Thanks to LSA-like calculations, OSPF has no problem with route calculations within a region.
network summary lsa)
The first two types of LSAs solve the problem of intra-regional route computation, but what about inter-regional? What if the router needs to access a different area?
This is where Type 3 LSAs are required.
Type 3 LSA is network aggregation LSA, and the word "aggregation" here is actually more appropriately translated as "induction", which is a completely different concept from routing aggregation.
Since the ABR belongs to more than two regions at the same time (there must be backbone regions among them), it knows the LSA-like of these regions, then it can do something:
Summarize the class LSA of a certain region, and then generate 3 types of LSA for other regions and flood them to other regions, so that the inter-region route calculation is no problem.
Hence the Class 3 LSA, which is produced from ABR:
In the figure above, r3 summarizes the lsa1 in area0, and then injects lsa3 into area1, which is actually described as 192168.34.0 24 and the cost value, of course, this cost value is actually the cost of the serial4 0 0 port interface of R3.
In the preceding figure, R3 injects the network information in Area1 into Area0 through LSA3, which contains three network segments. 2.2.2/32。Then R4 can calculate and get three routes.
Let's take a look at the LSDB for R3
Let's take a look at the 3 types of LSAs produced by R3 in more detail
The above are the three types of LSAs generated by R1 in Area0 and Area1. In fact, the Type 3 LSA is used by the ABR to advertise the subnet information of one region to other regions.
Thinking about it from a deeper perspective, the Category 3 LSA transfer between OSPF areas is very similar to the behavior of the distance vector routing protocol.
asbr summary lsa)
In order to explain LSA4 and LSA5, we need to make some minor changes to the configuration. On R4, we open a new loopback interface and configure an IP address with a subnet bit of 4444.44.0 24, now we use the import-route way, 4444.44.Direct routes 0 24 are re-advertised to OSPF.
Then continue with our explanation:
A Type 4 LSA is an LSA that points to an ASBR and is generated from the ABR in the area where the ASBR is located (this is something to be aware of).
As a domain border router, the ASBR injects external routes into the OSPF domain by re-publicing, and these external routes are passed in the OSPF (these external routes are propagated in the domain in the form of Type 5 LSA), and our routers inside OSPF want to go to these external network segmentsTwo conditions need to be met at the same time:
1.Know the external route (this is done by republishing the action, the injection is done, and the propagation is done with the help of a class 5 LSA).
2.Know the location of the ASBR that completed this redistribution action
That is to say, if we are in a besieged city, if we want to go somewhere outside the besieged city, we need to meet two conditions, 1 is that you need to know what is outside, and 2 is that you need to know that the city gate is in**, so the 5 types of LSA tell you what is outside, and the 4 types of LSA tell you who the city gate is.
The key lies in the second point.
The intra-regional router in the same area as the ASBR (for example, R3 in this experiment) can know the location of the ASBR through the Class 1 LSA generated by the ASBR (R4) (E bit = 1 in the Type 1 LSA, so the routers in the same area as the ASBR know), but the problem is that the flood range of the Class 1 LSA is in the same area, so how can the router outside the region (such as R1 and R2 in Area1) know the location of the ASBR?
Then you need to use Type 4 LSA.
Therefore, Type 4 LSAs are generated by the ABR and are used to tell other OSPF routers who are not in the same region as the ASBR about the ASBR.
In the preceding figure, R4 is used as the ASBR and the route is imported, which directly connects route 44.4.4 32 OSPF was introduced.
These routes are spread across the OSPF domain in the form of Type 5 LSA. But 44.4.4 32 routes should actually be loaded into the ospf routing tableIt is also important that they know where the ASBR is injected into this external route.
As we have already said, R3 in the same area as ASBR R4 knows about the ASBR through LSA1, but the router in Area1 does not, because the Class 1 LSA generated by R4 can only flood in Area0.
At this time, R3 plays an important role as an ABR, and when it learns the location of the ASBR, it will inject Type 4 LSA into Area1 to describe the ASBR.
In this way, R1 and R2 in Area1 learn route 4 through LSA54.4.4 32, and learned the location of the ASBR through LSA4Therefore, the external route can be loaded into their routing table.
Let's take a look at this Class 4 LSA on R1:
as external lsa)
R4 is already an ASBR at the moment because it routes 44 externally44.44.0 24 is injected into ospf via import-routeThis external route is actually flooded throughout the OSPF domain via LSA5.
nssa external lsa)
Category 7 LSA is oneVery special LSA,It should be noted that this LSA, as an LSA describing an external route, can only be flooded in the NSSA and cannot cross the NSSA into the backbone area 0
The NSSA in the special area will block the entry of the Type 5 LSA from the backbone area Area0, and at the same time allow the NSSA to originate external routes locally, and these external routes will be flooded in the local NSSA in the form of Type 7 LSA, and when these Type 7 LSAs reach the ABR of the NSSA, the ABR will be responsible for converting these Type 7 LSAs into Type 5 LSAs before they can be injected into the backbone area.
Take a look at the picture above, usMake a slight change to the configuration:
Configure area1 as nssa. Then create another loopback1 on r1 and configure an 1111.11.0 24 subnet IP, and then import this direct route into OSPF:
In this way, since the external route is injected in the special area NSSA, it is injected as LSA type 7 and flooded in NSSA Area 1.
Do a look on r2:
We see that in Area 1, there is already an NSSA type LSA, which is a type 7 LSA.
Let's take a look at the details:
As we can see, there is no significant difference between Type 7 LSAs and Type 5 LSAs in packet format. Both are used to describe external routes.
However, Class 7 LSAs can only exist in NSSAs and cannot be flooded into regular areas.
Therefore, in this experiment, R3 can also receive the Type 7 LSA generated by R1 from Area1, and load the following route in the routing table:
However, Type 7 LSAs cannot enter Area0, so how can users in Area0 learn this external route?
As an ABR, R3 plays a very important role, it will do a "7 to 5" action, that is, the 7 types of LSA are converted into 5 types of LSA, and then flooded into Area0, and thus flooded into other conventional areas
We can do that again on R4:
We see, 1111.11.0 is an external SLA, and when it comes to R4 in Area0, it becomes a Class 5 LSA, and the advrouter, that is, the informer, is R3.
Article**
2024.1. Detailed Explanation of OSPF LSA Types [Data Communication Basics] Huawei Carrier Customer Service Center.