0% found this document useful (0 votes)
34 views27 pages

OSPF

Uploaded by

saeed wedyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views27 pages

OSPF

Uploaded by

saeed wedyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

OSPF

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 1
Evolution of OSPF
▪ Open Shortest Path First (OSPF) is a link-state routing protocol that was
developed as a replacement for the distance vector routing protocol.
▪ Distance Vector use the hop count as the only metric for determining best route.
▪ Hop count does not scale well in larger networks with multiple paths of
varying speeds.
▪ OSPF has significant advantages over RIP in that it offers faster convergence
and scales to much larger network implementations.
▪ OSPF is a classless routing protocol that uses the concept of areas for
scalability.

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 2
Features of OSPF
▪ Classless - It is classless by design; therefore, it supports VLSM and CIDR.
▪ Efficient - Routing changes trigger routing updates (no periodic updates). It uses
the SPF algorithm to choose the best path.
▪ Fast convergence - It quickly propagates network changes.
▪ Scalable - It works well in small and large network sizes. Routers can be
grouped into areas to support a hierarchical system.
▪ Secure - It supports Message Digest 5 (MD5) authentication. When enabled,
OSPF routers only accept encrypted routing updates from peers with the same
pre-shared password.

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 3
Administrative
Distance
▪ Administrative distance (AD) is the
trustworthiness (or preference) of the
route source.
▪ OSPF has a default AD of 110.
▪ OSPF can be configured to authenticate
OSPF messages.

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 4
Components of OSPF
▪ Data Structures
OSPF creates and maintains three databases:

These tables contain a list of neighboring routers to exchange routing


information with and are kept and maintained in RAM.
ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 5
Components of OSPF
▪ Algorithm
• The CPU processes the neighbor and topology tables using Dijkstra’s SPF
algorithm.
• The SPF algorithm is based on the cumulative cost to reach a destination.
• The SPF algorithm creates an SPF tree by placing each router at the root of
the tree and calculating the shortest path to each node.
• The SPF tree is then used to calculate the best routes. OSPF places the best
routes into the forwarding database, which is used to make the routing
table.

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 6
Introduction to the SPF
Algorithm

Not based on hop


count

SPF for R1 : All routers will


construct a similar table of their
point of view.

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 7
OSPF Metric
▪ Routing protocol uses a metric to determine the best path of a packet across a
network. It gives indication of the overhead that is required to send packets across a
certain interface.

▪ OSPF uses cost as a metric. A lower cost indicates a better path than a higher
cost.
▪ The cost of an interface is inversely proportional to the bandwidth of the interface.

▪ The OSPF metric is called cost. :

• The formula used to calculate the OSPF cost is:


• Cost = reference bandwidth /interface bandwidth

• The default reference bandwidth is 10^8 (100,000,000); therefore, the formula is:
ITE PC v4.1• Cost = 100,000,000 bps / interface bandwidth in
Cisco Systems, Inc. bps, 2010 – 2007©
All rights Cisco
Chapter 1 . reserved Public 8
Link-State Routing Process
1. Each router learns the directly connected networks on it’s links. (Interface is
“up”)
2. Routers say (OSPF Hello packets) to its adjacent neighbors on directly connected
networks. (should be on the same autonomous , same network).
3. Each router builds a link-state packet (LSP) containing the state of each directly
connected link. (IP address , neighbor ID, link type, and bandwidth ” cost”)
4. Each router floods the LSP to all neighbors before storing all LSPs received in a
database. Neighbors will also flood the LSPs to their neighbors until all routers
in the area have received the LSPs.
5. Each router uses the database to construct a complete map of the topology and
computes the best path to each destination network using the SPF algorithm.

▪ All routers will have a common map or tree of the topology, but each router will
independently determine the best path to each network within that topology.

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 9
Step 1: Learning
About Directly
Connected Networks

When The link “router interface” is up and assigned an IP and a subnet mask.
◆ Directly connected networks are added to the routing table regardless of the
routing protocols used.
◆ Participate in routing process when included in the network statements. (same
routing protocol).
ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 10
R2
I’m
Step 2: Sending ll o,
Hello Packets to Hello, I’m R1 He

Neighbors
Hello, I’m R3

He
llo
,I ’m
R4

▪ Initially:
• Router unaware of any neighbor routers on the link.
• Hello protocol “keep alive messages” are used discover OSPF neighbors and
establish adjacencies, advertise parameters that OSPF neighbors must agree on, and
elect the DR and BDR.
• Receiving no Hello packets from a neighbor considers it as unreachable and the
ITE PC v4.1
adjacency is broken. Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 11
Step 3: Building the
Link-State Packet

◆ Step 3: After establishing adjacency using hellos , each router builds and sends a
link-state packet (LSP) containing the state of each directly connected link out all
it’s interfaces adjacent to routers .
◆ R1 not sent LSPs out its Ethernet interface. (No routers with same routing
protocol).

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 12
◆ Link states – Router send Information about the state of a router’s links
include
• Interface IP address/mask.
• Type of network “Ethernet (broadcast) or serial point-to-point link”.
• Cost of that link.
ITE PC v4.1
Chapter 1
• Any neighbor routers on that link..Cisco Systems, Inc. All rights , 2010 – 2007 ©
reserved
Cisco
Public 13
Step 4:
Flooding
Link-
State
Packets to
Neighbors

▪ A LSP needs to be sent only:


• During initial startup of the router or of the routing protocol process on that
router
• Whenever there is a change in the topology.
• link going down or neighbor adjacency being broken
• link coming up or neighbor adjacency being established

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 14
Step 4:
Flooding
Link-
State
Packets
to
Neighbor
s

▪ Step 4: Each router floods the LSP to all neighbors, who then store all LSPs
received in a database.
• Each router floods its link-state information (LSP) to all other link-state routers.
• When a router receives an LSP from a neighboring router, sends that LSP out all
other interfaces, except the interface that received the LSP.
• Flooding effect of LSPs throughout the routing area.
▪ Link-state routing protocols calculate the SPF algorithm after the flooding is complete.
ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 15
Step 5: Constructing a
Link-State Database

▪ After propagation of LSPs


• Each router will then have an LSP from every link-state router.
• LSPs stored in the link-state database. “same for all routers”
• Each router uses the database to construct a complete map of the topology (SPF
TREE ) and computes the best path to each destination network using the shortest
path first (SPF) algorithm .
ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 16
Building the
Shortest Path First
(SPF) Tree

▪ At first, the tree (topology) only includes its directly connected neighbors.
▪ Using the link-state information from all other routers, R1 can now begin to
construct an SPF tree of the network with itself at the root of the tree.
ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 17
Red: New information for
tree.

▪ The SPF algorithm begins by processing the following LSP information from R2:
Connected to neighbor R1 on network 10.2.0.0/16, cost of 20
Connected to neighbor R5 on network 10.9.0.0/16, cost of 10
Has a network 10.5.0.0/16, cost of 2
ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 18
Determining the
Shortest Path
▪ Each router constructs its
own SPF tree independently
from all other routers.
▪ SPF algorithm is used now to
find the shortest path to each
network.
▪ Link-state databases must be
identical on all routers.

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 19
Generating a Routing Table from the SPF Tree
SPF Tree for R1

▪ These paths listed previously can now


be added to the routing table.
▪ The routing table will also include
Directly connected networks
Static routes.

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 20
Single-Area and Multiarea OSPF
▪ An OSPF area is a group of routers that share the same link-state information in
their LSDBs. OSPF supports hierarchical routing using areas to make OSPF more
efficient and scalable.
▪ OSPF can be implemented in one of two ways:
• Single-Area OSPF - all routers are in one area called the backbone area (area
0).It’s useful in smaller networks with few routers.

• Multiarea OSPF - implemented using multiple areas, in a hierarchal fashion.


All areas must connect to the backbone area (area 0). Interconnecting routers
are called Area Border Routers (ABRs).Useful in larger network deployments
to reduce processing and memory overhead.

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 21
Configuring
Single-Area
OSPFv2

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 22
Topology

Kbps 64
Kbps 128

Kbps 256

▪ Notice that the addressing scheme is discontiguous and classless.


▪ Three serial links of various bandwidths.
▪ Each router has multiple paths to each remote network.

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 23
The router ospf
Command
R1(config)# router ospf 1
R1(config-router)#

▪ The process-id “autonomous”


• Between 1 and 65,535.
• Chosen by the network administrator.
• Does not have to match on all OSPF routers.

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 24
The network
Command

Router(config-router)# network network-address wildcard-mask area area-id

▪ Used to enable interfaces to send and receive OSPF packets.


• This network (or subnet) will be included in OSPF routing updates.
• Use wild card mask to specify the interface or range of interfaces that will be
enabled for OSPF. The wildcard mask can be configured as the inverse of a
subnet mask.

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 25
▪ [wildcard-mask]

▪ Think of a wildcard mask as the inverse of a subnet mask.


▪ The inverse of subnet mask 255.255.255.252 is 0.0.0.3.
▪ To calculate the inverse of the subnet mask, subtract the subnet mask
from 255.255.255.255:

255.255.255.255
- 255.255.255.252
---------------
0. 0. 0. 3
Wildcard mask

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 26
Configure the network
Router-ID does NOT have to
Commands be the same on all routers
R1(config)# router ospf 1 Area-ID must
R1(config-router)# network 172.16.1.16 0.0.0.15 area 0 be the same
R1(config-router)# network 192.168.10.0 0.0.0.3 area 0 on all routers
R1(config-router)# network 192.168.10.4 0.0.0.3 area 0
R2(config)# router ospf 1
Wildcard
R2(config-router)# network 10.10.10.0 0.0.0.255 area 0 mask must
R2(config-router)# network 192.168.10.0 0.0.0.3 area 0 be used
R2(config-router)# network 192.168.10.8 0.0.0.3 area 0
R3(config)# router ospf 1
R3(config-router)# network 172.16.1.32 0.0.0.7 area 0
R3(config-router)# network 192.168.10.4 0.0.0.3 area 0
R3(config-router)# network 192.168.10.8 0.0.0.3 area 0

ITE PC v4.1 Cisco Systems, Inc. All rights , 2010 – 2007 © Cisco
Chapter 1 . reserved Public 27

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy