Học viện mạng Bách Khoa - Website: www.bkacad.com 2Objectives • Describe the background and basic features of OSPF • Identify and apply the basic OSPF configuration commands • Describe,
Trang 1Chapter 11 - OSPF
CCNA Exploration 4.0
Trang 2Học viện mạng Bách 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 multiaccess
networks
• Describe the uses of additional configuration
commands in OSPF
Trang 3Học viện mạng Bách Khoa - Website: www.bkacad.com 3
Introduction
Trang 4Học viện mạng Bách Khoa - Website: www.bkacad.com 4
Trang 5Học viện mạng Bách Khoa - Website: www.bkacad.com 5
OSPF Message Encapsulation
• OSPF packet type
– There exist 5 types.
• OSPF packet header
Trang 6Học viện mạng Bách Khoa - Website: www.bkacad.com 6
Introduction to OSPF
OSPF Message Encapsulation
• Data link frame header
– Source MAC address
– Destination MAC address
Trang 7Học viện mạng Bách Khoa - Website: www.bkacad.com 7
OSPF Packet Types
OSPF PACKET TYPE DESCRIPTION
1: HELLO Discovers neighbors & builds
ADJACENCY W/ NEIGHBORS
2: DATABASE DESCRIPTION Checks for database synchronization
between routers
3: LINK STATE REQUEST REQUESTS SPECIFIC LINK STATE
DATABASE information from router to router
4: LINK STATE UPDATE TRANSPORTS LINK STATE records
5: LINK STATE
ACKNOWLEDGEMENT
ACKNOWLEDGES RECEIPT OF other packet types
Trang 8Học viện mạng Bách Khoa - Website: www.bkacad.com 8
Hello Protocol
• OSPF 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 designated
router(DR) and a backup designated router(BDR)
Trang 9Học viện mạng Bách Khoa - Website: www.bkacad.com 9
OSPF Hello Packet
Trang 10Học viện mạng Bách 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 before
the neighbor is considered down
– Default time is 4 times the hello interval
OSPF timers
Trang 11Học viện mạng Bách Khoa - Website: www.bkacad.com 11
DR and BDR
• Hello protocol packets contain information that is used in
electing
– Designated Router (DR)
• DR is responsible for updating all other OSPF routers
– Backup Designated Router (BDR)
• This router takes over DR’s responsibilities if DR fails
Trang 12Học viện mạng Bách 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
Trang 13Học viện mạng Bách Khoa - Website: www.bkacad.com 13
OSPF Algorithm
• OSPF routers build &
maintain link-state database
containing LSA received
from other routers
Trang 14Học viện mạng Bách Khoa - Website: www.bkacad.com 14
OSPF Administrative Distance
• Default Administrative Distance for OSPF is 110
Trang 15Học viện mạng Bách 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
Trang 16Học viện mạng Bách Khoa - Website: www.bkacad.com 16
Basic OSPF configuration
Trang 17Học viện mạng Bách 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
Trang 18Học viện mạng Bách Khoa - Website: www.bkacad.com 18
Addressing
Trang 19Học viện mạng Bách 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
Trang 20Học viện mạng Bách 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 state information
Trang 21Học viện mạng Bách Khoa - Website: www.bkacad.com 21
OSPF Router ID
Find Router ID
Trang 22Học viện mạng Bách Khoa - Website: www.bkacad.com 22
Basic OSPF Configuration
Trang 23Học viện mạng Bách 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 isn’t 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.
Trang 24Học viện mạng Bách 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 later
section.
• 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 to
receive an OSPF Hello packet from the neighbor before declaring the neighbor down This value is reset when the interface receives a Hello packet.
• Address - The IP address of the neighbor's interface to which this
router is directly connected.
• Interface - The interface on which this router has formed adjacency
with the neighbor.
Trang 25Học viện mạng Bách Khoa - Website: www.bkacad.com 25
Basic OSPF Configuration
• Neighboring router’s 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
Trang 26Học viện mạng Bách 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
Trang 27Học viện mạng Bách Khoa - Website: www.bkacad.com 27
Show ip protocols
Displays OSPF process ID , router ID,
networks router is advertising &
administrative distance
Show ip ospf
Displays OSPF process ID, router ID, OSPF area information & the last time SPF algorithm calculated
Show ip ospf interface Displays hello interval and dead interval
Verifying OSPF - Additional Commands
Trang 28Học viện mạng Bách Khoa - Website: www.bkacad.com 28
Show ip protocols
Trang 29Học viện mạng Bách Khoa - Website: www.bkacad.com 29
Show ip ospf
Trang 30Học viện mạng Bách Khoa - Website: www.bkacad.com 30
Show ip ospf interface
Trang 31Học viện mạng Bách 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
Trang 32Học viện mạng Bách Khoa - Website: www.bkacad.com 32
OSPF Metric
• OSPF uses cost as the metric for determining the best route
– Best route ~ lowest cost
Trang 33reference-Học viện mạng Bách Khoa - Website: www.bkacad.com 33
• COST of an OSPF route
– Is the accumulated value from one router to the next
OSPF Metric
Trang 34Học viện mạng Bách Khoa - Website: www.bkacad.com 34
• Usually the actual speed of a link is different than the
default bandwidth
– This makes it imperative that the bandwidth value
reflects link’s actual speed
• Reason: so routing table has best path information
• The show interface command will display interface’s
bandwidth
– Most serial link default to 1.544Mbps
OSPF Metric
Trang 35Học viện mạng Bách 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 the
Trang 36Học viện mạng Bách Khoa - Website: www.bkacad.com 36
Basic OSPF Configuration
Modifying the Cost of the link
• Difference between bandwidth command & the ip ospf cost
command:
– Ip ospf cost command
• Sets cost to a specific value
• Link cost is calculated
Trang 37Học viện mạng Bách Khoa - Website: www.bkacad.com 37
OSPF and Multi-access Networks
Challenges in Multi-access Networks
• OSPF defines five network types:
Trang 38Học viện mạng Bách Khoa - Website: www.bkacad.com 38
OSPF in Multi-access Networks
• 2 challenges presented by multi-access networks
– Multiple adjacencies
– Extensive LSA flooding
Trang 39Học viện mạng Bách 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
Trang 40Học viện mạng Bách Khoa - Website: www.bkacad.com 40
OSPF in Multi-access Networks
• Solution to LSA flooding issue is the
• 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 other
routers
Trang 41Học viện mạng Bách Khoa - Website: www.bkacad.com 41
OSPF in Multi-access Networks
DR/BDR Election Process
• DR/BDR elections DO NOT occur in point to point networks
Trang 42Học viện mạng Bách Khoa - Website: www.bkacad.com 42
• DR/BDR elections will take place on multi-access
networks as shown below.
OSPF in Multi-access Networks
Trang 43Học viện mạng Bách 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 break
the tie
OSPF in Multi-access Networks
Trang 44Học viện mạng Bách Khoa - Website: www.bkacad.com 44
– The OSPF process on the DR fails
– The multiaccess interface on the DR fails
OSPF in Multi-access Networks
Trang 45Học viện mạng Bách Khoa - Website: www.bkacad.com 45
DR/BDR Election – Refer to 11.4.2.3
Trang 46Học viện mạng Bách Khoa - Website: www.bkacad.com 46
Trang 47Học viện mạng Bách Khoa - Website: www.bkacad.com 47
Trang 48Học viện mạng Bách Khoa - Website: www.bkacad.com 48
Trang 49Học viện mạng Bách Khoa - Website: www.bkacad.com 49
Trang 50Học viện mạng Bách 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 other routers
Trang 51Học viện mạng Bách 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
Trang 52Học viện mạng Bách Khoa - Website: www.bkacad.com 52
Redistributing an OSPF Default Route
• Topology includes a link to ISP
– Router connected to ISP
– 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
Trang 53Học viện mạng Bách Khoa - Website: www.bkacad.com 53
Example default route
Trang 54Học viện mạng Bách Khoa - Website: www.bkacad.com 54
Example default route
Trang 55Học viện mạng Bách Khoa - Website: www.bkacad.com 55
Example default route
Trang 56Học viện mạng Bách Khoa - Website: www.bkacad.com 56
Example default route
Trang 57Học viện mạng Bách Khoa - Website: www.bkacad.com 57
Fine-Tuning OSPF
• Since link speeds are getting
faster it may be necessary to
change reference bandwidth
Trang 58Học viện mạng Bách Khoa - Website: www.bkacad.com 58
Modifying OSPF timers
• Modifying OSPF timers
– Reason to modify timers
• Faster detection of network failures
– Manually modifying Hello & Dead intervals
• Router(config-if)#ip ospf hello-interval seconds
• Router(config-if)#ip ospf dead-interval seconds
– Point to be made
• Hello & Dead intervals must be the same between neighbors
Trang 59Học viện mạng Cisco Bách Khoa - Website: www.ciscobachkhoa.com
• By default , a router trusts that routing information is coming from a router that
should be sending the information
• To guarantee this trust, routers in a specific area can be configured to authenticate
each other.
• Each OSPF interface can present an authentication key for use by routers sending OSPF information to other routers on the segment.
• The authentication key, known as a password , is a shared secret between the
routers This key is used to generate the authentication data in the OSPF packet header The password can be up to eight characters.
Configuring OSPF authentication
Trang 60Học viện mạng Cisco Bách Khoa - Website: www.ciscobachkhoa.com
• Router(config-if)#ip ospf authentication-key password
• After the password is configured, authentication must be
enabled:
• 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 sniffer captures an OSPF packet
Configuring OSPF authentication
Trang 61Học viện mạng Cisco Bách Khoa - Website: www.ciscobachkhoa.com
•To send encrypted authentication information and to ensure greater security, the message-digest
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 the
length of the message digest that is appended to the
packet
Configuring OSPF authentication
Trang 62OSPF redistribution
• Planning Redistribution
• Locate the boundary router between two routing processes
• Determine which routing process is the core or backbone
Trang 63Configuring Redistribution into OSPF
• Use this command to redistribute routes into OSPF:
Router(config-router)# redistribute
map-tag] [subnets] [tag tag-value]
• Default metric is 20
• Default metric type is 2
• Subnets do not redistribute by default
Trang 64Học viện mạng Bách Khoa - Website: www.bkacad.com 64
Configuring Redistribution into OSPF
RtrA(config)# router ospf 1
RtrA(config-router)# redistribute eigrp ?
<1-65535> Autonomous system number
RtrA(config-router)# redistribute eigrp 100 ?
metric Metric for redistributed routes
metric-type OSPF/IS-IS exterior metric type for
redistributed routes
route-map Route map reference
subnets Consider subnets for redistribution into OSPF
tag Set tag for routes redistributed into OSPF
…
<cr>
Trang 65Học viện mạng Bách Khoa - Website: www.bkacad.com 65
Configuring Redistribution into OSPF