You are on page 1of 71

Chapter 11 - OSPF

CCNA Exploration 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

Hc vin mng Bch Khoa - Website: www.bkacad.com

Introduction

Hc vin mng Bch Khoa - Website: www.bkacad.com

Introduction to OSPF
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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

Introduction to OSPF
OSPF Message Encapsulation OSPF packet type

There exist 5 types. Router ID.

OSPF packet header

Area ID. Type code(packet type).

IP packet header Source IP address. Destination IP address. Protocol field (set to 89 ).

Hc vin mng Bch Khoa - Website: www.bkacad.com

Introduction to OSPF
OSPF Message Encapsulation Data link frame header Source MAC address. Destination MAC address.

Hc vin mng Bch Khoa - Website: www.bkacad.com

OSPF Packet Types


OSPF PACKET TYPE 1: HELLO DESCRIPTION Discovers neighbors & builds ADJACENCY W/ NEIGHBORS Checks for database synchronization between routers REQUESTS SPECIFIC LINK STATE DATABASE information from router to router TRANSPORTS LINK STATE records ACKNOWLEDGES RECEIPT OF other packet types

2: DATABASE DESCRIPTION

3: LINK STATE REQUEST

4: LINK STATE UPDATE 5: LINK STATE ACKNOWLEDGEMENT

Hc vin mng Bch Khoa - Website: www.bkacad.com

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 designated router(DR) and a backup designated router(BDR).

Hc vin mng Bch Khoa - Website: www.bkacad.com

OSPF Hello Packet

Hc vin mng Bch Khoa - Website: www.bkacad.com

OSPF timers

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

10

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 DRs responsibilities if DR fails

Hc vin mng Bch Khoa - Website: www.bkacad.com

11

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

Hc vin mng Bch Khoa - Website: www.bkacad.com

12

Introduction to OSPF
OSPF Algorithm OSPF routers build & maintain link-state database containing LSA received from other routers Information found in database is utilized upon execution of Dijkstra SPF algorithm. SPF algorithm used to create SPF tree. SPF tree used to populate routing table.

Hc vin mng Bch Khoa - Website: www.bkacad.com

13

OSPF Administrative Distance

Default Administrative Distance for OSPF is 110

Hc vin mng Bch Khoa - Website: www.bkacad.com

14

Introduction to OSPF

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

Hc vin mng Bch Khoa - Website: www.bkacad.com

15

Basic OSPF configuration

Hc vin mng Bch Khoa - Website: www.bkacad.com

16

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

17

Addressing

Hc vin mng Bch Khoa - Website: www.bkacad.com

18

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

19

Basic OSPF Configuration

RA(config-router)#network network-address wildcardmask 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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

20

OSPF Router ID

Find Router ID

Hc vin mng Bch Khoa - Website: www.bkacad.com

21

Basic OSPF Configuration


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

Hc vin mng Bch Khoa - Website: www.bkacad.com

22

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

23

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

24

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

25

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

26

Verifying OSPF - Additional Commands

Command Show ip protocols

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 ospf
Show ip ospf interface

Hc vin mng Bch Khoa - Website: www.bkacad.com

27

Show ip protocols

Hc vin mng Bch Khoa - Website: www.bkacad.com

28

Show ip ospf

Hc vin mng Bch Khoa - Website: www.bkacad.com

29

Show ip ospf interface

Hc vin mng Bch Khoa - Website: www.bkacad.com

30

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

31

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

32

OSPF Metric

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

Hc vin mng Bch Khoa - Website: www.bkacad.com

33

OSPF Metric

Usually the actual speed of a link is different than the default 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 interfaces bandwidth Most serial link default to 1.544Mbps.

Hc vin mng Bch Khoa - Website: www.bkacad.com

34

Modify OSPF Cost value


Modifying the Cost of a link

Both sides of a serial link should be configured with the same 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

Hc vin mng Bch Khoa - Website: www.bkacad.com

35

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. Bandwidth command Link cost is calculated.

Hc vin mng Bch Khoa - Website: www.bkacad.com

36

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

37

OSPF in Multi-access Networks

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

Hc vin mng Bch Khoa - Website: www.bkacad.com

38

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

Hc vin mng Bch Khoa - Website: www.bkacad.com

39

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.
Hc vin mng Bch Khoa - Website: www.bkacad.com

40

OSPF in Multi-access Networks


DR/BDR Election Process DR/BDR elections DO NOT occur in point to point networks.

Hc vin mng Bch Khoa - Website: www.bkacad.com

41

OSPF in Multi-access Networks

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

Hc vin mng Bch Khoa - Website: www.bkacad.com

42

OSPF in Multi-access Networks

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

43

OSPF in Multi-access Networks

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 The DR fails. The OSPF process on the DR fails. The multiaccess interface on the DR fails.

Hc vin mng Bch Khoa - Website: www.bkacad.com

44

DR/BDR Election Refer to 11.4.2.3

Hc vin mng Bch Khoa - Website: www.bkacad.com

45

Hc vin mng Bch Khoa - Website: www.bkacad.com

46

Hc vin mng Bch Khoa - Website: www.bkacad.com

47

Hc vin mng Bch Khoa - Website: www.bkacad.com

48

Hc vin mng Bch Khoa - Website: www.bkacad.com

49

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

50

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

51

Redistributing an OSPF Default Route

Topology includes a link to ISP Router connected to ISP Called an Autonomous System Border Router(ASBR). 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
Hc vin mng Bch Khoa - Website: www.bkacad.com 52

Example default route

Hc vin mng Bch Khoa - Website: www.bkacad.com

53

Example default route

Hc vin mng Bch Khoa - Website: www.bkacad.com

54

Example default route

Hc vin mng Bch Khoa - Website: www.bkacad.com

55

Example default route

Hc vin mng Bch Khoa - Website: www.bkacad.com

56

Fine-Tuning OSPF

Since link speeds are getting faster it may be necessary to change reference bandwidth values Do this using the auto-cost reference-bandwidth (Mbps) command Example: R1(config-router)#autocost reference-bandwidth 10000

Hc vin mng Bch Khoa - Website: www.bkacad.com

57

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

58

Configuring OSPF authentication

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.
Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com

Configuring OSPF authentication




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.

Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com

Configuring OSPF authentication


To send encrypted authentication information and to ensure greater security, the message-digest keyword is used. The encryption type field refers to the type of encryption, where 0 means none and 7 means proprietary. Router(config-if)#ip ospf message-digest-key key-id md5 encryption-type key The key-id is an identifier and takes the value in the range of 1 through 255. The key is an alphanumeric password up to sixteen characters. Neighbor routers must use the same key identifier with the same key value.

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

Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com

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.
Hc vin mng Bach Khoa - Website: www.bkacad.com 62

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.

Hc vin mng Bch Khoa - Website: www.bkacad.com

63

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>

Hc vin mng Bch Khoa - Website: www.bkacad.com

64

Configuring Redistribution into OSPF

Hc vin mng Bch Khoa - Website: www.bkacad.com

65

Summary

RFC 2328 describes OSPF link state concepts and operations OSPF Characteristics A commonly deployed link state routing protocol Employs DRs & BDRs on multi-access networks DRs & BDRs are elected DR & BDRs are used to transmit and receive LSAs Uses 5 packet types: 1: HELLO 2: DATABASE DESCRIPTION 3: LINK STATE REQUEST 4: LINK STATE UPDATE 5: LINK STATE ACKNOWLEDGEMENT
Hc vin mng Bch Khoa - Website: www.bkacad.com 66

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

Hc vin mng Bch Khoa - Website: www.bkacad.com

67

Summary

Verifying OSPF configuration Use the following commands show ip protocol show ip route show ip ospf interface show ip ospf neighbor

Hc vin mng Bch Khoa - Website: www.bkacad.com

68

Hc vin mng Bch Khoa - Website: www.bkacad.com

69

Hc vin mng Bch Khoa - Website: www.bkacad.com

70

Hc vin mng Bch Khoa - Website: www.bkacad.com

71

You might also like