8/3/2019 CCNA Exp2 - Chapter11 - OSPF
1/71
1
Chapter 11 - OSPF
CCNA Exploration 4.0
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
2/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 2
Objectives
Describe the background and basic features of OSPF Identify and apply the basic OSPF configuration
commands Describe, modify and calculate the metric used by
OSPF Describe the Designated Router/Backup Designated
Router (DR/BDR) election process in multiaccessnetworks
Describe the uses of additional configurationcommands in OSPF
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
3/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 3
Introduction
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
4/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 4
Background of OSPF Began in 1987. 1989 OSPFv1 released in RFC 113.
This version was experimental & never deployed 1991 OSPFv2 released in RFC 1247. 1998 OSPFv2 updated in RFC 2328. 1999 OSPFv3 published in RFC 2740.
Introduction to OSPF
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
5/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 5
OSPF Message Encapsulation OSPF packet type There exist 5 types .
OSPF packet header
Router ID. Area ID. Type code(packet type).
IP packet header
Source IP address. Destination IP address. Protocol field (set to 89 ).
Introduction to OSPF
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
6/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 6
Introduction to OSPF
OSPF Message Encapsulation Data link frame header Source MAC address. Destination MAC address.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
7/71Hc vin mng Bch Khoa - Website: www.bkacad.com 7
OSPF Packet Types
OSPF PACKET TYPE DESCRIPTION
1: HELLO Discovers neighbors & buildsADJACENCY W/ NEIGHBORS
2: DATABASE DESCRIPTION Checks for database synchronizationbetween routers
3: LINK STATE REQUEST REQUESTS SPECIFIC LINK STATEDATABASE information from router torouter
4: LINK STATE UPDATE TRANSPORTS LINK STATE records
5: LINK STATEACKNOWLEDGEMENT
ACKNOWLEDGES RECEIPT OF otherpacket types
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
8/71Hc vin mng Bch Khoa - Website: www.bkacad.com 8
Hello Protocol
OSPF Hello Packet Purpose of Hello Packet
Discover OSPF neighbors & establish adjacencies.
Advertise guidelines on which routers must agree to
become neighbors.
Used by multi-access networks to elect a d esignated
router(DR) and a b ackup d esignated router(BDR).
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
9/71Hc vin mng Bch Khoa - Website: www.bkacad.com 9
OSPF Hello Packet
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
10/71Hc vin mng Bch Khoa - Website: www.bkacad.com 10
Hello Packets continued Router ID of transmitting router. Sent every 10 seconds on
multiaccess & point to point serial link. OSPF Hello Intervals
Usually multicast (224.0.0.5). Sent every 30 seconds for NBMA
segments. OSPF Dead Intervals
This is the time that must be expired beforethe neighbor is considered down.
Default time is 4 times the hello interval.
OSPF timers
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
11/71Hc vin mng Bch Khoa - Website: www.bkacad.com 11
DR and BDR
Hello protocol packets contain information that is used inelecting Designated Router (DR)
DR is responsible for updating all other OSPF routers Backup Designated Router (BDR)
This router takes over DRs responsibilities if DR fails
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
12/71Hc vin mng Bch Khoa - Website: www.bkacad.com 12
Introduction to OSPF
OSPF Link-state Updates Purpose of a Link State Update (LSU)
Used to deliver link state advertisements Purpose of a Link State Advertisement (LSA)
Contains information about neighbors & path costs
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
13/71Hc vin mng Bch Khoa - Website: www.bkacad.com 13
OSPF Algorithm OSPF routers build &
maintain link-state databasecontaining LSA receivedfrom other routers
Information found indatabase is utilized uponexecution of Dijkstra SPFalgorithm.
SPF algorithm used tocreate SPF tree.
SPF tree used topopulate routing table.
Introduction to OSPF
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
14/71Hc vin mng Bch Khoa - Website: www.bkacad.com 14
OSPF Administrative Distance
Default Administrative Distance for OSPF is 110
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
15/71Hc vin mng Bch Khoa - Website: www.bkacad.com 15
OSPF Authentication Purpose is to encrypt & authenticate routing information This is an interface specific configuration. Routers will only accept routing information from other
routers that have been configured with the same
password or authentication informa.tion
Introduction to OSPF
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
16/71Hc vin mng Bch Khoa - Website: www.bkacad.com 16
Basic OSPF configuration
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
17/71Hc vin mng Bch Khoa - Website: www.bkacad.com 17
Example
Lab Topology
Topology used for this chapter Discontiguous IP addressing scheme. Since OSPF is a classless routing protocol the subnet
mask is configured in.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
18/71Hc vin mng Bch Khoa - Website: www.bkacad.com 18
Addressing
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
19/71Hc vin mng Bch Khoa - Website: www.bkacad.com 19
Enable OSPF
The router ospf command
To enable OSPF on a router use the following command R1(config)# router ospf process-id Process id
A locally significant number between 1 and 65535 . Does not have to match other OSPF routers.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
20/71Hc vin mng Bch Khoa - Website: www.bkacad.com 20
Basic OSPF Configuration
RA(config-router)# network network-address wildcard- mask area area-id wildcard mask - the inverse of the subnet mask area-id
Area-id refers to the OSPF area.
OSPF area is a group of routers that share link stateinformation.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
21/71Hc vin mng Bch Khoa - Website: www.bkacad.com 21
OSPF Router ID
FindRouter ID
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
22/71Hc vin mng Bch Khoa - Website: www.bkacad.com 22
Basic OSPF Configuration
OSPF Router ID
Commands used to verify current router ID Show ip protocols. Show ip ospf. Show ip ospf interface.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
23/71Hc vin mng Bch Khoa - Website: www.bkacad.com 23
Basic OSPF Configuration
OSPF Router ID
Router ID & Loopback addresses Highest loopback address will be used as router ID if
router- id command isnt used. Advantage: loopback interface cannot fail OSPF stability
The OSPF router-id command Introduced in IOS 12.0 Command syntax
Router(config)# router ospf process-id. Router(config-router)# router-id ip-address.
Modifying the Router ID Use the command Router #clear ip ospf process.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
24/71Hc vin mng Bch Khoa - Website: www.bkacad.com 24
Show ip ospf neighbor command
Neighbor ID - The router ID of the neighboring router.
Pri - The OSPF priority of the interface. This is discussed in a latersection. State - The OSPF state of the interface. FULL state means that the
router and its neighbor have identical OSPF link-state databases.OSPF states are discussed in CCNP.
Dead Time - The amount of time remaining that the router will wait toreceive an OSPF Hello packet from the neighbor before declaring theneighbor down. This value is reset when the interface receives a Hellopacket.
Address - The IP address of the neighbor's interface to which thisrouter is directly connected.
Interface - The interface on which this router has formed adjacencywith the neighbor.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
25/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 25
Basic OSPF Configuration
Verifying OSPF Use the show ip ospf command to verify & trouble shoot
OSPF networks Neighbor adjacency
No adjacency indicated by
Neighboring routers Router ID is not displayed. A state of full is not displayed. Consequence of no adjacency
No link state information exchanged. Inaccurate SPF trees & routing tables.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
26/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 26
Reasons of no adjacency
Two routers may not form an OSPF adjacency if: The subnet masks do not match, causing the routers to be on
separate networks. OSPF Hello or Dead Timers do not match . OSPF Network Types do not match.
There is a missing or incorrect OSPF network command.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
27/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 27
Command Description
Show ip protocols
Displays OSPF process ID , router ID ,
networks router is advertising &administrative distance
Show ip ospfDisplays OSPF process ID, router ID ,OSPF area information & the last timeSPF algorithm calculated
Show ip ospf interface Displays hello interval and dead interval
Verifying OSPF - Additional Commands
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
28/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 28
Show ip protocols
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
29/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 29
Show ip ospf
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
30/71
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
31/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 31
Show ip route - Examining the routing table
Use the show ip route command to display the routing table O at the beginning of a route indicates that the router source is OSPF Note OSPF does not automatically summarize at major
network boundaries.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
32/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 32
OSPF Metric
OSPF uses cost as the metric for determining the best route Best route ~ lowest cost Cost:
10 8 / bandwidth
Reference bandwidth Defaults to 100Mbps
Can be modified using auto-cost reference-
bandwidth command.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
33/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 33
COST of an OSPF route Is the accumulated value .from one router to the next
OSPF Metric
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
34/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 34
Usually the actual speed of a link is different than thedefault bandwidth This makes it imperative that the bandwidth value
reflects links actual speed. Reason: so routing table has best path information.
The show interface command will display interfacesbandwidth Most serial link default to 1.544Mbps.
OSPF Metric
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
35/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 35
Modify OSPF Cost value
Modifying the Cost of a link
Both sides of a serial link should be configured with thesame bandwidth Commands used to modify bandwidth value
Router(config-if)#bandwidth bandwidth-kbps R1(config)#interface serial 0/0/0
R1(config-if)#ip ospf cost 1562
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
36/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 36
Basic OSPF Configuration
Modifying the Cost of the link
Difference between bandwidth command & the ip ospf costcommand: Ip ospf cost command
Sets cost to a specific value. Bandwidth command
Link cost is calculated.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
37/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 37
OSPF and Multi-access Networks
Challenges in Multi-access Networks
OSPF defines five network types: Point-to-point. Broadcast Multiaccess. Nonbroadcast Multiaccess (NBMA).
Point-to-multipoint. Virtual links.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
38/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 38
OSPF in Multi-access Networks
2 challenges presented by multi-access networks Multiple adjacencies Extensive LSA flooding
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
39/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 39
OSPF in Multi-access Networks
Extensive flooding of LSAs For every LSA sent out there must be an acknowledgement
of receipt sent back to transmitting router.lots of bandwidth consumed and chaotic traffic
l k
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
40/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 40
OSPF in Multi-access Networks
Solution to LSA flooding issue is theuse of: Designated router(DR). Backup designated router(BDR).
DR & BDR selection Routers are elected to send &
receive LSA. Sending & Receiving LSA
DRothers send LSAs via
multicast 224.0.0. 6 to DR & BDR. DR forward LSA via multicast
address 224.0.0.5 to all otherrouters.
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
41/71
OS i l i k
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
42/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 42
DR/BDR elections will take place on multi-accessnetworks as shown below .
OSPF in Multi-access Networks
OSPF i M l i N k
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
43/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 43
Criteria for getting elected DR/BDR DR: Router with the highest OSPF
interface priority . BDR : Router with the second highest
OSPF interface priority .
If OSPF interface priorities are equal ,the highest router ID is used to breakthe tie.
OSPF in Multi-access Networks
OSPF i M l i N k
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
44/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 44
Timing of DR/BDR Election Occurs as soon as 1 st router has its interface enabled on
multi-access network. When a DR is elected it remains as the DR until one of the
following occurs
The DR fails. The OSPF process on the DR fails. The multiaccess interface on the DR fails.
OSPF in Multi-access Networks
l f
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
45/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 45
DR/BDR Election Refer to 11.4.2.3
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
46/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 46
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
47/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 47
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
48/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 48
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
49/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 49
OSPF i M l i N k
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
50/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 50
OSPF in Multi-access Networks
Manipulating the election process If you want to influence the election of DR & BDR then do
one of the following Boot up the DR first, followed by the BDR, and then boot
all other routers,
OR Shut down the interface on all routers, followed by a no
shutdown on the DR, then the BDR, and then all otherrouters.
Manipulating the DR/BDR election
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
51/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 51
Manipulating the DR/BDR election
OSPF Interface Priority
Manipulating the DR/BDR election process continued Use the ip ospf priority interface command. Example:Router(config-if)# ip ospf priority {0 - 255 }
Priority number range 0 to 255 0 means the router cannot become the DR or BDR. 1 is the default priority value.
Redistributing an OSPF Default Route
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
52/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 52
Redistributing an OSPF Default Route
Topology includes a link to ISP Router connected to ISP
Called an AutonomousS ystem BorderRouter( ASBR ).
Used to propagate adefault route
Example of static default route R1(config)# ip route 0.0.0.0 0.0.0.0 loopback 1 Requires the use of the default-information originate command. Example of default-information originate command R1(config-router)# default-information originate
E l d f lt t
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
53/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 53
Example default route
E l d f lt t
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
54/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 54
Example default route
E ample defa lt ro te
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
55/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 55
Example default route
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
56/71
Fine Tuning OSPF
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
57/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 57
Fine-Tuning OSPF
Since link speeds are gettingfaster it may be necessary tochange reference bandwidthvalues Do this using the auto-cost
reference-bandwidth( Mbps ) command
Example:R1(config-router)# auto-
cost reference-bandwidth
10000
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
58/71
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
59/71
Configuring OSPF authentication
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
60/71
Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com
Router(config-if)# ip ospf authentication-key password
After the password is configured, authentication must beenabled:
Router(config-router)# area area-number authentication Note: With simple authentication, the password is sent as plain
text. This means that it can be easily decoded if a packet sniffercaptures an OSPF packet.
Configuring OSPF authentication
Configuring OSPF authentication
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
61/71
Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com
To send encrypted authentication
information and to ensure greatersecurity, the message-digestkeyword is used.The encryption type field refers tothe type of encryption, where 0means none and 7 meansproprietary.
Router(config-if)# ip ospf message-digest-key key-id md5 encryption-type key
The key-id is an identifier and takesthe value in the range of 1 through255. The key is an alphanumericpassword up to sixteen characters.Neighbor routers must use the samekey identifier with the same keyvalue.
The authentication type identifies which authentication,
if any, is being used.In the case of message-digest authentication, the
authentication data field contains the key-id and thelength of the message digest that is appended to the
packet
Configuring OSPF authentication
OSPF redistribution
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
62/71
OSPF redistribution
Planning Redistribution
Locate the boundary router between two routing processes. Determine which routing process is the core or backbone
process
Determine which routing process is the edge or migrationprocess Select a method for injecting the required edge protocol routes
into the core.
62Hc vin mng Bach Khoa - Website: www.bkacad.com
Configuring Redistribution into OSPF
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
63/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 63
Configuring Redistribution into OSPF
Use this command to redistribute routes into OSPF:
Router(config-router)# redistribute
protocol [ process-id ] [ metric metric-value ]
[ metric-type type-value ] [ route-map map-
tag ] [ subnets ] [ tag tag-value ]
Default metric is 20.
Default metric type is 2.
Subnets do not redistribute by default .
Configuring Redistribution into OSPF
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
64/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 64
Configuring Redistribution into OSPF
RtrA(config)# router ospf 1RtrA(config-router)# redistribute eigrp ?
Autonomous system numberRtrA(config-router)# redistribute eigrp 100 ?
metric Metric for redistributed routes metric-type OSPF/IS-IS exterior metric type for
redistributed routesroute-map Route map referencesubnets Consider subnets for redistribution into OSPFtag Set tag for routes redistributed into OSPF
Configuring Redistribution into OSPF
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
65/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 65
Configuring Redistribution into OSPF
Summary
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
66/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 66
Summary
RFC 2328 describes OSPF link state concepts and
operations OSPF Characteristics A commonly deployed link state routing protocol Employs DRs & BDR s on multi-access networks
DRs & BDRs are electedDR & BDRs are used to transmit and receive LSAs
Uses 5 packet types: 1: HELLO 2: DATA BASE DESCRIPTION
3: LINK S TATE REQUEST 4: LINK S TATE UPDATE 5: LINK S TATE ACKNOWLEDGEMENT
Summary
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
67/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 67
Summary
OSPF Characteristics Metric = cost Lowest cost = best path
Configuration Enable OSPF on a router using the following command
R1(config)# router ospf process-id use the network command to define which interfaces will
participate in a given OSPF process Router(config-router)# network network-address
wildcard-mask area area-id
Summary
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
68/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 68
Summary
Verifying OSPF configuration Use the following commands
show ip protocol show ip route show ip ospf interface show ip ospf neighbor
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
69/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 69
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
70/71
Hc vin mng Bch Khoa - Website: www.bkacad.com 70
8/3/2019 CCNA Exp2 - Chapter11 - OSPF
71/71