0% found this document useful (0 votes)
22 views

ENTS 749D: Network Design and Configuration Lab

OSPF is a link-state routing protocol that uses Hello packets to establish adjacencies between neighboring routers. Routers run the Dijkstra algorithm to determine the shortest path to each destination based on the link states shared in LSAs that are reliably flooded throughout the network. Areas and router types such as ABRs are used to scale the protocol and limit LSA flooding. Stub areas reduce database size by filtering out external LSAs.

Uploaded by

Sandeep Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

ENTS 749D: Network Design and Configuration Lab

OSPF is a link-state routing protocol that uses Hello packets to establish adjacencies between neighboring routers. Routers run the Dijkstra algorithm to determine the shortest path to each destination based on the link states shared in LSAs that are reliably flooded throughout the network. Areas and router types such as ABRs are used to scale the protocol and limit LSA flooding. Stub areas reduce database size by filtering out external LSAs.

Uploaded by

Sandeep Reddy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

ENTS 749D

Network Design and Configuration Lab

OSPF Routing
MS in Telecommunications Program
Department of Electrical and Computer Engineering
University of Maryland, College Park, MD, USA
OSPF Overview
Link-state protocol
IPv4: OSPF v2
Runs directly on IPv4 with Protocol ID 89
Operation:
1. The local router sends Hello messages to its neighbors
2. The neighboring routers form adjacencies
3. The routers advertise summary link-state database
information to each other to compare their databases
4. If needed, the routers request database updates from
each other until both routers have identical databases
5. The routers run Dijkstra's shortest path algorithm to
find the best route to each destination

MS in Telecommunications, University of Maryland, College Park, MD, USA [2]


OSPF Packet Types
Hello packet:
To establish and maintain neighbor relationship (keep-alives)
Sent to IPv4 multicast address 224.0.0.5
Default hello interval: 10 seconds
Default router dead interval: 40 seconds
Database Description packet:
To advertise local database information during database
synchronization
Sends only summary info (LSA headers only)
Link-State Request packet:
Identifies the requested LSAs
Link-State Update packet:
Contains the requested LSAs
Also reliably flooded through the network until every router has a copy
Link-State Acknowledgment packet:
For reliable data transfer: ACKs the received LSAs
MS in Telecommunications, University of Maryland, College Park, MD, USA [3]
OSPF Router IDs
The Router ID is used in OSPF packets to identify the
packet's originator (original sender)
Router ID determination (Junos-specific):
1. By default, the Router ID is the lowest IP address on the interface
2. If the loopback interface is configured, the Router ID is the lowest
IP address on the loopback interface (for all physical interfaces)
3. If the Router ID is explicitly configured, it will be used as the
Router ID (for all physical interfaces)
Use 2. or 3.: If an interface goes down or its IP address changes,
OSPF can get confused for a while
Note: the Router ID is NOT an IP address or a network address !!!
They are just made numerically the same for convenience
MS in Telecommunications, University of Maryland, College Park, MD, USA [4]
Forming Adjacencies
Router state transitions:
1. Down: Starting state or no Hello packets received within
the router dead interval
2. Init: Hello packet has been received, but no bidirectional
communication yet
3. Attempt: Like Init, but for Non-Broadcast Multi-Access
(NBMA) networks
4. 2-Way: Bidirectional communication has been established
and the routers has become OSPF neighbors
5. ExStart: Establishing which router will be the master in
the database synchronization process
6. Exchange: The routers exchange Database Descriptor packets
7. Loading: Sending/receiving Link-State Request and Link-State
Update packets (LSA exchanges)
8. Full: Fully functional OSPF adjacency with synchronized databases

MS in Telecommunications, University of Maryland, College Park, MD, USA [5]


Designated Routers (DRs) 1/2
Multiple OSPF routers on the same broadcast network segment

A designated router (DR) is selected


Represents the network segment (handles LSAs for the
network segment
The other routers on the network segment form adjacencies
with only the DR (and not with each other)
Reduces the number of adjacencies and LSA flooding

Backup Designated Router (BDR) is also selected


Takes over the DR role if the current DR fails
Also forms full adjacencies with the other (non-DR) routers
on the network segment
MS in Telecommunications, University of Maryland, College Park, MD, USA [6]
Designated Routers (DRs) 2/2
DR election:
First criterion: Router priority
Manually configured
Range: 0 255, default value: 128
The router with the highest priority will become the DR
Second criterion: Router ID
The router with the highest router ID wins

BDR election:
After the DR election
Similar to the DR election

New elections only take place when the DR fails


MS in Telecommunications, University of Maryland, College Park, MD, USA [7]
Areas
To increase the scalability of the protocol
Limit the LSA flooding process and the link-state database size
Identified by area numbers: 32-bit values
Area 0: backbone area
All other areas must connect to area 0
Notation: dotted decimal like IP addresses
E.g.: Area 0 = Area 0.0.0.0

MS in Telecommunications, University of Maryland, College Park, MD, USA [8]


Router Types
Internal router:
Router having all of its interfaces in a single area

Area border router (ABR):


Connects one or more areas to area 0
Router having at least one interface in area 0 and at least
another interface in another area

Autonomous System Boundary Router (ASBR):


Connects the OSPF domain with other routing protocols
Injects external routing knowledge into the OSPF network

MS in Telecommunications, University of Maryland, College Park, MD, USA [9]


Link State Advertisements (LSAs)
Describe the router's links, their costs, the router's neighbors
and the networks it is attached to
LSA types:
Flooding
Type Name Description Sender
Scope
1 Router Directly connected networks All routers Area

2 Network Networks from a broadcast network segments DRs Area


Network (Other)
3 Network summary information for another area ABRs
Summary Area
ASBR (Other)
4 Routes to ASBRs (ASBR reachability info) ABRs
Summary Area
5 AS External External (non-OSPF) networks ASBRs OSPF domain

NSSA External (non-OSPF) networks from the ASBR to


7 ASBRs Area
External the NSSA

MS in Telecommunications, University of Maryland, College Park, MD, USA [10]


Additional Scaling Techniques 1/2
To reduce the link-state database size

Stub areas:
May be configured for areas that have no external connection
(connected only to the backbone area/area 0)
The ABR does not flood AS-external and ASBR summary
LSAs into the area
The ABR floods a summary LSA for the default route 0.0.0.0/0
instead
Stub areas cannot connect to external (non-OSPF) networks
(cannot contain an ASBR)

MS in Telecommunications, University of Maryland, College Park, MD, USA [11]


Additional Scaling Techniques 2/2
Not-so-stubby areas (NSSAs):
Stub area connecting to an external (non-OSPF) network
Can contain ASBRs
The ASBR floods NSSA External LSAs within the area
AS-external and ASBR summary LSAs are not flooded
into the area

MS in Telecommunications, University of Maryland, College Park, MD, USA [12]


Configuring OSPF 1/2
Hierarchy level: [edit protocols ospf]
Add the interfaces to the appropriate OSPF area
Type: set area <area number> interface <interface number>
Include the unit number (default: unit 0)

[edit protocols ospf]


zsafar@router001# set area 0 interface ge-0/0/1.0

[edit protocols ospf]


zsafar@router001# show
area 0.0.0.0 {
interface ge-0/0/1.0;
}

[edit protocols ospf]


zsafar@router001#

MS in Telecommunications, University of Maryland, College Park, MD, USA [13]


Configuring OSPF 2/2
Recommended: add the loopback interface to OSPF as well
Make it passive: it will advertise its addresses,
but it will not form adjacencies

[edit protocols ospf]


zsafar@router001# set area 0 interface lo0 passive

[edit protocols ospf]


zsafar@router001#

Unit 0
is assumed

MS in Telecommunications, University of Maryland, College Park, MD, USA [14]


Configuring Stub Areas
Stub area:
Must be applied to all routers in the stub area
Hierarchy level: [ edit protocols ospf ]
Type: set area <area number> stub
[edit protocols ospf]
zsafar@router003# set area 2 stub

For ABRs only:


To inject a default route into the stub area
Type: set area <area number> stub default-metric <metric>

[edit protocols ospf]


zsafar@router003# set area 2 stub default-metric 10

MS in Telecommunications, University of Maryland, College Park, MD, USA [15]


Configuring NSSAs
NSSA:
Must be applied to all routers in the not-so-stubby area
Hierarchy level: [ edit protocols ospf ]
Type: set area <area number> nssa
[edit protocols ospf]
zsafar@router003# set area 2 nssa

For ABRs only:


To inject a default route into the stub area
Type:
set area <area number> nssa default-lsa default-metric <metric>

[edit protocols ospf]


zsafar@router003# set area 2 nssa default-lsa default-metric 10

MS in Telecommunications, University of Maryland, College Park, MD, USA [16]


Monitoring OSPF 1/5
To check the operation of the OSPF interfaces
Type: show ospf interface

zsafar@router001> show ospf interface


Interface State Area DR ID BDR ID Nbrs
ge-0/0/1.0 BDR 0.0.0.0 72.114.200.1 72.114.100.1 1

zsafar@router001>

Current area Number of


Current state: The router IDs OSPF
Configured DR designated router of the DR and BDR neighbors
OSPF interface BDR backup DR discovered
DRother neither DR nor BDR through this
Down not operational interface
MS in Telecommunications, University of Maryland, College Park, MD, USA [17]
Monitoring OSPF 2/5
To check the adjacency states with the neighbors
Type: show ospf neighbor

zsafar@router001> show ospf neighbor


Address Interface State ID Pri Dead
72.114.10.2 ge-0/0/1.0 Full 72.114.200.1 128 36

zsafar@router001>

Local interface Neighbor's


connected to Adjacency router ID Remaining
the neighbor state router dead
IP address of interval
Neighbor's
the neighbor's
router
connected
priority
interface

MS in Telecommunications, University of Maryland, College Park, MD, USA [18]


Monitoring OSPF 3/5
To look at OSPF statistics (sent/received OSPF packets)
Type: show ospf statistics
zsafar@router003> show ospf statistics

Packet type Total Last 5 seconds


Sent Received Sent Received
Hello 1017 954 1 1
DbD 2 3 0 0
LSReq 1 1 0 0
LSUpdate 4 5 0 0
LSAck 4 3 0 0

DBDs retransmitted : 0, last 5 seconds : 0


LSAs flooded : 4, last 5 seconds : 0
LSAs flooded high-prio : 2, last 5 seconds : 0
LSAs retransmitted : 0, last 5 seconds : 0
LSAs transmitted to nbr: 1, last 5 seconds : 0
LSAs requested : 1, last 5 seconds : 0
LSAs acknowledged : 4, last 5 seconds : 0
. . .

MS in Telecommunications, University of Maryland, College Park, MD, USA [19]


Monitoring OSPF 4/5
To display the OSPF database
Type: show ospf database
zsafar@router003> show ospf database

OSPF database, Area 0.0.0.0


Type ID Adv Rtr Seq Age Opt Cksum Len
Router 72.114.100.1 72.114.100.1 0x80000006 510 0x22 0x44bd 60
Router *72.114.200.1 72.114.200.1 0x80000005 894 0x22 0xa1f6 36
Network *72.114.10.2 72.114.200.1 0x80000001 894 0x22 0xb891 32

zsafar@router003>

LSA Options
LSA
Router ID sequence field from the
Link-state length
of the router number OSPF header
LSA ID LSA
type originating OSPF
age in
the LSA packet
seconds
checksum
MS in Telecommunications, University of Maryland, College Park, MD, USA [20]
Monitoring OSPF 5/5
To check the routes generated by the OSPF shortest path
algorithm
Type: show ospf route
zsafar@router003> show ospf route
Topology default Route Table:

Prefix Path Route NH Metric NextHop Nexthop


Type Type Type Interface Address/LSP
72.114.100.1 Intra Router IP 1 ge-0/0/3.0 72.114.10.1
72.114.10.0/24 Intra Network IP 1 ge-0/0/3.0
72.114.100.0/24 Intra Network IP 1 ge-0/0/3.0 72.114.10.1
72.114.100.1/32 Intra Network IP 1 ge-0/0/3.0 72.114.10.1

zsafar@router003>

To check the routes placed in the routing table


Type: show route or show route protocol ospf (similar to RIP)

MS in Telecommunications, University of Maryland, College Park, MD, USA [21]


Modifying OSPF Link Costs 1/2
Changing the metric for an OSPF interface
Configured at the interface level in the appropriate OSPF area
To redirect traffic in an area
Type set interface <interface number> metric <new metric>

[edit protocols ospf area 0.0.0.0]


zsafar@router001# set interface ge-0/0/1 metric 2

[edit protocols ospf area 0.0.0.0]


zsafar@router001#

MS in Telecommunications, University of Maryland, College Park, MD, USA [22]


Modifying OSPF Link Costs 2/2
Changing the reference bandwidth for metric calculation
Hierarchy level: [edit protocols ospf] for all interfaces
OSPF metric calculation:
Metric = reference bandwidth / interface bandwidth
Default reference bandwidth for Gigabit Ethernet is
1 Gbit/second (1g)
Type: set reference-bandwidth <new ref bandwidth>

[edit protocols ospf]


zsafar@router003# set reference-bandwidth 10g

[edit protocols ospf]


zsafar@router003#

10 Gbit/sec
MS in Telecommunications, University of Maryland, College Park, MD, USA [23]
Configuring OSPF Authentication
Options: a) no authentication, b) simple (plain-text) password,
c) MD5 cryptographic authentication recommended!
MD5 authentication configuration steps:
1. Configure MD5 authentication for the whole area
2. Set the key/password for each interface
Type: set authentication md5 <key-ID> key <key/password>

[edit protocols ospf area 0.0.0.0]


zsafar@router001# set authentication-type md5

[edit protocols ospf area 0.0.0.0]


zsafar@router001# set interface ge-0/0/1 authentication md5 1 key hello

[edit protocols ospf area 0.0.0.0]


zsafar@router001#

Key ID Key/password
MS in Telecommunications, University of Maryland, College Park, MD, USA [24]

You might also like