Article From:

OSPFProtocol introduction and configuration (Part one)


Looking back at the working principle of distance vector routing protocols, routers running distance vector routing protocols periodically flood their own routing tables. Through routing interactions, each router learns to route from an adjacent router and loads it into its own routing table, whereas for all routers in the networkIn other words, they don’t know the topology of the network. They simply know where to go and how far to go.
In contrast, link state routing protocols are much more complicated.

1. LSAsFlooding

A neighbor relationship between routers running the link state routing protocol will first be established. Then they start to interact with each other LSA, that is, link state notification. Note that this interaction is not routing information, but link state notification. So what is link state notification?Each router produces a notification describing its own direct connection port state (including interface overhead, relationships with neighboring routers, etc.), and more commonly, each router produces an notification describing its own doorway.

2. LSDBSet up

Each router generates LSAs, and the router puts the LSAs collected in the network into its own LSDB (link state database). With LSDB, the router knows the topology of the whole network. Because every LSA stored in LSDB is generated by routers in the network.An entry describing the information of its direct connection interface.

3. SPFCalculation

Next, each router is calculated using SPF (shortest path algorithm) based on LSDB. SPF is a core algorithm of OSPF routing protocol, which is used to make routing optimization decisions in a complex network. After SPF algorithm is calculated, each router calculates a tree from itself.The “tree” that is the root, the acyclic and the shortest path. With this tree, the router actually knows the best path to reach every corner of the network.

4. Maintain routing table

Finally, the router loads the optimized path into its own routing table.

OSPF:Open Shortest Path First,The open shortest path first protocol is a link state routing protocol, described in RFC 2328. The letter O in OSPF means open, which means open, public, and any standardized device vendor can support OSPF.

OSPFIt is a widely used IGP protocol. It is very necessary to master OSPF in depth.

Unlike the routing table of the direct interactive router of the distance vector routing protocol, OSPF acts as a link-state routing protocol. The routers interact with LSA (link-state notification), and the routers collect the flooded LSA from the network into their own LSDB (link-state database), which helps OSP.F understands the entire network topology, and on this basis, through the SPF shortest path algorithm to calculate their own root, to the network corner, acyclic tree, and finally, the router loads the calculated routes into the routing table.

Two.OSPFBasic concepts


OSPF Router-IDUsed to uniquely represent an OSPF router in the OSPF domain, from an OSPF network design point of view, we require that two routers be prohibited from having the same OSPF Router ID in the full OSPF domain.
OSPF Router-IDThe settings can be manually configured or automatically selected by agreement. Of course, in actual network deployment, it is strongly recommended to configure the outer-ID of OSPF manually, because this is related to the stability of the protocol.
After the router runs OSPF and the system automatically selects Router-ID, OSPF remains the original Router-ID (that is, the Router-ID value isNon-preemptive, stabilization first, Router-ID will not change even if the reset OSPF process restarts the OSPF process at this point; unless Router-ID is manually reconfigured (manually tapping router-id XXXX under the OSPF process)) and restart the OSPF process. In addition, if the interface IP address corresponding to the Router-ID disappears, such as undo IP address, the Router ID changes after reset OSPF process.


OSPFUse cost “overhead” as a routing metric.
Every interface that activates OSPF has a cost value. OSPF interface cost=100M / interface bandwidth, where 100M is the reference bandwidth of OSPF (reference-bandwidth).
The cost of an OSPF route is the sum of the cost values of all incoming interfaces from the origin of the route all the way to the locality.

Note: The above diagram is just to help you understand how routing costs are computed. We all know that the actual routing calculations for OSPF are computed by LSA, so here’s just a visualization to help you understand: R1 updates the routing, Cost = 1, R2 from SeriaL4/0/0 port receives this route, and eventually the cost of this route in R2’s routing table equals 1 plus the cost 50 of the serial4/0/0 interface, or 51, and then updates the route to R3, so the cost of this route on R3 = 51 + 1 is52.
In addition, since the default reference bandwidth is 100M, this means that a higher bandwidth transmission medium (higher than 100M) will compute a score less than 1 in the OSPF protocol, which is not allowed in the OSPF protocol (rounded to 1). Today, network equipment is more than 1.00M bandwidth interface, at this time the calculation of routing COST is actually not accurate. So you can use the bandwidth-reference 1000 command to modify it, but this command should be used with caution, and once configured, it is recommended that all network-wide OSPF routers be configured.


OSPFThere are five kinds of messages, each of which has different uses.
HelloEstablish and maintain OSPF neighbor relationship
DBDLink state database description information (description of LSA header information in LSDB)
LSRLink state request for requesting link state information to OSPF neighbors.
LSULink state updates (including one or more LSA)
LSAckConfirm LSA in LSU


4、OSPFThree tables

Neighbor table (Peer table):
OSPFIt is a reliable routing protocol that requires the establishment of OSPF neighborhood relationship before passing link state announcements between routers. Hello packets are used to discover other OSPF routers on direct links. After a series of OSPF message interactions, all neighborhood relationships are finally established.There is a need to experience several neighbors’ relations between them. This is also an important point of knowledge. The neighbors maintained by the router on each active OSPF interface are listed in the neighbor table. By observing the neighbor table, we can further understand the neighbor state between OSPF routers.

Link state database LSDB (Link-state database):
OSPFThe network topology information is described by LSA (link state Advertisement link state notification), and then the OSPF router uses the link state database to store these LSAs of the network. OSPF collects the LSA generated by itself and its neighbors.It is stored in link state database LSDB. Only by mastering LSDB’s view and analyzing LSA deeply can you understand OSPF better.

OSPFRouting table (Routing table):
The OSPF routing table is derived from the SPF (Dijkstra) calculation of the link state database.


5、OSPFNeighbor relationship building process

OSPFNeighborhood relationship building process is a key point in the process of learning OSPF, and it is of great research value. As far as the actual deployment of OSPF is concerned, it is also necessary to master the mechanism, because the establishment of neighborhood relationship is the basic work of OSPF, if even neighborhood relationship can not be established.Come on, don’t talk about anything else. In the actual business deployment, may encounter a variety of problems that lead to OSPF neighborhood relationship can not be established properly, so this module is very worthy of deliberation.
This paper describes the basic knowledge of data communication, so the more in-depth content is not involved.


6、OSPFNetwork type

OSPFIt is a “interface sensitive” protocol, which deserves careful consideration. When we introduced OSPF cost above, it was said that routing costs actually add up to the cost of the incoming interface. And the concept of DR and BDR that will be introduced later in OSPF is actually also true.Based on the interface, in addition to the establishment of neighborhood relations, is also related to the interface, so in fact, many mechanisms focus on the interface. Once we activate OSPF on an interface, the interface will be encapsulated in layer 2 (data link layer) of the interface, bundling the corresponding OSPF network typeNote that different OSPF interface network types will have different operations on the OSPF interface.
OSPFSupported network type:

  • Point-to-point
  • Multiaccess Broadcast Network
  • Non broadcast multiple access (NBMA) network
  • P2MPnetwork

Default network types corresponding to common link layer protocols

If an interface is an Ethernet interface, then when the interface activates OSPF, the default OSPF network type of the interface is Broadcast, or Broadcast Multiplexed Network. If an interface is a serial interface, the two layer is encapsulated as HDLC or PPP, then activate O.After SPF, the default OSPF network type is Point-to-Point, that is, point to point.
The OSPF network type of the interface can be modified by command.



In broadcast multiaccess networks, such as Ethernet interfaces, all routers have the same network segment and are in the same broadcast network. If two or two of these interfaces establish OSPF neighborhood, this means that the network ***has:


With so many OSPF neighborhood relationships, maintaining so many neighborhood relationships not only consumes additional device resources, but also increases the number of LSAs flooding in the network.

  • To reduce OSPF traffic in a multipath access network, OSPF elects a designated router (DR) and a standby designated router (BDR) for each MA network (multipath access network).
  • DRElection Rules: The highest OSPF interface priority owner is chosen as DR, and if the priority is equal (default is 1), the router with the highest OSPF Router-ID is elected as DR, and the DR is non-preemptive, that is, if the MA network has been elected, the router with the highest OSPF Router-ID is selected as DR.And a DR is elected, so even if new, higher-priority devices are added, the DR election will not be affected unless the DR hangs up.
  • Designated Router (DR): DR is responsible for listening for topology change information in a multi-access network and notifying other routers of the change information, while sending LSA type 2 on behalf of the MA network. In MA network, all OSPF routers establish a OSPF adjacency close to DR.Department.
  • Backup Designated Router (BDR): BDR monitors the status of the DR and replaces its role in the event of a current DR failure
  • Note that OSPF is an “interface-sensitive protocol” and that the identity status of DR and BDR is based on the OSPF interface, so if we say, “this router is DR,” it’s actually a loose statement. Strictly speaking, it should be: “This interface of this router is on this MA network.DR “.
  • MAIn the network, all DRother routers only establish full adjacency relationship with DR and BDR, and DRothers do not establish full adjacency relationship. As a result, the OSPF neighborhood relationship that the multipath access network devices need to maintain is greatly reduced: M = n-2) *2 + 2.1, the flooding problem of LSA can also be alleviated.
  • If the network type of the router is broadcast multiaccess or non-broadcast multiaccess, the DR / BDR election will take place. So we can see that the operation of OSPF is different from the different type of OSPF interface network. On P2P or P2MP type interfaces, it is not selected.Take DR\BDR.

Let’s take a look at the flooding of LSA in the MA network with the presence of DR and BDR:

Assuming that the network has completed the OSPF convergence, now suddenly a network that R3 has hung down has malfunction.
Router R3 notifications DR and BDR with
DR、BDRListen to multicast address.
DRSend updates to multicast address to notify other routers
All OSPF routers listen to multicast address.
After receiving the LSU containing the changed LSA, the router updates its own LSDB, executes the SPF algorithm on the updated link state database over a period of time (SPF delay), and updates the routing table if necessary.
Here’s a point to remember: OSPF uses two well-know multicast addresses: and, which is a common sense to remember. All OSPF routers will listen to multicast.The message of the address will listen to for all DR/BDR.


8、OSPF Concept of area (area)

Problems in single region:

Imagine if OSPF doesn’t have the concept of zones, or if the entire OSPF network is a zone, what’s the problem? In an area, the LSA is flooded, and OSPF routers in the same area synchronize the LSA for that area, so if the entire networkIn a single area, if the scale is very large, then LSA flooding will be very serious, OSPF routers have a heavy burden, because OSPF requires all routers in the area, LSDB must be unified, so as to calculate a unified, ring-free topology;
Regional turbulence will cause the SPF calculation of the whole network router.
LSDBHuge resources consume too much, equipment performance degrades, and affect data forwarding.
Each router needs to maintain a larger routing table, and the routing in a single area can not be aggregated.


OSPFMulti region:

For these reasons, OSPF designed the concept of regional area.
Multi-region design reduces the scope of LSA flooding and effectively controls topology changes in the region to achieve the purpose of network optimization.
Routing summarization can be done at the regional boundary, and the routing table is reduced.
Making full use of the characteristics of OSPF special area, further reducing LSA flooding and optimizing routing.
Multi area improves the scalability of the network, and is conducive to the formation of large-scale networks.


OSPFBackbone area Area0 in the region:

When deploying OSPF, all OSPF domains must have and can only have one area 0, area 0 as the backbone area. The backbone area is responsible for issuing routing information (not detailed link state information) aggregated by the area boundary routers between the non-backbone areas, in order to avoid inter-area routing loops.Inter regional routing is not allowed directly between non backbone regions. Therefore, all zone boundary routers have at least one interface belonging to Area 0, that is, each region must be connected to the backbone region.


OSPFThe role of router

OSPFThe role of the router:
Regional routers Internal Router
Area boundary router Area Border Router
Backbone router Backbone Router
ASBorder router AS Boundary Router


Three.OSPF LSAsAnd special areas


As we’ve already mentioned, LSA link state notification is the most critical and core component for link state routing protocols such as OSPF. Because of LSA, OSPF can accurately describe the network topology and finally calculate the optimal routing. OSPF has designed a variety of LSA to describe network topology and various types of routing.


2、Experimental environment

The above is the network topology we used to explain OSPF LSA, which is relatively simple:

  • R1、R2、R3、R4The four router runs OSPF.
  • The device interface IP, as shown in the figure, is the address section beginning with
  • All devices have Loopback0 interface, IP address is x.x.x.x/32, and X is the device number.
    But network loopback0 interface is only on R1 and R2.
  • All devices OSPF RouterID use the IP address of the Loopback0 interface, that is, x.x.x.x.
  • In R1, R2 and R3 LAN, the GE0/0/0 port priority of R3 is raised to DR.
    We began to recognize each LSA one by one.

3、LSADetailed explanation

1) LSAType 1- router LSA (Router SLA)
Every router running OSPF will generate 1 kinds of LSA. How do we understand the 1 type of LSA? Simply, each router describes its “doorway situation” and only tells “the whole village” (flooding in the area).
1The main functions of class LSA are as follows:
Describe the special roles of the router, such as Virtual-link, ABR, ASBR:
This is reflected by the related V, B, E bit placement 1 in class 1 LSA, for example, if the device is ABR, then it produces a class 1 LSA in the B bit placement 1.
Describes the direct link (Interface) and interface COST value of the router within a certain area.

For example, in the above figure, all OSPF routers generate 1 types of LSA and flood in this area. Let’s take R1 as an example. It produces a type 1 LSA, and in this LSA1, it contains a description of two links, a C for describing the Loopback interface and the interface.OST value, and the other is the description of GE0/0/0 interface and COST value. This 1 category of LSA will flood in area1.

Let’s first take a look at the LSDB of R1:
[R1] display ospf lsdb
OSPF Process 1 with Router ID
Link State Database
Type      LinkState ID    AdvRouter Age  Len   Sequence   Metric
Router     527  48    80000005   1
Router     562  48    80000006   1
Router  775  36    80000007   1
Network    816  36    80000003   0
Sum-Net    771  28    80000001   48
Above is the LSDB of R1. In fact, in area1, the LSDB of OSPF routers on area1 is unified. In the above LSDB, we observed 1, 2 and 3 LSA. Let’s focus on 1 types of LSA generated by R1:


[R1] display ospf lsdb router                                #This command looks at router LSA, which is the 1 class LSA
OSPF Process 1 with Router ID
Link State Database
Type    : Router                                                        #LSAThe type is router LSA, which is type 1.
Ls id    :                                                        # LS IDFor, this is R1’s RouterID.
Adv rtr   :                                                     # The RouterID of the LSA announcements is the RouterID of R1.
Ls age  : 644
Len     : 48
Options  :  E
seq#    : 80000006
chksum : 0xbca7
Link count: 2                                                          #This LSA contains 2 link descriptions.
* Link ID:                                       #Link 1, ID is, that is, the IP address of DR.
Data :                                           #R1IP of GE0/0/0 port
Link Type: TransNet                                            #Link type
Metric : 1                                                           #Interface Cost=1
* Link ID:                                                  #Link 2, corresponding to Loopback interface
Data   :
Link Type: StubNet
Metric : 0 #Interface Cost=0
Priority: Medium
This is the 1 kind of LSA. R2 is similar to the 1 type LSA in Area1, so what is the 1 type LSA of R3 flooding?


[R3 ]display ospf lsdb router
OSPF Process 1 with Router ID
Area: of 1 kinds of LSA in Area0
Link State Database
Type : Router
Ls id     :
Adv rtr   :
Ls age   : 946
Len     : 48
Options  :  ABR  E
seq#     : 80000002
chksum : 0x2878
Link count: 2                              #R3A class 1 LSA flooding in Area0 contains two Links, one that actually describes the network segment where the interface is located, and the other that describes the end-to-end router of the point-to-point interface, R4
* Link ID:                     #R4RouterID
Data :                #R3The IP address of serial4/0/0
Link Type: P-2-P
Metric : 48
* Link ID:           #Describe the network segment and mask of the Serial4/0/0 port of R4.
Data   :
Link Type: StubNet
Metric : 48
Priority : Low

Area:                            #R3Flooding of 1 kinds of LSA in area1
Link State Database
Type      : Router
Ls id     :
Adv rtr   :
Ls age    : 970
Len      : 36
Options   :  ABR  E
seq#    : 80000007
chksum : 0x7fe4
Link count: 1
* Link ID:
Data  :
Link Type: TransNet
Metric : 1

Let’s conclude that, for different link types, the contents of the LSID and Data fields of OSPF class 1 LSA differ when describing different link types:


2) LSAType 2- network LSA (Network LSA)

In a multi-access MA network (such as Ethernet, or frame relay network), DR and BDR are elected, and all Drothers can only establish adjacent relationships with DR and BDR. Drothers are non-DR and BDR routers that do not have fully adjacent OSPF neighbors.Connection.
At some level, DR actually represents the MA network, flooding two types of LSA in the region to present all routers in the MA network. Therefore, two types of LSA exist only in areas with MA networks and are sent by DR to describe all routers in this MA network.(Router-ID).

In the example above, the GE0/0/0 port of R3 is the DR of 123.0 network, so R1 and R2 only establish full adjacency with R3. At this point R3 becomes the representative of this MA network, which sends two types of LSA, the LSA contains the contents as shown below, for more information, noteThe 2 category of LSA is just flooding in area1.
[R3] display ospf lsdb network
OSPF Process 1 with Router ID
Link State Database
Type      : Network                    #LSAThe type is network LSA, which is type 2.
Ls id     :            #LS IDInterface IP address with link state ID DR
Adv rtr   :                      #Announcements RouterID, naturally, is R3’s RouerID.
Ls age    : 1256
Len       : 36
Options   :  E
seq#      : 80000003
chksum    : 0x2a1e
Net mask  :        #Mask information
Priority  : Low
Attached Router        #The router connecting to the MA network: R3
Attached Router        #The router connecting to the MA network: R1
Attached Router        #The router connecting to the MA network: R2
Sum up:
2Class LSA, or network LSA, is generated by DR, which describes the Router ID (including DR itself) of all routers it connects to on the MA network and the mask of the MA network.
2Class LSA is only flooding within the Area of this area, and it is not allowed to span ABR. And only in the MA network will it appear.
2There is no COST field in class LSA (so we need to use the 1 class of LSA to do the SPF algorithm).

Thanks to 1 or 2 types of LSA, OSPF has no problem in routing computation in one area.


3) LSAType 3- network aggregate LSA (Network Summary LSA)

The first two types of LSA solve the problem of routing in the area. What about the inter area? What if the router needs to visit other regions?
3 kinds of LSA are needed. Three types of LSA are network aggregation LSA, where the word “aggregation” is actually translated as “induction” more appropriate, and it is always entirely different from the concept of routing aggregation. Since ABR belongs to more than two regions at the same time (where there must be a backbone region), it knows 1 of these regionsTwo types of LSA, then you can do one thing: one or two types of LSA in one area, make an induction, and then generate three types of LSA for other areas and flood to other areas, so that the inter-area routing calculation is no problem. .
Therefore, the 3 type of LSA is generated by ABR:

In the figure above, R3 summarizes the LSA1 in area0, and then injects LSA3 into area1, which is actually the segment described, along with the cost value, which is, of course, Seria in R3.L4/0/0 port interface cost.

The graph above shows that R3 injects network information from area1 into Area0 via LSA3, which contains three segments of information,, 1.1.1/32, and 2.2.2/32. So R4 can do it.Calculate, get three routes.
Take a look at R3’s LSDB.

[R3] display ospf lsdb
OSPF Process 1 with Router ID
Link State Database

Type      LinkState ID    AdvRouter  Age  Len   Sequence   Metric
Router     1574  48    80000002      48
Router      1573  48    80000002      48
Sum-Net       1593  28    80000001       1
Sum-Net     1350  28    80000001       1
Sum-Net     1386  28    80000001       1

Type      LinkState ID    AdvRouter   Age  Len   Sequence   Metric
Router      1351  48    80000005       1
Router      1387  48    80000006       1
Router       1597  36    80000007       1
Network       1638  36    80000003       0
Sum-Ne192.168.34.0        1593  28    80000001      48


Look at the 3 types of LSA generated by R3 in more detail.
[R3] display ospf lsdb summary
OSPF Process 1 with Router ID
# R3LSA3 injected for Area0
Link State Database
Type : Sum-Net
Ls id     :
Adv rtr   :
Ls age  : 1637
Len    : 28
Options   :  E
seq#      : 80000001
chksum    : 0x1b50
Net mask  :
Tos 0  metric: 1
Priority  : Low

Type      : Sum-Net
Ls id     :            #Describes the LSA3 of subnet.
Adv rtr   :
Ls age    : 1394
Len       : 28
Options   :  E
seq#      : 80000001
chksum    : 0xbe89
Net mask  :
Tos 0  metric: 1#cost=1
Priority  : Low

Type      : Sum-Net
Ls id     :            #Describes the LSA3 of subnet.
Adv rtr   :
Ls age    : 1430
Len       : 28
Options   :  E
seq#      : 80000001
chksum    : 0xec5f
Net mask  :
Tos 0  metric: 1#cost=1
Priority  : Low

#R3LSA3 injected for area1
Link State Database
Type      : Sum-Net
Ls id     :            #Describe the subnet of
Adv rtr   :
Ls age    : 1637
Len       : 28
Options   :  E
seq#      : 80000001
chksum    : 0xc9cb
Net mask  :
Tos 0  metric: 48#cost48
Priority  : Low
These are the 3 kinds of LSA generated by R1 in Area0 and area1. In fact, the 3 kind of LSA is ABR, which announcements subnet information in one area to other regions. To think deeper, in fact, the 3 LSA transfer between OSPF and area is very similar to the distance vector routing protocol.Act.


4) LSAType 4-ASBR summary LSA (ASBR Summary LSA)

To explain LSA4 and LSA5, we need to make minor changes in configuration. On R4, we set up a new Loopback interface, configured an IP address, subnet, and now we use import-route toThe direct routing of is re released into OSPF. Then proceed with our explanation:
4A class LSA is an LSA that points to an ASBR and is generated by the ABR in the area where the ASBR is located (this should be noted).
ASBRAs domain boundary routers, we inject external routes into the OSPF domain by redistribution, and these external routes are passed through the OSPF domain (these external routes are propagated in the domain in the form of five types of LSA), while our OSPF internal routers need to go to these external network segments if they want toThere are two conditions at the same time:

  • Knowing the external route (this has been injected through the republished action and propagated through five types of LSA)
  • Know the location of ASBR that completes the redistribution action.

That is to say, when we are in a siege, there are two requirements for us to go somewhere outside the siege. One is that you know what’s out there, the other is that you know where the gate is, so five types of LSA tell you what’s out there, and four types of LSA tell you who the gate is.
The key lies in second points. Intra-area routers in the same area as ASBR (e.g. R3 in this experiment) can know the location of the ASBR (E bit = 1 in class 1 LSA, so routers in the same area as ASBR) through a class 1 LSA generated by ASBR (R4), butThe problem is that the flooding area of Class 1 LSA is within the region. How do routers outside the region (such as R1 and R2 in area 1) know the location of this ASBR? Then we need 4 kinds of LSA.

So the four types of LSA are generated by ABR to tell other OSPF Routers not in the same area as ASBR about ASBR.

In the above image, R4 acts as ASBR, routing import and introducing direct connection into OSPF. These routes proliferate in OSPF Domain through 5 types of LSA. But’s routing must be loaded into OSP.An important factor in the F routing table is that they know where the ASBR is injected into the external route. As we’ve already said, the R3 of an area with ASBR R4 knows ASBR through LSA1, but the routers in area1 don’t.Because 1 types of LSA generated by R4 can only flood in Area0.
At this point, R3, as an ABR, plays an important role. When it knows the location of the ASBR itself, it injects four types of LSA into area1 to describe the ASBR. In this way, R1 and R2 in area1 learned the routing through LSA5.32. The location of the ASBR is also known through LSA4, so the external route can be loaded into their routing table.
Let’s look at these 4 types of LSA on R1:

[R1]display ospf lsdb asbr
OSPF Process 1 with Router ID
Link State Database
Type      : Sum-Asbr
Ls id     :
Adv rtr   :              #Notice the RouterID of the 4 class LSA ABR.
Ls age    : 1037
Len       : 28
Options   :  E
seq#      : 80000001
chksum    : 0x2ce3
Tos 0  metric: 48            #ABRThat is, R3’s own ASBR cost.


5)LSAType 5-AS external LSA (AS External LSA)

R4This is now an ASBR because it injects external route into OSPF via import-route, which actually floods the entire OSPF domain through LSA5.

[R1]display ospf lsdb ase
OSPF Process 1 with Router ID
Link State Database
Type      : External
Ls id     :            #The network number injected into this external route.
Adv rtr   :  #ASBRRouteriD
Ls age    : 781
Len       : 36
Options   :  E
seq#      : 80000001
chksum    : 0xcde2
Net mask  : for external routing
TOS 0  Metric: 1             #The external metric of this external route.
E type    : 2                    #The metric type of external routing is metric-type 2.
Forwarding Address :
Tag       : 1
Priority  : Medium


6)LSAType 7:NSSA external LSA (NSSA External LSA)

7LSA-like is a very special LSA, it should be noted that this LSA as a description of external routing LSA can only be flooded in NSSA, can not cross NSSA into the backbone area 0. Special area NSSA will block 5 types of LS coming from Area0 of backbone area.A enters and allows NSSA to initiate external routes locally. These external routes flood in local NSSA in the form of seven types of LSA. When these seven types of LSA arrive at the ABR of NSSA, the ABR is responsible for converting these seven types of LSA into five types of LSA before they can be injected into the backbone area.Domain.

Take note of the above figure, we will configure a little change: configure area1 to NSSA. Then create a Loopback1 on R1, configure a subnet IP of, and import the direct route to OSPF:

Thus, since this external route is injected in a special area NSSA, it is injected as LSA type 7 and floods within NSSA area 1.
Take a look at R2:

[R2]display ospf lsdb
OSPF Process 1 with Router ID
Link State Database
Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
Router            100  48    80000006       1
Router            100  48    80000007       1
Router            100  36    80000006       1
Network            100  36    80000003       0
Sum-Net            148  28    80000001      48
NSSA            163  36    80000001       1
We have seen a NSSA type LSA in area 1, which is the 7 type of LSA.

Let’s take a look at the details.
[R2] display ospf lsdb nssa
OSPF Process 1 with Router ID
Link State Database
Type      : NSSA
Ls id    :
Adv rtr   :
Ls age    : 253
Len       : 36
Options   :  NP
seq#      : 80000001
chksum    : 0xf90
Net mask  :
TOS 0  Metric: 1
E type    : 2
Forwarding Address :
Tag       : 1
Priority  : Low
We can see that in fact, there is no obvious difference between the 7 types of LSA in the message format and the 5 category LSA. Both are used to describe external routes. But the 7 kind of LSA can only exist in NSSA, and can not be flooding into the normal area. Therefore, in this experiment, R3 can also receive R1 from area1.The 7 class of LSA is generated, and the following route is loaded in the routing table:

[R3] display ip routing-table
Route Flags: R – relay, D – download to fib
Routing Tables: Public
Destinations : 16       Routes : 16
Destination/Mask    Proto    Pre   Cost  Flags    NextHop         Interface      O_NSSA  150   1      D   GigabitEthernet0/0/0
But class 7 LSAs are not allowed to enter area0, so how can users within Area0 learn this external routing? R3, as an ABR, plays an important role. It does a “7 to 5” action, that is, converts a 7-class LSA to a 5-class LSA, and thenIn flooding to Area0, flood into other conventional areas:

We can check again on R4:
[R4] display ospf lsdb
OSPF Process 1 with Router ID
Link State Database
Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
Router            765  48    8000000C      48
Router            686  48    8000000B      48
Sum-Net            685  28    8000000A       1
Sum-Net            640  28    80000001       1
Sum-Net            642  28    80000001       1

AS External Database
Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
External            638  36    80000001       1
External            642  36    80000001       1
We see that the external SLA of, on R4 in area 0, becomes a five-class LSA, and advrouter, the announcer, is R3.

Leave a Reply

Your email address will not be published. Required fields are marked *