Posted:
23 Aug 07
C
C
N
P
B
S
C
I
O
S
P
F
|
OSPF
-
Basics
-
Link state protocol
-
runs spf algorithm
-
maintains topology table
-
Broken down into areas to increase stability and allow summarization -
this reduces the size of the Link State Database and routing table,
decreases the frequency of spf calculations, and hides topology
changes in one area from the rest of the network
-
OSPF areas
-
Areas start and end on interfaces - each interface is part of a single
area
-
Areas are arranged in a two-layer hierarchy
-
Transit area
-
This is the backbone area - Area 0
-
all other areas areas must connect to the backbone
-
regular area
-
contains groups and resources
-
should be grouped to allow for summarization
-
Special areas
-
stub area
-
does not accept routes that are external to the AS - uses a
default route
-
cannot contain ASBRs except the ABR (see III - Router types)
-
area id stub router
config command
-
all routers in the area must be configured as stub
-
totally stubby area
-
cisco only
-
same as stub area except is also does not accept inter-area
routes - uses a default route out of the area instead
-
area id stub no-summary
router command on ABR
-
Not So Stubby Area
-
a stubby area that can have an ASBR
-
uses a Type 7 lsa to advertise external routes
-
the ABR takes the type 7 from the ASBR and changes it into a
type 5 to send to the rest of the ospf domain
-
area id nssa router
command
-
totally stubby NSSA - same as totally stubby area except it allows
ASBR's with type 7 lsa's
-
set the cost of the default route advertised by ABR's in a stub
area with router command area
area-id default-cost
cost
-
Design recommendations
-
Areas should be smaller than 50 routers
-
each router should have less than 60 neighbors
-
each router should be in 3 or less areas
-
Types of routers
-
Area Border Router (ABR)
-
connects an area to the backbone
-
focus point for route summarization
-
Autonomous System Boarder Router (ASBR) - has at least one interface
in a non-ospf routing domain
-
Protocol
-
OSPF is a layer 4 protocol, encapsulated into an IP packet - IP
protocol 89
-
header
-
Version # - usually 2
-
Type of OSPF packet
-
length of the packet
-
router ID
-
32 bit number that uniquely identifies a router
-
can be manually configured
-
defaults to highest loopback IP
-
defaults next to highest interface IP
-
Area ID
-
checksum
-
authentication type
-
authentication
-
OSPF packet types
-
1 - Hello
-
finds and negotiates neighbors
-
also contains a list of known neighbors
-
2 - Database Description (DBD)
-
Allows for database synchronization between routers
-
contains a summary of the LSDB
-
3 - Link-State Request (LSR)
-
Requests specific link-state records from other routers
-
contains the LSU needed and the router ID of the router that
has it
-
4 - Link State Update (LSU)
-
sends specifically requested link-state records (LSA)
-
can contain more than one LSA
-
Types of LSA
-
5 - LSAck - Acknowledges other packet types
-
OSPF neighbors
-
hello packets are multicast on active ospf interfaces to 224.0.0.5
-
contains area number, hello interval, and dead interval - which
must match other router for adjacencies to form
-
also contains a list of known neighbors
-
bidirectional communication is established when a router sees
itself in another router's hello
-
states
-
down - ospf has been enabled but no packets have been exchanged
-
attempt - for statically configured neighbors, unicast hellos are
sent every polling interval
-
init - the router sends a hello packet. all routers that receive
the hello add this router to their neighbor list and send a
unicast reply
-
two-way - The router has received replies and adds all these
replying router ID's to its database and hello packets
-
exstart - Designated and Backup Designated routers are chosen
(non-preempting) and master/slave relationship is established
during this state
-
exchange - DBD's are exchanged. DBD's are acknowledged and then
compared to the LSDB.
-
Loading - any link-state's with a newer sequence number than the
database generates a LSR to get detailed information about that
link. the other router responds with an LSU. An LSAck is sent.
-
Full - all LSDB's are synchronized and routing can begin
-
All router form full adjacencies with the DR only - they do keep track
of other neighbors in their hello packets
-
OSPF routing
-
LSDB
-
Sequence number tracks changes in information about a link
-
32 bits long
-
starts at 0x80000001 and ends at 0x7FFFFFFF
-
LSA's are aged out at 07FFFFFFF and a new LSA is sent starting
back at the beginning
-
aging
-
Each LSU has an aging timer (30 minutes by default)
-
when the timer expires, a Link-State Update with a new
sequence # is sent to refresh the link
-
metric
-
cost is assigned to each link in the network
-
metric is sum of the cost of each link a packet would travel along
a path
-
default behavior is that cost is calculated based on configured
bandwidth (100/bandwidth in Mb)
-
Route types
-
O - intra-area routes (from Type 1 and Type 2 LSA's)
-
O IA - inter-area (from summary LSA's - type 3 and 4 LSA's)
-
O E1 - outside OSPF domain. Includes external cost of the path
plus internal cost of the path to the ASBR
-
O E2 - outside OSPF domain. Includes only external cost. Cost of
path to the ASBR is not added
-
Behavior on different types of networks
-
Point-to-point
-
no special config needed
-
routers will NOT elect a DR or BDR
-
Broadcast
-
no special config needed
-
routers WILL elect a DR and BDR
-
DROthers will only establish a full adjacency with the DR and BDR
-
NBMA
-
default hello and dead intervals are 30/120 (instead of 10/30)
-
multicast hellos cannot be sent because of non-broadcast nature
-
interface command ip ospf network network-type
-
choices
-
non-broadcast
-
point to multipoint
-
point-multipoint non-broadcast (cisco only)
-
point-point (cisco only)
-
broadcast (cisco only)
-
DR and BDR election
-
DR and BDR are elected to reduce the amount of traffic needed for ospf
on a broadcast network
-
Router with the highest priority becomes the DR
-
second highest priority becomes BDR
-
highest router id breaks priority ties
-
BDR is chosen first from all routers not claiming to be the DR, then
DR is chosen, then BDR is chosen again in case the BDR became the DR
-
DR/BDR cannot be preempted by another router with a higher priority
once elected
-
configuring OSPF
-
router ospf process-id [vrf
vpn-name] global command -
turns on ospf
-
router-id
id router command -
optionally manually set the routerID
-
neighbor
neighbor-ip priority
num router command -
necessary for non-broadcast only
-
ip ospf priority
number interface command
establishes a routers DR priority
-
range is 0 - 255
-
default is 1
-
routers with 0 priority are ineligible for DR/BDR
-
identify the networks you want advertised
-
network network-add
wildcard-mask area
area-id router
command
-
at least one network on an interface must be advertised for ospf
to run on that interface
-
alternative method is with the ip
ospf proc-id area
area-id [secondaries
none] interface command
-
route summarization
-
on an ABR for inter-area routes -
area id range
net-add mask [cost
cost] router config
command
-
to summarize routes redistributed
from outside the AS on an ASBR use
summary-address
net-add
mask router config
command
-
default route
-
used to advertise a default route into ospf with a type 5 lsa
-
'default-information originate' command - router needs a default
route to do this
-
add the always keyword to advertise a default route even if this
router doesn't have one already
-
Virtual Links
-
can be used to connect a discontinuous area 0 or to connect an
area to area 0 through a transit area
-
area
id virtual-link
router-id router
command. Use area id of transit area and router id of the virtual
link neighbor
-
configured on each end of the virtual link
-
Authentication
-
can be used to secure routing updates against accidental or
malicious route updates
-
ospf already uses a non-decreasing sequence number, which prevents
replay attacks
-
plain text
-
ip ospf authentication interface command enables
authentication
-
can also be enabled per area with the area
id
authentication router
command
-
ip ospf authentication-key
password
interface command sets the password. can be up to 8 bytes.
stored in plain text if service password-encrypt is not
on
-
MD5
-
ip ospf authentication message-digest
interface command, or area router command,
sets the type
-
ip ospf message-digest-key
key-id md5
password
interface command
-
LSDB overload protection
-
protects against too many LSA's eating up memory
-
max-lsa
max [ignore-time
mins] [ignore-count
numb] router
command
-
if max count is reached for more than 1 min, OSPF clears all
adjacencies and clears the LSDB, entering the 'ignore' state until
the ignore time expires
-
if it enters ignore state more than
the ignore count times consecutively, it will remain in the ignore
state until manually removed from it
-
Changing default bandwidth reference
-
by default, OSPF cost is calculated so that FastE is a cost of 1
(reference of 100)
-
change that with router command
ospf auto-cost
reference-bandwidth reference
-
verifying
-
show ip protocols
-
show ip route ospf
-
sh ip ospf interfaces
-
sh ip ospf neighbor
-
sh ip ospf database
-
Troubleshooting
-
debug ip ospf events
-
debug ip ospf adj
-
debug ip packet
-
References
-
Cisco Press BSCI Authorized Self-Study Guide
-
Cisco Press BSCI Official Exam Certification Guide
-
Wikipedia
-
Sybex CCNP Complete
-
Sybex CCNA Deluxe Edition
Back to EIGRP - Up to index - Next to IS-IS
| Updated:
23 Aug 07
C
C
N
P
B
S
C
I
O
S
P
F
|