Вы находитесь на странице: 1из 99

Chapter 11: OSPF

CCNA Exploration version 4.0

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

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Introduction

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Introduction to OSPF

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Background of OSPF
Background of OSPF Began in 1987 1989 OSPFv1 released in RFC 1131 This version was experimental & never deployed 1991 OSPFv2 released in RFC 1247 1998 OSPFv2 updated in RFC 2328 1999 OSPFv3 published in RFC 2740

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Single Area OSPF Concepts: OSPF terminology

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Single Area OSPF Concepts: OSPF terminology

H c vi n m ng Bch Khoa - Website: www.bkacad.com

OSPF area

H c vi n m ng Bch Khoa - Website: www.bkacad.com

OSPF Message Encapsulation

H c vi n m ng Bch Khoa - Website: www.bkacad.com

OSPF Packet Types

H c vi n m ng Bch Khoa - Website: www.bkacad.com

10

Hello Protocol

H c vi n m ng Bch Khoa - Website: www.bkacad.com

11

Hello Protocol

1. Discover OSPF neighbors and


establish neighbor adjacencies. 2. Advertise parameters on which two routers must agree to become neighbors. 3. Elect the Designated Router (DR) and Backup Designated Router (BDR) on multiaccess networks like Ethernet and Frame Relay.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 12

Hello Protocol

OSPF Hello Intervals


Usually multicast (224.0.0.5) Sent every 30 seconds for NBMA segments Sent every 10 seconds for Multi access network 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
H c vi n m ng Bch Khoa - Website: www.bkacad.com 13

Hello Protocol

H c vi n m ng Bch Khoa - Website: www.bkacad.com

14

Hello Protocol

Electing a DR and BDR


Designated Router (DR): DR is responsible for updating all other OSPF routers (called DROthers) Backup Designated Router (BDR): This router takes over DRs responsibilities if DR fails

H c vi n m ng Bch Khoa - Website: www.bkacad.com

15

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
H c vi n m ng Bch Khoa - Website: www.bkacad.com

16

OSPF Link-state Updates

H c vi n m ng Bch Khoa - Website: www.bkacad.com

17

Extra: How routing information is maintained when a failure is occurs

Network 1 is down
LSAs LSAs LSAs

Area x
1. 2. 3. 4. 5. When a failure occurs in the network, such as a neighbor becomes unreachable Link-state protocols flood LSAs using a special multicast address throughout an area. Each link-state router takes a copy of the LSA, updates its link-state/topological database. The link-state router will then forward the LSA to all neighboring devices. LSAs cause every router within the area to recalculate routes. Because LSAs need to be flooded throughout an area

Note: all routers within that area need to recalculate their routing tables ==> the number of link-state routers that can be in an area should be limited

H c vi n m ng Bch Khoa - Website: www.bkacad.com

18

OSPF Algorithm

H c vi n m ng Bch Khoa - Website: www.bkacad.com

19

Administrative Distance

H c vi n m ng Bch Khoa - Website: www.bkacad.com

20

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 information Note: Authentication does not encrypt the router's routing table.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 21

Basic OSPF Configuration

H c vi n m ng Bch Khoa - Website: www.bkacad.com

22

Lab Topology

H c vi n m ng Bch Khoa - Website: www.bkacad.com

23

Addressing

H c vi n m ng Bch Khoa - Website: www.bkacad.com

24

The router ospf 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

H c vi n m ng Bch Khoa - Website: www.bkacad.com

25

The network command

Router(config-router)# network networkaddress wildcard-mask area area-id wildcard mask - the inverse of the subnet mask. The network address along with the wildcard mask is used to specify the interface or range of interfaces that will be enabled for OSPF using this network command. area-id Area-id refers to the OSPF area. OSPF area is a group of routers that share link state information
H c vi n m ng Bch Khoa - Website: www.bkacad.com 26

The network command

H c vi n m ng Bch Khoa - Website: www.bkacad.com

27

OSPF Router ID

Router ID ?

H c vi n m ng Bch Khoa - Website: www.bkacad.com

28

OSPF Router ID

Commands used to verify current router ID Show ip protocols Show ip ospf Show ip ospf interface

H c vi n m ng Bch Khoa - Website: www.bkacad.com

29

OSPF Router ID
Host Mask

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 Router(config)#router ospf process-id Router(config-router)#router-id ip-address Modifying the Router ID Router#clear ip ospf process
H c vi n m ng Bch Khoa - Website: www.bkacad.com 30

OSPF Router ID

H c vi n m ng Bch Khoa - Website: www.bkacad.com

31

OSPF Router ID

Duplicate Router IDs When two routers have the same router ID in an OSPF, domain routing may not function properly. If the router ID is the same on two neighboring routers, the neighbor establishment may not occur. When duplicate OSPF router IDs occur, IOS will display a message similar to: %OSPF-4-DUP_RTRID1: Detected router with duplicate router ID
H c vi n m ng Bch Khoa - Website: www.bkacad.com 32

Verifying OSPF

H c vi n m ng Bch Khoa - Website: www.bkacad.com

33

Verifying OSPF

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 linkstate 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.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 34

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.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 35

Verifying OSPF
Verifying OSPF - Additional Commands
Command Description Displays OSPF process ID, router ID, networks router is advertising & administrative distance Displays OSPF process ID, router ID, OSPF area information & the last time SPF algorithm calculated Displays hello interval and dead interval

Show ip protocols

Show ip ospf

Show ip ospf interface

H c vi n m ng Bch Khoa - Website: www.bkacad.com

36

show ip protocols

H c vi n m ng Bch Khoa - Website: www.bkacad.com

37

show ip ospf

H c vi n m ng Bch Khoa - Website: www.bkacad.com

38

show ip ospf

A network that cycles between an up state and a down state is referred to as a flapping link. A flapping link can cause OSPF routers in an area to constantly recalculate the SPF algorithm, preventing proper convergence. To minimize this problem, the router waits 5 seconds (5000 msecs) after receiving an LSU before running the SPF algorithm. This is known as the SPF schedule delay. In order to prevent a router from constantly running the SPF algorithm, there is an additional Hold Time of 10 seconds (10000 msecs). The router waits 10 seconds after running the SPF algorithm before rerunning the algorithm again.
H c vi n m ng Bch Khoa - Website: www.bkacad.com

39

show ip ospf interface

H c vi n m ng Bch Khoa - Website: www.bkacad.com

40

show ip ospf database

H c vi n m ng Bch Khoa - Website: www.bkacad.com

41

Examining the routing table

Note: OSPF does not automatically


summarize at major network boundaries

H c vi n m ng Bch Khoa - Website: www.bkacad.com

42

The OSPF Metric

H c vi n m ng Bch Khoa - Website: www.bkacad.com

43

OSPF Metric

OSPF uses cost as the metric for determining the best route Best route ~ lowest cost Cost 108 / bandwidth Reference bandwidth defaults to 100Mbps can be modified using auto-cost referencebandwidth command

H c vi n m ng Bch Khoa - Website: www.bkacad.com

44

OSPF Metric

COST of an OSPF route Is the accumulated value from one router to the next

H c vi n m ng Bch Khoa - Website: www.bkacad.com

45

OSPF Metric

Usually the actual speed of a link is


different than the default bandwidth Bandwidth value does not actually affect the speed of the link; it is used by some routing protocols to compute the routing metric. The show interface command will display interfaces bandwidth Most serial link default to 1.544Mbps

H c vi n m ng Bch Khoa - Website: www.bkacad.com

46

OSPF Metric

H c vi n m ng Bch Khoa - Website: www.bkacad.com

47

Modifying the Cost of a link

Both sides of a serial link should be


configured with the same bandwidth Router(config-if)#bandwidth bandwidth-kbps R1(config)#interface serial 0/0/0 R1(config-if)#ip ospf cost 1562

H c vi n m ng Bch Khoa - Website: www.bkacad.com

48

Modifying the Cost of a link

H c vi n m ng Bch Khoa - Website: www.bkacad.com

49

Modifying the Cost of a link

Difference between bandwidth


command & the ip ospf cost command Ip ospf cost command Sets cost to a specific value Bandwidth command Link cost is calculated

H c vi n m ng Bch Khoa - Website: www.bkacad.com

50

Modifying the Cost of a link

H c vi n m ng Bch Khoa - Website: www.bkacad.com

51

OSPF and Multiaccess Networks

H c vi n m ng Bch Khoa - Website: www.bkacad.com

52

Challenges in Multi-access Networks

OSPF defines 5 network types: 1. Point-to-point 2. Broadcast Multiaccess 3. Nonbroadcast Multiaccess (NBMA) 4. Point-to-multipoint 5. Virtual links

H c vi n m ng Bch Khoa - Website: www.bkacad.com

53

OSPF in Multi-access Networks

2 challenges presented by multi-access networks Multiple adjacencies Extensive LSA flooding

H c vi n m ng Bch Khoa - Website: www.bkacad.com

54

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

H c vi n m ng Bch Khoa - Website: www.bkacad.com

55

OSPF in Multi-access Networks

Solution to LSA flooding issue is the use 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 other routers
H c vi n m ng Bch Khoa - Website: www.bkacad.com 56

OSPF in Multi-access Networks

H c vi n m ng Bch Khoa - Website: www.bkacad.com

57

DR/BDR Election Process

DR/BDR elections DO NOT occur in point to point networks

H c vi n m ng Bch Khoa - Website: www.bkacad.com

58

DR/BDR Election Process

DR/BDR elections will take place on multi-access networks as shown below

H c vi n m ng Bch Khoa - Website: www.bkacad.com

59

DR/BDR Election Process

Criteria for getting elected DR/BDR 1.DR: Router with the highest OSPF interface priority. 2.BDR: Router with the second highest OSPF interface priority. 3.If OSPF interface priorities are equal, the highest router ID is used to break the tie.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 60

DR/BDR Election Process

H c vi n m ng Bch Khoa - Website: www.bkacad.com

61

DR/BDR Election Process

H c vi n m ng Bch Khoa - Website: www.bkacad.com

62

DR/BDR Election Process

Timing of DR/BDR Election


Occurs as soon as 1st 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 1. The DR fails. 2. The OSPF process on the DR fails. 3. The multiaccess interface on the DR fails.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 63

DR/BDR Election Process

H c vi n m ng Bch Khoa - Website: www.bkacad.com

64

DR/BDR Election Process

H c vi n m ng Bch Khoa - Website: www.bkacad.com

65

DR/BDR Election Process

H c vi n m ng Bch Khoa - Website: www.bkacad.com

66

DR/BDR Election Process

H c vi n m ng Bch Khoa - Website: www.bkacad.com

67

DR/BDR Election Process

H c vi n m ng Bch Khoa - Website: www.bkacad.com

68

OSPF in Multi-access Networks

Manipulating the election process


1. Boot up the DR first, followed by the BDR, and then boot all other routers, OR 2. Shut down the interface on all routers, followed by a no shutdown on the DR, then the BDR, and then all other routers.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 69

OSPF Interface Priority

Manipulating the DR/BDR election


process continued 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
H c vi n m ng Bch Khoa - Website: www.bkacad.com 70

OSPF Interface Priority

H c vi n m ng Bch Khoa - Website: www.bkacad.com

71

More

H c vi n m ng Bch Khoa - Website: www.bkacad.com

72

OSPF neighbor relationships progress through seven states:


not exchanged information

OSPF interfaces can be in one of seven states.

Send Hello packets to establish a relationship with neighbor routers.

There are 2 kinds of relationship

Each router keeps a list of adjacent neighbor, called the Adjacency databese.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 73

Steps in the operation of OSPF

OSPF routers progress through the following 5 distinct steps of operation: 1. Establish router adjacencies 2. Elect a DR and BDR, if necessary 3. Discover routes 4. Select the appropriate routes to use 5. Maintain routing information

H c vi n m ng Bch Khoa - Website: www.bkacad.com

74

1.Establish router adjacencies

H c vi n m ng Bch Khoa - Website: www.bkacad.com

75

2.Elect a DR and BDR, if necessary

H c vi n m ng Bch Khoa - Website: www.bkacad.com

76

3.Discover routes

H c vi n m ng Bch Khoa - Website: www.bkacad.com

77

4.Select the appropriate routes to use

H c vi n m ng Bch Khoa - Website: www.bkacad.com

78

5.Maintain Routing Information

2 3 1

H c vi n m ng Bch Khoa - Website: www.bkacad.com

79

More OSPF Configuration

H c vi n m ng Bch Khoa - Website: www.bkacad.com

80

Redistributing an OSPF Default Route

Router connected to ISP Called an autonomous system border router Used to propagate a default 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

H c vi n m ng Bch Khoa - Website: www.bkacad.com

81

Example default route

H c vi n m ng Bch Khoa - Website: www.bkacad.com

82

Example default route

H c vi n m ng Bch Khoa - Website: www.bkacad.com

83

Example default route

H c vi n m ng Bch Khoa - Website: www.bkacad.com

84

Example default route

H c vi n m ng Bch Khoa - Website: www.bkacad.com

85

Fine-Tuning OSPF

Since link speeds are getting faster it may


be necessary to change reference bandwidth values Do this using the auto-cost referencebandwidth command Example: R1(config-router)#auto-cost reference-bandwidth 10000

H c vi n m ng Bch Khoa - Website: www.bkacad.com

86

Fine-Tuning OSPF

H c vi n m ng Bch Khoa - Website: www.bkacad.com

87

Modifying OSPF timers

Reason to modify timers Faster detection of network failures Manually modifying Hello & Dead intervals Router(config-if)#ip ospf hellointerval seconds Router(config-if)#ip ospf deadinterval seconds Point to be made Hello & Dead intervals must be the same between neighbors
H c vi n m ng Bch Khoa - Website: www.bkacad.com 88

Configuring Simple OSPF authentication

The clear-text authentication Create a plain text password: Router(config-if)#ip ospf authentication-key {password} Enable authentication on all interfaces: Router(config-router)#area {area-number} authentication Or Enable authentication on an interface: Router(config-if)# ip ospf authentication
H c vi n m ng Bch Khoa - Website: www.bkacad.com 89

Configuring Simple OSPF authentication



The encrypted authentication Create a plain text password: Router(config-if)#ip ospf message-digest-key {keyid} md5 {password} Enable authentication on all interfaces: Router(config-router)#area {area-number} authentication message-digest Or Enable authentication on an interface: Router(config-if)# ip ospf authentication messagedigest Note: key-id and password must to match on all routers on the same link
H c vi n m ng Bch Khoa - Website: www.bkacad.com 90

Configuring Simple OSPF authentication

The encrypted authentication

H c vi n m ng Bch Khoa - Website: www.bkacad.com

91

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 migration process Select a method for injecting the required edge protocol routes into the core.
H c vi n m ng Bach Khoa - Website: www.bkacad.com 92

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 maptag] [subnets] [tag tag-value] Default metric is 20 or 1. Default metric type is 2. Subnets do not redistribute by default.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

93

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>

H c vi n m ng Bch Khoa - Website: www.bkacad.com

94

Configuring Redistribution into OSPF

H c vi n m ng Bch Khoa - Website: www.bkacad.com

95

Extra: E1-E2 routes

H c vi n m ng Bch Khoa - Website: www.bkacad.com

96

Extra: RIPv1 versus OSPF

H c vi n m ng Bch Khoa - Website: www.bkacad.com

97

Summary

H c vi n m ng Bch Khoa - Website: www.bkacad.com

98

H c vi n m ng Bch Khoa - Website: www.bkacad.com

99

Вам также может понравиться