Vous êtes sur la page 1sur 46

Open Shortest Path First OSPF

Iskra Djonova-Popova

Limitations of RIP
Limit of 15 hops Class based protocol Overhead over the links? Slow convergence Metric Protocol for flat networks
OSPF Iskra Dj. Popova 2

5th CEENet Workshop Budapest, 1999

The Response is OSPF


Link state or SPF technology Developed by OSPF Working Group of IETF (not proprietary) Designed for TCP/IP Internet environment Documented in rfc 1583, rfc 2178

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

OSPF Solutions
No limitation on hop count Supports classless routing Routing updates sent only when only when there is a change Faster convergence then RIP Better load balancing Logical definition of areas Authentication and external routes tagging
5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 4

OSPF - Link State Protocol


Link

an interface on the router


description of the interface and the neighboring routers
IP address, mask, type, routers connected to

Link state

Link state database

collection of link state advertisement for all routers and networks


OSPF Iskra Dj. Popova 5

5th CEENet Workshop Budapest, 1999

How OSPF Works?


Each router generates link-state advertisements for its links When no OSPF areas are configured, linkstate advertisements are flooded to all routers It is crucial that all routers have identical link state database Shortest path three is calculated by all routers and routing tables are derived
5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 6

Link State Advertisement (LSA)


Generated periodically or in response to any change Contains:

source identification sequence number link state age list of neighbors


OSPF Iskra Dj. Popova 7

5th CEENet Workshop Budapest, 1999

A Simplified Link State Database Example From To Link Cost


A c 1
D e 2 a 1 d E

B 2

f 1

Link State Announcement (LSA) From A to B, Link 1, Cost = 1, Ls seq. Num. = 2


5th CEENet Workshop Budapest, 1999 OSPF

A A B B B C C D D E E E

B D A C E B E A E B C D
Iskra Dj. Popova

a c a b e b f c e d d e

1 1 1 3 2 3 1 1 2 2 2 2
8

LS seq. num . 2 2 2 1 2 1 1 2 1 2 1 1

In Case of a Link Failure


A 1 D e 2 a 1 d E B 2 f 1 b 3

A and B send the C information to all other nodes about state of link a and the connectivity is reestablished.

In the case when network is segmented the link state database in both parts are different.
5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 9

Segmented Network
A a 1 B b 3 C

1
D e 2

d
E

2 f 1

If b breaks, A and D will not receive this LSA and their database will be different than the one of B, C and E.

When e comes up the Ds has to become synchronized. This process is called bringing up adjacency.
5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 10

Bringing up Adjacency
Synchronizing databases via comparison of sequence numbers 3 Interesting records - the sequence numbers are different or not present in database Client-server relationship is established first

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

11

The Flooding Protocol


Used to securely deliver LSAs

Every node sends the LSA on every link except the one from where it received it Very fast and very reliable, but wastes bandwidth Messages sent only when there is a change or every 45 minutes

Each node compares the newly received LSA with the entry in the data base. If it is newer the database is updated
OSPF Iskra Dj. Popova 12

5th CEENet Workshop Budapest, 1999

Securing the Map Updates


Flooding procedure includes hop-by-hop acknowledgments Database description packets are transmitted in a secure fashion Each link state record is protected by a timer and is removed from the database if a refreshing packet does not arrive in due time All records are protected by checksum Messages can be authenticated, e. g. by passwords

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

13

Authenticated Routing Updates


Two possibilities are defined

no authentication (configured by default) authentication


simple password authentication message digest authentication

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

14

More Routers on One Network


N routers on the same network (broadcast or non-broadcast)

N(N-2)/2 LSA will be needed to transmit information about the same network too much overhead

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

15

Designated Router (DR)


Selected among more routers on the same network

All routers in the network become adjacent to DR

selection based on the priority assigned by the network administrator for security reason backup designated router (BDR) is also selected

DR updates all the neighbors


5th CEENet Workshop Budapest, 1999 OSPF

exchange routing information with DR via multicast


Iskra Dj. Popova

16

The Metrics in OSPF


formula: cost = 108 /bandwidth in bps
56 Kbps serial link 64 Kbps serial link T1 (1.544 Mbps seral link) E1 (2.048 Mbps serial link) 4 Mbps token ring Ethernet 16 Mbps token ring FDDI
5th CEENet Workshop Budapest, 1999 OSPF

1758 1562 65 48 25 10 6 1
Iskra Dj. Popova 17

External Routes
One router to external word
only advertise default route

Several routers to outside world


pick one that is closest pick one that carry data more efficiently

Two types of metrics can be used


type1 - the same as internal metrics type 2 - keeps the external costs

External routes are added to the database as gateway link state records
5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 18

Shortest Path Algorithm


Places the router at the root of the tree In each iteration adds the router that is closest to it (smallest cumulative metric of the path) Finished when all routers are added and the shortest path tree is generated

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

19

Representation of routers and networks in a table


R3
R8

R1 N3

R2

R6
N7 4 From R8 To R8 N7 4

R3

R4

From R3 R6 To R3 6 R6 8

Point-to-point network
5th CEENet Workshop Budapest, 1999

Stub network
OSPF

From R1 R2 R3 R4 N3 R1 0 R2 0 To R3 0 R4 0 N3 1 1 1 1 Broadcast or NBMA network


Iskra Dj. Popova 20

R1

N12 N13 N14 R4 N3 R5

N1
N2 R2

Example of an AS
N12 R7

R3 N4
N11

R6

R9
R5 and R7 are border routers N10
5th CEENet Workshop Budapest, 1999

N8
R11 N9 R12 R10 N6

N15

R8
N7
OSPF Iskra Dj. Popova 21

R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 N1 N2 N3 N4 N6 N7 N8 N9 N10 N11 N12 N13 N14 N15

R1 R2 R3 R4 R5 R6 R7 R8 R9R10R11R12 N3 N6 N8 N9 0 0 6 0 8 0 8 6 6 8 7 5 6 0 0 0 7 0 0 0 0 0 3 3 1 1 1 1 2 1 1 1 4 3 2 1 1 1 2 3 8 2 8 8 9

The Resulting Directed Graph


Networks and routers are represented by vertices. An edge of cost X connects Vertex A to Vertex B if the intersection of Column A and Row B is marked with the cost of the interface.

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

22

R5

R6

N12N13 N14 N4 R4 R 2
N2

R3R10

Shortest Path Tree and Routing Table for R6


N6
R7
Dest. Next Hop Cost N1 N2 N3 N4 N6 N7 N8 N9 N10 N11 RT5 RT7 R3 R3 R3 R3 R10 R10 R10 R10 R10 R10 RT5 RT10 10 10 7 8 8 12 10 11 13 14 6 8

N3
R1 N1

N8

R11
N9 R12 N10

R8 N12 N15 N7

R9
N11

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

23

Load Balancing by Multiple Path


R2

equal or proportional cost multiple paths


path 1

N1
R1 path 2 R3

N2

R4
5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 24

Hierarchical Structure
Introduced to put a boundary on the explosion of link-state updates Every area is connected to the backbone Backbone area
Area #0

Area #1
5th CEENet Workshop Budapest, 1999

Area #2

Area #3
Iskra Dj. Popova 25

OSPF

Multiple Areas
Group of contiguous hosts and networks One LS database per area Backbone area (contiguous) Virtual links Inter-area routing
5th CEENet Workshop Budapest, 1999

IR Area 2 to other AS Area 3 IR/BR

area 0
ASBR Area 4 Area 1 Virtual link
OSPF Iskra Dj. Popova 26

OSPF Areas
The border area is OSPF area 0 all routers belonging to the same area have identical database SPF calculations are performed separately for each area LSA flooding is bounded by area

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

27

Area Link State Database


Link state database for every Area database is composed of

router links advertisements network links advertisements summary links advertisements AS external advertisements

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

28

Scaling OSPF
Rule of thumb

no more than 150 routers /area no more than 500 routers/area always marked as area 0

Reality

Backbone area is an area

proper use of areas reduces bandwidth

summarized routes instability is limited within the area


5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 29

Route Redistribution
RIP Domain OSPF Domain

UNIX host ruining routed the router redistributes RIP into OSPF and vice versa
5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 30

Route Tagging
C

Autonomous System B wants to

propagate routes from A --> D, but not propagate from C --> D

OSPF tags routes with AS input

the information can be used when redistributing routs


5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 31

OSPF - Advantages
Fast convergence Load balancing Low bandwidth utilization Optimal path utilization Authenticated routing updates External routes
OSPF Iskra Dj. Popova 32

5th CEENet Workshop Budapest, 1999

OSPF Essential Configuration


Enable OSPF routing router ospf <process-id>
Define interfaces on which OSPF runs and define the area ID for each interface. network <address> <mask> area <area-id>

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

33

The Link State Header


0 LS age 31 Link State ID

LS age

time since the LS record was first advertised E - external links T - TOS (type 0 doesnt support any TOS ET

options

options LS type

Advertising Router
LS sequence number LS checksum length

LS type

(router link, network link, summary link (IP network, summary link, to a border router, external link)

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

34

The Router Links


0 ..0.EB ..0.. Link ID Link data Type #TOS TOS 0 metric TOS =x 0 TOS x metric 31 number of links

summarizes all links that start from the router bits 6 and 7 of the first word indicate the type of the router

--TOS =z 0 TOS z metric

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

35

The Network Links


0 Network mask Attached router --Attached router 31

advertised by designated routers


5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 36

The Summary Links


TOS TOS =x network mask 0 TOS 0 metric 0 TOS x metric

--TOS =z 0 TOS z metric

advertised by area-border routers the network mask is followed by a set of metrics


5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 37

The External Links


network mask E, TOS 0 TOS 0 metric external route tag 0 E,TOS =x 0 TOS x metric
external route tag x -------

advertised by border routers required by EGPs E indicates that TOS is not comparable with that of internal routes

E,TOS =z 0 TOS z metric external route tag z


5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 38

Protocols within OSPF


Common header Hello protocol

Exchange protocol
Flooding protocol

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

39

The Common Header


0 version (1) type (1) Router ID (4) packet length (2) 31

Area ID (4)
Checksum (2) autype (2) Authentication (4)

5th CEENet Workshop Budapest, 1999

OSPF

Iskra Dj. Popova

40

The Hello Protocol


OSPF packet header, type = 1 (hello) Network mask Hello interval Options Dead interval Designated router Backup designated router Neighbour ---Neighbour
5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 41

31

Priority

The Exchange Protocol


0 31 Uses database description OSPF packet header, type = 2 (dd) packets 0 0 options 0I M MS Asymmetric protocol (master-slave) DD sequence number Master sends database Link state type description packets Link State ID Slave sends the Advertising router acknowledgments Link State sequence number LS checksum ---5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 42

LS age

The Exchange Protocol 2


0 31
OSPF packet header, type = 3 (rq) Link state type

Request records

Link State ID Advertising router

----

send in case when sequence number of the LS is smaller the other router will answer with a LS update
Iskra Dj. Popova 43

5th CEENet Workshop Budapest, 1999

OSPF

The Flooding Protocol


When a link changes OSPF packet header, type = 4 (upd) state
Number of advertisements Link State advertisements ---0 31

31

OSPF packet header, type = 5 (ack)

Link State advertisements headers ---5th CEENet Workshop Budapest, 1999 OSPF

a router responsible for that link issues a new version of the link state the update is retransmitted in regular interval until an acknowledgment is 44 received Iskra Dj. Popova

Conclusions
More complex than RIP

the documentation is five times thicker the management needs more information the implementation needs more code routing is important requires less signalization messages compute better routes
OSPF Iskra Dj. Popova 45

Why design such complex procedure?


5th CEENet Workshop Budapest, 1999

Conclusions
OSPF is not a perfect protocol IETF keeps making it better

O in OSPF stands for Open

OSPF is not the only link state protocol

IS-IS protocol is part of OSI routing framework for CLNP


similar in design to OSPF uses different terminology
5th CEENet Workshop Budapest, 1999 OSPF Iskra Dj. Popova 46

Vous aimerez peut-être aussi