You are on page 1of 105

Module 4

OSPF Overview and


Configuration

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 1 OSPF Overview and Configuration

Module Objectives

Define OSPF, features, advantages over RIP


Describe OSPF LSA, format and Types
Define LSDB, Initial synchronization, database
exchange & reliable flooding
Describe Routing Calculations, supported network type
& Database Synchronization
Describe how to build OSPF Networks
Define the OSPF routing, areas, router types and virtual
Links
Differentiate DR, BDR, Router Election
OSPF Configuration and Examples
Lab Exercises
Summary

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 2 OSPF Overview and Configuration

Define OSPF
Dynamic Routing Protocol
Link State Protocol
Employ a distributed database model
More efficient than RIP

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 3 OSPF Overview and Configuration

The OSPF Advantage

OSPF is an interior gateway protocol (IGP)


that is more efficient than RIP.

Consumes fewer network resources


Highly scalable
Faster convergence
A more descriptive routing metric
Route load sharing
Greater security

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 4 OSPF Overview and Configuration

Link-state Protocol
Employ a distributed database model.
model
Each router advertises a description of its local
environment

interfaces
costs
neighbor information

Uses a single synchronized database for


collecting advertisements (LSDB)
LSDB
Routing table is derived from this database
Utilize a shortest-path first algorithm
OSPF is a Link-state routing protocol

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 5 OSPF Overview and Configuration

Basic Features of OSPF


Hello Packets
Link State Advertisements (LSA)
Link State Database
Reliable Flooding
Shortest Path First Routing Calculations
Areas and Inter-area Routing

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 6 OSPF Overview and Configuration

OSPF Hello Packet & Neighbor Discover


OSPF Hello packets are sent out all of a
routers interfaces to advertise itself to
neighbor routers
A router learns about its neighbors when it
receives neighbor routers Hello packet
Hello packets are sent out every 10 seconds
by default
If subsequent Hello packet is not received
within 40 seconds,
seconds neighbor relationship is
terminated

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 7 OSPF Overview and Configuration

OSPF Hello Packets


Will only be recognized by routers attached
to the same subnet with same subnet mask
Contains information on parameters for

Hello Interval and


Router Dead Interval

This information is used by neighbor routers


to agree on the communication variables
This allows an occasional lost Hello packet
not to be interpreted as a link down
condition.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 8 OSPF Overview and Configuration

OSPF Hello Packets (cont.)

In a broadcast environment, it contains the


OSPF router IDs of all routers the sender has
heard up to the point of transmission

This reduces overhead of sending multiple


Hellos

Ensure that the OSPF link is bi-directional

NOTE: An OSPF router will not forward data


packets over a unidirectional link.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 9 OSPF Overview and Configuration

Link State Advertisement (LSA)

Each OSPF router is responsible for


describing its local piece of the routing
topology through the transmission of linkstate advertisements.

Every thirty minutes a router will -- even in


the absence of any change, retransmit this
self-originating data in the event it may have
been lost or corrupted in a neighbor routers
tables.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 10 OSPF Overview and Configuration

OSPF LSA Format


LS Age
O p t io n s

All OSPF LSAs start


with a 20-byte common
header

This provides orderly


updating and removal of
LSAs and organization to
the LSDB

LS T ype

L in k S t a t e I D

A d v e r tis in g R o u t e r

LS S equence N um ber
LS C hecksum
L e n g th

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 11 OSPF Overview and Configuration

LSA Format - LS Age


LS Age
O p tio n s

Number of seconds since


the LSA was originated
normally 0 - 30 mins.

If LSA reaches 30 minutes,


originating router will
refresh the LSA by flooding
a new instance.

If LSA reaches 1 hour, it is


deleted from the database.

LS T ype

L in k S t a te I D

A d v e r t is in g R o u t e r

LS S equence N um ber
LS C hecksum
L e n g th

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 12 OSPF Overview and Configuration

LSA Format - LS Type

Classifies the LSA


according to function

Type 1
Type 2
Type 3
Type 4
Type 5
Type 7

LS Age
O p tio n s

LS Type

L in k S t a t e ID

A d v e r tis in g R o u t e r

LS S equence N um ber
LS C hecksum
L e n g th

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 13 OSPF Overview and Configuration

LSA Format - Link State ID


A unique identification
Used to describe a router
in the OSPF routing
domain
Depends on the LS Type

LS Age
O p t io n s

LS T ype

L in k S t a t e I D

A d v e r tis in g R o u te r

Type 1, 2, 3, 4, 5 or 7
LS S equence N um ber
LS C hecksum
L e n g th

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 14 OSPF Overview and Configuration

LSA Format - Advertising Router


LS Age
O p t io n s

The originating routers


OSPF router ID

In practice, this is one of


the routers IP address

LS Type

L in k S ta t e ID

A d v e r tis in g R o u te r

LS S equence N um ber
LS C hecksum
L e n g th

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 15 OSPF Overview and Configuration

LSA Format - LS Sequence Number

A linear sequence number

LS Age
O p t io n s

Used to compare a new


LSA with an old LSA

LS Type

L in k S t a t e I D

A d v e r tis in g R o u te r

The LSA instance having


the larger LS Sequence
Number is considered to
be more recent.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 16 OSPF Overview and Configuration

LS S equence N um ber
LS C hecksum
L e n g th

LSA Format - LS Checksum


LS Age
O p t io n s

Used to detect data


corruption.

Does not include LS


Age field

Derived using Fletcher


checksum algorithm

LS Type

L in k S t a t e I D

A d v e r tis in g R o u te r

LS S equence N um ber
LS C hecksum
L e n g th

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 17 OSPF Overview and Configuration

LSA Types

Type Number

Description

1
2
3
4
5
7

Router-LSAs
Network-LSAs
Summary-LSAs (IP network)
Summary-LSAs (ASBR)
AS external-LSAs
NSSA external-LSAs

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 18 OSPF Overview and Configuration

LS Type 1 - Router-LSAs
Generated by each OSPF
router
It describes the routers set
of active interfaces, its
associated cost and any
neighbor information
Link State ID is set to the
routers OSPF Router ID
Flooded throughout a
single area only

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 19 OSPF Overview and Configuration

LS Age
O p t io n s

LS Type

L in k S ta t e I D

A d v e r tis in g R o u t e r

LS S equence N um ber
LS C hecksum
L e n g th

LS Type 2 - Network-LSAs

Generated by OSPF Designated Routers (DRs)

Describes a network segment - i.e., broadcast


domain along with the IDs of all currently attached
routers.

Link State ID field lists the IP interface address of


the DR

LS Age
O p tio n s

LS Type

L in k S ta te ID

A d v e r t is in g R o u t e r

LS S equence N um ber
LS C hecksum
L e n g th

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 20 OSPF Overview and Configuration

LS Type 3 - Summary-LSAs (IP Network)

This originate from Area


Border Routers (ABRs)

LS Age
O p tio n s

LS Type

L in k S ta t e I D

Supports hierarchical
routing through the use
of OSPF areas
Link State ID field is an
IP network number

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 21 OSPF Overview and Configuration

A d v e r t is in g R o u t e r

LS S equence N um ber
LS C hecksum
L e n g th

LS Type 4 - Summary-LSAs (ASBR)

This originate from Area


Border Routers (ABRs)
Similar to LS Type 3
Used when destination is
an Autonomous System
Boundary Router (ASBR)

LS Age
O p tio n s

LS Type

L in k S ta t e I D

A d v e r tis in g R o u t e r

LS S equence N um ber
LS C hecksum

The Link State ID is the AS


boundary routers OSPF
Router ID

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 22 OSPF Overview and Configuration

L e n g th

LS Type 5 - AS-external-LSAs
LS Age

Originated by AS boundary
routers and describes
destinations ex-ternal to
the AS.
Link State ID field specify
an IP network number

O p tio n s

LS Type

L in k S ta t e I D

A d v e r tis in g R o u t e r

LS S equence N um ber
LS C hecksum
L e n g th

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 23 OSPF Overview and Configuration

LS Type 7 - NSSA external-LSAs

Allows the import of


external routes that
will not be advertised
out of the NSSA

LS Age
O p tio n s

LS Type

L in k S t a t e ID

A d v e r t is in g R o u t e r

NSSA - Not So Stubby


Area

LS S equence N um ber
LS C hecksum
L e n g th

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 24 OSPF Overview and Configuration

Router LSA Format - Link ID

R o u te r T y p e

N u m b e r o f L in k s
L in k I D

L in k 1

L in k D a t a

L in k T y p e

# T O S M e t r ic s
M e t r ic
L in k I D

L in k 2 ,
e tc .

L in k D a t a
L in k T y p e

# T O S M e t r ic s
M e t r ic

Originating routers link


information follows the LSA
header.
There are four Link IDs
determined by Link Type.
Type 1 Neighboring routers Router ID

Three of this Link ID are


relevant in a broadcast
network

Link
type Description
Link ID
2
Link to transit network Interface address of
Designated Router
3
Link to stub network
IP network number
4
Virtual link
Neighbor Router ID

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 25 OSPF Overview and Configuration

Router LSA Format - Link Data

For transit and Virtual


Links

specifies the IP address


of associated router
interface.

R o u te r T y p e
N u m b e r o f L in k s
L in k ID

L in k 1

L in k D a ta
L in k T y p e

For stub networks

Specifies the stub


network mask

# T O S M e t r ic s
M e t r ic
L in k ID

L in k 2 ,
e tc .

L in k D a ta
L in k T y p e

# T O S M e t r ic s
M e t r ic

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 26 OSPF Overview and Configuration

Router LSA Format - Metric


The cost of using this
router link.
A user-configurable value
from 1 - 65,535
The larger the metric, the
less likely (more
expensive) data will be
routed over that particular
link.
Connections to STUB
networks are allowed to
advertise a metric of zero.

R o u te r T y p e

N u m b e r o f L in k s
L in k I D

L in k 1

L in k D a t a
L in k T y p e

# T O S M e tr ic s
M e tr ic
L in k I D

L in k 2 ,
e tc .

L in k D a t a
L in k T y p e

# T O S M e tr ic s
M e tr ic

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 27 OSPF Overview and Configuration

Link-State Database (LSDB)


The collection of all OSPF LSAs received
Each OSPF router has an identical LSDB
Gives complete description of the network:

routers
network segments
interconnectivity (how it is interconnected)

LSDBs are exchanged between neighboring


routers soon after routers discover each
other
Maintained through a procedure called
reliable flooding

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 28 OSPF Overview and Configuration

LSDB Initial Synchronization

When two neighbors first start


communicating, they must synchronize their
databases before forwarding traffic over
their shared link to prevent routing loops
from occurring.
S w itc h A

S w itc h B

S u m m it 4

S u m m it 4

S y n c h r o n iz e D a ta b a s e s

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 29 OSPF Overview and Configuration

OSPF-specified Database Exchange

Procedure used by the routers to


synchronize their databases once the hello
protocol determines a bi-directional
connection between router neighbors.

During synchronization, the neighbor routers


do three things:

Forward current LSA headers


Compares the header received to the LSDB
Request the full LSA for new or newer headers

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 30 OSPF Overview and Configuration

Example LSDB Initial Synchronization


s w it c h e
S u m m it 4

s w it c h d
S u m m it 4

Switches A thru F are


in a stable OSPF
network and have fully
synchronized
databases

S w it c h A
S u m m it 4

S w it c h F
S u m m it 4

s w it c h c
S u m m it 4

s w it c h b
S u m m it 4

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 31 OSPF Overview and Configuration

OSPF is restarted on
Switch F, forcing
database
synchronization with
switch A.

Example LSDB Initial Synchronization


S w it c h A

S w itc h F

S u m m it 4

S u m m it 4

O S P F H e llo
O S P F H e llo : I h e a r d S w itc h
A
D a ta b a s e D e s c r ip tio n : S e q u e n c e = X

B id ir e c t io n a lit y e s ta b lis h e d
D a ta b a s e E x c h a n g e s e q u e n c e n u m b e r c re a te d

D a t a b a s e D e s c r ip t io n : S e q u e n c e = X w ith 6 L S A h e a d e r s
( R o u te r L S A , S w itc h A , 0 x 8 0 0 0 0 0 0 7 ) ( R o u te r L S A , S w itc h d , 0 x 8 0 0 0 0 0 2 1 )
( R o u te r L S A , S w itc h b , 0 x 8 0 0 0 0 0 b 2 ) ( R o u te r L S A , S w itc h e , 0 x 8 0 0 0 0 0 1 2 )
( R o u te r L S A , S w itc h c , 0 x 8 0 0 0 0 0 0 3 ) ( R o u te r L S A , S w itc h F , 0 x 8 0 0 0 0 0 0 5 )

D a t a b a s e D e s c r ip t io n : S e q u e n c e = X + 1
L S A h e a d e r = ( r o u te r L S A , s w itc h F , 0 x 8 0 0 0 0 0 0 1 )
D a t a b a s e D e s c r ip t io n : S e q u e n c e = X + 1

S e q u e n c e n u m b e r in c r e m e n t e d , a c k n o w le d g e s p r e v io u s
e x c h a n g e p a ir
e m p t y d a t a b a s e d e s c r ip t io n p a c k e t u s e d f o r
a c k n o w le d g e m e n t

L in k S t a te R e q u e s t P a c k e t fo r th e f o llo w in g L S A s :
( R o u te r L S A , S w itc h d )
( R o u te r L S A , S w itc h e )
( R o u te r L S A , S w itc h F )

( R o u te r L S A , S w itc h A )
( R o u te r L S A , S w itc h b )
( R o u te r L S A , S w itc h c )

R o u te r r e q u e s ts a ll L S A s n o t in its lo c a l d a ta b a s e

L in k S t a t e U p d a t e p a c k e t f o r t h e f o llo w in g L S A s :
( R o u te r L S A , S w itc h A , 0 x 8 0 0 0 0 0 0 7 ) ( R o u te r L S A , S w itc h d , 0 x 8 0 0 0 0 0 2 1 )
( R o u te r L S A , S w itc h b , 0 x 8 0 0 0 0 0 b 2 ) ( R o u te r L S A , S w itc h e , 0 x 8 0 0 0 0 0 1 2 )
( R o u te r L S A , S w itc h c , 0 x 8 0 0 0 0 0 0 3 ) ( R o u te r L S A , S w itc h F , 0 x 8 0 0 0 0 0 0 5 )
L in k S t a te U p d a te p a c k e t, L S A =
( r o u te r L S A , s w it c h F , 0 x 8 0 0 0 0 0 0 6 )

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 32 OSPF Overview and Configuration

U p d a t e d L S A f o r s w it c h F w it h la r g e r s e q u e n c e n u m b e r

OSPF Database - Reliable Flooding

LSA Updates are periodically generated by


a router wishing to update a self-originated
LSA because:

The routers local state may have changed


The router wants to delete one of its selforiginated LSAs

Used to propagate LSA Updates throughout


the routing domain

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 33 OSPF Overview and Configuration

Reliable Flooding - What Happens


A router will generate a Link-state Update
packet containing one or more LSAs
Update is forwarded out all interfaces.
Neighbor router receives the Update and
compares the LSAs with the LSDB
More recent LSAs are installed in LSDB
Acknowledgement is sent back to
originating route
New Link-state Update containing the LSA is
sent out all interfaces except receiving one.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 34 OSPF Overview and Configuration

OSPF Routing Calculations

With router LSDBs synchronized for all


routers in routing domain

The router will use Dijkstras Shortest Path First


algorithm

This allows calculation of shortest paths to all


destinations

Routing table is constructed from the


calculations and includes

network destinations
associated costs

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 35 OSPF Overview and Configuration

OSPF Routing Calculations

Every link carries an associated cost.


S w it c h H

S w itc h I

S u m m it 4 8

S u m m it 4 8

S w itc h E

S u m m it 1

S w itc h G

S u m m it 4 8

S w it c h J

S u m m it 4 8

1
5

S w itc h F

S w itc h D

S u m m it 4 8

S w it c h K
S u m m it 4 8

S u m m it 1

2
S w itc h C
S u m m it 4

S w it c h A

S u m m it 4 8

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 36 OSPF Overview and Configuration

S w it c h B
S u m m it 4 8

OSPF Routing Calculations


S h o r te s t P a th F ir s t C a lc u la tio n fo r S w itc h " C "
I t e r a t io n

D e s t in a t io n A d d e d t o
S h o rte s t-P a th T re e

C a n d id a te L is t D e s tin a tio n
(c o s t, n e x t h o p s )

S w itc h C

S
S
S
S

S w itc h A

S w it c h B ( 1 , S w it c h B )
S w itc h D ( 2 , S w itc h D )
S w it c h E ( 2 , S w it c h E )

S w itc h B

S w itc h D ( 2 , S w itc h D )
S w it c h E ( 2 , S w it c h E )

S w itc h D

S
S
S
S

w
w
w
w

it c h E ( 2 , S w it c h E )
itc h I (3 , S w itc h D )
itc h J (3 , S w itc h D )
itc h K (3 , S w itc h D )

S
S
S
S
S
S

w
w
w
w
w
w

it c h I ( 3 , S w it c h D )
it c h J ( 3 , S w it c h D )
it c h K ( 3 , S w it c h D )
itc h F (3 , S w itc h E )
itc h G (3 , S w itc h E )
itc h H (3 , S w itc h E )

S w itc h E

6
7
8
9
10

S
S
S
S
S

11

S w itc h I

w
w
w
w
w

itc h
itc h
itc h
itc h
itc h

w
w
w
w

itc h
itc h
itc h
itc h

I
J
K
F
G

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 37 OSPF Overview and Configuration

E m p ty

A
B
D
E

(1 ,
(1 ,
(2 ,
(2 ,

Sw
Sw
Sw
Sw

itc h
itc h
itc h
it c h

A)
B)
D)
E)

OSPF Routing Calculations

Applying Dijkstras SPF algorithm, Switch Cs routing table


would incorporate the highlighted links
S w itc h H

S w itc h I

S u m m it 4 8

S u m m it 4 8

S w itc h E

S u m m it 1

S w itc h G

S u m m it 4 8

S w it c h J

S u m m it 4 8

1
5

S w itc h F

S w itc h D

S u m m it 4 8

S w itc h K

S u m m it 4 8

S u m m it 1

Note that Switch A will


never talk directly to
Switch B as long as the
links thru Switch C
remain stable.

S w itc h C
S u m m it 4

S w it c h A

S u m m it 4 8

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 38 OSPF Overview and Configuration

S w itc h B
S u m m it 4 8

OSPF Routing Calculations


Note how changing a link cost affects the route
calculation for the shortest path

S w it c h H

S w it c h I

S u m m it 4 8

S u m m it 4 8

S w it c h E

S u m m it 1

S w it c h G

S u m m it 4 8

S w it c h J

S u m m it 4 8

1
3

S w it c h F

S w it c h D

S u m m it 4 8

S w itc h K
S u m m it 4 8

S u m m it 1

Communication with
Switch B is no longer
direct, but must routed
thru Switch A.
S w it c h A

4
S w it c h C
S u m m it 4

S u m m it 4 8

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 39 OSPF Overview and Configuration

S w itc h B
S u m m it 4 8

With this configuration,


Switch C now has two
paths of equal cost to
communicate with
Switch J.

OSPF Network Types

Point-to-Point networks

Non-broadcast Multi-access (NBMA)


networks

X.25, ATM

Point-to-Multipoint networks

Serial lines

Frame Relay

Broadcast networks

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 40 OSPF Overview and Configuration

OSPF Network Type - Broadcast


Networks
A network with more than two attached
devices
Has the ability to address a single physical
message to all of the attached devices
(broadcast)

1 0 .1 .1 .1

1 0 .1 .1 .3

1 0 .1 .1 .2

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 41 OSPF Overview and Configuration

1 0 .1 .1 .5

1 0 .1 .1 .4

OSPF Network Type - Broadcast


Networks
Only network type supported by Extreme switches
Other Network Types are for WAN use

1 0 .1 .1 .1

1 0 .1 .1 .3

1 0 .1 .1 .2

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 42 OSPF Overview and Configuration

1 0 .1 .1 .5

1 0 .1 .1 .4

Broadcast Networks Terminology


DR - Designated Router
BDR - Backup DR
DR and BDR Election
Network LSAs

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 43 OSPF Overview and Configuration

Broadcast Networks - Designated Router


Every broadcast network has a Designated
Router (DR) and a Backup Designated Router
(BDR)
Each router on the network exchanges link
state information only with the DR and BDR.

This information is used to maintain database


synchronization between the DR and neighbor
routers

This reduces the amount of traffic otherwise


consumed by routing protocol traffic
Only a DR generates a LS Type 2 - NetworkLSAs

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 44 OSPF Overview and Configuration

DR and BDR Election


First OSPF router on an IP subnet always
becomes the DR
Second OSPF router always becomes BDR
If DR or BDR fail, the OSPF router with the
highest Router Priority will replace the BDR
If two OSPF routers have same Router
Priority, then the OSPF Router ID will break
the tie
A Router Priority of 0 will prevent an OSPF
router from ever being elected as DR or BDR

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 45 OSPF Overview and Configuration

Database Synchronization

An OSPF router will send its Link State


Update (LSU) to the DR and BDR

The destination IP address for the LSU will be


multicast address 224.0.0.6 (All DRouters).

The DR will then flood the update to all


OSPF routers

The destination IP address for the LSU will be


multicast address 224.0.0.5 (All OSPFRouters).

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 46 OSPF Overview and Configuration

Representing Broadcast Subnet in LSDB

If an OSPF router included all known routers on a


common subnet in its router-LSA, there would be
n*(n-1) links in the OSPF database.

By using a new LSA type, the Network-LSA,


Network-LSA to
represent the broadcast subnet, the number of links
is reduced from n*(n-1) to n*2.

Each network LSA has a link to every router-LSA,


and every router-LSA has a link to the broadcast
subnets network-LSA.

DR maintains the network-LSA

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 47 OSPF Overview and Configuration

Type 2: Network LSAs


LS Age
O p t io n s

Created in order to
reduce the number of
links in each routers
resulting LSDB

Describes the subnet,


all routers on that
network DR identity

LS T ype

L in k S t a t e I D

A d v e r tis in g R o u t e r

LS S equence N um ber
LS C hecksum
L e n g th
N e tw o rk M a s k

A tta c h e d R o u te r 1

A tta c h e d R o u te r 2 , e tc .

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 48 OSPF Overview and Configuration

Type 2: Network LSAs


R o u te r 1
ro u te r-L S A

n e tw o rk -L S A
lin k -s ta te ID

R o u te r 3
ro u te r-L S A

D e s ig n a te d
R o u te r-o r g in a te d
n e tw o rk -L S A

n e tw o rk -L S A
lin k -s ta te ID

ro u te r-L S A
lin k -s ta te ID
ro u te r-L S A
lin k -s ta te ID
ro u te r-L S A
lin k -s ta te ID
ro u te r-L S A
lin k -s ta te ID

R o u te r 2
ro u te r-L S A

R o u te r 4
ro u te r-L S A

n e tw o rk -L S A
lin k -s ta te ID

n e tw o rk -L S A
lin k -s ta te ID

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 49 OSPF Overview and Configuration

The network-LSA
helps in database
synchronization,
since a router
having a routerLSA with a link to
the network-LSA
and vice-versa is
known to have a
database
synchronized with
the Designated
Router.

Building OSPF Networks


Hierarchical Routing
OSPF Routing Hierarchy
OSPF Areas
OSPF Types of Routers
Virtual Links
CLI Commands for OSPF Configuration

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 50 OSPF Overview and Configuration

Hierarchical Routing

OSPF implements a two-level


hierarchical routing scheme

Saves router memory consumed


by the routing table

Saves router resources when


computing the routing table

Saves link bandwidth when


distributing routing data

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 51 OSPF Overview and Configuration

OSPF Areas Defined


The OSPF hierarchy is maintained through
the deployment of OSPF areas
Each OSPF area is identified by a 32-bit
Area ID
Each area consists of a collection of one or
more network segments interconnected by
routers
An area has its own LSDB consisting of
router-LSAs and network-LSAs

These LSAs describe areas topology

Routing with an area is flat.


flat

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 52 OSPF Overview and Configuration

Areas Router-LSA and Network-LSA


Not flooded beyond the areas borders
Detailed knowledge of areas topology is
hidden from all other areas in the parent
Autonomous System.

S u m m it 4 8

S u m m it 4 8

S u m m it 4 8

S u m m it 4 8

S u m m it 1

S u m m it 1
1

S u m m it 4

S u m m it 3

S u m m it 4 8

S u m m it 3

S u m m it 3

S u m m it 4 8

S u m m it 4

S u m m it 3

S u m m it 3

A re a A

S u m m it 4 8

S u m m it 3

S u m m it 4 8

A re a B

Area A does not know the internal topology of Area B and


vice versa.
LE-201 - Unicast Routing and L3 Switch Configuration
Module 4 - 53 OSPF Overview and Configuration

Area Border Router (ABR)


Manages inter-area communication
Attached to two or more areas, running
multiple copies of the basic algorithm
Maintain LSDBs for each attached area and
an additional copy for the backbone
Condense the topological information of
their attached areas into Type 3: SummaryLSAs for distribution to the backbone.

The backbone in turn distributes the information


to the other areas.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 54 OSPF Overview and Configuration

Area Border Router (ABR) cont.


S u m m it 4 8

S u m m it 4 8

1 0 .5 .1 .0 /2 4
S u m m it 1
1

1 0 .5 .3 .0 /2 4

1 0 .5 .2 .0 /2 4

S u m m it 4

S u m m it 3

S u m m it 3

1 0 .5 .4 .0 /2 4
S u m m it 4 8

S u m m it 4 8

S u m m it 3

A g g re g a te !!!

1 0 .5 .0 .0 /1 6
LE-201 - Unicast Routing and L3 Switch Configuration
Module 4 - 55 OSPF Overview and Configuration

ABRs can be
configured to
aggregate some or
all of the networks
within its
dependent area
into a single,
summary network
address with a less
discreet network
mask.

Types of OSPF Areas

Normal Area

Area 0 (Backbone)

Stub Areas
Not-So-Stubby-Areas (NSSA)
Virtual Links

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 56 OSPF Overview and Configuration

Normal Area

An area which is not a:

Stub area
NSSA

Can be placed anywhere within the OSPF


routing domain
Support ASBRs
Support Virtual Links
Can distribute external routes

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 57 OSPF Overview and Configuration

Area 0 (Backbone)
Is a Normal Area
Responsible for distributing routing
information between areas
Consist of

all area border routers


networks not contained in any other area
and their attached routers

Has an Area ID of 0.0.0.0


Only one backbone area per AS
All areas are required to attach directly to the
OSPF backbone area

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 58 OSPF Overview and Configuration

Stub Area

For routers with limited resources

reduce memory and computation requirements

The LSDB is kept as small as possible


External route information is not distributed

Will use default routes to ABRs instead

Does not support ASBRs


Does not support virtual links
Appears to lie on the edge of an OSPF
domain (AS) in configuration

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 59 OSPF Overview and Configuration

Not-So-Stubby-Area (NSSA)

Similar to existing OSPF Stub Area with two


additional capabilities

External routes originating from ASBR connected to NSSA can be advertised within
External routes originating from NSSA can be
propagated to other areas, including the
backbone.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 60 OSPF Overview and Configuration

OSPF Defines Three types of Routers

Internal Router (IR)

Has all of its interfaces within the same area

Area Border Router (ABR)


Autonomous System Boundary Router
(ASBR)

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 61 OSPF Overview and Configuration

OSPF Hierarchical Components


OSPF Router Types Displayed
R 1

R 2

R 3

A re a 1

R 9

A re a 2

R 8
R 4

ABR

R 6

R 7

Internet

R 10

ABR

ASBR

R 5

ABR

A re a 3
A re a 3

R 11

R 12
R 13

A u to n o m o u s S y s te m

*All other routers that are not labeled ASBR or ABR are Internal Routers
LE-201 - Unicast Routing and L3 Switch Configuration
Module 4 - 62 OSPF Overview and Configuration

Virtual Links

Used when a new area is introduced that


does not have a direct physical attachment
to the backbone

Provides a logical path between the ABR of


the disconnected area and the backbone

A virtual link is established between two


ABRs that have a common area, with one
ABR connected to the backbone

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 63 OSPF Overview and Configuration

OSPF Configuration Example


A re a 0 .0 .0 .1
N o rm a l
E

In te rn e t

A re a 0 .0 .0 .4
STUB

BG P
E

VL

A re a 0 .0 .0 .2
N o rm a l

A re a 0 .0 .0 .0

A re a 0 .0 .0 .3
N o rm a l
VL

R IP
C lo u d

A re a 0 .0 .0 .5
N SSA

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 64 OSPF Overview and Configuration

Configuring OSPF

Must have a unique router ID for each switch

Recommend manually setting the router ID


of the switches participating in OSPF

Simplifies router management


Prevents corruption of virtual links

Do not use 0.0.0.0 as a router ID

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 65 OSPF Overview and Configuration

OSPF CLI Commands


enable/disable ospf
config ospf add/delete vlan
create/delete ospf area
config ospf vlan area
show ospf area
show ospf interfaces

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 66 OSPF Overview and Configuration

CLI Command - enable/disable ospf


enable ospf
disable ospf
Enable or disable OSPF for the whole router.
Default is disabled.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 67 OSPF Overview and Configuration

CLI Command - config ospf add/del vlan


config ospf add vlan [<name> | all]
config ospf delete vlan [<name> | all]

Enables or disables OSPF on one or all VLANs


(router interfaces).
The default setting is disabled.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 68 OSPF Overview and Configuration

CLI Command - create/del ospf area


create ospf area <areaid>
delete ospf area [<areaid> | all]

Create or delete an OSPF area. Area 0.0.0.0


does not need to be created. It exists by default.
It also cannot be deleted.
Once an OSPF area is removed, the associated
OSPF area and OSPF interface information will
also be removed.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 69 OSPF Overview and Configuration

CLI Command - config ospf vlan area


config ospf vlan <name> area <areaid>

Associates a VLAN (router interface) with/from


an OSPF area. The area must already be
defined. All router interfaces must have an
associated OSPF area.
By default, all router interfaces are associated
with area 0.0.0.0 (backbone).

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 70 OSPF Overview and Configuration

CLI Command - show ospf


show ospf

Displays global OSPF information.

show ospf area {<areaid>}

Displays information about a particular OSPF


area, or all OSPF areas.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 71 OSPF Overview and Configuration

Example: show ospf area


OSPF_Switch4: show

ospf area

Area: 0.0.0.0 Stub: FALSE Rtr Id: 20.20.20.20


Spf Runs: 48 Num ABR: 6 Num ASBR: 0 Num LSA: 43 LSA Chksum:0x170863
Interfaces:
IP addr
Ospf State DR IP addr
BDR IP addr
10.0.2.1
/24 E DOWN 0.0.0.0
0.0.0.0
10.0.1.1
/24 E BDR
10.0.1.2
10.0.1.1
Inter-Area route Filter: None
External route Filter: None
Configured Address Ranges:
Area: 10.11.0.0 Stub: FALSE Rtr Id: 20.20.20.20
Spf Runs: 21 Num ABR: 2 Num ASBR: 0 Num LSA: 35 LSA Chksum:0x16c3de
Interfaces:
IP addr
Ospf State DR IP addr
BDR IP addr
10.11.1.1
/24 E DR
10.11.1.1
10.11.1.2
Inter-Area route Filter: None
External route Filter: None
Configured Address Ranges:

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 72 OSPF Overview and Configuration

CLI Command - show ospf interfaces


show ospf interfaces {vlan <name> | area <areaid>|all}

Displays information about one or all OSPF area, or all


OSPF areas.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 73 OSPF Overview and Configuration

Example: show ospf interface


Summit4: sh

ospf interface

Interface(rif4): 10.15.1.1/24 Vlan: norm151 Ospf: ENABLED Router: ENABLED


AreaId: 10.15.0.0 RtId: 20.20.20.20 Cost: 1 Pri: 1 Transit Delay: 1
Hello Interval: 10s Rtr Dead Time: 40s Retransmit Interval: 5s
Authentication: NONE
State: BDR Number of events: 1
DR RtId: 30.30.30.30 DR IP addr: 10.15.1.3 BDR IP addr: 10.15.1.1
Neighbours:
RtrId: 10.10.10.10 IpAddr: 10.15.1.2 Pri: 1
State: FULL Dr: 10.15.1.3 BDR: 10.15.1.1 Dead Time: 7
RtrId: 30.30.30.30 IpAddr: 10.15.1.3 Pri: 1
State: FULL Dr: 10.15.1.3 BDR: 10.15.1.1 Dead Time: 6

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 74 OSPF Overview and Configuration

Laboratory Exercise

Lab4 - OSPF Configuration I

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 75 OSPF Overview and Configuration

Lab4 - Network Topology

O SPF_LAB _3

O SPF_LAB_1

.2

N o rm a l
1 0 .1 3 .0 .0
.1
N O R M 131
1 0 .1 3 .1 .0 /2 4

O SPF_LAB _3

.2

O SPF_LAB_2

N o rm a l
1 0 .1 1 .0 .0
.1
N O R M 111
1 0 .1 1 .1 .0 /2 4

P o rt 2 1

P o rt 1 8

N O RM 131

N O R M 111

P o rt 1 8

P o rt 2 1

N O R M 131

N O RM 111

O SPF_LAB _1

O SPF_LAB _2
P o rt 1 9

.1

BBO N E1

Backbone
0 .0 .0 .0
BBO NE1
1 0 .0 .1 .0 /2 4

N o rm a l
1 0 .1 9 .0 .0
.1
N O R M 171
1 0 .1 9 .1 .0 /2 4
.2

O SPF_LAB _6

.2

O SPF_LAB_5

P o rt 1 9
BBO N E1

N o rm a l
1 0 .1 7 .0 .0
.1
N O R M 151
1 0 .1 7 .1 .0 /2 4

O SPF_LAB _5

.2

O SPF_LAB_4

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 76 OSPF Overview and Configuration

O SPF_LAB _6

P o rt 1 8

P o rt 2 1

N O R M 191

N O RM 171

P o rt 2 1

P o rt 1 8

N O RM 191

N O R M 171

O SPF_LAB _4

More OSPF Configuration


config ospf add virtual-link
config ospf delete virtual-link
show ospf virtual-link

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 77 OSPF Overview and Configuration

CLI Command - config ospf add virtual-link


config ospf add virtual-link <routerid> <areaid>
config ospf delete virtual-link <routerid> <areaid>

Adds or deletes a virtual link connected to another


area border router (ABR).
Specify the following:

routerid -- Far-end router ID.


Areaid -- Transit area used for connecting the
two end-points. The transit area cannot be the
backbone (0.0.0.0).

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 78 OSPF Overview and Configuration

CLI Command - show ospf virtual-link


show ospf virtual-link {<areaid><routerid> | all}
Displays virtual link information about a particular
router or all routers. Default is all. Contains:
Area ID and neighbor router ID
Receive interval, transit delay, Hello interval, and
dead interval.
Authentication configuration
Virtual link type and number of events
Neighbor router ID, IP address, and priority
Link state, DR ID, BDR ID, and dead time
LE-201 - Unicast Routing and L3 Switch Configuration
Module 4 - 79 OSPF Overview and Configuration

Example: show ospf virtual-link


OSPF_LAB_2:19 # show

ospf virtual-link

AreaId: 10.15.0.0 NbrRouterId: 10.10.10.10


Rxmit Interval: 5 Transit Delay: 1 Hello Interval: 10 Dead Interval: 40
Auth Type: NONE
State: P2P Number of Events: 3
RtrId: 10.10.10.10 IpAddr: 10.15.1.2 Pri: 1
State: FULL Dr: 0.0.0.0 BDR: 0.0.0.0 Dead Time: 9
AreaId: 10.15.0.0 NbrRouterId: 30.30.30.30
Rxmit Interval: 5 Transit Delay: 1 Hello Interval: 10 Dead Interval: 40
Auth Type: NONE
State: P2P Number of Events: 1
RtrId: 30.30.30.30 IpAddr: 10.15.1.3 Pri: 1
State: FULL Dr: 0.0.0.0 BDR: 0.0.0.0 Dead Time: 7

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 80 OSPF Overview and Configuration

Laboratory Exercise

Lab5 - OSPF Configuration II

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 81 OSPF Overview and Configuration

Lab5 - Network Topology 1


N e tw o rk

O SPF_LAB _3

.3

.2

N o rm a l
1 0 .1 3 .0 .0
.1
N O RM 131
1 0 .1 3 .1 .0 /2 4

N o rm a l
1 0 .1 5 .0 .0 .2
N O R M 151
1 0 .1 5 .1 .0 /2 4

P h y s ic a l

O SPF_LAB _1
.2

.1

O SPF_LAB _2

N o rm a l
1 0 .1 1 .0 .0
.1
N O RM 111
1 0 .1 1 .1 .0 /2 4

O SPF_LAB_3

P o rt 2 1

P o rt 1 8

N O RM 121

N O RM 121

O SPF_LAB _1

P o rt 2 2

P o rt 1 7

N O R M 151

P o rt 1 7

P o rt 1 8

P o rt 2 1

N O RM 121

N O RM 121

O SPF_LAB_2

N O R M 151

NO R M 151

P o rt 2 2
N O R M 151

P o rt 1 9

.1

BBO NE1

Backbone
0 .0 .0 .0
BBO N E1
1 0 .0 .1 .0 /2 4

N o rm a l
1 0 .1 9 .0 .0
.1
N O R M 191
1 0 .1 9 .1 .0 /2 4

O SPF_LAB _5
.1

.2

O SPF_LAB _6

P o rt 1 9

.2

.3

N o rm a l
1 0 .2 1 .0 .0
N O RM 211
1 0 .2 1 .1 .0 /2 4

N o rm a l
1 0 .1 7 .0 .0
.1
N O RM 171
1 0 .1 7 .1 .0 /2 4
.2

.2

O SPF_LAB _4

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 82 OSPF Overview and Configuration

BBO NE1

P o rt 1 7
N O R M 211

P o rt 2 2

P o rt 2 2

O SPF_LAB_5
P o rt 1 8

P o rt 2 1

N O RM 171

N O RM 171

N O R M 211

O SPF_LAB_6

N O R M 211

P o rt 1 7
NO R M 211

P o rt 2 1

P o rt 1 8

N O RM 171

N O RM 171

O SPF_LAB _4

Lab5 - Network Topology 2


N e tw o rk

P h y s ic a l

V ir t u a l L in k s

O SPF_LAB_3

.3

N O R M 131
1 0 .1 3 .1 .0 /2 4

O SPF_LAB _1

.2

N O R M 151
1 0 .1 5 .1 .0 /2 4

.2
N o rm a l
1 0 .1 3 .0 .0

N o rm a l
1 0 .1 5 .0 .0

.2

.1
.1

O SPF_LAB _2

.1

O SPF_LAB _3
P o rt 2 2
NO RM 151

N o rm a l
1 0 .1 1 .0 .0
N O R M 111
1 0 .1 1 .1 .0 /2 4

P o rt 1 7

P o rt 2 1

P o rt 1 8

N O R M 121

N O R M 121

P o rt 1 8

P o rt 2 1

N O RM 121

N O R M 121

O SPF_LAB _2

N O R M 151

O SPF_LAB _1
P o rt 1 7
N O R M 151

P o rt 2 2
NO R M 151

P o rt 1 9

.1

BBO NE1

B ackbone
0 .0 .0 .0
BBO NE1
1 0 .0 .1 .0 /2 4

P o rt 1 9

.2
N o rm a l
1 0 .1 9 .0 .0
N O R M 191
1 0 .1 9 .1 .0 /2 4

.1

O SPF_LAB _5
.1

.2

O SPF_LAB_6

BBO NE1

.3

N o rm a l
1 0 .2 1 .0 .0
N O R M 211
1 0 .2 1 .1 .0 /2 4

.1

N O R M 211

N O R M 171
1 0 .1 7 .1 .0 /2 4

.2
.2

P o rt 1 7

N o rm a l
1 0 .1 7 .0 .0

O SPF_LAB _4

V ir t u a l L in k s

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 83 OSPF Overview and Configuration

P o rt 2 2

P o rt 2 2

O SPF_LAB _5
P o rt 1 8

P o rt 2 1

N O RM 171

N O R M 171

NO RM 211

O SPF_LAB _6

NO R M 211

P o rt 1 7
N O R M 211

P o rt 2 1

P o rt 1 8

N O R M 171

N O R M 171

O SPF_LAB _4

More OSPF Configuration - Areas


config ospf area normal
config ospf area stub
config ospf area nssa
show ospf

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 84 OSPF Overview and Configuration

CLI Command - config ospf area normal


config ospf area <areaid> normal

Configure an OSPF area as a normal area


Default area type is normal
Area 0.0.0.0 can only be normal

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 85 OSPF Overview and Configuration

CLI Command - config ospf area stub

config ospf area <areaid> stub [summary|


nosummary] stub-default-cost <cost>

Configures an OSPF area as a stub area.


Stub-default-cost is the the cost of the default
summary-LSA that the router should advertise into the
area

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 86 OSPF Overview and Configuration

CLI Command - config ospf area nssa


config ospf area <areaid> nssa [summary|
nosummary] stub-default-cost <cost>
{translate}

Configures an OSPF area as a NSSA.


Stub-default-cost is the the cost of the default
summary-LSA that the router should advertise
into the area
Translate option: determines whether type 7
LSAs are translated into type 5 LSAs.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 87 OSPF Overview and Configuration

CLI Command - show ospf


show ospf
Display global OSPF information:

Router ID
OSPF state
Is router an autonomous system boundary router (Y/N)?
Is router an area border router (Y/N)?
Number of external LSAs processed
External LSA checksum
Number of originating new LSAs
Number of received new LSAs
Shortest Path First hold time

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 88 OSPF Overview and Configuration

Example: show ospf

Summit4: show ospf


Router Id
OSPF ASBR ABR ExtLSA ExtLSACsum OrigNewLSA RxNewLSA
SpfHoldTime
20.20.20.20 E
NO YES
0
0x0
14694
20634
RouterId Selection: User Configured Export Static: Disabled
Export Static: Disabled
Export Rip: Disabled
ASBR route Filter: None

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 89 OSPF Overview and Configuration

Laboratory Exercise
OSPF Lab6
Utilizing the CLI Commands:

config ospf area normal


config ospf area stub
show ospf

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 90 OSPF Overview and Configuration

Lab6 - Network Topology


V ir t u a l L in k s

S tu b
1 0 .1 4 .0 .0
STU
1 0 .1 4
STU
1 0 .1 4
STU
1 0 .1 4
STU
1 0 .1 4

B141
.1 .1 /2
B142
.2 .1 /2
B143
.3 .1 /2
B144
.4 .1 /2

S tu b
1 0 .1 2 .0 .0
STU
1 0 .1 2
STU
1 0 .1 2
STU
1 0 .1 2
STU
1 0 .1 4

4
4
4

N o rm a l
1 0 .1 5 .0 .0

O SPF_LAB _3

.3

.2
N o rm a l
1 0 .1 3 .0 .0
NO RM 131
1 0 .1 3 .1 .0 /2 4

N O R M 151
1 0 .1 5 .1 .0 /2 4
N O R M 152
1 0 .1 5 .2 .0 /2 4
N O R M 153
1 0 .1 5 .3 .0 /2 4
N O R M 154
1 0 .1 5 .4 .0 /2 4

4
4
4
4

O SPF_LAB _1

.2

O SPF_LAB_2

.1

P o rt1 x -o v e r to P o rt2

P o rt1 x -o v e r to P o rt2

O SPF_LAB _3
P o rt 2 2

.2

.1

.1

B121
.1 .1 /2
B122
.2 .1 /2
B123
.3 .1 /2
B124
.2 .1 /2

NO RM 151

N o rm a l
1 0 .1 1 .0 .0
NO RM 111
1 0 .1 1 .1 .0 /2 4

P o rt 1 7

P o rt 2 1

P o rt 1 8

N O RM 131

N O R M 111

P o rt 1 8

P o rt 2 1

N O R M 131

N O RM 111

O SPF_LAB_2

N O R M 151

P o rt 1 7
NO R M 151

P o rt 2 2
N O R M 151

P o rt 1 9

.1

O SPF_LAB _1

BBO NE1

P o rt2 x -o v e r to P o rt3

B ackbone
0 .0 .0 .0
BBO NE1
1 0 .0 .1 .0 /2 4
P o rt2 x -o v e r to P o rt3
.2
N o rm a l
1 0 .1 9 .0 .0
NO RM 191
1 0 .1 9 .1 .0 /2 4

.1

O SPF_LAB _6
S tu b
1 0 .2 0 .0 .0
STU
1 0 .2 0
STU
1 0 .2 0
STU
1 0 .2 0
STU
1 0 .2 0

B201
.1 .1 /2
B202
.2 .1 /2
B203
.3 .1 /2
B204
.2 .1 /2

BBO NE1

O SPF_LAB_5
.1
N o rm a l
1 0 .2 1 .0 .0

.2
.3

N O R M 211
1 0 .2 1 .1 .0 /2 4
N O R M 212
1 0 .2 1 .2 .0 /2 4
N O R M 213
1 0 .2 1 .3 .0 /2 4
N O R M 214
1 0 .2 1 .4 .0 /2 4

.1

P o rt 1 7

N o rm a l
1 0 .1 7 .0 .0

N O R M 211

NO RM 171
1 0 .1 7 .1 .0 /2 4

P o rt 2 2

.2
.2

4
4
4
4

P o rt 1 9

V ir t u a l L in k s

P o rt 2 2

O SPF_LAB_5
P o rt 1 8

P o rt 2 1

N O R M 191

N O RM 171

NO RM 211

O SPF_LAB _4

O SPF_LAB _6

S tu b
1 0 .1 8 .0 .0
STU
1 0 .1 8
STU
1 0 .1 8
STU
1 0 .1 8
STU
1 0 .1 8

B181
.1 .1 /2
B182
.2 .1 /2
B183
.3 .1 /2
B184
.2 .1 /2

4
4
4
4

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 91 OSPF Overview and Configuration

P o rt1 x -o v e r to P o rt2

N O R M 211

P o rt 1 7
NO R M 211

P o rt 2 1

P o rt 1 8

N O RM 191

N O R M 171

O SPF_LAB _4
P o rt1 x -o v e r to P o rt2

More OSPF Configuration Commands


config ospf routeid
config ospf area add range
config ospf vlan area cost
config ospf vlan area priority
*enable iproute sharing
enable/disable ospf exportstatic type
config ospf vlan area virtual link authentication
config ospf vlan area virtual link timer
config ospf spf-hold-time
show ospf lsdb

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 92 OSPF Overview and Configuration

CLI Command - config ospf area add range


config ospf area <areaid> add range
<ipaddress> <mask> [advertise | noadvertise]
{type 3|type 7}
config ospf area <areaid> delete range
<ipaddress> <mask>

Configures or deletes a range of IP addresses in an


OSPF area.
On add, and if advertised, the range is exported as a
single LSA by the ABR.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 93 OSPF Overview and Configuration

CLI Command - config ospf cost


config ospf [vlan <name> | area <areaid> | all]
cost <number>

Configures the cost (metric) of one or all


interface(s).
The default cost of an interface is 1.
The maximum cost is 65,535.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 94 OSPF Overview and Configuration

CLI Command - config ospf priority


config ospf [vlan <name> | area <areaid> | all]
priority <number>

Configures the priority used in the designated


router-election algorithm for one or all IP
interface(s) or for all the interfaces within the
area.
The range is 0 - 255
The Default priority setting is 1
A value of 0 disqualifies the router from election

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 95 OSPF Overview and Configuration

CLI Command - enable iproute sharing


enable iproute sharing

Enables load sharing if multiple routes to the


same destination are available (equal cost
multipath)
Only paths with the same lowest cost are
shared.
The default setting is disabled.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 96 OSPF Overview and Configuration

CLI Command - enable/disable ospf exportstatic


enable ospf export static cost {<metric>}
[ase-type-1|ase-type-2] {tag <number>}
disable ospf export static

Enable/disables the distribution of static routes


into the OSPF domain.
The default tag number is 0.
The default setting is disabled.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 97 OSPF Overview and Configuration

CLI Command - config ospf authentication


config ospf [vlan <name> | area <areaid> | virtual-link
<routerid> <areaid>] authentication
[simple-password <password> | md5 <md5_key_id>
<md5_key> | none]

Configure OSPF authentication information for one


interface or all the interfaces in an AREA.
When the OSPF AREA ID is specified, then the
authentication information is applied to all the OSPF
interfaces within the area.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 98 OSPF Overview and Configuration

CLI Command - config ospf timer


config ospf [vlan <name> | area <areaid> | virtuallink <routerid>] timer <retransmission_interval>
<transmission_delay> <hello_interval>
<dead_interval>

Configures the timers for one interface or all the


interfaces in the same OSPF area.
The following default, min, and max values (in seconds) are used:
Variable
RETRANSMISSION
DELAY
HELLO
DEAD INTERVAL

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 99 OSPF Overview and Configuration

Default Min
5
0
1
0
10
1
40
1

Max
3600
3600
65535
2147483647

CLI Command - config ospf spf-hold-time


config ospf spf-hold-time {<seconds>}

Configures the minimum number of seconds


between Shortest Path First (SPF) recalculations.
The default setting is 3 seconds.

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 100 OSPF Overview and Configuration

CLI Command - show ospf lsdb


show ospf lsdb {detail} area [<areaid> | all]
[router | network | summary-net |
summary-asb | as_external | external-type 7 | all}

Displays a table of the current LSDB.


The user can filter the display using either area ID,
the remote router's router ID, or the link state ID.
Default is all with no detail.
If detail is specified, each entry includes complete
LSA information

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 101 OSPF Overview and Configuration

Example: show ospf lsdb


OSPF_LAB_2:18 # show

ospf lsdb area all all

Router LSAs for area 0.0.0.0


Link State ID Adv Router
Seq#
Age Chksum #Links
------------------------------------------------------------10.10.10.10 10.10.10.10 0x8000011d 1227 0xafc6 1
20.20.20.20 20.20.20.20 0x80006754 510 0x835f 3
30.30.30.30 30.30.30.30 0x800040a9 1245 0xf018 1
40.40.40.40 40.40.40.40 0x80000169 450 0x6e4c 1
50.50.50.50 50.50.50.50 0x800001ab 1279 0x7f83 3
60.60.60.60 60.60.60.60 0x8000016c 461 0x8095 1
Network LSAs for area 0.0.0.0
Link State ID Adv Router
Seq#
Age Chksum
------------------------------------------------------------10.0.1.2
50.50.50.50 0x80000169 1273 0xb14f
Summary LSAs for area 0.0.0.0
Link State ID Adv Router
Seq#
Age Chksum
------------------------------------------------------------10.11.1.0
10.10.10.10 0x80000114 1230 0x dfc
10.11.1.0
20.20.20.20 0x8000011b 1250 0xd109
10.12.0.0
10.10.10.10 0x80000109 1018 0x22f2
10.13.1.0
20.20.20.20 0x80000194 1250 0xc698

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 102 OSPF Overview and Configuration

Laboratory Exercise

OSPF Lab7

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 103 OSPF Overview and Configuration

Lab7 - Network Topology


N e tw o rk
V ir tu a l L in k s

S tu b
1 0 .1 4 .0 .0
1
1
1
1

STU B141
0 .1 4 .1 .1 /2
STU B142
0 .1 4 .2 .1 /2
STU B143
0 .1 4 .3 .1 /2
STU B144
0 .1 4 .4 .1 /2

P h y s ic a l

S u m m a r iz e
to
1 0 .1 4 .0 .0 /1 6

4
4

S u m m a r iz e
to
1 0 .1 2 .0 .0 /1 6

N o rm a l
1 0 .1 5 .0 .0

O SPF_LAB _3

.3

.2
N o rm a l
1 0 .1 3 .0 .0
NO RM 131
1 0 .1 3 .1 .0 /2 4

NO RM 151
1 0 .1 5 .1 .0 /2 4
NO RM 152
1 0 .1 5 .2 .0 /2 4
NO RM 153
1 0 .1 5 .3 .0 /2 4
NO RM 154
1 0 .1 5 .4 .0 /2 4

STU
1 0 .1 2
STU
1 0 .1 2
STU
1 0 .1 2
STU
1 0 .1 4

B121
.1 .1 /2
B122
.2 .1 /2
B123
.3 .1 /2
B124
.2 .1 /2

4
4
4
4

S u m m a r iz e
.2
to O S P F _ L A B _ 1
1 0 .1 5 .0 .0 /1 6

O SPF_LAB _2

.1

P o rt1 x -o v e r to P o rt2

P o rt1 x -o v e r to P o rt2

O SPF_LAB _3
P o rt 2 2

.2

.1

.1

S tu b
1 0 .1 2 .0 .0

N O RM 151

N o rm a l
1 0 .1 1 .0 .0
NO RM 111
1 0 .1 1 .1 .0 /2 4

P o rt 1 7

P o rt 2 1

P o rt 1 8

NO RM 131

NO RM 111

O SPF_LAB _1
P o rt 1 7

P o rt 1 8

P o rt 2 1

N O R M 131

NO RM 111

NO RM 151

O SPF_LAB _2

P o rt 2 2

NO RM 151

.1

NO RM 151

P o rt 1 9

P o rt 2 0

BBO NE1

BBO NE2

P o rt 1 9

P o rt 2 0

BBO NE1

BBO NE2

P o rt2 x - o v e r to P o r t3

B ackbone
0 .0 .0 .0
BBO N E1
1 0 .0 .1 .0 /2 4
BBO N E2
1 0 .0 .2 .0 /2 4

E q u a l-C o s t M u ltip a th
P o rt2 x -o v e r to P o r t3

.2
N o rm a l
1 0 .1 9 .0 .0
NO RM 191
1 0 .1 9 .1 .0 /2 4

.1

O SPF_LAB _5
.1
N o rm a l
1 0 .2 1 .0 .0

.2

O SPF_LAB _6
S tu b
1 0 .2 0 .0 .0
1
1
1
1

STU B201
0 .2 0 .1 .1 /2
STU B202
0 .2 0 .2 .1 /2
STU B203
0 .2 0 .3 .1 /2
STU B204
0 .2 0 .2 .1 /2

4
4
4
4

S u m m a r iz e
to
1 0 .2 1 .0 .0 /1 6
S u m m a r iz e
to
1 0 .2 0 .0 .0 /1 6

.3

NO RM 211
1 0 .2 1 .1 .0 /2 4
NO RM 212
1 0 .2 1 .2 .0 /2 4
NO RM 213
1 0 .2 1 .3 .0 /2 4
NO RM 214
1 0 .2 1 .4 .0 /2 4

.1

P o rt 1 7

N o rm a l
1 0 .1 7 .0 .0

NO RM 211

NO RM 171
1 0 .1 7 .1 .0 /2 4

P o rt 2 2

.2
.2

O SPF_LAB _6

S tu b
1 0 .1 8 .0 .0
1

V ir tu a l L in k s

P o rt 1 8

P o rt 2 1

N O R M 191

NO RM 171

N O RM 211

O SPF_LAB _4

S u m m a r iz e
to
1 0 .1 8 .0 .0 /1 6

P o rt 2 2

O SPF_LAB _5

1
1
1

STU
0 .1 8
STU
0 .1 8
STU
0 .1 8
STU
0 .1 8

B181
.1 .1 /2
B182
.2 .1 /2
B183
.3 .1 /2
B184
.2 .1 /2

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 104 OSPF Overview and Configuration

4
4
4
4

P o rt1 x -o v e r to P o rt2

NO RM 211

P o rt 1 7
NO RM 211

P o rt 2 1

P o rt 1 8

NO RM 191

NO RM 171

O SPF_LAB _4
P o rt1 x -o v e r to P o rt2

Summary
Define OSPF, features, advantages over RIP
Describe OSPF LSA, format and Types
Define LSDB, Initial synchronization, database
exchange & reliable flooding
Describe Routing Calculations, supported network
type & Database Synchronization
Describe how to build OSPF Networks
Define the OSPF routing, areas, router types and
virtual Links
Differentiate DR, BDR, Router Election
OSPF Configuration and Examples
Lab Exercises

LE-201 - Unicast Routing and L3 Switch Configuration


Module 4 - 105 OSPF Overview and Configuration

You might also like