ip routing: ospf

28
Nov 03, 2003 CS573: Network Protocols and Sta ndards 1 IP Routing: OSPF Network Protocols and Standards Autumn 2003-2004

Upload: hinda

Post on 16-Jan-2016

56 views

Category:

Documents


1 download

DESCRIPTION

IP Routing: OSPF. Network Protocols and Standards Autumn 2003-2004. OSPF. Link State Routing Dijkstra Algorithm Distributed Map concept Flooding protocol for information dissemination Advantages over distance vector Fast, loopless convergence Precise metrics and multiple metrics per link - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards

1

IP Routing: OSPF

Network Protocols and Standards

Autumn 2003-2004

Page 2: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 2

OSPF Link State Routing Dijkstra Algorithm Distributed Map concept Flooding protocol for information

dissemination Advantages over distance vector

Fast, loopless convergence Precise metrics and multiple metrics per link Support for multiple paths to destination

Page 3: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 3

OSPF Features Type of Service (TOS) routing Load balancing

Multiple routes to a destination Network partitioning

Areas made independent of each other Authentication of exchanges between routers Reduction of routing traffic on broadcast

networks by means of a designated router Support for exchange of information learned

from other (external) sites

Page 4: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 4

Basic Idea Each router has a complete map of the network The map is built by “flooding”:

Each router advertises the state of all its interfaces (their costs and where they connect to)

These link state advertisements are flooded throughout the network; upon reception, the other routers repeat them on all their interfaces

Advertisements have sequence numbers Given the map, each router uses Dijkstra’s

algorithm to compute the shortest path tree from itself to all other routers

Page 5: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 5

Link State DatabaseFrom

To

Link

Distance

A B 1 1

A D 3 1

B A 1 1

B C 2 1

B E 4 1

C B 2 1

C E 5 1

D A 3 1

D E 6 1

E B 4 1

E C 5 1

E D 6 1

A B C

ED6

1 2

435

Every router has a copy of thedistributed map in memory

Page 6: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 6

Link State DatabaseFrom

To

Link

Distance

Number

A B 1 Inf 2

A D 3 1 1

B A 1 Inf 2

B C 2 1 1

B E 4 1 1

C B 2 1 1

C E 5 1 1

D A 3 1 1

D E 6 1 1

E B 4 1 1

E C 5 1 1

E D 6 1 1

Router A will advertise:Message: <From A, To B, Link 1, distance = Inf>

Database is updated after each changeof link state using “Flooding Protocol”

A B C

ED6

12

435

xxxxxx

Old messages “may” pollute the database if wedo not number the messages!

Page 7: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 7

Flooding Algorithm Receive a message on an interface and look for

that same message in the DB. Do one of the following:

Add to the local DB and broadcast incoming message on all the interfaces except for the incoming if:

Received record was not in the DB, or Record number in the DB is lower (i.e., a newer message

is received and others should know it) Transmit only on the incoming interface if:

Record number in the DB is higher (i.e., the neighboring bridge through incoming interface must be told that the information sent is too old!)

Do not transmit anywhere if: Record number in DB is the same as the one received

Page 8: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 8

Map Inconsistencies!From

To

Link

Dist

Num

A B 1 Inf 2

A D 3 1 1

B A 1 Inf 2

B C 2 1 1

B E 4 1 1

C B 2 1 1

C E 5 1 1

D A 3 1 1

D E 6 1 1

E B 4 1 1

E C 5 1 1

E D 6 Inf 2

A B C

ED6

12

435

xxxxxx

xxxxxx

From

To

Link

Dist

Num

A B 1 Inf 2

A D 3 1 1

B A 1 Inf 2

B C 2 1 1

B E 4 1 1

C B 2 1 1

C E 5 1 1

D A 3 1 1

D E 6 Inf 2

E B 4 1 1

E C 5 1 1

E D 6 1 1

DB in Nodes A and D DB in Nodes B, C, and E

What if link 6 also failsafter link 1 failed?

Page 9: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 9

Map Inconsistencies!From

To

Link

Dist

Num

A B 1 Inf 2

A D 3 1 1

B A 1 Inf 2

B C 2 Inf 2

B E 4 1 1

C B 2 Inf 2

C E 5 1 1

D A 3 1 1

D E 6 1 1

E B 4 1 1

E C 5 1 1

E D 6 Inf 2

From

To

Link

Dist

Num

A B 1 Inf 2

A D 3 1 1

B A 1 Inf 2

B C 2 1 1

B E 4 1 1

C B 2 1 1

C E 5 1 1

D A 3 1 1

D E 6 Inf 2

E B 4 1 1

E C 5 1 1

E D 6 1 1

DB in Nodes A and D DB in Nodes B, C, and E

What if link 2 also fails now?A and D will not know…

A B C

ED6

1 2

435

xxxxxx

xxxxxx

xxxxxx

Page 10: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 10

Map Inconsistencies!From

To

Link

Dist

Num

A B 1 1 3

A D 3 1 1

B A 1 1 3

B C 2 Inf 2

B E 4 1 1

C B 2 Inf 2

C E 5 1 1

D A 3 1 1

D E 6 1 1

E B 4 1 1

E C 5 1 1

E D 6 Inf 2

From

To

Link

Dist

Num

A B 1 1 3

A D 3 1 1

B A 1 1 3

B C 2 1 1

B E 4 1 1

C B 2 1 1

C E 5 1 1

D A 3 1 1

D E 6 Inf 2

E B 4 1 1

E C 5 1 1

E D 6 1 1

DB in Nodes A and D DB in Nodes B, C, and E

What if link 1 is restored?Inconsistency results!!!

A B C

ED6

1 2

435

xxxxxx

xxxxxx

Page 11: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 11

Bringing up Adjacencies Neighboring routers need to align

or synchronize their databases on a continuous basis Record numbers help!

Exchanging complete copies of databases is inefficient OSPF defines database description

packets containing link identifiers and version numbers only

Page 12: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 12

Bringing up Adjacencies Neighboring routers synchronize their

databases in two phases: Phase 1

Routers send complete description of their databases

Compile a list of records they are interested in after receiving the database descriptions

Phase 2 Each router polls its neighbor for a full copy of

these interesting records by means of “link state request” packets

Page 13: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 13

Securing the Map Updates Coherency of routing is fully dependent upon

maintaining synchronized copies of databases in all nodes

Each router is only required to be synchronized with its neighbors

Measures introduced by OSPF Flooding includes hop-by-hop acknowledgements 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 not refreshed in due time All records are protected by checksum The messages can be authenticated or encrypted

Page 14: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 14

OSPF Algorithm: Notation E: set of nodes already evaluated R: remaining nodes O: an ordered list of paths used to

find the next shortest route P: the shortest path in O V: the last node in P

Page 15: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 15

OSPF Algorithm: Dijkstra’s1. Initialization

Initialize E to contain only the source node S Initialize R to contain all the other nodes Initialize the list of paths O to contain all the

one hop paths starting from S. Each of these paths has a cost equal to the corresponding link’s metric. Sort list O by increasing metrics

2. If list O is empty, or if the first path in O has an infinite metric, mark all nodes in R as unreachable. The computation is finished…

Page 16: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 16

OSPF Algorithm: Dijkstra’s3. Set P=the shortest path in list O. Remove the

shortest path from O. Let V be the last node in P. If V is already in E, go back to step 2. Otherwise, P is the shortest path to V. Move V from R to E

4. Last step Build a set of new candidate paths by concatenating P

and each of the links starting from V The cost to these paths is the sum of the cost of P and

the metric of the link appended to P Insert the new links in the ordered list O, each at the

rank corresponding to its cost Go to step 2

Page 17: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 17

Example

S

CA

B D

E

1

1 1

5 2

6

3

1

Each node will find a shortest path from itself to all other nodes

Consider node S to see how Dijkstra’s algorithm works!

Page 18: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 18

Example: Link State DBSA

1 BD 6

SB

5 CA 3

AS

1 CB 1

AB

1 CE 1

AC

3 DB 6

BS

5 DE 2

BA

1 EC 1

BC

1 ED 2

S

CA

B D

E

1

1 1

5 2

6

31

Like every node, S has a complete map of the network

Page 19: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 19

Example

5SB

4SAC

8SABD

3SABCC,D,ES,A,B

5SB

4SAC

2SABB,C,D,ES,A

5SB

1SAA,B,C,D,ES

CostORE

5(*)SB

8SABD

6SABCEDDS,A,B,C,E

5SB

4 (*)SAC

8SABD

4SABCED,ES,A,B,C

CostORE

Underlined paths are shortest at each iteration(*) links removed at step 3

S

CA

B D

E

1

1 1

52

6

31

Page 20: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 20

Another Example

A

CB

E D

1

1

23

1

L1

L5L4

L3

L2

5AEDA,B,E,C,D5

5AED

DA-L1-B-L2-C-L3-D3ABCDDA,B,E,C4

2AE

EA-L5-E2ABCC,D,EA,B2

2AE

BA-L1-B1ABB,C,D,EA1

AED

CA-L1-B- L2-C2ABCC,DA,B,E3

5

VPDistORE

Need paths from A

A

CB

E D

1

1

23

1

L1

L5L4

L3

L2

Page 21: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 21

Advantages of OSPF Why is a link state protocol better?

Fast, loopless convergence Support for precise metrics and, if

needed, multiple metrics Support for multiple paths to

destination

Page 22: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 22

Fast, loopless convergence Fast

Distance vector uses Bellman-Ford algorithm and converges in O(NM) where N is the number of nodes and M is the number of links

OSPF uses Dijkstra’s algorithm where local computation involves O(MlogM) computations

Transmission of new information is quick by using flooding

Loopless Immediately after flooding and the computation, all

routes in the network are same – no loops and no counting to infinity

The loopless features avoids the disruptive consequences of routing loops

Page 23: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 23

Support for Multiple Metrics Full topology is known for computation;

arbitrarily precise metrics can be used without slowing down the convergence

Convergence speed is not a function of metrics The precision of computation makes it possible

to use multiple metrics in parallel Must make consistent decision in all nodes. Why?

Possible metrics Throughput Delay Cost Reliability

Page 24: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 24

Support for Multiple Metrics

A

E

B

DCT1TerrestrialLink (10ms)

T1 Satellite link (275ms)

64kbps(10ms)

T1TerrestrialLink (10ms)

64kbps (10ms)

How to route from D to B?Bandwidth-based: DCAB (1.544Mbps vs. 64kbps)Delay-based: DEB (20ms vs. 295ms)

T1 link ~ 1.544Mbps

Page 25: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 25

Support for Multiple Paths In complex networks, there are usually several

“almost equivalent” routes towards a destination Analysis have proved that splitting traffic over

multiple paths is more efficient Average delay will be lower Delay variations will also be lower

Spreading the traffic also alleviates the effect of the disconnection in one single path. Without spreading the traffic, if the single path being used becomes unavailable, all traffic will be routed to the alternate path, causing possible congestion

Page 26: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 26

Support for Multiple Paths Issues

Splitting (or spreading) traffic will lead to out-of-order delivery of certain packets

Effect on TCP flow control (different delay) A solution is to route packets belonging to

the same connection over one path and distribute the connections rather than the packets over multiple available paths

Page 27: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 27

Modified Algorithm1. Initialize E, R, and O as in the standard SPF2. If O is empty, the algorithm is finished3. Examine P, the shortest path in O. Remove P from O

and Let V be the last node in P. If V is already in E, continue at step 4. Otherwise, P is the shortest path to V. Move V from R to E and continue at step 5

4. If the distance to V is larger than the shortest path, ignore P. Otherwise (distance to V is equal to the shortest path), P is an equal cost path. Move V from R to E. In all cases continue at step 2

5. Build the new set of candidate paths, add them to O as in standard algorithm and continue at step 2

Page 28: IP Routing: OSPF

Nov 03, 2003 CS573: Network Protocols and Standards 28

Issues Design of OSPF

Separating hosts and routers Broadcast networks (Ethernet, FDDI,

…) Non-broadcast networks (ATM, X.25,

…) Splitting very large networks into

areas