BSCI Module 3: © 2006 Cisco Systems, Inc. All Rights Reserved. Cisco Public BSCI Module 3
BSCI Module 3: © 2006 Cisco Systems, Inc. All Rights Reserved. Cisco Public BSCI Module 3
BSCI Module 3
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 1
Terminology
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 2
1
OSPF Overview
OSPF does not gather routing table information, but
routers and the status of their connections, links.
OSPF routers use this information to build a topological
data base (link state database), runs the Shortest Path
First (SPF), Dijkstra’s algorithm, and creates a SPF tree.
From that SPF tree, a routing table is created.
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 3
Link:
Link interface on a router
Link state:
state the status of a link between to routers.
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 4
2
Cisco’s OSPF’s metric is based on cost
Cost is an OSPF metric expressed as an 16bit
integer, from 1 to 65.535.
Cisco uses a default cost of 108/BW, where BW is
the configured bandwidth (bandwidth command) of
the interface and 108 (100.000.000) as the reference
bandwidth.
Example: A serial link with bandwidth:128K
cost: 100.000.000/128.000 = 781
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 5
OSPF Areas
Review of OSPF area characteristics:
Minimizes routing
table entries
Localizes impact of
a topology change
within an area
Detailed LSA
flooding stops at
the area boundary
Requires a
hierarchical
network design
Transit Area:
aka Backbone, Area 0
Regular Area:
aka Nonbackbone areas
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 6
3
OSPF Areas
Every OSPF router must belong to at least one area.
Every OSPF network must have an Area 0 (backbone
area).
All other Areas should “touch” Area 0.
There are exceptions to this rule
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 7
OSPF Database
OSPF maintains three databases
Adjacency Database (show ip ospf neighbor)
Link-state Database (show ip ospf database)
Forwarding Database (show ip route)
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 8
4
Operation
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 9
5
Steps to OSPF Operation
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 11
OSPF States
OSPF router interfaces can be in one of seven states:
Down State
Init State
Two-way State
ExStart State
Exchange State
Loading State
Full Adjacency State
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 12
6
Steps to OSPF Operation with OSPF States
1. Establishing router adjacencies
Down State
Init State
Two-way State
2. Electing DR and BDR
ExStart State with DR and BDR
Two-way State with all other routers
3. Discovering Routes
ExStart State
Exchange State
Loading State
Full State
4. Choosing Routes
5. Maintaining Routing Information
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 13
1. Establishing Adjacencies
7
1. Establishing Adjacencies
1. Establishing Adjacencies
RTA and RTC receive Hello packets from RTB and add
RTB’s Router ID to the Neighbor ID field of the Hello
packet its sends back to RTB, at the same time entering
the init state.
When a router receives its first Hello packet, it enters the
init state, meaning the router is ready to take the
relationship to the next level.
From init state to the two-way state
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 16
8
Steps to OSPF Operation with OSPF States
3. Discovering Routes
ExStart State
Exchange State
Loading State
Full State
4. Choosing Routes
5. Maintaining Routing Information
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 17
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 18
9
2. Electing a DR/BDR
Designated Router
Router with the highest Router ID is elected the DR.
But like other elections, this one can be rigged.
The router’s priority field can be set to either ensure that
it becomes the DR or prevent it from being the DR.
The router can be assigned a priority between 0 and
255, with 0 preventing this router from becoming the DR
(or BDR) and 255 ensuring at least a tie. (The highest
BSCI Module 3
Router ID would break the tie)
© 2006 Cisco Systems, Inc. All rights reserved. 19
Cisco Public
2. Electing a DR/BDR
All other routers, “DRother”, establish adjacencies with
only the DR and BDR.
DRother routers multicast LSAs to only the DR and
BDR
(224.0.0.6 - all DR routers)
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 20
10
2. Electing a DR/BDR
Backup Designated Router - BDR
Listens, but doesn’t act.
If LSA is sent, BDR sets a timer.
If timer expires before it sees the reply from the DR, it
becomes the DR and takes over the update process.
The process for a new BDR begins.
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 21
2. Electing a DR/BDR
Once a DR is established, a new router that enters the
network with a higher priority or router id will NOT
become the DR or BDR. (Bug in early IOS 12.0)
If DR fails, BDR takes over as DR and selection process
for new BDR begins.
State of the relationship
DRothers enter ExStart state with DR and BDR and
two-way state with all other routers
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 22
11
Steps to OSPF Operation with OSPF States
1. Establishing router adjacencies
Down State
Init State
Two-way State
3. Discovering Routes
ExStart State
Exchange State
Loading State
Full State
4. Choosing Routes
5. Maintaining Routing Information
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 23
“adjacent”
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 24
12
3. Discovering Routes and reaching Full
State
ExStart State
ExStart state - prepare for initial database exchange
Purpose of ExStart is to establish a master/slave relationship between
the two routers decided by the higher router id.
Once the roles are established they enter the exchange state.
Exchange State
Exchange state - routers exchange one or more Type-2 DBDs
(Database Description) packets, which is a summary of the link-state
database.
Routers compare these DBDs with information in its own database.
If the router receives information about a link that is not already in its
database, the router requests a complete update from its neighbor.
Complete routing information is exchanged in the loading state.
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 25
Loading State
If the other router has more updated information, this router sends a LSR
(Link-State Request) packet requesting more information.
Remote router sends the requested information in a LSA Type-4 packet
(more on this packet type(s) in next chapter).
Router sends LSAck to acknowledge receipt
Full State
Full state - after all LSRs have been updated.
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 26
13
Steps to OSPF Operation with OSPF States
1. Establishing router adjacencies
Down State
Init State
Two-way State
3. Discovering Routes
ExStart State
Exchange State
Loading State
Full State
4. Choosing Routes
BSCI Module 3 5. Maintaining Routing Information
© 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 27
4. Choosing Routes
The router now has a complete link-state database
Now the router is ready to create a routing table, but
first needs to run the Shortest Path First Algorithm on
the link state database, which will create the SPF tree.
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 28
14
Steps to OSPF Operation with OSPF States
1. Establishing router adjacencies
Down State
Init State
Two-way State
3. Discovering Routes
ExStart State
Exchange State
Loading State
Full State
4. Choosing Routes
5. Maintaining Routing Information
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 29
Basic OSPF
Configuration
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 30
15
Configuring Basic OSPF
Router(config)#
router ospf process-id [vrf vpn-name]
Router(config-router)#
network ip-address wildcard-mask area area-id
Router(config-if)#
ip ospf process-id area area-id [secondaries none]
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 31
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 32
16
OSPF router-id Command
Router(config-router)#
router-id ip-address
Router(config)#router ospf 1
Router(config-router)#router-id 172.16.1.1
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 33
Loopback interface
Rtr(config)# interface loopback 0
Rtr(config-if)# ip add 10.1.1.1
255.255.255.0
Very useful in setting Router IDs.
17
Why Does the show ip ospf neighbor Command Reveal
Neighbors Stuck in 2-Way State? (This is normal in this
situation)
In the following topology, all routers are running OSPF neighbors over the Ethernet network:
Following is sample output of the show ip ospf neighbor command on R7:
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 35
NBMA OSPF
Configuration
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 36
18
OSPF over NBMA Topology Modes of
Operation
RFC 2328-compliant modes are as follows:
Nonbroadcast (NBMA)
Point-to-multipoint
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 37
NBMA
Non-Broadcast Multi-access Access Networks.
Frame Relay
X.25
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 38
19
RFC-compliant Non-broadcast Mode
One IP subnet.
Neighbors must be manually
configured.
DR and BDR elected.
DR and BDR need to have full
connectivity with all other
routers.
Typically used in a full mesh
topology.
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 39
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 40
20
NBMA Networks and OSPF
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 41
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 42
21
Cisco’s Broadcast Mode
Makes a WAN interface
appear to be a LAN
One IP subnet
Uses multicast hellos to
discover neighbors
DR and BDR elected
Requires a full mesh.
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 43
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 44
22
OSPF over NBMA Topology Summary
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 45
OSPF Multi-Area
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 46
23
OSPF Multi-Area
Areas
LSAs
Type of areas:
Stub Areas
Totally Stubby Areas
E1 and E2 routes
NSSA (Not So Stubby Areas)
Virtual Links
Route Summarization
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 47
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 48
24
OSPF uses “Areas”
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 49
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 50
25
OSPF Router Types
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 51
LSA types
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 52
26
LSA Types
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 53
LSA Types
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 54
27
LSA Type 1: Router LSA
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 56
28
LSA Type 3: Summary LSA
29
LSA Type 5: External LSA
30
E1 vs. E2 External Routes
router ospf 1
redistribute routing-protocol metric-type [1|2]
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 62
31
Area Types
Standard
Backbone
Stub
Stub
Totally Stubby Area (TSA)
Not-so-stubby-area (NSSA)
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 63
Area Types
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 64
32
Stub Areas
Considerations for both Stub and Totally Stubby Areas
An area could be qualified a stub when there is a single exit point (a single ABR)
from that area or if routing to outside of the area does not have to take an optimal
path.
The area is not needed as a transit area for virtual links (later).
The ASBR is not within the stub area
The area is not the backbone area (area 0)
Stub areas will result in memory and processing savings depending upon the size
of the network.
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 65
Stub Areas
Receives all routes from within A.S.:
Within the local area - LSA 1s and LSA 2s (if appropriate)
From other areas (Inter-Area) - LSA 3s and LSA 4s
ABR:
LSA 3s and LSA 4s are propagated by the ABR.
ABR blocks all LSA 5s.
If LSA 5s are not know inside an area, are LSA 4s are necessary ??
Default route is injected into stub area by ABR
External Routes: Once the ABR gets a packet headed to a default route, it must
have a default route, either static or propagated by the ASBR via default
information originate (coming!)
Configuration:
All routers in the area must be configured as “stub”
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 66
33
Totally Stubby Areas
Cisco proprietary
Same considerations as with Stub areas:
An area could be qualified a stub when there is a
single exit point (a single ABR) from that area or if
routing to outside of the area does not have to take
an optimal path.
The area is not needed as a transit area for virtual
links (later).
The ASBR is not within the stub area
The area is not the backbone area (area 0)
Stub areas will result in memory and processing
savings depending upon the size of the network. -
This is even more true with Totally Stubby areas
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 67
ABR:
ABR blocks all LSA 5s.
ABR blocks all LSA 3s and LSA 4s, except propagating a default route.
Default route is injected into totally stubby area by ABR.
Configuring:
All routers must be configured as “stub”
ABR must be configured as “stub no-summary”
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 68
34
Multi-area Example
RIP
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 69
Multi-area Example
All routes to all areas including LSA 3s (IA) other areas routes
from ABRs, LSA 4s (IA to ASBR) reachability to ASBR from
ABRs, and LSA 5s (E1/E2) external routes from the ASBR.
ABR
RIP
ASBR
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 70
35
Stub Example
ABR
LSA 3s (IA routes) via ABR
No Type
LSA 5s
Route to 0.0.0.0/0
via ABR
ASBR
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 71
No Type 3, 4,
or 5 LSAs
36
Propagating Default
Routes in NSSAs
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 73
NSSA Example
NSSA Backbone Area
Area 2 Area 0
RTH
RIP
RTE
RTG RTD
ASBR
RTB RTA
(Possible
ABR
ASBR)
RTF RTC
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 74
37
NSSA Backbone Area
Default route via RTG Area 2 Area 0
RTH
RIP
RTE LSA 7
LSA 7
RTG RTD LSA 5
ASBR LSA 7 LSA 7
RTB RTA
(Possible
ABR
ASBR)
RTF RTC LSA 7s
LSA 7 LSA 7 Blocked
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 76
38
NSSA Backbone Area
Default route via RTG Area 2 Area 0
RTH
RIP
LSA 3s &
RTE
LSA 7 0.0.0.0/0
LSA 7
RTG RTD LSA 5
ASBR LSA 7
LSA 7 RTB RTA
(Possible
ABR
ASBR)
RTF RTC LSA 7s
LSA 7 LSA 7 Blocked
NSSA example
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 78
39
Virtual Link
Concepts and
Configuration
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 79
Virtual Links
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 80
40
Virtual Links
Virtual Links
41
The command to configure a virtual link is as follows:
area <area-id> virtual-link <remote-router-id>
RTA(config)#router ospf 1
RTA(config-router)#network 192.168.0.0 0.0.0.255 area 51
RTA(config-router)#network 192.168.1.0 0.0.0.255 area 3
RTA(config-router)#area 3 virtual-link 10.0.0.1
...
RTB(config)#router ospf 1
RTB(config-router)#network 192.168.1.0 0.0.0.255 area 3
RTB(config-router)#network 192.168.2.0 0.0.0.255 area 0
BSCI Module 3
© 2006RTB(config-router)#area
Cisco Systems, Inc. All rights reserved.
3 virtual-link 10.0.0.2
Cisco Public 83
42
Configuring and Verifying a Virtual Link
Route
summarization
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 86
43
Inter-
Inter-Area Route Summarization - Area Range
44
RTB
router ospf 100
area 1 range 128.213.64.0 255.255.224.0
RTC
router ospf 100
area 2 range 128.213.96.0 255.255.224.0
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 89
Router(config-router)# summary-address
network-address subnet-mask
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 90
45
RTA
router ospf 100
summary-address 128.213.64.0 255.255.224.0
redistribute bgp 50 metric 1000 subnets (later)
RTD
router ospf 100
summary-address 128.213.96.0 255.255.224.0
redistribute bgp 20 metric 1000 subnets (later) 91
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public
OSPF
Authentication
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 92
46
OSPF Authentication Types
• OSPF supports 2 types of authentication:
•Simple password authentication (plain text)
•MD5 authentication
• Router generates and checks each packet and authenticates the
source of each update packet it receives
• Configure a “key” (password)
•Note: all participating neighbors must have the same key
configured
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 93
Router(config-router)#
area area-id authentication [message-digest]
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 94
47
Example Simple Password Authentication
Configuration
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 95
<output omitted>
interface Loopback0
ip address 10.2.2.2 255.255.255.0
<output omitted>
interface Serial0/0/1
ip address 192.168.1.102 255.255.255.224
ip ospf authentication
ip ospf authentication-key plainpas
<output omitted>
router ospf 10
log-adjacency-changes
network 10.2.2.2 0.0.0.0 area 0
network 192.168.1.0 0.0.0.255 area 0
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 96
48
Configuring OSPF MD5 Authentication
Router(config-if)#
ip ospf message-digest-key key-id md5 key
Router(config-if)#
ip ospf authentication [message-digest | null]
Router(config-router)#
area area-id authentication [message-digest]
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 97
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 98
49
Q and A
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 99
BSCI Module 3 © 2006 Cisco Systems, Inc. All rights reserved. Cisco Public 100
50