You are on page 1of 48

MEN Part 1


Network Learning Centre
Proprietary & Confidential

Day 4

Module 5

• Exercises

– OSPF - 5 labs

Network Learning Centre
Proprietary & Confidential
Module 5
Open Shortest Path First - OSPF

Network Learning Centre
Proprietary & Confidential

Limitations of RIP

• Limit of 15 hops
• Slow convergence
• Metric
• Protocol for flat networks

Network Learning Centre
Proprietary & Confidential

The rapid growth and expansion of today's networks has pushed RIP to its limits. RIP
has certain limitations that could cause problems in large networks:
1. RIP has a limit of 15 hops. A RIP network that spans more than 15 hops (15 routers)
is considered unreachable.
2. RIP cannot handle Variable Length Subnet Masks (VLSM). Given the shortage of IP
addresses and the flexibility VLSM gives in the efficient assignment of IP addresses,
this is considered a major flaw.
3. Periodic broadcasts of the full routing table will consume a large amount of
bandwidth. This is a major problem with large networks especially on slow links and
WAN clouds.
4. RIP converges slower than OSPF. In large networks convergence gets to be in the
order of minutes. RIP routers will go through a period of a hold-down and garbage
collection and will slowly time-out information that has not been received recently. This
is inappropriate in large environments and could cause routing inconsistencies.
5. RIP has no concept of network delays and link costs. Routing decisions are based on
hop counts. The path with the lowest hop count to the destination is always preferred
even if the longer path has a better aggregate link bandwidth and slower delays.
6. RIP networks are flat networks. There is no concept of areas or boundaries. With the
introduction of classless routing and the intelligent use of aggregation and
summarization, RIP networks seem to have fallen behind.

OSPF Solutions

• No limitation on hop count
• Supports classless routing (route summarization)
• Routing updates sent only when there is a change
• Faster convergence then RIP
• Better load balancing
• Logical definition of areas
• Authentication and external routes tagging

Network Learning Centre
Proprietary & Confidential

OSPF is classified as an Interior Gateway Protocol (IGP). This means that it
routing information between routers belonging to a single Autonomous
System. The OSPF protocol is based on link-state or SPF technology.

OSPF (Open Shortest Path First) protocol was developed due to a need in the
internet community to introduce a high functionality non-proprietary Internal
Gateway Protocol (IGP) for the TCP/IP protocol family. The discussion of creating
a common interoperable IGP for the Internet started in 1988 and did not get
formalized until 1991. At that time the OSPF Working Group requested that OSPF
be considered for advancement to Draft Internet Standard.

OSPF Concepts

Network Learning Centre
Proprietary & Confidential

OSPF Overview

• OSPF—Open Shortest Path First
• OSPF is the most widely used IGP
routing protocol
• OSPF is link state routing protocol
• OSPF is developed by IETF
• The latest RFC is RFC2328 and the
version is version 2(For IPv4).
• The other RFC related to OSPF:
rfc1583, rfc2178…
Page 7 Learning Centre
Proprietary & Confidential

OSPF is the abbreviation of open shortest path first , it is described by RFC 2328,
which is open to everyone, you can get this document freely from internet. OSPF
is also an internal gateway protocol, which is running within an autonomous
system .

OSPF is a link state protocol. You can, for example, think of a link as being an
interface on the router. The state of the link is a description of that interface. This
description would include its IP address, mask, and the type of network to which it
is connected. OSPF using the SPF algorithm to calculate the best route, it is a loop
free routing protocol.


Choose all the characteristics that OSPF applies ?( )
A: open IGP routing protocol
B: loop-free protocol
C: support larger networks
D: working between ASs

What type of do you think of OSPF represents?
A: distance vector
B: Link state
C: Balanced hybrid
OSPF Features
• Loop-free
• Supporting large networks
• Fast route update and convergence
• Supporting ECMP( equal cost multi-path )
• Dividing the whole routing domain into
different areas
• Using multicast address
• Supporting VLSM
• Running on IP( the value of IP protocol field is
89 )
• Supporting authentication
Page 8 Learning Centre
Proprietary & Confidential

OSPF supports the large networks, for a good designed network, OSPF can support up to 1000 OSPF routers. OSPF supports
the two level
OSPF is link-state routing protocol, so when a change occurs in the network topology, route update will be generate and
flooding so all the OSPF routers will receive the update and then run the SPF algorithm quickly to build the new routing
table ,so it is fast convergence routing protocol.
OSPF supports equal-cost multi-paths, allowing multiple next hops to be recorded for the same destination .
OSPF supports the areas division to support the two-level hierarchy network, OSPF usually reduce the size of the SPF
calculation by partitioning the network into areas, the number of routers in an area and the number of link state information
that flood only within the area are small ,which means that the link state database for an area is small , consequently ,the SPF
calculation is easier and takes less time ,so using the area divisions can reduce the protocol impact on CPU % memory .
Using of reserved multicast addresses to reduce the impact on non-OSPF-speaking devices, OSPF using the as the
destination IP address for the route update send out to all OSPF enable interface .
OSPF supports the variable length subnet mask (VLSM) .
OSPF is carried with IP packet, the value of protocol field in IP header is 89 . So OSPF only working the IP network,
sometimes we call OSPF as IP routing protocol .
Generally speaking ,Which IP address will OSPF use as the destination IP address when OSPF router sends the route update
out ?
A :
B ;
C :
D : any IP address depending on the network design
Choose the correct answer which supports the VLSM ?
What is the IP protocol number for OSPF packets?
A: 89
B: 86
C: 179
D: 520

OSPF - Link State Protocol

• Link
– an interface on the router
• Link state
– description of the interface and the neighboring
• IP address, mask, type, routers connected to
• Link state database
– collection of link state advertisement for all routers
and networks

Network Learning Centre
Proprietary & Confidential

OSPF Basic Concepts

Router ID
ID :: AA 32-bit
32-bit number
number that
that uniquely
uniquely identifies
identifies the
the router
router in
in the
the OSPF
OSPF routing

Cost :: Cost
Cost is
is the
the OSPF
OSPF metric.
metric. And
And is
is expressed
expressed as
as an
an unsigned
unsigned 16-bit
16-bit integer,
integer, from
from 11
to 65535.

Page 10 Learning Centre
Proprietary & Confidential

Router ID: The router ID is a 32−bit number assigned to each OSPF enabled router,
which is used to uniquely identify the router within an autonomous system. The
router ID calculated at boot time is the highest loopback address on the router; if no
loopback interfaces are configured, the highest IP address on the router is used.
Also you can manually configure the router id by yourself ,we recommend
manually configure the router id yourself . Certainly, the manually configured
router id has the highest preference .

Cost: Quidway router uses the formula 108/Bandwidth to calculate the cost for an

Which of the following is the correct order for selecting the router id by the ospf
1: manually configured router id
2: highest physical IP address
3: highest logical IP address
A: 1-2-3
B: 1-3-2
C: 3-2-1
D: 2-3-1

Network Type
Point To Point Networks

Encapsulate the link with PPP /
HDLC Protocol

Broadcast Networks

Encapsulate the link with
Ethernet / FDDI / Token Ring

Page 11 Learning Centre
Proprietary & Confidential

Generally speaking ,OSPF supports 4 type of the network types:
Point to point networks
Broadcast networks
Point to multi-point networks
Non-broadcast multi-access networks (NBMA)

A point to point network joins a single pair of routers, a E1 serial line configured
with a link layer protocol such as point to point protocol (PPP) or high level data
link control protocol is an example of a point to point network .

On point to point network, the router dynamically detects its neighboring routers by
multicasting it hello packets to all SPF routers, using the address . On
point to point networks, neighboring routers become adjacent whenever they can
communicate directly. No designated router and backup designated router election
is performed because there can be only two routers on a point to point link ,so there
is no need fro a DR or BDR .The default OSPF hello and dead intervals on point to
point links are 10 seconds and 40 seconds ,respectively .

Broadcast networks, such as Ethernet, Token Ring, and FDDI, might be better
defined as broadcast multi-access networks to distinguish them from NBMA
networks. Broadcast networks are multi-access in that they are capable of
connecting more than two devices, and they are broadcast in that all attached
devices can receive a single transmitted packet. OSPF routers on broadcast
networks will elect a DR and a BDR, as described in the next section, "Designated 11
Routers and Backup Designated Routers " Hello packets are multicast with the All
Network Type (cont.)


Point To Multi-Point Networks


Non-Broadcast Multi-Access Network

Page 12 Learning Centre
Proprietary & Confidential

A point to multi-point environment is very similar to the point to point environment
,no DR or BDR is chosen, all PVCs are treated as point to point links, the only
difference is that all the PVCs go back to a single router.
A point to multi-point network will send the hello packet every 30 seconds and the
Dead interval is four times the hello interval, 120 seconds . For all the ATM ,
frame-relay and x.25 network ,the default network type is non-broadcast multi-
access network, so there is no default network type for the point to multi-point, you
should manually configure the ATM , frame-relay ,x.25 network as a point to
multi-point network yourself .
NBMA networks, such as X.25, Frame Relay, and ATM, are capable of connecting
more than two routers but have no broadcast capability. A packet sent by one of the
attached routers would not be received by all other attached routers. As a result,
extra configuration may be necessary for routers on these networks to acquire their
neighbors. OSPF routers on NBMA networks elect a DR and BDR, and all OSPF
packets are unicast.
The difference between NBMA and point-to-multipoint:
In OSPF protocol, NBMA and point-to-multipoint both mean Non-Broadcast
Multipoint Access networks, but NBMA must meet the requirements of a full
meshed network, namely, any two points can make access of the packets to the
remote port possible without forwarding. Otherwise, we will call the network a
point-to-multipoint network

How many network type available in the OSPF network?
A: 4 12
Designated Router And



M= n(n-1)/2 M= (n-2)×2+1
= 28 = 13

Page 13 Learning Centre
Proprietary & Confidential

Multiaccess networks present two problems for OSPF, relating to the
flooding of LSAs
1. The formation of an adjacency between every attached router would
create many unnecessary LSAs. If n is the number of routers on a
multiaccess network, there would be n(n- 1)/2 adjacencies . Each router
would flood n- 1 LSAs for its adjacent neighbors, plus one LSA for the
network, resulting in n 2 LSAs originating from the network.
2. Flooding on the network itself would be chaotic. A router would flood an
LSA to all its adjacent neighbors, which in turn would flood it to all their
adjacent neighbors, creating many copies of the same LSA on the same

to solve this problem, OSPF designates a router, Designated Router, DR in
short, to be responsible for packet flooding. All the routers transmit their
information through the routes to the DR only, then the DR transmits the
route information to other routers in this stub network. Two routers other
than DR (DROther) no longer establish an adjacency relationship and no
longer exchange any route information. In this way, only adjacency
relations of N in number will be needed to be established among the
routers in the same stub network, and the route change every time will be
forwarded for N times.
BDR stands for the backup designated Router .
Once the DR and BDR are selected, any router to the network established
adjacencies with the DR and BDR only
Each OSPF interface (multi-access network only) possesses a configurable 13
router priority the default value is 1 if you don’t want a router interface
Network Types
• Point-to-point networks
• Point-to-multipoint networks
– Collection of point-to-point links
– Packets are multicast
• Broadcast networks (eg: Ethernet)
– Elect a DR and a BDR
– Packets are multicast
• Non-broadcast Multi-access (NBMA) networks (eg: X.25, Frame
relay, ATM)
– Elect a DR and a BDR
– Packets are unicast
• Virtual links
– Packets are unicast

Network Learning Centre
Proprietary & Confidential


Area 0

Area 1 To another AS
Area 2



Page 15 Learning Centre
Proprietary & Confidential

As shown in the figure , a OSPF routing domain is divided into three OSPF areas.
Area 0, also known as the backbone area ,if there is more than one area in the
OSPF routing domain, backbone area must exist.
OSPF using the area ID to identify the different areas, the value of area ID is from
0 to 232 .

After the area division in the OSPF routing domain, there are some roles for
different OSPF routers.
Internal Routers are routers which all interfaces belonged to the same area.
Area Border Routers (ABRs) connect one or more areas to the backbone and act
as a gateway for inter-area traffic.
Backbone Routers are routers which at least one interface attached to the

OSPF Areas

• The border area is OSPF area 0
• all routers belonging to the same area have
identical database
• SPF calculations are performed separately for
each area
• LSA flooding is bounded by area

Network Learning Centre
Proprietary & Confidential

OSPF Basic Concepts

LSA: Link-State
Link-State advertisement
advertisement (LSA)
(LSA) is
is an
OSPF data
data packet
packet containing
containing link-state
link-state and
routing information that is shared among OSPF network
routing information that is shared among OSPF network

Link-State Database:
Database: Link-State
Link-State Database
Database (LSDB)
(LSDB) is
is the
the collection
collection of
of LSAs
,LSDB is
used in calculating the best paths through the network
used in calculating the best paths through the network . .

Page 17 Learning Centre
Proprietary & Confidential

Link-State Advertisement : OSPF is a link state routing protocol ,so the routing
information exchanged between the OSPF routers is called the link state
advertisement. The state of the link is a description of that interface, and the
description includes the IP address, mask, and the type of network to which it is
connected ,and all the link state advertisements are stored in a database ,which is
called link state database ,or topology table .OSPF router periodically floods each
LSA every 30 minutes by default.

Because the LSA describe the OSPF router and the network it attached, so the
LSDB is the topology of OSPF network, OSPF using all the LSA which stored in
the LSDB to calculate the best route to the destination network .

Which of the following packet are used by OSPF router to exchange the routing
information ?
A: link state advertisement (LSA)
B: link state packet (LSP)
C: link information packet
D: routing table


Type LSA
1 Router-LSA

2 Network-LSA

3 Summary-LSA

4 ASBR-summary-LSA

5 AS-external-LSA

7 NSSA external-LSA

Page 18 Learning Centre
Proprietary & Confidential

Router LSAs( Type 1) are produced by each router. These LSAs lists all of a
router's links, or interfaces, the state and cost of each link, and neighbors on the
link. And these LSAs are flooded only within the area in which they are originated.

Network LSAs( Type 2) are produced by the DR on every multi-access network(
NBMA or Broadcast ). The Network LSA lists all attached routers, including the
DR itself. and Network LSAs are flooded only within the originating area.

Network Summary LSAs( Type 3) are generated by ABRs. They are sent into an
area to advertise destinations outside that area. An ABR also advertises the
destinations within its attached areas into the backbone with Network Summary
LSAs. Default routes external to the area, but internal to the OSPF routing domain,
are also advertised by this LSA type.

ASBR Summary LSAs( Type 4) are also originated by ABRs. ASBR Summary
LSAs are the same as Network Summary LSAs except that the destination they
advertise is an ASBR, not a network. It tells other routers how to get to ASBR.

Autonomous System External LSAs( Type 5), or External LSAs, are generated by
ASBRs. They advertise either a destination or a default route external to the OSPF
routing domain. Destination IP address, mask and cost are included in this LSA
type. They are flooded with the whole OSPF routing domain.

NSSA External LSAs( Type 7) are generated by ASBRs within not-so-stubby areas
(NSSAs). An NSSA External LSA is almost identical to an AS External LSA.
Unlike AS External LSAs, which are flooded throughout the whole OSPF routing
domain, NSSA External LSAs are flooded only within the not-so-stubby area in
which it was originated.
OSPF Packets

Hello Packet

Database Description
Description Packet

Link State
State Request
Request Packet

Link State
State Update
Update Packet

Link State
State Acknowledgment
Acknowledgment Packet

Page 19 Learning Centre
Proprietary & Confidential

There are five type of OSPF packets which are used by OSPF routers to exchange the information.

Hello packets are OSPF packet type 1. These packets are sent periodically on all interfaces in
order to establish and maintain neighbor relationships. In addition, Hello Packets are multicast on
those physical networks having a multicast or broadcast capability, enabling dynamic discovery of
neighboring routers.

Database Description packets are OSPF packet type 2. These packets are exchanged when an
adjacency is being initialized. They describe the contents of the link-state database.

Link State Request packets are OSPF packet type 3. After exchanging Database Description packets
with a neighboring router, a router may find that parts of its link-state database are out-of-date. The
Link State Request packet is used to request the pieces of the neighbor's database that are more up-
to-date. Multiple Link State Request packets may need to be used.

Link State Update packets are OSPF packet type 4. These packets implement the flooding of LSAs.
Each Link State Update packet carries a collection of LSAs one hop further from their origin.
Several LSAs may be included in a single packet.

Link State Acknowledgment Packets are OSPF packet type 5. To make the looding of LSAs
reliable, flooded LSAs are explicitly acknowledged. This acknowledgment is
accomplished through the sending and receiving of Link State Acknowledgment packets. Multiple
LSAs can be acknowledged in a single Link State Acknowledgment packet

The Position of OSPF Packets

Link Layer OSPF Protocol Frame
IP Packet Header
Header Packet Checksum

Protocol Number: 89

OSPF Protocol Header OSPF Packet Data

Page 20 Learning Centre
Proprietary & Confidential

OSPF Packet Header

Version Type Packet Length

Router ID

Area ID
Checksum AuType



Packet Data

Page 21 Learning Centre
Proprietary & Confidential

As we know that for most protocol ,it will cover the protocol header and the
protocol body, it is the same to OSPF protocol .before we begin discuss the detail
information inside the OSPF packet , we should have a basic understanding of the
OSPF header:

OSPF header contain the following information :
Version : The OSPF version number. In today’s network, all the OSPF router will
running the OSPF version 2 or above ,but now we just talking about the OSPF
version 2.
Type: The OSPF packet types are as follows
Type Description
1 Hello
2 Database Description
3 Link State Request
4 Link State Update
5 Link State Acknowledgment
Packet length
The length of the OSPF protocol packet in bytes. This
length includes the standard OSPF header.
Router ID
The Router ID of the packet's source.
Area ID
A 32 bit number identifying the area that this packet
belongs to. All OSPF packets are associated with a single area. Mosttravel
a single hop only. Packets travelling over a virtual link are labelled with the
backbone Area ID of 21
Hello Packet
• Content of Hello Packet
– Router id
– Area id of originating interface
– Address mask of originating interface
– Authentication of originating interface
– Hello Interval of originating interface
– Router Dead Interval of originating interface
– Priority
– Neighbors
• Hello Interval
– Lan – 10s
– P-P – 30s
• Hold down timer (Router Dead Interval)
– Lan – 40s
– P-P – 120s

Network Learning Centre
Proprietary & Confidential
OSPF Principle – Intra area

Network Learning Centre
Proprietary & Confidential

How OSPF Works?

• Each router generates link-state advertisements
for its links
• When no OSPF areas are configured, link-state
advertisements are flooded to all routers
• It is crucial that all routers have identical link state
• Shortest path tree is calculated by all routers and
routing tables are derived

Network Learning Centre
Proprietary & Confidential

OSPF addresses most of the issues not included in RIP:
1. With OSPF, there is no limitation on the hop count.
2. The intelligent use of VLSM is very useful in IP address allocation.
3. OSPF uses IP multicast to send link-state updates. This ensures less processing on routers
that are not listening to OSPF packets. Also, updates are only sent in case routing changes
occur instead of periodically. This ensures a better use of bandwidth.
4. OSPF has better convergence than RIP. This is because routing changes are propagated
instantaneously and not periodically.

Link State Advertisement

• Generated in response to any change
• Contains:
– source identification
– sequence number
– link state age
– list of neighbors

Network Learning Centre
Proprietary & Confidential

Used to securely deliver LSAs

Every node sends the LSA on every link except the one from where it
received it
Very fast and very reliable, but wastes bandwidth
Messages sent only when there is a change or every 30 minutes
Each node compares the newly received LSA with the entry in the data
base. If it is newer the database is updated

OSPF Operation

OSPF operation can be divided into three categories

Neighbor and
and Adjacency
Adjacency initialization

LSA flooding

SPF calculation

Page 26 Learning Centre
Proprietary & Confidential

OSPF operation can be divided into three categories
1. Neighbor and Adjacency initialization
2. LSA flooding
3. SPF calculation
• OSPF routers send hello packets out all interface participating in the OSPF
process. If the router and the router on the other sides of the connection agree
on the parameters set forth in the hello packet, the routers will form neighbor
relationships .
• Some of the neighbors will adjacencies, Forming adjacencies is dependent
upon the type of network the hello packet is being sent across and the type of
routers exchanging the hello packets.
• The routers will send link state advertisement (LSAs) , which contain
description of the router’s links and the state of each link to the adjacent router .
• The routers receive the LSAs will then record the information into their link
state database and forward the LSAs on to their respective neighbors . This
allows all routers participating in the OSPF process to have the same view of
the network, although from their own perspective .
• After learning all LSAs, each router will run the SPF algorithm to learn the
shortest path to all the known destination , each router uses this information to
create its SPF tree. The information contained in the SPF tree is then used to
populate the routing table .

Neighbors And Adjacencies

• Neighbors

IfIf two
two routers
routers sharing
sharing aa common
common data
data link
link agree
agree on
on certain
certain parameters
specified in
in their
their respective
respective hello
hello packets,
packets, they
they will
will become
become neighbors.

z Adjacencies

Adjacencies may
may be
be thought
thought of
of as
as virtual
virtual point-to-point
point-to-point links
links between
neighbors. Whether
Whether the
the neighbors
neighbors will
will become
become adjacencies
adjacencies depends
depends on
on the
type of
of network
network they
they are
are attached
attached to.

Page 27 Learning Centre
Proprietary & Confidential

A neighbor refers to a connected router that is running an OSPF process with the adjoining
interface assigned to the same area. Neighbors are found via hello packets( hello packet is
discuss in the subsequence slides), no routing information is exchanged with neighbors
unless adjacencies are formed!

An adjacency refers to the logical connection between a router and its corresponding
designated routers and backup designated router or its point to point neighbor. The
formation of this type of relationship depends heavily on the type of the network that
connect the OSPF routers, on point to point connection , the two routers will form adjacency
with each other without require a designated router, not all neighbors become adjacent.

Neighbor And Adjacency Initialization

In aa broadcast
broadcast network,
network, DR
DR and
and BDR
,DR and
and DRother,
DRother, BDR
BDR and
DRother will
will form
form the
the neighbor
neighbor and
and adjacency
adjacency relationship,
relationship, but
DRother and
and DRother
DRother only
only form
form neighbor
neighbor relationship

In point
point to
to point
point /NBMA
/NBMA // point
point to
to multi-point
multi-point network
network ,if
,if two
two OSPF
router form
form the
the neighbor
neighbor relationship,
relationship, they
they will
will form
form the
the adjacency

Page 28 Learning Centre
Proprietary & Confidential

In a broadcast network, DR is represent the multi-access network and its attached
routers to the rest of the network , DR manage the flooding process on the multi-
access network ,so in the broadcast network, DR and BDR ,DR and DRother, BDR
and DRother will form the neighbor and adjacency relationship, but DRother and
DRother only form neighbor relationship .

In point to point / NBMA / point to multi-point network ,if two OSPF router form
the neighbor relationship, they will form the adjacency relationship.

So you should know that in a broadcast network such as Ethernet , two DRother
router will never exchange routing information even they are form the neighbor
relationship .

Quiz :
Which of the following statement is true ,choose all apply ( )
A: DRother will form the adjacent with the DR and BDR
B: DRother will form the adjacent with the DR only.
C: DRother will form the adjacent with the DRother
D: DRother will never form the adjacent with the DRother

OSPF Neighbor State Machine


Attempt Init

2-way ExStart Exchange


Page 29 Learning Centre
Proprietary & Confidential

An OSPF router transitions a neighbor (as described in the neighbor data
structure) through several states before the neighbor is considered fully
Down: The initial state of a neighbor conversation indicates that no Hellos
have been heard from the neighbor in the last RouterDeadInterval. Hellos are
not sent to down neighbors unless those neighbors are on NBMA networks;
in this case, Hellos are sent every Poll Interval. If a neighbor transitions to the
Down state from some higher state, the link state Retransmission, Database
Summary, and Link State Request lists are cleared.
Attempt: This state applies only to neighbors on NBMA networks, where
neighbors are manually configured. A DR-eligible router transitions a
neighbor to the Attempt state when the interface to the neighbor first becomes
Active or when the router is the DR or BDR. A router sends packets to a
neighbor in Attempt state at the Hello Interval instead of the Poll Interval.
Init: This state indicates that a Hello packet has been seen from the neighbor
in the last Router Dead Interval, but two-way communication has not yet
been established. A router includes the Router IDs of all neighbors in this
state or higher in the Neighbor field of the Hello packets.
2-Way: This state indicates that the router has seen its own Router ID in the
Neighbor field of the neighbor's Hello packets, which means that a
bidirectional conversation has been established. On multi-access networks,
neighbors must be in this state or higher to be eligible to be elected as the DR
or BDR. The reception of a Database Description packet from a neighbor in
the init state also causes a transition to 2-Way.
ExStart: In this state, the router and its neighbor establish a master/slave
relationship and determine the initial DD sequence number in preparation for 29
h h fD b D i i k Th i hb i h h hi h
OSPF Operation


LSA Flooding

RTD SPF Algorithm

D/M NH Cost
..... ..... ...
..... ..... ...
..... ..... ...
..... ..... ... Route Calculating
..... ..... ...
Shortest Path Tree
IP Routing Table

Page 30 Learning Centre
Proprietary & Confidential

LSAs Used in Intra-area Route

Area 1

Router-LSA Network-LSA


Page 31 Learning Centre
Proprietary & Confidential

Every router will generate Router-LSA. Only DR will generate Network-LSA.

OSPF Principle – Inter area and
external routes

Network Learning Centre
Proprietary & Confidential

Problems When Network Grows

• Maintain a big link-state database in the router
• SPF calculation become more complex
• Route flapping impact the network stability
• The route entry size is too big for a router
• Management and troubleshooting become more

Page 33 Learning Centre
Proprietary & Confidential

How to solve the problems when OSPF network grows?
The answer is divide the OSPF routing domain into several logical router groups.
This logical group is called OSPF area. OSPF uses areas to reduce these
adverse effects
Routers within an area will have no detailed knowledge of the topology outside of
their area. Because of this condition:
1. A router must share an identical link state database only with the other routers
in its area, not with the entire internetwork. The reduced size of the database
reduces the impact on a router's memory.
2. The smaller link state databases mean fewer LSAs to process and therefore less
impact on the CPU.
3. Because the link state database must be maintained only within an area, most
flooding is also limited to the area.

So there are some benefit with the OSPF area division :
• Reduce the requirement of router memory and CPU power
• SPF calculation become easy to implementation
• Reduce the impact of flapping route with the route summary
• Reduce the route entry in routing table with route summary
• Easy to manage the OSPF router in a area

Network Summary LSA (Type 3 LSA)

area 1 Area 0

Type :: SumNet RTB Type
Type :: SumNet
Type SumNet
Ls Router Id: Ls
Ls id
id ::
Ls id
id ::
Adv Adv
Adv rtr
rtr ::
Adv rtr
rtr ::
Net mask
mask :: Net
Net mask
mask ::
Metric :: 22 Metric
Metric :: 1563

Page 34 Learning Centre
Proprietary & Confidential

Before discuss the new type LSA ,one router role in the OSPF network we should
understand is the ABR : area border router .an ABR is a router that has multiple
area assignments .an interface may belong to only one area, if a router has multiple
interfaces and if any of these interfaces belong to different areas ,this router is
considered an ABR.

After the division of the autonomous system into different area by OSPF, many
changes have also taken place in the route-calculating algorithm:
•LSDB synchronization is ensured only between routers belonging to the same
area, and the change in network topological structure will be updated first within
the area.
•Network Summary LSAs are originated by ABRs. They are sent into a single area
to advertise destinations outside that area . In effect, these LSAs are the means by
which an ABR tells the Internal Routers of an attached area what destinations the
ABR can reach. An ABR also advertises the destinations within its attached areas
into the backbone with Network Summary LSAs. Default routes external to the
area but internal to the OSPF autonomous system are also advertised by this LSA

Simple explanation for the network summary LSA
•SumNet : indicate a network summary LSA
•LS id : indicate the destination network ,it is always work with the net mask
•Adv rtt : indicate the ABR who generate the LSA
•Net mask : net mask for the destination network. 34
Inter-area Route Calculation

• OSPF using the router LSA & network LSA to
calculate the best route within a area
• Each network summary LSA is treat as a
StubNet directly attached to the ABR
• Router installed the destination network
advertised by ABR, and the total cost is the sum
of the cost of the router to the ABR and the cost
advertise by the network summary LSA. This
behavior is distance vector behavior

Page 35 Learning Centre
Proprietary & Confidential

When an ABR originates a Network Summary LSA, it includes the cost from itself
to the destination the LSA is advertising. The ABR will originate only a single
Network Summary LSA for each destination even if it knows of multiple routes to
the destination. Therefore, if an ABR knows of multiple routes to a destination
within its own attached area, it originates a single Network Summary LSA into the
backbone with the lowest cost of the multiple routes. Likewise, if an ABR receives
multiple Network Summary LSAs from other ABRs across the backbone, the
original ABR will choose the lowest cost advertised in the LSAs and advertise that
one cost into its attached non-backbone areas.
When another router receives a Network Summary LSA from an ABR, it does not
run the SPF algorithm. Rather, it simply adds the cost of the route to the ABR and
the cost included in the LSA. A route to the advertised destination, via the ABR, is
entered into the route table along with the calculated cost. This behavior—
depending on an intermediate router instead of determining the full route to the
destination—is distance vector behavior. So, while OSPF is a link state protocol
within an area, it uses a distance vector algorithm to find inter-area routes

AS External LSA / ASBR Summary
Type ::SumASB
Type SumASB
Type ::ASE
ASE Lsid
id ::
Ls id :: Advrtr
rtr ::
Adv rtr :: metric:1562
Net mask ::
Metric ::3030 RTB
type ::11 Rotuer id

area 1
Router ID:

<RTC>display ospf
ospf routing
Destination Cost
Cost TypeType Tag
Tag NextHop
NextHop AdvRouter
AdvRouter 1593
1593 11 11
Page 36 Learning Centre
Proprietary & Confidential

ASBR : an autonomous system boundary routter ,is a router with an interface
connected to an external network or to a different AS .an external network or
autonomous system refers to an interface belonging to a different routing protocol
such as RIP, an ASBR is reponsible for injecting route information learned by
other routing protocols into OSPF .
ASBR Summary LSAs are also originated by ABRs. ASBR Summary LSAs are
identical to Network Summary LSAs except that the destination they advertise is
an ASBR , not a network. The command show ip ospf database asbr-summary is
used to display ASBR Summary LSAs , Note in the illustration that the destination
is a host address, and the mask is zero; the destination advertised by an ASBR
Summary LSA will always be a host address because it is a route to a router.

Autonomous System External LSAs, or External LSAs, are originated by ASBRs
and advertise either a destination external to the OSPF autonomous system , AS
External LSAs are the only LSA types in the database that are not associated with a
particular area; external LSAs are flooded throughout the autonomous system .
Simple explanation for the AS external LSA
ASE : indicate the as external LSA
LS id : the AS external network that ASBR can reached
Adv rtr : ASBR router ID
Net mask the network mask for the destination network
Metric : the cost for the ASBR to the AS external destination network.
E type :1 indicate that this is a AS external path type 1
Simple explanation for the ASBR summary LSA
sumASB : indicate that this is a ASBR summary LSA
LS id : ABR router id
Adv rtr : the ASBR router id
AS External LSA / ASBR Summary
LSA (Cont .)
Type ::SumASB
Type SumASB
Type ::ASE
ASE Lsid
id ::
Ls id :: Advrtr
rtr ::
Adv rtr :: metric:1562
Net mask ::
Metric ::3030
type ::22 RTB

area 1
Router ID:
Destination Cost
Cost TypeType Tag
Tag NextHop
NextHop AdvRouter
…… 30
30 22 1

Page 37 Learning Centre
Proprietary & Confidential

Type 2 external paths (E2) are also to destinations outside the OSPF autonomous
system, but do not take into account the cost of the path to the ASBR. E2 routes
provide the network administrator with the option of telling OSPF to consider only
the external cost of an external route, disregarding the internal cost of reaching the
ASBR. OSPF external routes are, by default, E2 paths.

Till now ,we should know that in the OSPF network, there are four type of route
available for us: intra-area route ,inter-area route ,type 1 external paths (routes),
type 2 external paths (routes) .

How may type of OSPF route type available in a OSPF network ?
A: 1
B: 2
C: 3
D: 4

What are the OPSF network route type available in the OSPF network ?
A: intra-area route ,inter-area route ,type 1 external paths (routes), type
2 external paths (routes)
B: point to point network ,point to multi-point network ,NBMA
network and the broadcast network

Comparisons of Different LSAs
Type Description Originator Flooding Area Main Functions
1 Router LSA Each Originating Lists all links, or interfaces,
Router Area addresses and mask, cost, etc.
2 Network LSA DR Originating Lists all the attached routers
3 Network ABR Area Opposite Tells the Internal Routers what
Summary LSA to Destination destinations the ABR can reach

4 ASBR Summary ABR Area Opposite Tells the Internal Routers how
LSA to ASBR to get to ASBR in another area

5 AS External ASBR OSPF Advertise destination external
LSA Domain to the OSPF Domain
7 NSSA External ASBR in Originating Advertise destination external
LSA NSSA NSSA to the OSPF Domain within
Page 38 Learning Centre NSSA 38
Proprietary & Confidential 38

OSPF – Advance Topic

Network Learning Centre
Proprietary & Confidential

Route Summary On ABR

area 1 area 0

ABR can
can perform
perform the
the address
address summarization
summarization from
from one
one area
area to
to another
area, and
and this
this can
can reduce
reduce the
the network
network summary
summary LSALSA flooding
flooding and
and improve
the network
network performances

Page 40 Learning Centre
Proprietary & Confidential

OSPF can perform two types of address summarization: inter-area summarization
and external route summarization. Inter-area summarization is, as the name
implies, the summarization of addresses between areas; this type of summarization
is always configured on ABRs..
In this figure, area 1 contains sixteen subnets: through,
and all these addresses can be represented with the single summary address .

Route Summary On ASBR


ASBR can
can perform
perform the
the address
address summarization
summarization from
from Non-OSPF
routing domain to OSPF routing and this can reduce the
domain to OSPF routing and this can reduce the AS
AS external
LSA flooding
flooding and
and improve
improve the
the network
network performances

Page 41 Learning Centre
Proprietary & Confidential

External route summarization allows a set of external addresses to be redistributed
into an OSPF domain as a summary address and is configured on ASBRs . ASBR
can perform the address summarization from Non-OSPF routing domain to OSPF
routing and this can reduce the AS external LSA flooding and improve the
network performances

Stub Area

area 0 area 1

Type 3 LSA √ Stub area

Type 3 LSA (default route)

Type 4 LSA
Type 5 LSA ×
ABR router
router will
will stop
stop the
the type
type 55 LSA
LSA to
to enter
enter the
the stub
stub area,
area, all
all the
the traffic
traffic forward
forward outside
the OSPF routing domain will be using the default route generated
the OSPF routing domain will be using the default route generated by the ABR .by the ABR .

Page 42 Learning Centre
Proprietary & Confidential

In some Autonomous Systems, the majority of the link-state database may consist
of AS-external-LSAs. An OSPF AS-external-LSA is usually flooded throughout
the entire AS. However, OSPF allows certain areas to be configured as "stub
areas". AS-external-LSAs are not flooded into/throughout stub areas; routing to
AS external destinations in these areas is based on a (per-area) default only. This
reduces the link-state database size, and therefore the memory requirements, for a
stub area's internal routers.
In order to take advantage of the OSPF stub area support, default routing must be
used in the stub area. This is accomplished as follows. One or more of the stub
area's area border routers must advertise a default route into the stub area via
summary-LSAs. These summary defaults are flooded throughout the stub area, but
no further. (For this reason these defaults pertain only to the particular stub area).
These summary default routes will be used for any destination that is not explicitly
reachable by an intra-area or inter-area path (i.e., AS external destinations).

Total Stub Area

area 0 area 2
Type 3 LSA
× (total stub area)

Type 3 LSA (default route)

Type 4 LSA
Type 5 LSA ×
ABR will
will stop
stop the
the type
type 3/4/5
3/4/5 LSA
LSA to to enter
enter total
total stub
stub area
area except
except the
the one
one type
type 33
LSA: the
the default
default route
route for
for the
the traffic
traffic outside
outside the
the total
total stub
stub area
Page 43 Learning Centre
Proprietary & Confidential

For all total stub area ,ABR will stop the type 3/4/5 LSA to enter the total stub area
only one exception : the ABR attached to the total stub area will generate a default
route type 3 LSA and flooding in this total stub area ,the total stub area can reduce
the LSA heavily. So in the total stub area ,there are type 1 / 2 LSAs and one type 3
default route LSA available in the LSDB .

Not-So-Stubby Area (NSSA)


Type 7 LSA
Type 5

area 0 NSSA area

NSSA areaarea can
can import
import the
the Non-OSPF
Non-OSPF routeroute into
into the
the OSPF
OSPF routing
routing domain
domain using
the type
type 77 LSA,
LSA, type
type 77 LSA
LSA will
will only
only be
be flooded
flooded inin the
the NSSA
NSSA area
area and
and translated
into type
type 55 LSA
LSA byby the
the ABR.

Page 44 Learning Centre
Proprietary & Confidential

NSSA External LSAs are originated by ASBRs within not-so-stubby areas
(NSSAs). NSSAs are described in the following section. An NSSA External LSA
(type 7 LSA )is almost identical to an AS External LSA, as the section on OSPF
packet formats shows. Unlike AS External LSAs, which are flooded throughout an
OSPF autonomous system, NSSA external LSAs are flooded only within the not-
so-stubby area in which it was originated. At NSSA area border routers will
translate selected type 7 LSA from the NSA into type 5 LSA,these type 5 lsa wil be
flooded to all type 5 capable areas .

NSSA- Totally Stub

• Prevents LSA Type – 5 & Type – 3 from leaking
in the area

Network Learning Centre
Proprietary & Confidential

In the previous network diagram, we configured area 2 as NSSA totally stub by
entering the area 2 nssa no-summary command on the NSSA ABR. This keeps
any Type 5 AS-external or Type 3 summary routes from leaking in area 2.

Virtual Link

area 1
area 0 area 2
Virtual Links

OSPF requires
requires all all non
non backbone
backbone areas
areas must
must connect
connect to to the
the backbone
backbone directly
or logically.
logically. IfIf an
an area
area does
does not
not connect
connect to
to the
the backbone
backbone area, area, the
the virtual
virtual link
should be be configured
configured between
between two
two ABR
ABR routers
routers inin the
the non
non backbone
backbone areaarea..

Page 46 Learning Centre
Proprietary & Confidential

The OSPF backbone is the special OSPF Area 0 ,The OSPF backbone always
contains all area border routers. The backbone is responsible for distributing
routing information between non-backbone areas. The backbone must be
contiguous. However, it need not be physically contiguous; backbone
connectivity can be established/maintained through the configuration of virtual
Virtual links can be configured between any two backbone routers that have
an interface to a common non-backbone area. Virtual links belong to the
backbone. The protocol treats two routers joined by a virtual link as if they were
connected by an unnumbered point-to-point backbone network. On the graph of
the backbone, two such routers are joined by arcs whose costs are the intra-area
distances between the two routers. The routing protocol traffic that flows along
the virtual link uses intra-area routing only.

Area Types – LSA Types

Area Restriction

Normal None
Stub No Type 5 AS-external LSA allowed
No Type 3, 4 or 5 LSAs allowed except the default
Totally Stub
summary route
No Type 5 AS-external LSAs allowed, but Type 7
NSSA LSAs that convert to Type 5 at the NSSA ABR can
No Type 3, 4 or 5 LSAs except the default summary
NSSA Totally
route, but Type 7 LSAs that convert to Type 5 at the
NSSA ABR are allowed

Network Learning Centre
Proprietary & Confidential

External Routes

One router to external world
only advertise default route
Several routers to outside world
pick one that is closest
pick one that carry data more efficiently
Two types of metrics can be used
type1 - the same as internal metrics
type 2 - keeps the external costs (default)
External routes are added to the database as “gateway link state records”


Network Learning Centre
Proprietary & Confidential