Sie sind auf Seite 1von 52

OSPF

(Open Shortest Path First Protocol)

Kevin Chi kevinchi@cisco.com Cisco Systems.


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

Agenda

OSPF Overview OSPF Terminology OSPF Operation Multiple OSPF Area

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

A day in a life of a router

- Find path - Forward packet, forward packet, forward packet, forward packet... - Find alternate path - Forward packet, forward packet, forward packet, forward packet - Repeat until powered off

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

Routing versus Forwarding

Routing = building maps and giving directions Forwarding = moving packets between interfaces according to the directions

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

IP Routing - finding the path

Path derived from information received from a routing protocol Several alternative paths may exist
best next hop stored in forwarding table

Decisions are updated periodically or as topology changes (event driven) Decisions are based on:
topology, policies and metrics (hop count, filtering, delay, bandwidth, etc.)
RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

IP Routing Learns Destinations

Static routes Default routes Dynamic routing

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Static Routes

Routes configured manually Useful when few or just one route exist Can be administrative burden Frequently used for default route

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

Default Routes Route used if no match is found in forwarding table Can be carried by routing protocols Two models
Special network number:
0.0.0.0 (IP)

Flagged in routing protocol


RIP, RIPv2 : network 0.0.0.0 IGRP, EIGRP : ip default-network OSPF,ISIS : default originate
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Dynamic Routing - Routing Protocol Goals


Optimal path selection Loop-free routing Fast convergence Limited design administration Minimize update traffic Handle address limitations Support hierarchical topology Incorporate rapid convergence
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

Easy to configure Adapts to changes easily and quickly Does not create a lot of traffic Scales to a large size Compatible with existing hosts and routers Supports variable length subnet masks and discontiguous subnets Supports policy routing
9

Internet Routing Protocols


IP routing protocols are characterized as
Name RIP RIPv2 IGRP EIGRP OSPF IS-IS BGP
RST-1001 8118_05_2003_c2

Type DV DV DV Adv DV LS LS Path Vec

Proprietary Function Updates Metric No No Yes Yes No No No Interior Interior Interior Interior Interior Interior Exterior 30 Sec 30 Sec 90 Sec Trig Trig Trig Incr Hops Hops Comp Comp Cost Cost N/A

VLSM No Yes No Yes Yes Yes Yes

Summ Auto Auto Auto Both Man Auto Auto


10

2003, Cisco Systems, Inc. All rights reserved.

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

IP RIP
Routing Information Protocol Widely available Hop count metric Periodic update Easy to implement One of the first available
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

RFC 1058 Simple = limited Slow convergence No VLSM No discontiguous subnets Max 15 Hops

11

Distance Vector
A A B B C C C D D D

Routing Update

Routing Table

Routing Table Update Interval

Routing Table

Routing Table

Update Interval

Update Interval

Scalability concerns: Convergence Update traffic Metric limitations


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

12

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

RIP Metric
Host A sends traffic to Host B

1 Hop Path I R2

Hops

T1 R1
Host A

T1 56k R3

Path II 0 Hops
Host B
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

13

Discontiguous IP Subnet
A
Where Is 172.16.0.0? 192.168.1.4 255.255.255.252 .5 .13 172.16.50.1 172 255.255.255.0

B
172.16.40.1 172.16 255.255.255.0

.6 .9 192.168.1.8 255.255.255.252 .14 .10 172.16.60.1 255.255.255.0 192.168.1.12 255.255.255.252

Routing Protocols will by Default Summarize Major Networks


RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

14

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

VLSM : Variable Length Subnet Mask


A
172.16.1.4 255.255.255.252 .5 .13 172.16.50.1 255.255.255.0

B
172.16.40.1 255.255.255.0 172.16.1.X With a 255.255.255.252 mask Or /30 the 1 subnet my be broken into 64 Subnets

.6 .9 172.16.1.8 255.255.255.252 .14 .10 172.16.60.1 255.255.255.0 172.16.1.12 255.255.255.252

Conserve IP Addresses
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

15

Administrative Distance
The router treats different routing protocols with a different preference

Route Source Connected Interface Static Route Enhanced IGRP Summary Route External BGP Internal Enhanced IGRP IGRP OSPF IS-IS RIP EGP External Enhanced IGRP Internal BGP Unknown, Discard Route
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

Default Distance 0 1 5 20 90 100 110 115 120 140 170 200 255
16

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

OSPF

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

17

OSPF
Open Shortest Path First Link state or SPF technology Developed by OSPF working group of IETF (RFC 1247) Designed for TCP/IP Internet environment Fast convergence
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

Variable-length subnet masks Discontiguous subnets No periodic updates Route authentication Delivered two years after IGRP OSPF standard described in RFC2328
18

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Link State

Zs Link State Qs Link State Z


A B C Q Z X 2 13 13

X Xs Link State
RST-1001 8118_05_2003_c2

Topology Information Is Kept in a Database Separate from the Routing Table


19

2003, Cisco Systems, Inc. All rights reserved.

Link-State
B

1
A C D C D

Topological Database

Link-State Advertisements

Routing Table

5
SPF Algorithm

3
Shortest Path First Tree

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

20

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Why Is It Called a Link State Protocol?


Traditional Distance Vector Routing Protocols (DVRP) relay information regarding their relative distance to a destination Link State Protocols relay specific link characteristics and state information Only changes or updates are sent across the network Each router uses that information to build a routing table on its own
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

21

Link-State vs. Distance Vector Protocols

Link-State router tells ALL other routers about ONLY its neighbors and links Distance Vector router tells ONLY neighbors about ALL routes

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

22

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

What Is a Link State Protocol ?


The network can be viewed as a jigsaw puzzle Each piece of the puzzle holds one router Each router creates a Link State Packet (LSP) which represents its own jigsaw piece LSPs are flooded reliably within the network The LSPs are collected by each router to form a Link State Database (LSDB) or complete picture of the network Use Shortest Path First (SPF) algorithm to put the pieces together
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

23

Link State Protocols


to A LSP A to B to E to C to E to A to B to D to B LSP B

to A

LSP E to D to C

to C LSP C to D

LSP D

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

24

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

All Routers Have the Same View


All routers exchange all LSPs
Via a reliable flooding mechanism

All routers store all LSPs in a link-state database (LSDB)


Separate from the routing table (RIB) All routers should have exactly the same LSDB, but different RIBs

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

25

All Routers Have the Same LSDB


Router A - LSDB
LSPA LSPB

Router B - LSDB
LSPA LSPB

LSPE LSPC LSPD

Router E - LSDB
LSPA LSPB LSPC LSPE LSPE LSPD

Router C - LSDB
LSPA LSPB

LSPC

LSPD

Router D - LSDB
LSPA LSPB

LSPE LSPC
RST-1001 8118_05_2003_c2

LSPE LSPD LSPC LSPD


26

2003, Cisco Systems, Inc. All rights reserved.

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Link State Routing Neighbour discovery Constructing an LSP Distribute LSP Compute routes On network failure
New LSPs flooded All routers recompute routing tables
RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

27

What To Do With LSPs?


Each router calculates a topology map by executing Dijkstras Shortest Path First algorithm (SPF)
the topology is calculated as a Shortest Path Tree (SPT), with itself as root each router computes a different Shortest Path Tree (SPT)

From the SPT the RIBs are calculated


RIB : Routing Information Base
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

28

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Dijkstra
Shortest Path First (SPF) Algorithm

Dijkstra is a path finding algorithm Will find the shortest path from A to B given intermediate path and cost information One of many path finding algorithms:
Dijkstra, best path, A*, etc

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

29

Dijkstras algorithm

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

30

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Dijkstra
Shortest Path First (SPF) Algorithm

Link state database


Created with link state packets (LSPs) from each router

TENT database
Tentative triples (ID, path cost, direction)

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

31

Dijkstra (SPF) Overview

PATH database
Best path triples (ID, path cost, direction)

Forwarding database
Aka the routing table

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

32

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Dijkstra (SPF) Overview (Cont.)


All routers exchange Link State Packets (LSPs) Each starts with itself as root Tent is built from LSPs Path is created by examining and comparing tent triples Once path is final the forwarding table is populated

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

33

Dijkstra Basics
C

4
D

1 2

1
E

Router IDs are alphabetic Costs are numeric Lowest cost best
RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

34

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

LSP Data
A B/4 G/2 B A/4 C/1 C B/1 D/4 E/2 D C/4 E/1 E C/2 D/1 F/2 F E/2 G/2 G A/2 F/2

4
D

1 2

1
E

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

35

Dijkstra Example1/7
B (0) C (1)
A B/4 G/2 B A/4 C/1 C B/1 D/4 B/1 E/2 D C/4 E/1 E C/2 D/1 F/2 F E/2 G/2

A (4)
G A/2 F/2

As an example start with B A and C costs are tent


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

36

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Dijkstra Example2/7
B (0) C (1) D (5) E (3) A (4)

Now fill in C D,E are in tent BC is now in path


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

A B/4 G/2

B A/4 C/1

C B/1 D/4 E/2

D C/4 E/1

E C/2 D/1 F/2

F E/2 G/2

G A/2 F/2

37

Dijkstra Example3/7
B (0) C (1) D (5),(4) E (3) F (5) A (4)

Now fill in C D,E are in tent BC is now in path


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

A B/4 G/2

B A/4 C/1

C B/1 D/4 E/2

D C/4 E/1

E C/2 D/1 F/2

F E/2 G/2

G A/2 F/2

38

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Dijkstra Example4/7
B (0) C (1) D (5),(4) E (3) F (5) G (6) A (4)

Now fill in A G is in tent BA is now in path


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

A B/4 G/2

B A/4 C/1

C B/1 D/4 E/2

D C/4 E/1

E C/2 D/1 F/2

F E/2 G/2

G A/2 F/2

39

Dijkstra Example5/7
B (0) C (1) D (4) E (3) F (5) G (6) A (4)

CD is removed ED is placed in path

A B/4 G/2

B A/4 C/1

C B/1 D/4 E/2

D C/4 E/1

E C/2 D/1 F/2

F E/2 G/2

G A/2 F/2

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

40

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Dijkstra Example6/7
B (0) C (1) D (4) E (3) F (5),(8) G (6) A (4)

Now fill in F G is Tent GF does not provide better path EF is in path


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

A B/4 G/2

B A/4 C/1

C B/1 D/4 E/2

D C/4 E/1

E C/2 D/1 F/2

F E/2 G/2

G A/2 F/2

41

Dijkstra Example7/7
B (0) C (1) D (4) E (3) F (5) G (6) A (4)

Now fill in G FG is removed AG is in path


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

A B/4 G/2

B A/4 C/1

C B/1 D/4 E/2

D C/4 E/1

E C/2 D/1 F/2

F E/2 G/2

G A/2 F/2

42

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

OSPF Terminology
Autonomous System

Neighbors
Interfaces

Area 1
Cost = 1785
Neighborship Database Lists Neighbors
RST-1001 8118_05_2003_c2

Cost = 10
Token Ring

Area 0
Cost = 6

Topology Database Lists All Routes

Routing Table Lists Best Routes

2003, Cisco Systems, Inc. All rights reserved.

43

OSPF Topologies

Broadcast Multiaccess

Point-to-Point

NBMA

X.25
Frame Relay

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

44

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Optimal Path Utilisation


The optimal path is determined by the sum of the interface costs: Cost = 10^8/BW
Cost = 1 N2
FDDI Dual Ring

Cost = 1
FDDI Dual Ring

N3

R2 R3 N1 R1 R4 N5 Cost = 10

RST-1001 8118_05_2003_c2

N4
2003, Cisco Systems, Inc. All rights reserved.

Cost = 10
45

Fast Convergence
Detection Plus LSA/SPF
R2 Alternate Path

N1 R1

X
Primary Path

N2 R3

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

46

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Fast Convergence

Finding a new route


LSA flooded throughout area Acknowledgement based Topology database synchronised Each router derives routing table to destination networks
N1 R1

LSA

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

47

Low Bandwidth Utilisation


FDDI Dual Ring

LSA

X
LSA

R1

Only changes propagated Multicast on multi-access broadcast networks


LSA : Link State Advertisement
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

48

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Utilises IP Multicast for Sending/Receiving Updates

Broadcast networks
DR and BDR > AllSPFRouters (224.0.0.5) All other routers > AllDRRouters (224.0.0.6)

Hello packets sent to AllSPFRouters (Unicast on point-to-point and virtual links)

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

49

OSPF Areas

Group of contiguous hosts and networks Per area topological database


Invisible outside the area Reduction in routing traffic
Area 0 Backbone Area

Area 2

Area 3

Backbone area contiguous


All other areas must be connected to the backbone

Virtual Links
RST-1001 8118_05_2003_c2

Area 1 Area 4

2003, Cisco Systems, Inc. All rights reserved.

50

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Classification of Routers

IR
Area 2 Area 3

ABR /BR
Area 0

IR /BR Internal Router (IR) ASBR


To other AS Area 1

Area Border Router (ABR) Backbone Router (BR) Autonomous System Border Router (ASBR)
51

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

OSPF Route Types

Area 2

Area 0

Area 3

ABR

Intra-area Route O
ASBR
To other AS

all routes inside an area

Inter-area Route O IA
routes advertised from one area to another by an Area Border Router

External Route O E1 or O E2
routes imported into OSPF from other protocol or static routes
RST-1001 8118_05_2003_c2 52

2003, Cisco Systems, Inc. All rights reserved.

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Inter-Area Route Summarisation

Prefix or all subnets Prefix or all networks Area range command


With summarisation Network 1 Next Hop R1 Next Hop R1 R1 R1 R2

FDDI Dual Ring

Backbone Area 0

R1 (ABR) Area 1

Without Network summarisation 1.A 1.B 1.C


RST-1001 8118_05_2003_c2

1.A

1.B

1.C

2003, Cisco Systems, Inc. All rights reserved.

53

External Routes

Redistributed into OSPF Flooded unaltered throughout the AS OSPF supports two types of external metrics
Type 1 external metrics Type 2 external metrics (Default)

OSPF Redistribute
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

RIP IGRP EIGRP BGP etc.


54

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

External Routes
Type 1 external metric: metrics are added to the summarised internal link cost
to N1 External Cost = 1 R1 Cost = 10 R2 Cost = 8 R3
Network N1 N1
RST-1001 8118_05_2003_c2

to N1 External Cost = 2

Type 1 11 10

Next Hop R2 R3

Selected Route
55

2003, Cisco Systems, Inc. All rights reserved.

External Routes
Type 2 external metric: metrics are compared without adding to the internal link cost
to N1 External Cost = 1 R1 Cost = 10 R2 Cost = 8 R3
Network N1 N1
RST-1001 8118_05_2003_c2

to N1 External Cost = 2

Type 2 1 2

Next Hop R2 R3

Selected Route

2003, Cisco Systems, Inc. All rights reserved.

56

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Topology/Link State Database

A router has a separate LS database for each area to which it belongs All routers belonging to the same area have identical database SPF calculation is performed separately for each area LSA flooding is bounded by area

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

57

Protocol Functionality

Bringing up adjacencies LSA types Area classification

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

58

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

The Hello Protocol

Responsible for establishing and maintaining neighbour relationships Elects designated router on multi-access networks

Hello

FDDI Dual Ring Hello Hello

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

59

Neighborship
D E

Hello

afadjfjorqpoeru 39547439070713

Hello

Router ID Hello/dead intervals Neighbors Area-ID Router priority DR IP address BDR IP address Authentication password Stub area flag

*
60

* Entry must match on neighboring routers


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Neighborship (cont.)
D E

Hello

afadjfjorqpoeru 39547439070713

Hello

Router ID Hello/dead intervals Neighbors Area-ID Router priority DR IP address BDR IP address Authentication password Stub area flag

*
61

* Entry must match on neighboring routers


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

DR and BDR

DR

BDR

Hellos elect DR and BDR to represent segment Each router then forms adjacency with DR and BDR
RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

62

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Designated Router
One per multi-access network
Generates network links advertisements Assists in database synchronization
Designated Router Backup Designated Router

Designated Router
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

Backup Designated Router


63

Designated Router by Priority


Configured priority (per interface) Else determined by highest router ID
Router ID is the loopback interface address, if configured, otherwise the highest IP address

131.108.3.2 DR R1 Router ID = 144.254.3.5 144.254.3.5


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

131.108.3.3

R2 Router ID = 131.108.3.3

64

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

When to Become Adjacent

Underlying network is point to point Underlying network type is virtual link The router itself is the designated router The router itself is the backup designated router The neighbouring router is the designated router The neighbouring router is the backup designated router

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

65

Building the Adjacency


1- Down: No information has been received from anybody on the segment. 2- Init: The interface has detected a Hello packet coming from a neighbor but bi-directional communication has not yet been established. 3- Two-way: There is bi-directional communication with a neighbor. The router has seen itself in the Hello packets coming from a neighbor. At the end of this stage the DR and BDR election would have been done. At the end of the 2way stage, routers will decide whether to proceed in building an adjacency or not. The decision is based on whether one of the routers is a DR or BDR or the link is a point-to-point or a virtual link. 4- Exstart: Routers are trying to establish the initial sequence number that is going to be used in the information exchange packets. The sequence number insures that routers always get the most recent information. One router will become the primary and the other will become secondary. The primary router will poll the secondary for information. 5- Exchange: Routers will describe their entire link-state database by sending database description packets. At this state, packets could be flooded to other interfaces on the router. 6- Loading: At this state, routers are finalizing the information exchange. Routers have built a link-state request list and a link-state retransmission list. Any information that looks incomplete or outdated will be put on the request list. Any update that is sent will be put on the retransmission list until it gets acknowledged. 7- Full: At this state, the adjacency is complete. The neighboring routers are fully adjacent. Adjacent routers will have a similar link-state database.
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

66

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Neighbor and Adjacency


RTD# show ip ospf interface e 0 Ethernet0 is up, line protocol is up Internet Address 203.250.14.4 255.255.255.0, Area 0.0.0.0 Process ID 10, Router ID 192.208.10.174, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DROTHER, Priority 1 Designated Router (ID) 203.250.15.1, Interface address 203.250.14.2 Backup Designated router (ID) 203.250.13.41, Interface address 203.250.14.1 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 0:00:03 Neighbor Count is 3, Adjacent neighbor count is 2 Adjacent with neighbor 203.250.15.1 (Designated Router) Adjacent with neighbor 203.250.13.41 (Backup Designated Router) RTD# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 203.250.12.1 1 2WAY/DROTHER 0:00:37 203.250.14.3 Ethernet0 203.250.15.1 1 FULL/DR 0:00:36 203.250.14.2 Ethernet0 203.250.13.41 1 FULL/BDR 0:00:34 203.250.14.1 Ethernet0
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

67

Routing Protocol Packets


Share a common protocol header Routing protocol packets are sent with type of service (TOS) of 0 Five types of OSPF routing protocol packets
Hello - packet type 1 Database description - packet type 2 Link-state request - packet type 3 Link-state update - packet type 4 Link-state acknowledgement - packet type 5

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

68

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Different Types of LSAs

Five distinct type of LSAs


Type 1 : Type 2 : Type 3 and 4: Type 5 and 7: Router LSA Network LSA Summary LSA External LSA

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

69

Router LSA (Type 1)

Describes the state and cost of the routers links to the area All of the routers links in an area must be described in a single LSA Flooded throughout the particular area and no more Router indicates whether it is an ASBR, ABR, or end point of virtual link
RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

70

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Network LSA (Type 2)

Generated for every transit broadcast and NBMA network Describes all the routers attached to the network Only the designated router originates this LSA Flooded throughout the area and no more
NBMA : Non-Broadcast Multi-Access
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

71

Summary LSA (Type 3 and 4)

Describes the destination outside the area but still in the AS Flooded throughout a single area Originated by an ABR Only intra-area routes are advertised into the backbone Type 4 is the information about the ASBR

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

72

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

External LSA (Type 5)

Defines routes to destination external to the AS Default route is also sent as external Two types of external LSA:
E1: Consider the total cost up to the external destination E2: Considers only the cost of the outgoing interface to the external destination
RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

73

Not Summarised: Specific Links


Specific link LSA advertised out Link state changes propagate out

ASBR

External links

1.A 1.B 1.C 1.D

Backbone Area #0

3.A 3.B 3.C 3.D

2.A 2.B 2.C 1.B


Token Ring

1.A
Token Ring

3.B

3.A
Token Ring Token Ring

2.B
Token Ring

Token Ring

1.C

1.D

3.C 2.A 2.C

3.D

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

74

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Not Summarised: Specific Links


Specific link LSA advertised in Link state changes propagate in
ASBR External links
1.A 1.B 1.C 1.D 2.A 2.B 2.C

2.A 2.B 2.C 3.A 3.B 3.C 3.D

Backbone 1.A Area #0


1.B 1.C 1.D 3.A 3.B 3.C 3.D

1.B
Token Ring

1.A
Token Ring

3.B

3.A
Token Ring Token Ring

2.B
Token Ring

Token Ring

1.C

1.D

3.C 2.A 2.C

3.D

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

75

Summarised: Summary Links


Only summary LSA advertised out Link state changes do not propagate

External links ASBR

Backbone Area #0

1 2
1.B
Token Ring

1.A
Token Ring

3.B 2.B
Token Ring Token Ring

3.A
Token Ring Token Ring

1.C

1.D

2.A

3.C

3.D

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

76

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Summarised: Summary Links


Only summary LSA advertised in Link state changes do not propagate

External links ASBR

Backbone Area #0

2,3 1,3
1.B
Token Ring

1,2

1.A
Token Ring

3.B 2.B
Token Ring Token Ring

3.A
Token Ring Token Ring

3.D 3.C

1.C

1.D

2.A

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

77

Addressing

Area 0 network 192.117.49.0 range 255.255.255.0

Area 1 network 131.108.0.0 subnets 17-31 range 255.255.240.0

Area 2 network 131.108.0.0 subnets 33-47 range 255.255.240.0

Area 3 network 131.108.0.0 subnets 49-63 range 255.255.240.0

Assign contiguous ranges of subnets per area to facilitate summarisation


RST-1001 8118_05_2003_c2 78

2003, Cisco Systems, Inc. All rights reserved.

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Regular Area
From area 1s viewpoint Summary networks from other areas injected External networks injected, for example network X.1
External Networks

ASBR

X.1

2,3 1,3
1.B
Token Ring

1,2

1.A X.1 1.C


Token Ring

3.B 2.B 1.D X.1


Token Ring Token Ring

3.A X.1
Token Ring

2.A 2.D

Token Ring

3.D 3.C

2.C
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

79

Normal Stub Area


From area 1s viewpoint Summary networks from other areas injected Default network injected into the area - represents external links Default path to closest area border router Define all routers in the area as stub area x stub command
2,3 &
External Networks

ASBR

X.1

Default
1,3

1,2

1.B
Token Ring

1.A X.1 1.C


Token Ring

3.B 2.B 1.D X.1


Token Ring Token Ring

3.A X.1
Token Ring

2.A 2.D

Token Ring

3.D 3.C

2.C
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

80

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Totally Stubby Area


From area 1s viewpoint Only a default network is injected into the area
Represents external networks and all inter-area routes

Default path to closest area border router Define all routers in the area as totally stubby
area x stub no-summary command 2,Default 3 & Default 1,3
1.B
Token Ring

External Networks

ASBR

X.1

1,2

1.A X.1 1.C


Token Ring

3.B 2.B 1.D X.1


Token Ring Token Ring

3.A X.1
Token Ring

2.A 2.D

Token Ring

3.D 3.C

2.C
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

81

Not-So-Stubby Area
Capable of importing external routes in a limited fashion Type-7 LSAs carry external information within an NSSA NSSA Border routers translate selected type-7 LSAs into type-5 external network LSAs
External Networks

Default
1,3
1.B External Networks X.2
Token Ring

ASBR

X.1

1,2

1.A X.1 1.C


Token Ring

3.B 2.B 1.D


Token Ring Token Ring

3.A
Token Ring Token Ring

2.A 2.D

X1, X2 3.D X.1


3.C

X.1 2.CX1, X2
82

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Virtual Links

Area 0.0.0.0

Area 0.0.0.1 Area 0.0.0.4

Virtual Link Virtual Link

RST-1001 8118_05_2003_c2

Area 0.0.0.6
2003, Cisco Systems, Inc. All rights reserved.

Area 0.0.0.3

Area 0.0.0.5
83

Virtual Links
Router A

Area 3
Virtual Link

X
Router B

X
Area 0
Virtual Link

Area 2

Router A (RID 171.0.1.7) router ospf 100 area 2 virtual-link 171.0.1.5 Router B (RID 171.0.1.5) router ospf 100 area 2 virtual-link 171.0.1.7
RST-1001 8118_05_2003_c2

Area 1
2003, Cisco Systems, Inc. All rights reserved.

84

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Summary

Scalable OSPF Network Design


Area hierarchy Stub areas Contiguous addressing Route summarisation

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

85

Reference Commands

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

86

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

OSPF - Adding Networks (Method One)

redistribute connected subnets


Works for all connected interfaces on the router but sends networks as external type-2s which are not summarized
router ospf 100 redistribute connected subnets

Not recommended

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

87

OSPF - Adding Networks

Specific network statements


Every interface needs a OSPF network statement. Interface that should not be broadcasting OSPF Hello packets needs passive-interface.
router ospf 100 network 192.168.1.4 0.0.0.3 area 51 network 192.168.1.6 0.0.0.3 area 51 passive interface Serial 1/0
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

88

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

OSPF - Adding Networks

Network statements - wildcard mask


Every interface covered by wildcard mask used in OSPF network statement. Interfaces that should not be broadcasting OSPF Hello packets need passive-interface or default passive-interface.
router ospf 100 network 192.168.1.0 0.0.0.255 area 51 default passive-interface default no passive interface POS 4/0
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

89

OSPF - Adding Networks


Key Theme when selecting a technique: Keep the Link State Database Lean
Increases Stability Reduces the amount of information in the Link State Advertisements (LSAs) Speeds Convergence Time

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

90

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

OSPF Logging Neighbour Changes

The router will generate a log message whenever an OSPF neighbour changes state Syntax:
[no] ospf log-adjacency-changes log- adjacency-

Example of a typical log message:


%OSPF-5-ADJCHG: Process 1, Nbr 223.127.255.223 on %OSPFEthernet0 from LOADING to FULL, Loading Done

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

91

Number of State Changes

The number of state transitions is available via SNMP (ospfNbrEvents) and the CLI:
show ip ospf neighbor [type number] [neighbor-id] [detail] [neighborDetail(Optional) Displays all neighbours given in detail (list all neighbours). When specified, neighbour state transition counters are displayed per interface or neighbour ID

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

92

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

State Changes (Continued)

To reset OSPF-related statistics, use the clear ip ospf counters EXEC command. At this point neighbor is the only available option; it will reset neighbour state transition counters per interface or neighbour id
clear ip ospf counters [neighbor [<type number>] [neighbor-id]] [neighbor-

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

93

OSPF Router ID
If the loopback interface exists and has an IP address, that is used as the router ID in routing protocols - stability! If the loopback interface does not exist, or has no IP address, the router ID is the highest IP address configured - danger! New sub command to manually set the OSPF Router ID: router-id <ip address>

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

94

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

OSPF Clear/Restart
clear ip ospf [pid] redistribution
This command can now clear redistribution based on OSPF routing process ID. If no pid is given, it assumes all OSPF processes.

clear ip ospf [pid] counters


This command can now clear counters based on OSPF routing process ID. If no pid is given, it assumes all OSPF processes.

clear ip ospf [pid] process


This command will restart the specified OSPF process. If no pid is given, it assumes all OSPF processes. It attempts to keep the old router-id, except in cases, where a new router-id was configured, or an old user configured router-id was removed. Since this command can potentially cause a network churn, a user confirmation is required before performing any action.

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

95

Redistributing Routes into OSPF

ROUTER OSPF <pid#x> REDISTRIBUTE {protocol} <as#y> <metric> <metric-type (1 or 2) <tag> <subnets>

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

96

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Router Sub-commands

NETWORK <n.n.n.n> <mask> AREA <area-id> AREA <area-id> STUB {no-summary} AREA <area-id> AUTHENTICATION AREA <area-id> VIRTUAL-LINK <router-id>... AREA <area-id> RANGE <address mask>

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

97

Interface Subcommands

IP OSPF COST <cost> IP OSPF PRIORITY <8-bit-number> IP OSPF HELLO-INTERVAL <number-of-seconds> IP OSPF DEAD-INTERVAL <number-of-seconds> IP OSPF AUTHENTICATION-KEY <8-bytes-of-password>

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

98

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Verifying OSPF Operation


Router#

show ip protocols

Verifies that OSPF is configured


Router#

show ip route

Displays all the routes learned by the router


Router#

show ip ospf interface

Displays area ID and adjacency information


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

99

Verifying OSPF Operation (cont.)


Router#

show ip ospf

Displays OSPF timers and statistics


Router#

show ip ospf neighbor detail

Displays information about DR, BDR, and neighbors


Router#

show ip ospf database

Displays the link-state database


RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

100

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Verifying OSPF Operation (cont.)

Router#

clear ip route *

Allows you to clear the IP routing table


Router#

debug ip ospf option

Displays router interaction during the hello, exchange, and flooding processes
RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

101

Configuring OSPF ABRs


Area 0 A
E0 10.64.0.2 10.64.0.1 E0

ABR B
S0 10.2.1.2

Area 1
10. 2.1.1 S1

<Output Omitted> interface Ethernet0 ip address 10.64.0.1 255.255.255.0 ! <Output Omitted>


router ospf 77 network 10.0.0.0 0.255.255.255 area 0

<Output Omitted> interface Ethernet0 ip address 10.64.0.2 255.255.255.0 ! interface Serial0 ip address 10.2.1.2 255.255.255.0 <Output Omitted> router ospf 50 network 10.2.1.2 0.0.0.0 area 1 network 10.64.0.2 0.0.0.0 area 0

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

102

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

OSPF Stub Area Configuration Example


External AS
192.168.14.1 E0
R3

192.168.15.1 S0 192.168.15.2 S0
R4

Area 0

Stub Area 2
R3# R4# interface Ethernet 0 ip address 192.168.14.1 255.255.255.0 interface Serial 0 ip address 192.168.15.1 255.255.255.252 router ospf 100 network 192.168.14.0 0.0.0.255 area 0 network 192.168.15.0 0.0.0.255 area 2 area 2 stub
RST-1001 8118_05_2003_c2
2003, Cisco Systems, Inc. All rights reserved.

interface Serial 0 ip address 192.168.15.2 255.255.255.252 router ospf 15 network 192.168.15.0 0.0.0.255 area 2 area 2 stub

103

RST-1001 8118_05_2003_c2

2003, Cisco Systems, Inc. All rights reserved.

104

Copyright 2000, Cisco Systems, Inc. All rights reserved. Printed in USA. Presentation_ID.scr

Das könnte Ihnen auch gefallen