LSA Types and Network Types

Table 9-4 lists the LSA types and their descriptions for reference; following the table, each type is explained in more detail, in the context of a working network.

Table 9-4 OSPF LSA Types \ Topic

LSA Type

Common Name

Description

1

Router

One per router, listing RID and all interface IP addresses. Represents stub networks as well.

2

Network

One per transit network. Created by the DR on the subnet, and represents the subnet and the router interfaces connected to the subnet.

3

Net Summary

Created by ABRs to represent one area's type 1 and 2 LSAs when being advertised into another area. Defines the links (subnets) in the origin area, and cost, but no topology data.

4

ASBR Summary

Like a type 3 LSA, except it advertises a host route used to reach an ASBR.

5

AS External

Created by ASBRs for external routes injected into OSPF.

6

Group Membership

Defined for MOSPF; not supported by Cisco IOS.

7

NSSA External

Created by ASBRs inside an NSSA area, instead of a type 5 LSA.

8

External Attributes

Not implemented in Cisco routers.

9-11

Opaque

Used as generic LSAs to allow for easy future extension of OSPF; for example, type 10 has been adapted for MPLS traffic engineering.

Before diving into the coverage of LSA types, two more definitions are needed:

■ Transit network—A network over which two or more OSPF routers have become neighbors, so traffic can transit from one to the other.

■ Stub network—A subnet on which a router has not formed any neighbor relationships. Now on to the LSA types!

LSA Types 1 and 2

Each router creates and floods a type 1 LSA for itself. These LSAs describe the router, its interfaces (in that area), and a list of neighboring routers (in that area) on each interface. The LSA itself is identified by a link-state ID (LSID) equal to that router's RID.

Type 2 LSAs represent a transit subnet for which a DR has been elected. The LSID is the RID of the DR on that subnet. Note that type 2 LSAs are not created for subnets on which no DR has been elected.

Armed with an LSDB with all the type 1 and 2 LSAs inside an area, a router's SPF algorithm should be able to create a topological graph of the network, calculate the possible routes, and finally choose the best routes. For example, Figure 9-6 shows a sample internetwork that is used in several upcoming examples. Figure 9-7 shows a graphical view of the type 1 and type 2 LSAs created in area 3.

Figure 9-6 Network Used in LSA Examples

Figure 9-6 Network Used in LSA Examples

Figure 9-7 Graph of Type 1 and 2 LSAs for Area 3

For subnets without a DR, the type 1 LSAs hold enough information for the SPF algorithm to create the math model of the topology. For example, R1 and R3 use point-to-point subinterfaces, and the OSPF point-to-point network type. SPF can match up the information shown in the type 1 LSAs for R1 and R3 in Figure 9-7 to know that the two routers are connected.

For transit networks with DRs, OSPF uses a type 2 LSA to model the subnet as a node in the SPF mathematical model. Because the SPF process treats the type 2 LSA as a node in the graph, this LSA is sometimes called apseudonode. The type 2 LSA includes references to the RIDs of all routers that are currently neighbors of the DR on that subnet. That information, combined with the type 1 LSAs for each router connected to the subnet represented by the type 2 LSA, allows SPF to construct an accurate picture of the network.

Example 9-4 shows the LSAs in area 3 (Figures 9-6 and 9-7) via show commands.

Example 9-4 LSA Types 1 and 2 in Area 3

! R3's LSDB is shown, with type 1 LSAs listed as "Router Link States" and ! type 2 LSAs as "Net Link States." The command output shows a section for each LSA ! type, in sequential order. R3# show ip ospf database

OSPF Router with ID (3.3.3.3) (Process ID 1) Router Link States (Area 3)

Example 9-4 LSA Types 1 and 2 in Area 3 (Continued)

Link ID ADV Router Age

Age 1203 779 899

Seq#

Checksum Link count

0x80000025 0X0072C3 2 0x80000027 0X003FB0 3 0x80000020 0x002929 2

Net Link States (Area 3) ADV Router Age

Age 1290

Seq#

Checksum

0x8000001F 0X00249E

! Lines omitted for brevity

! Next, the specific LSA's link ID is included in the show command, listing detail ! for the one LSA type 2 inside area 3. Note that the "Link ID" is the DR's ! interface address on the subnet. The network keyword refers to the network LSAs (type 2 LSAs). R3# show ip ospf database network 10.3.1.3

Routing Bit Set on this LSA LS age: 1304

Options: (No TOS-capability, DC) LS Type: Network Links

Link State ID: 10.3.1.3 (address of Designated Router)

Advertising Router: 3.3.3.3

LS Seq Number: 8000001F

Checksum: 0x249E

Length: 32

Network Mask: /23

Attached Router: 3.3.3.3 Attached Router: 10.3.3.33 ! Next, the type 1 LSA for R3 is listed. The link ID is the RID of R3. Note that ! the LSA includes reference to each stub and transit link connected to R3. The router ! keyword refers to the router LSAs (type 1 LSAs).

R3# show ip ospf database router 3.3.3.3

LS age: 804

Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 3.3.3.3 Advertising Router: 3.3.3.3 LS Seq Number: 80000027 Checksum: 0x3FB0 Length: 60 Number of Links: 3

Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 1.1.1.1 (Link Data) Router Interface address: 10.3.13.3 Number of TOS metrics: 0 TOS 0 Metrics: 64

OSPF Router with ID (3.3.3.3) (Process ID 1) Net Link States (Area 3)

OSPF Router with ID (3.3.3.3) (Process ID 1) Router Link States (Area 3)

Example 9-4 LSA Types 1 and 2 in Area 3 (Continued)

Link connected to: a Stub Network (Link ID) Network/subnet number: 10.3.13.0 (Link Data) Network Mask: 255.255.255.0 Number of TOS metrics: 0 TOS 0 Metrics: 64

! Note that R3's LSA refers to a transit network next, based on its DR RID -! these lines allow OSPF to know that this router (R3) connects to the transit ! network whose type 2 LSA has LSID 10.3.1.3.

Link connected to: a Transit Network (Link ID) Designated Router address: 10.3.1.3 (Link Data) Router Interface address: 10.3.1.3 Number of TOS metrics: 0 TOS 0 Metrics: 10

! Below, the routes from R3 and R1 to 10.3.2.0/23 are shown. Note the cost values ! for each reflect the cumulative costs of the outgoing interfaces used to reach ! the subnet—for instance, R3's cost is the sum of its outgoing interface cost ! (10) plus R33's outgoing interface cost (1). R1's cost is based on three outgoing ! links: R1 (cost 64), R3 (cost 10), and R33 (cost 1), for a total of 75. Also ! note that the time listed in the route is the time since this LSA first arrived ! at the router, even if the LSA has been refreshed due to the LSRefresh interval. R3# show ip route ospf 1 I include 10.3.2.0

O 10.3.2.0/23 [110/11] via 10.3.1.33, 17:08:33, Ethernet0/0

R1# show ip route ospf I include 10.3.2.0

O 10.3.2.0/23 [110/75] via 10.3.13.3, 17:10:15, Serial0/0.3

The show ip ospf database command lists the LSAs in that router's LSDB, with LSA type 1 LSAs (router LSAs) first, then type 2 (network link states), continuing sequentially through the LSA types. Also note that the LSDB for area 3 should be identical on R33, R3, and R1. However, on R1, the show ip ospf database command lists all of R1's LSDB entries, including LSAs from other areas, so using an internal router to look at the LSDB may be the best place to begin troubleshooting a problem. Also note the costs for the routes on R3 and R1 at the end of the example—the SPF algorithm simply added the outgoing costs along the routes, from each router's perspective.

NOTE To signify a network that is down, the appropriate type 1 or 2 LSA is changed to show

a metric of 16,777,215 (224 - 1), which is considered to be an infinite metric to OSPF.

LSA Type 3 and Inter-Area Costs

ABRs do not forward type 1 and 2 LSAs from one area to another. Instead, ABRs advertise type 3 LSAs into one area in order to represent subnets described in both the type 1 and 2 LSAs in another area. Each type 3 summary LSA describes a simple vector—the subnet, mask, and the ABR's cost to reach that subnet, as shown in Figure 9-8.

Figure 9-8 Representation of Area 3 Subnets as Type 3 LSAs in Area 0

Add: My cost to reach R1 (cost 1) to Type 3 LSA's costs

Add: My cost to reach R1 (cost 1) to Type 3 LSA's costs

Figure 9-8 Representation of Area 3 Subnets as Type 3 LSAs in Area 0

Routing Table:

10.3.2.0/23: Cost 76 10.3.0.0/23: Cost 75 10.3.13.0/24: Cost 65

Routing Table:

10.3.2.0/23: Cost 76 10.3.0.0/23: Cost 75 10.3.13.0/24: Cost 65

Example 9-5 focuses on the three subnets inside area 3, looking at the type 3 summary LSAs created for those subnets by ABR R1. Note that the example shows commands on S2; S2 has identical area 0 LSDB entries as compared with R1.

Example 9-5 LSA Type 3 Created by R1 for Area 3's Subnets

S2, internal to area 0, does not have the type 1 and 2 LSAs seen by R3 back in Example 9-4. However, type 3 LSAs (listed as "Summary Net Links") show all three subnets inside area 3. R1 is listed as the advertising router because it created the type 3 LSAs. S2# show ip ospf database ! Lines omitted for brevity

Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum

10.3.0.0 1.1.1.1 257 0x80000001 0X00A63C

10.3.2.0 1.1.1.1 257 0x80000001 0X009A45

10.3.13.0 1.1.1.1 261 0x80000021 0X007747

Lines omitted for brevity

Below, note that the summary keyword is used to view type 3 LSAs. The metric reflects R1s cost to reach the subnet inside area 3. S2# show ip ospf database summary 10.3.0.0

OSPF Router with ID (8.8.8.8) (Process ID 1) Summary Net Link States (Area 0)

Routing Bit Set on this LSA LS age: 341

Options: (No TOS-capability, DC, Upward)

LS Type: Summary Links(Network)

Link State ID: 10.3.0.0 (summary Network Number)

Advertising Router: 1.1.1.1

LS Seq Number: 80000001

Checksum: 0xA63C

Length: 28

Network Mask: /23

TOS: 0 Metric: 74 ! Next, S2's routes to all three subnets are listed. S2 calculates its cost ! based on its cost to reach R1, plus the cost listed in the type 3 LSA. For

Example 9-5 LSA Type 3 Created by R1 for Area 3's Subnets (Continued)

! example, the cost (above) in the type 3 LSA for 10.3.0.0/23 is 74; S2 adds ! that to S2's cost to reach ABR R1 (cost 1), for a metric of 75. S2# show ip route ospf | include 10.3

O IA 10.3.13.0/24 [110/65] via 10.1.1.1, 00:16:04, Vlan1

O IA 10.3.0.0/23 [110/75] via 10.1.1.1, 00:05:08, Vlan1

O IA 10.3.2.0/23 [110/76] via 10.1.1.1, 00:05:12, Vlan1

! Next, S2's cost to reach RID 1.1.1.1 is listed as cost 1.

S2# show ip ospf border-routers

OSPF Process 1 internal Routing Table

Codes: i-Intra-area route, I-Inter-area route

i 1.1.1.1 [1] via 10.1.1.1, Vlanl, ABR, Area 0, SPF 18 i 2.2.2.2 [1] via 10.1.1.2, Vlan1, ABR, Area 0, SPF 18 i 7.7.7.7 [1] via 10.1.1.3, Vlan1, ASBR, Area 0, SPF 18

! Below,

the show ip ospf statistics command lists the number of SPF calculations.

R1# show ip ospf stat

OSPF process ID 1

Area 0

: SPF algorithm

executed

6 times

Area 3

: SPF algorithm

executed

15 times

Area 4

: SPF algorithm

executed

6 times

Area 5

: SPF algorithm

executed

5 times

! Lines omitted for brevity

Example 9-5 shows how S2 calculated its cost to the area 3 subnets. Routers calculate the cost for a route to a subnet defined in a type 3 LSA by adding the following items:

1. The calculated cost to reach the ABR that created and advertised the type 3 LSA.

2. The cost as listed in the type 3 LSA.

You can see the cost of the type 3 LSA with the show ip ospf database summary link-id command, and the cost to reach the advertising ABR with the show ip ospf border-routers command, as shown in Example 9-5.

The beauty of this two-step cost calculation process is that it allows a significant reduction in the number of SPF calculations. When a type 1 or 2 LSA changes in some way that affects the underlying routes—for instance, a link failure—each router in the area runs SPF, but routers inside other areas do not. For instance, if R3's E0/0 is shut down, all three routers in area 3 run SPF inside that area, and the counter for area 3 in the show ip ospf statistics command increments. However, routers not inside area 0 do not run SPF, even though they update their routing tables—a process called a partial run, partial SPF, or partial calculation.

For example, imagine that R3's LAN interface fails. R33 then updates its type 2 LSA, listing a metric of 16,777,215. R1 in turn updates its type 3 LSA for 10.3.0.0/23, flooding that throughout

Key Topic area 0. The next step shows the computational savings: S2, using the two-step calculation, simply adds its cost to R1 (still 1) to 16,777,215, finds the number out of range, and removes the route from the IP routing table. S2 did not have to actually run the SPF algorithm to discover a new SPF tree.

Of particular importance is that partial calculations happen without any route summarization. With OSPF, route summarization does help reduce the overall number of routes that require SPF calculations, but route summarization is not required for partial calculations to occur.

Removing Routes Advertised by Type 3 LSAs

When a router wants to remove a route advertised by a type 3 LSA from the LSDBs of its neighbors, it could simply remove that route from its LSDB and stop advertising it. The trouble with that approach is that the route might stick around for a while in other routers' LSDBs. Clearly, it is better to actively remove the failed route instead. As a result, the router that was advertising the failed route sets the route's age to the Maxage, as described in RFC 2328, and refloods it throughout the routing domain. This removes the route as quickly as possible from the domain, rather than waiting for it to age out slowly.

LSA Types 4 and 5, and External Route Types 1 and 2

.-■— OSPF allows for two types of external routes, aptly named types 1 and 2. The type determines

I Topic whether only the external metric is considered by SPF when picking the best routes (external type 2, or E2), or whether both the external and internal metrics are added together to compute the metric (external type 1, or E1).

When an ASBR injects an E2 route, it creates a type 5 LSA for the subnet. The LSA lists the metric. The ASBR then floods the type 5 LSA throughout all areas. The other routers simply use the metric listed in the LSA; no need exists to add any cost on any links internal to the OSPF domain.

To support E1 routes, the ASBR creates and floods a type 5 LSA. When an ABR then floods the type 5 LSA into another area, the ABR creates a type 4 LSA, listing the ABR's metric to reach the ASBR that created the type 5 LSA. Other routers calculate their costs to reach E1 routes in a manner similar to how metrics for LSA type 3 routes are calculated—by calculating the cost to reach the ASBR, and then adding the cost listed in the type 5 LSA. Figure 9-9 outlines the mechanics of how the LSAs are propagated, and how the metrics are calculated.

Figure 9-9 LSA Types 4 and 5 Propagation and the Effect on Type 1 External Routes

\ Topic

Figure 9-9 LSA Types 4 and 5 Propagation and the Effect on Type 1 External Routes

\ Topic

Note: Arrows Show Propagation of LSAs.

E1 routes by definition include the cost as assigned when the ASBR injected the route into OSPF, plus any cost inside the OSPF domain. To calculate the cost for the E1 route, a router inside a different area must use two steps to calculate the internal cost, and a third step to add the external cost. For example, when R3, internal to area 3, calculates the cost to reach 192.168.2.0/24 (an E1 route), R3 adds the following:

■ R3's calculated area 3 cost to reach ABR R1 (RID 1.1.1.1).

■ R1's cost to reach the ASBR that advertised the route (S2, RID 7.7.7.7). R1 announces this cost in the forwarded LSA type 4 that describes a host route to reach ASBR 7.7.7.7.

■ The external metric for the route, as listed in the type 5 LSA created by the ASBR.

Example 9-6 shows the components of the metrics and LSAs for two external routes: 192.168.1.0/ 24 E1 with metric 20, and 192.168.2.0/24 E2, also with metric 20.

Example 9-6 Calculating the Metric for External Types 1 and 2

! R3 has learned the two LSA type 5s. R3# show ip ospf database | begin Type-5

Type-5 AS External Link States

Link ID ADV Router Age Seq# Checksum Tag

192.168.1.0 7.7.7.7 1916 0X8000002B 0X0080EF 0

192.168.2.0 7.7.7.7 1916 0x80000028 0X00FEF2 0

! Next, the detail for E2 192.168.2.0 is listed, with "metric type" referring ! to the external route type E2. (192.168.1.0, not shown, is type 1.) R3# show ip ospf database external 192.168.2.0

OSPF Router with ID (3.3.3.3) (Process ID 1) Type-5 AS External Link States

Routing Bit Set on this LSA LS age: 1969

Options: (No TOS-capability, DC) LS Type: AS External Link

Link State ID: 192.168.2.0 (External Network Number)

Advertising Router: 7.7.7.7

LS Seq Number: 80000028

Checksum: 0xFEF2

Length: 36

Network Mask: /24

Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 20

Forward Address: 0.0.0.0 External Route Tag: 0 ! Next, R1s advertised cost of 1 between itself and the ASBR is listed. Note ! that S1s RID (7.7.7.7) is listed, with the ABR that forwarded the LSA into

Example 9-6 Calculating the Metric for External Types 1 and 2 (Continued)

! area 3, R1 (RID 1.1.1.1) also listed. R3# show ip ospf database asbr-summary

OSPF Router with ID (3.3.3.3) (Process ID 1) Summary ASB Link States (Area 3)

Routing Bit Set on this LSA LS age: 923

Options: (No TOS-capability, DC, Upward)

LS Type: Summary Links(AS Boundary Router)

Link State ID: 7.7.7.7 (AS Boundary Router address)

Advertising Router: 1.1.1.1

LS Seq Number: 8000000A

Checksum: 0x12FF

Length: 28

Network Mask: /0

! Below, R3's calculated cost to R1 (64) and then to S2 (7.7.7.7) are listed. Note

! that the total of 65 is the cost 64 to reach the ABR, plus the cost 1 for the

! ABR to reach the ASBR.

R3# show ip ospf border-routers

OSPF Process 1 internal Routing Table

Codes: i-Intra-area route, I-Inter-area route i 1.1.1.1 [64] via 10.3.13.1, Serial0/0.1, ABR, Area 3, SPF 30

I 7.7.7.7 [65] via 10.3.13.1, Serial0/0.1, ASBR, Area 3, SPF 30

! Below, each route is noted as E1 or E2, with the E1 route's metric including

! the external cost (20), plus cost to reach the ASBR (65). R3# show ip route I include 192.168

O E1 192.168.1.0/24 [110/85] via 10.3.13.1, 00:50:34, Serial0/0.1

O E2 192.168.2.0/24 [110/20] via 10.3.13.1, 00:50:34, Serial0/0.1

OSPF Design in Light of LSA Types

OSPF's main design trade-offs consist of choosing links for particular areas, with the goal of speeding convergence, reducing memory and computing resources, and keeping routing tables small through route summarization. For instance, by using a larger number of areas, and the implied conversion of dense types 1 and 2 LSAs into sparser type 3 LSAs, the OSPF LSDBs can be made smaller. Also, link flaps in one area require SPF calculations only in that area, due to the partial calculation feature. Additionally, ABRs and ASBRs can be configured to summarize routes, reducing the number of type 3 LSAs introduced into other areas as well. (Route summarization is covered in Chapter 10, "IGP Route Summarization, Route Redistribution, and Default Routes.")

The OSPF design goals to reduce convergence time, reduce overhead processing, and improve network stability can be reached using the core OSPF protocols and features covered so far. Another key OSPF design tool, stubby areas, will be covered next.

NOTE Before moving on, a comment is in order about the relative use of the word "summary" in OSPF. The typical uses within OSPF include the following:

■ Type 3 LSAs are called summary LSAs in the OSPF RFCs.

■ Type 5 and 7 external LSAs are sometimes called summary LSAs, because the LSAs cannot represent detailed topology information.

■ The term LSA summary refers to the LSA headers that summarize LSAs and are sent inside DD packets.

■ The term summary can also be used to refer to summary routes created with the area range and summary-address commands.

Was this article helpful?

0 0

Responses

  • natalia
    How are type 3 lsa generated?
    1 year ago

Post a comment