Sie sind auf Seite 1von 52

OSPF - STUDY

Saravanan AR

INDEX
Introduction
Motivation
OSPF Basics
Detail in OSPF
Summary

INTRODUCTION

Development began in 1987


OSPF Working Group (part of IETF)
OSPFv2 first established in 1991
Many new features added since then
Updated OSPFv2 specification in RFC 2178

MOTIVATION

Original IGP used was RIP


Based on Bellman-Ford Algorithm
Worked well in small systems
Suffered from problems of Distance Vector Protocol
Count to Infinity Problem

Slow Convergence
Problems with Distance Vector Protocol
Large update packets
Slow response to topological changes

Need for a Link State Protocol


A long list of functional requirements follows

WHAT is OSPF

OSPF uses a link-state algorithm in order to build and

calculate the shortest path to all known destinations.


There are 2 link state routing protocol. Rest all belong to
distance vector routing protocol & other.
OSPF
IS-IS

Link state routing protocol maintains 3 tables like eIGRP.


Neighbor table track the neighbor
Topology table roadmap / possible map info.
Routing table.

Link state routing knows the entire roadmap whereas

distance vector routing protocol only know what their


neighbor know. So link state routing is more CPU overhead
compared to distance vector.
The shortest path is calculated using the Dijkstra
algorithm.
OSPF was designed to support variable-length subnet
masking (VLSM) or Classless Inter-Domain Routing (CIDR)

BASICS of OSPF - Attributes

Attributes
Type - Link-State
Algorithm - Dijkstra
Metric - Cost (Bandwidth)
AD 110
Protocols IP
Transport - IP/89
Authentication - Plaintext,MD5
AllSPF Address - 224.0.0.5
AllDR Address - 224.0.0.6

BASICS of OSPF - High level view


Neighbor Discovery
Forming Adjacencies
Link State Advertisements
(LSAs)
Flooding
Reliable Transport
Shortest Path First
Calculations
SPF Tree formation
Buinling Route Table

BASICS of OSPF - High level view

High level view on OSPF Operations


OSPF speaking routers sends hello packets out of all

OSPF-enabled interfaces. If routers sharing a common


data link agree upon certain parameters, they will
become neighbors.
Adjacencies, OSPF defines several network types and
several router types. It is determined by type of router
exchanging Hellos and type of network over which the
Hellos are exchanged.
Each router sends LSAs(Link State Advertisements)
It describes all of the routers links, the routers neighbors, and

the state of the link.


These links might be STUB, to other OSPF routers, to networks
in other areas, or to a external networks.
That is why OSPF defines multiple LSA Types.

BASICS of OSPF - High level view

Each router receiving an LSA from neighbor records

the LSA in its link-state-database and send a copy of it


to other neighbors.
By flooding LSAs all routers will build identical linkstate-database.
When the databases are complete, each router uses
SPF algorithm to calculate a loop-free graph
describing the shortest(lowest cost)path to every
known destination, with itself as the root.
This graph is the SPF TREE.
Each router builds its route table from its SPF TREE.
link-state-database have been synchronized and the
route tables are built, OSPF is a QUIET PROTOCOL.
Hello packets are exchanged as keepalives and LSA
are transmitted every 30 minutes.

Detail in OSPF - Metric - Cost (Bandwidth)

The cost of an interface is inversely proportional to


the bandwidth of that interface.
A higher bandwidth indicates a lower cost
Cost= Cost = Reference / Bandwidth.
OSPF uses a Reference Bandwidth of 100 Mbps for
cost calculation. The formula to calculate the cost is
reference bandwidth divided by interface bandwidth.
For example, in the case of Ethernet, it is 100 Mbps /
10 Mbps = 10.
Note: If ip ospf cost cost is used on the interface, it
overrides this formulated cost.
The cost of an interface is calculated based on the
bandwidth; you can force the cost of an interface with
the ip ospf cost <value> interface sub
configuration mode command

Detail in OSPF - Metric - Cost (Bandwidth)

Detail in OSPF AD PROTOCOL - Authentication

Administrative distance is a measure of the


trustworthiness of the source.
Other application is use Static Routes to backup
existing IGP route.
Eg: ip route 10.0.0.0 255.0.0.0 Dialer 1 250
In the above eg floating static

route is added and when there is a


loss of IGP route dialer will be installed.

In order to enable the router to

prefer RIP routes to OSPF,


configure the distance command
R1(config)#router rip
R1(config-router)#distance 90

Detail in OSPF AD PROTOCOL - Authentication

IP PROTOCOL no 89 Network Layer


Refer the below link for IP numbers for protocol

http://www.networkuptime.com/library/ip_protocol.html

OSPF does not use a TCP/IP transport protocol (UDP, TCP), but is

encapsulated directly in IP datagrams with protocol number 89.


This is in contrast to other routing protocols such as BGP,RIP.
OSPF handles its own error detection and correction functions.
Consider the frame as it goes up the stack

type field says "0800," so it gets handed up to IP.


http://www.cavebear.com/archive/cavebear/Ethernet/type.html
it will *typically* be 6 or 17 (TCP or UDP respectfully)
will be handed up to TCP or UDP accordingly.
From there, the port number will be looked at - and will be 23 for Telnet, 69 for
TFTP, as you mentioned.
In the case of OSPF, the IP protocol number is 89 - neither TCP (6) nor UDP
(17), but rather OSPF.
It's sometimes referred to as "its own Layer 4 protocol."

Detail in OSPF AD PROTOCOL - Authentication

Authentication
Types of Authentication:
1) Null authentication: Null authentication means that there is no
authentication, which is the default on Cisco routers.
2) Clear text authentication: In this method of authentication,
passwords are exchanged in clear text on the network
3) Cryptographic authentication: The cryptographic method
uses the open standard MD5 (Message Digest type 5) encryption.
OSPF authentication can be enabling in two ways:
1) Per interface: Authentication is enabling per interface using the
"ip ospf athentication" command.
2) Area authentication: Authentication for area can enable using
"area authentication" command.

Detail in OSPF Multicast IP

Broadcast Networks For broadcast networks, OSPF

routers use the following two reserved IP multicast


addresses:

224.0.0.5 - AllSPFRouters: Used to send OSPF messages to all

OSPF routers on the same network. The AllSPFRouters address is


used for Hello packets. The DR and BDR use this address to send
Link State Update and Link State Acknowledgment packets.
224.0.0.6 - AllDRouters: Used to send OSPF messages to all OSPF
DRs (the DR and the BDR) on the same network. All OSPF routers
except the DR use this address when sending Link State Update
and Link State Acknowledgment packets to the DR.

Point-to-Point Networks Point-to-Point networks use

the AllSPFRouters address (224.0.0.5) for all OSPF


messages.
NBMA Networks NBMA networks have no multicasting
capability. Therefore, the destination IP address of any Hello
or Link State packets is the unicast IP address.
Multicast IP addresses are mapped to MAC-level multicast
addresses

Detail in OSPF Router Types

Router Types
Internal Router
All interfaces reside within the

same area

Backbone Router
A router with an interface in

area 0 (the backbone)

Area Border Router (ABR)


Connects two or more areas

AS Boundary Router (ASBR)


Connects to additional routing

in
the backbone

domains; typically located

Detail in OSPF Router Types

Area 10

ASBR

Area 0

ABR

Area 20

VODAFONE
MPLS 4445

Detail in OSPF LSA Types

1Router LSA
2Network LSA
3Network summary LSA
4ASBR summary LSA
5AS external LSA
6Group membership LSA(Multicast LSA)- not
supported in CISCO
7NSSA external LSA
8External attributes LSA
9Opaque LSA (link-local scope)
10Opaque LSA (area scope)
11Opaque LSA (AS scope)

Detail in OSPF Types of Areas

Areas are introduced to put a boundary on the


explosion of link-state updates. Flooding and
calculation of the Dijkstra algorithm on a router is
limited to changes within an area.
All routers within an area have the exact link-state
database.
Types of Areas
Backbone area (area 0)
Standard area
Stub area
Totally stubby area
Not-so-stubby area (NSSA)

Detail in OSPF Backbone area (area 0) Standard Area

type 1 and 2 LSAs are being flooded between routers


sharing a common area.
Type 3 and 5 LSAs, which describe internal and external
IP routes, respectively, are flooded throughout the
backbone and all standard areas.
External routes are generated by an ASBR, while
internal routes can be generated by any OSPF router.
type 4 LSAs contains how to reach the ASBR.

Detail in OSPF STUB

ABR injects a type 3 LSA containing a default route into


the stub area.
This ensures that routers in the stub area will be able
to route traffic to external destinations without having
to maintain all of the individual external routes.
Stub will not allow type 4 LSA.
For an area to become a stub.
Router(config-router)# area 10 stub

Detail in OSPF Totally Stubby Areas

Like stub areas, totally stubby areas do not receive


type 4 or 5 LSAs from their ABRs.
However, they also do not receive type 3 LSAs.
all routing out of the area relies on the single default
route injected by the ABR.
A stub area is extended to a totally stubby area by
configuring all of its ABRs with the no-summary
parameter:
Router(config-router)# area 10 stub no-summary

Detail in OSPF Not-so-stubby Areas

An NSSA makes use of type 7 LSAs, which are


essentially type 5 LSAs in disguise.
This allows an ASBR to advertise external links to an
ABR, which converts the type 7 LSAs into type 5 before
flooding them to the rest of the OSPF domain.
An NSSA can function as either a stub or totally stubby
area. To designate a normal (stub) NSSA, all routers in
the area must be so configured:
Router(config-router)# area 10 nssa

Detail in OSPF Area Types & LSA - summary

Detail in OSPF LSA Types

LSA 1 (Router LSA)


Generated by all routers in an area to describe their
directly attached links (Intra-area routes). These
do not leave the area.

LSA 2 (Network LSA)


Generated by the DR of a broadcast or non-broadcast segment
to describe the neighbors connected to the segment. These do
not leave the area.
LSA 3 (Summary LSA)
Generated by the ABR to describe a route to neighbors outside
the area.
(Inter-area routes)
LSA 4 (Summary LSA)
Generated by the ABR to describe a route to an ASBR to
neighbors outside the area.
LSA 5 (External LSA)
Generated by ASBR to describe routes redistributed into the
area. These routes appear as E1 or E2 in the routing table. E2
(default) uses a static cost throughout the OSPF domain as it
only takes the cost into account that is reported at

Detail in OSPF LSA Types

LSA 6 (Multicast LSA)


Not supported on Cisco routers.
LSA 7 (NSSA External LSA)
Generated by an ASBR inside a NSSA to describe routes
redistributed into the NSSA. LSA 7 is translated into LSA 5 as it
leaves the NSSA by the ABR. These routes appear as N1 or N2 in
the IP routing table inside the NSSA. Much like LSA 5, N2 is a static
cost while N1 is a cumulative cost that includes the cost to the
ASBR.

Detail in OSPF NETWORK Types

Point-to-Point
Broadcast
Non-Broadcast
Non-Broadcast Multi-Access (NBMA)
Point-to-Multipoint

Point-to-Point

A link between exactly two points (or routers). A packet sent


from on of the routers will always have exactly one recipient on
the local link.
Multicast address - 224.0.0.5
Broadcast
A much more efficient manner of connecting a large
number of devices is to implement a multi-access
segment.
An Ethernet segment is an example of such a network.
Ethernet networks support broadcasts; a single packet
transmitted by a device can be multiplied by the

Detail in OSPF NETWORK Types

Facilitating automatic neighbor discovery.

OSPF routers on a multiaccess segment will elect a


designated router (DR) and backup designated router
(BDR).
DR & BDR concept reduces full mesh adjacency.
a segment containing ten routers would require 45
adjacencies to form a mesh, but only 17 when a DR and
BDR are in place.
Non-Broadcast
Unfortunately, not all multi-access technologies support
broadcast transmissions.
Frame relay and ATM are probably the most common
examples of non-broadcast transport.

Detail in OSPF NETWORK Types

Requiring individual permanent virtual circuits (PVCs) to


be configured between end points.

R1 must craft and transmit an individual packet for every


destination he wants to reach.
Aside from being horribly inefficient with regard to
bandwidth.
This limitation requires the router to know the addresses
of his neighbors before he can communicate to them.
OSPF can operate in one of two modes across a nonbroadcast network:
non-broadcast multi-access (NBMA)
point-to-multipoint
Each of these topologies tackles the absence of broadcast

Detail in OSPF NETWORK Types

Non-Broadcast Multi-Access (NBMA)


An NBMA segment emulates the function of a broadcast
network.
Every router on the segment must be configured with
the IP address of each of its neighbors.
Multiple computers and devices are attached, but data
is transmitted directly from one computer to another
over a virtual circuit or across a switching fabric.
OSPF hello packets are then individually transmitted as
unicast packets to each adjacent neighbor.
As in a true broadcast network, a DR and BDR are
elected to limit the number of adjacencies formed.
Point-to-Multipoint
A point-to-multipoint configuration approaches the nonbroadcast limitation in a different manner.
Rather than trying to emulate broadcast capability, it
seeks to organize the PVCs into a collection of point-topoint networks.
Hello packets must still be replicated and transmitted
individually to each neighbor. but the multipoint

Detail in OSPF NETWORK Types

All routers attached to a non-broadcast network must be


manually configured to recognize it as a point-tomultipoint segment.
The non-broadcast parameter can be appended to the
OSPF network type to force unicasting of packets rather
than relying on multicast. This might be necessary when
dynamic circuits are in use.

Detail in OSPF Adjacency States

Down
Attempt
Init
2-Way
Ex-start
Exchange
Loading
Full

Detail in OSPF Adjacency States


1. Establish Router Adjacencies
Down State No Hello received
Init State Hello received, but not with this routers Router
ID
Two-way State Hello received with this routers Router ID
(Ex-Start State unless DR/BDR election needed)
2. Elect DR and BDR (Broadcast Segments Only)
Ex-Start State with DR and BDR
Two-way State with all other routers
3. Discover Routes
Ex-Start State
Exchange State
Loading State
Full State
4. Calculate the Routing Table
5.Maintain the LSDB and Routing Table

Detail in OSPF Adjacency States


Down State
An OSPF router attempts to form an adjacency with at least one
neighbor for each IP network to which it is connected.
RTB multicasts OSPF Hello packets to 224.0.0.5 (the AllSPFRouters
multicast
address), advertising its own Router ID.

Detail in OSPF Adjacency States


OSPF Necessary Conditions
Specifically, the following must match before a pair of routers
become OSPF neighbors.
1.

Subnet mask used on the subnet.

2. Subnet number ( as derived using the subnet mask and each


router's interface IP
address)
3. Hello Interval
4.

Dead Interval

5.

OSPF area ID

6.Must pass authentication checks ( if used)


If any of these parameters differs, the routers do not become OSPF
neighbors.

Detail in OSPF Adjacency States


RTB Hello packet

Detail in OSPF Adjacency States


After initial HELLO
When a router receives a Hello packet, it will add the
neighbors Router ID to its list of neighbors.
The router will also transition to the Init state.

Detail in OSPF Adjacency States


Moving Toward the Two-Way State
When a router sends or receives its first Hello packet, it
enters the init state.
Waiting for a Hello packet that contains its own
Router ID in the list of
neighbors

Detail in OSPF Adjacency States


RTA Hello Packet

Detail in OSPF Adjacency States


Entering the Two-WayState
Once a router receives a Hello packet and sees its own
Router ID in the Neighbor ID field, the router transitions to
the two-way state.
The two-way state indicates bidirectional communication is
established.

Detail in OSPF Adjacency States


Completing the Handshake

Detail in OSPF Adjacency States


Finishing the Two-Way State
Once a router receives a Hello packet and sees its own
Router ID in the Neighbor ID field, the router transitions to
the two-way state.
The two-way state indicates bidirectional communication
is established.

Detail in OSPF Adjacency States


Reached The Two-way state
Need to decide which routers with which to establish a full
adjacency.
Depends upon the type of network on which the interface
resides:
Two-way state to Ex-Start state
If the interface is on a point-to-point link, the routers
Next Steps
becomes adjacent with its sole link partner and enters the
Ex-Start state.
Remaining in the two-way state
If the interface is on a multi-access link (Ethernet, Frame
Relay, etc.),
RTB
must enter an election
process to see the routers with which it will
establish a
full adjacency.
Remains in the two-way state..

Detail in OSPF Adjacency States


Ex-Start State
Once the DR and BDR are elected, the actual process of exchanging
link state information can start between the routers and their DR and
BDR.
In this state, the routers and their DR and BDR establish a masterslave relationship and choose the initial sequence number for
adjacency formation.
The router with the higher router ID becomes the master and starts
the exchange, and as such, is the only router that can increment the
sequence number.
Highest router ID will become the master during this process of
master-slave relation.
It is possible that a DR plays the role of slave. And also note that
master/slave election is on a per-neighbor basis.

Detail in OSPF Adjacency States


Ex-Start State

Detail in OSPF Adjacency States


Exchange State
In the exchange state, OSPF routers exchange database
descriptor (DBD) packets.
Database descriptors contain link-state advertisement (LSA)
headers only
Each DBD packet has a sequence number which can be
incremented only by master which is explicitly acknowledged
by slave.
Routers also send link-state request packets and link-state
update packets (which contain the entire LSA) in this state.
The contents of the DBD received are compared to the
information contained in the routers link-state database.

Detail in OSPF Adjacency States


Loading
In this state, the actual exchange of link state information
occurs.
Based on the information provided by the DBDs, routers
send link-state request packets.
The neighbor then provides the requested link-state
information in link-state update packets.
During the adjacency, if a router receives an outdated or
missing LSA, it requests that LSA by sending a link-state
request packet.
All link-state update packets are acknowledged.
Full
In this state, routers are fully adjacent with each other. All
the router and network LSAs are exchanged and the routers'
databases are fully synchronized.
The only exception to this is the 2-way state,
Routers achieve the full state with their DR and BDR
only. Neighbors always see each other as 2-way.

Detail in OSPF LAB

Detail in OSPF LAB

Find the below link for command reference with example.


http://www.cisco.com/en/US/docs/ios/iproute_ospf/command/
reference/iro_osp3.html#wp1012052
Show ip protocols displays all protocols running on the router.
Show ip ospf database to show contents of database.
show ip ospf neighbour <detail> neighbour relationships
show ip ospf interface fa0/0 use the specific interface
show ip ospf interface brief to show a brief of all interfaces
show ip route ospf filters only ospf routes
show ip ospf virtual-link check virtual links
show ip ospf displays basic info. about OSPF routing
processes.
show ip ospf border-routers displays border and boundary
router information.
Clear ip ospf processes clear ip route table
Clear ip route *- clears entire routing table
Clear ip ospf counters resets ospf counters.

Detail in OSPF LAB

Basic Show commands


Checking neighbor ship
Route advertisement
Route injection
LSA based Tshoot

Detail in OSPF LSA Commands

show ip ospf database


Show ip ospf database router type 1
Show ip ospf database network type 2
Show ip ospf database summary type 3
Show ip ospf database asbr-summary type 4
Show ip ospf database external
show ip ospf database router self-originate

Das könnte Ihnen auch gefallen