Understanding Ospf Lsas: © 2007 - 2010, Cisco Systems, Inc. All Rights Reserved. Cisco Public
Understanding Ospf Lsas: © 2007 - 2010, Cisco Systems, Inc. All Rights Reserved. Cisco Public
OSPF LSAs
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 1
LSAs
LSAs are the building blocks of the OSPF LSDB.
• Individually, LSAs act as database records.
• When combined, they describe the entire topology of an OSPF area.
There are several types of OSPF network LSAs
• Not all are in use.
LSA Type Description
1 Router LSA
2 Network LSA
3 and 4 Summary LSAs
5 AS external LSA
6 Multicast OSPF LSA
7 Defined for NSSAs
8 External attributes LSA for Border Gateway Protocol (BGP)
9, 10, or 11 Opaque LSAs
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 2
LSA Type 1: Router LSA
Generated by all routers in an area to describe their directly
attached links (Intra-area routes).
• Floods within its area only and cannot cross an ABR.
• LSA includes list of directly attached links and is identified by the router
ID of the originating router
• Routing Table Entry = O
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 3
LSA Type 2: Network LSA
Advertised by the DR of the broadcast network.
• Floods within its area only; does not cross ABR.
• Link-state ID is the DR.
• Routing Table Entry = O
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 4
LSA Type 3: Summary LSA
Advertised by the ABR of originating area.
• Regenerated by subsequent ABRs to flood throughout the autonomous
system.
• By default, routes are not summarized, and type 3 LSA is advertised for
every subnet.
• Link-state ID is the network or subnet advertised in the summary LSA
• Routing Table Entry = O IA
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 5
LSA Type 4: Summary LSA
Generated by the ABR of the originating area to advertise
an ASBR to all other areas in the autonomous system.
• They are regenerated by all subsequent ABRs to flood throughout the
autonomous system.
• Link-state ID is the router ID of the ASBR.
• Routing Table Entry = O IA
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 6
LSA Type 5: External LSA
Used by the ASBR to advertise networks from other
autonomous systems.
• Type 5 LSAs are advertised and owned by the originating ASBR.
• The Link-state ID is the external network number.
• Routing Table Entry = O E1 or O E2
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 7
LSA Type 7: NSSA LSA
Generated by an ASBR inside a Not-so-stubby area
(NSSA) to describe routes redistributed into the NSSA.
• LSA 7 is translated into LSA 5 as it leaves the NSSA.
• Routing Table Entry = O N1 or O N2
• Much like LSA 5, N2 is a static cost while N1 is a cumulative cost that
includes the cost up to the ASBR.
ABR
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 8
Interpreting the
OSPF LSDB
and Routing
Table
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 9
Interpreting the OSPF Database
Use the show ip ospf database command to gather link
state information.
R1# show ip ospf database
OSPF Router with ID (10.0.0.11) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
10.0.0.11 10.0.0.11 548 0x80000002 0x00401A 1
10.0.0.12 10.0.0.12 549 0x80000004 0x003A1B 1
100.100.100.100 100.100.100.100 548 0x800002D7 0x00EEA9 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.31.1.3 100.100.100.100 549 0x80000001 0x004EC9
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
10.1.0.0 10.0.0.11 654 0x80000001 0x00FB11
10.1.0.0 10.0.0.12 601 0x80000001 0x00F516
<output omitted>
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 10
LSA Sequence Numbering
Each LSA in the LSDB maintains a sequence number.
• The sequence numbering scheme is a 4-byte number that begins with
0x80000001 and ends with 0x8FFFFFFF.
OSPF floods each LSA every 30 minutes to maintain proper
database synchronization.
• Each time the LSA is flooded, the sequence number is incremented
by one.
When a router encounters two instances of an LSA, it must
determine which is more recent.
• The LSA having the newer (higher) LS sequence number is more
recent.
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 11
Route Designator in Routing Table
Route Designator Description
• Networks from within the router’s
O OSPF intra-area (router LSA) and network LSA area. Advertised by way of router
LSAs and network LSAs.
• Networks from outside the router’s
O IA OSPF interarea (summary LSA) area but within the OSPF AS.
Advertised by way of summary LSAs.
• Networks from outside the router’s
O E1 Type 1 external routes AS, advertised by way of external
LSAs.
• Networks from outside the router’s
O E2 Type 2 external routes AS, advertised by way of external
LSAs.
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 12
Best Path Calculation
1. All routers calculate the best paths to destinations within
their area (intra-area) and add these entries to the routing
table.
• Includes type 1 and 2 LSAs, noted with a designator of O.
2. All routers calculate the best paths to the other areas.
• Includes type 3 and 4 LSAs, noted with a designator of O IA.
3. All routers (except stub areas) calculate the best paths to
the external autonomous system (type 5) destinations.
• Includes either external type 1 (E1), indicated with an O E1 or
external type 2 (E2), indicated with an O E2.
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 13
ASBR – Type 1 and 2 Routes
The cost of an external route varies, depending on the
external type configured on the ASBR.
An ASBR can be configured to send out two types of
external routes into OSPF.
• Denoted in the routing table as E1 for Type 1
• Denoted in the routing table as E2 for Type 2.
Depending on the type, OSPF calculates the cost of
external routes differently.
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 14
ASBR – Type 1 and 2 Routes
O E1 Routes
• The metric is calculated by adding the external cost to the internal
cost of each link that the packet crosses.
• Use this packet type when there are multiple ASBRs advertising a route to
the same autonomous system.
O E2 Routes
• The packet will always have the external cost assigned, no matter
where in the area it crosses.
• Default setting on ASBRs.
• Use this packet type if only one router is advertising a route to the
autonomous system.
• Type 2 routes are preferred over Type 1 routes unless two equal cost
routes exist to the destination.
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 15
E2 Routes
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 16
E1 Routes
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 17
Configuring and
Verifying
Advanced OSPF
Features
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 18
OSPF Passive-Interface
Prevent OSPF updates out a specified router interface.
Router(config-router)#
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 19
Passive-Interface Example
192.168.1.96 /27
64 kbps
.101 S0/0/1
.102 .1 Internet
R1 S0/0/0 R2
S0/0/0
.1 Fa0/0 .1 Fa0/0 192.168.1.0 /27
Alternate configuration:
R1(config)# router ospf 1
R1(config-router)# passive-interface default
R1(config-router)# no passive-interface S0/0/0
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 21
default-information originate Command
Parameter Description
(Optional) Specifies that OSPF always advertises the default route
always
regardless of whether the router has a default route in the routing table.
(Optional) A metric used for generating the default route. If you omit a value
metric and do not specify a value using the default-metric router configuration
command, the default metric value is 1. Cisco IOS Software documentation
metric-value indicates that the default metric value is 10; testing shows that it is actually
1.
(Optional) The external link type that is associated with the default route
metric-type that is advertised into the OSPF routing domain. It can be one of the
type-value following values: 1—Type 1 external route 2—Type 2 external route. The
default is type 2 external route (indicated by O*E2 in the routing table).
route-map (Optional) Specifies that the routing process generates the default route if
map-name the route map is satisfied.
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 22
default-information originate Example
0.0.0.0 Cost 10
172.16.1.0 /24
10.1.1.1 .2 ISP A
R1 .1
OSPF Domain
172.17.1.0 /24
10.2.1.1 .2
R2 .1 ISP B
0.0.0.0 Cost 100
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 23
Route Summarization
Route summarization involves consolidating multiple routes
into a single advertisement.
Proper route summarization directly affects the bandwidth,
memory and CPU, that are consumed by the OSPF
process.
• If a network link fails or flaps, the topology change will not be
propagated into the backbone or other areas.
• It protects routers from needless routing table recalculations.
• Because the SPF calculation places a significant demand on the
router's CPU, proper summarization is an imperative part of OSPF
configuration.
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 24
Using Route Summarization
IA 172.16.8.0 255.255.248.0
IA 172.16.16.0 255.255.252.0
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 25
Types of Route Summarization
Inter-area summarization
• Performed at the ABR and creates Type 3 LSAs.
External summarization
• Performed at the ASBR and creates Type 5 LSAs.
Both have the same fundamental requirement of contiguous
addressing.
If summarization is not configured correctly and there are
multiple ASBRs, or multiple ABRs in an area, suboptimal
routing is possible.
• For example, summarizing overlapping ranges from two different
routers can cause packets to be sent to the wrong destination.
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 26
Intra-Area Summarization
Configure an ABR to summarize routes for a specific area.
Router(config-router)#
Parameter Description
area area-id Identifies the area subject to route summarization.
address The summary address designated for a range of addresses.
mask The IP subnet mask used for the summary route.
(Optional) Sets the address range status to advertise and generates a
advertise
type 3 summary LSA.
(Optional) Sets the address range status to DoNotAdvertise. The type
not-advertise 3 summary LSA is suppressed, and the component networks remain
hidden from other networks.
(Optional) Metric or cost for this summary route, which is used during
cost cost the OSPF SPF calculation to determine the shortest paths to the
destination. The value can be 0 to 16777215.
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 27
Intra-Area Summarization Example
Area 0
172.16.96.0 /24 - 172.16.127.0 /24
R1 R2
Area 2
Area 1 172.16.64.0 /24 - 172.16.95.0 /24
172.16.32.0 /24 - 172.16.63.0 /24
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 28
External Summarization
Configure an ASBR to summarize external routes.
Router(config-router)#
Parameter Description
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 29
External Summarization
ABR
External AS – RIPv2 .1 OSPF Area 1 OSPF Area 0
172.16.32.0 /24 – 172.16.63.0 /24 R1 172.16.64.0 /24 R2
Chapter 3
© 2007 – 2010, Cisco Systems, Inc. All rights reserved. Cisco Public 30