33
Internet Routing Protocols: Fundamental Concepts of Link-State and Distance Vector Routing* Vishal Sharma, Ph D Tellabs Research Center vsharma@trc tellabs com November 20, 1998 *From Christian Huitema’s Routing in the Internet

Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Embed Size (px)

DESCRIPTION

An easy to follow basic presentation designed to explain the core operating principles of link-state and distance-vector routing protocols, which form the basis of OSPF/IS-IS and BGP routing protocols for the Internet, respectively. Adapted and summarized from Christian Huitema's "Routing in the Internet," bringing some of his examples "to life" as it were.This talk/presentation is useful for...

Citation preview

Page 1: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Internet Routing Protocols: Fundamental Concepts of Link-State and Distance Vector Routing*

Vishal Sharma, Ph D

Tellabs Research Center

vsharma@trc tellabs com

November 20, 1998

*From Christian Huitema’s Routing in the Internet

Page 2: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 2Internet Routing Protocols: Fundamental Operation

Outline of the Talk

What does a router do? A look at the forwarding process at a router

How does it know where to forward packets? Distance vector routing

An illustration of its operationIts drawbacks and how they affect performanceSome solutions to those drawbacks

Link state routing A look at its major components An illustration of their operation Its features and advantages

OSPF: a link state based intra-domain routing protocol BGP: a distance vector based inter-domain routing

protocol

Page 3: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 3Internet Routing Protocols: Fundamental Operation

Importance of Routing in the Internet

The structure that glues together the worldwide Internet

Without routing there would be no Internet!

Page 4: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 4Internet Routing Protocols: Fundamental Operation

Routing process at a router

Destination address (DA) based forwarding

Longest prefix matching

Routing Table

DA=my_add or DA= IP brdcst add. ?

RT entry = complete DA?

RT entry = Destn. n/w id?

Default entry exists?

No

No

No

No

Yes

Yes

Yes

Yes

Deliver datagram to protocol module (TCP/UDP) specified in IP hdr.

Send pkt. to next-hop router or to directly connected interface.

Send pkt. to next-hop router or to directly connected interface.

Send pkt. to next-hop router.

Datagram undeliverable. (Use ICMP to inform source.)

Receive incoming pkt.

DA Next hoprouter

NetworkInterface

Host entry 198.168.7.3 X 2

Host entry 198.168.7.4 X 3

Host entry 198.168.7.1 198.168.7.5 1

Host entry 198.168.7.2 198.168.7.5 1

N/w entry 198.100.x.x 198.100.9.1 4

N/w entry 128.72.x.x 128.72.55.4 5

Default x.x.x.x 128.84.73.1 6

Page 5: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 5Internet Routing Protocols: Fundamental Operation

Routing process at a router

How do routers build their routing tables? By exchanging information with each other using routing protocols

DA = 198 100 9 75

Packet generated

198.168.7.4

198.168.7.3

198.168.7.1

198.168.7.2

198.168.7.5

198.168.7.6

198.100.x.x

198.100.9.1

128.72.x.x

128.72.55.4

128.84.x.x

128.84.73.1

2 3

4

5 6

1

198.100.9.75

DA Next hoprouter

N/wInt.

Host entry 198.168.7.3 X 2

Host entry 198.168.7.4 X 3

Host entry 198.168.7.1 198.168.7.5 1

Host entry 198.168.7.2 198.168.7.5 1

N/w entry 198.100.x.x 198.100.9.1 4

N/w entry 128.72.x.x 128.72.55.4 5

Default x.x.x.x 128.84.73.1 6

Routing table (RT) at 198 168 7 6

Longest prefix match in RT gives next hop router as 198 100 9 1 and outgoing interface as 4

Page 6: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 6Internet Routing Protocols: Fundamental Operation

Routing Protocols: Distance vector (DV) Routing

Local dispersal of global information Each router has unique ID Each router knows cost of its outgoing links Router starts with distance vector “0” for itself, and “infinity” for all other destinations Transmits DV to each neighbor -- periodically or upon change Saves the most recently received DV from each neighbor Calculates new DV based on minimizing cost for each destination Recalculations occur when:

DV with new values received from a neighbor Link(s) fails

Page 7: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 7Internet Routing Protocols: Fundamental Operation

Operation of Distance Vector Routing (1)

From E Link Cost

E local 0

From A Link Cost

A local 0

From D Link Cost

D local 0

From C Link Cost

C local 0

From B Link Cost

B local 0

A B

C

E D

1

2

3 4

5

6

A=0

Numbers on links represent link identifiers (not cost)

Letters represent Node names

Page 8: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 8Internet Routing Protocols: Fundamental Operation

Operation of Distance Vector Routing (2)

From E Link Cost

E local 0

From A Link Cost

A local 0

From D Link Cost

D local 0A 3 1

From C Link Cost

C local 0

From B Link Cost

B local 0A 1 1

A B

C

E D

1

2

3 4

5

6

B=0, A=1

D=0, A=1

Page 9: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 9Internet Routing Protocols: Fundamental Operation

Operation of Distance Vector Routing (3)

From E Link Cost

E local 0B 4 1A 4 2D 6 1

From A Link Cost

A local 0B 1 1D 3 1

From D Link Cost

D local 0A 3 1

From C Link Cost

C local 0B 2 1A 2 2

From B Link Cost

B local 0A 1 1

A B

C

E D

1

2

3 4

5

6

E=0, B=1, A=2,D=1

A=0, B=1, D=1

C=0, B=1, A=2

Page 10: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 10Internet Routing Protocols: Fundamental Operation

Operation of Distance Vector Routing (4)

From E Link Cost

E local 0B 4 1A 4 2D 6 1C 5 1

From A Link Cost

A local 0B 1 1D 3 1

From D Link Cost

D local 0A 3 1B 3 2E 6 1

From C Link Cost

C local 0B 2 1A 2 2

From B Link Cost

B local 0A 1 1D 1 2C 2 1E 5 1A B

C

E D

1

2

3 4

5

6

E=0, B=1, A=2,D=1, C=1

B=0, A=1, D=2, C=1, E=1

D=0, A=1, B=2E=1

Page 11: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 11Internet Routing Protocols: Fundamental Operation

Operation of Distance Vector Routing (5)

A B

C

E D

1

2

3 4

5

6 From E Link Cost

E local 0B 4 1A 4 2D 6 1C 5 1

From A Link Cost

A local 0B 1 1D 3 1C 1 2E 1 2

From D Link Cost

D local 0A 3 1B 3 2E 6 1C 6 2

From C Link Cost

C local 0B 2 1A 2 2E 5 1D 5 2

From B Link Cost

B local 0A 1 1D 1 2C 2 1E 5 1

These do not alter routing tables further Thus, no new updates generated

DV routing has now converged

Page 12: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 12Internet Routing Protocols: Fundamental Operation

Drawbacks of Distance-vector Routing

Slow convergence after topology change “Counting to infinity” problem:

Loop exists DVs do not converge till the link costs reach “infinity ”

Problematic convergence with unequal link costs Bouncing effect:

Routing and link costs temporarily stabilize, but have a loop Data packets circulate in the loop till time-to-live (TTL) expires This changes only when network converges to a new,

coherent version of the routing tables

Page 13: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 13Internet Routing Protocols: Fundamental Operation

Drawbacks of Distance Vector Routing: Counting to “Infinity” (1)

A B

C

E D

1

2

3 4

5

6

From A Link Cost

A local 0B 3 3D 3 1C 3 3E 3 2

A’s stable routing tableafter link 1 fails

From D Link Cost

D local 0A 3 1B 6 infE 6 infC 6 inf

D’s routing table immediately after link 6 fails

Link 6 fails

A=0, B=3, D=1, C=3, E=2

A transmits its last DV before D does

Page 14: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 14Internet Routing Protocols: Fundamental Operation

Drawbacks of Distance Vector Routing: Counting to “Infinity” (2)

A B

C

E D

1

2

3 4

5

6

From A Link Cost

A local 0B 3 3D 3 1C 3 3E 3 2

From D Link Cost

D local 0A 3 1B 3 4E 3 3C 3 4

D=0, A=1, B=4, E=3, C=4

D transmits its updated DV

D updates its routing table

Page 15: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 15Internet Routing Protocols: Fundamental Operation

Drawbacks of Distance Vector Routing: Counting to “Infinity” (3)

A B

C

E D

1

2

3 4

5

6

From A Link Cost

A local 0B 3 5D 3 1C 3 5E 3 4

From D Link Cost

D local 0A 3 1B 3 4E 3 3C 3 4

We are in an infinite loop!

Infinite loop broken by some convention on the representation of “infinity ”

Then A updates its routing table

A=0, B=5, D=1, C=5, E=4

A transmits its updated DV

Page 16: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 16Internet Routing Protocols: Fundamental Operation

Drawbacks of Distance Vector Routing: Bouncing Effect (1)

A B

C

E D

1

2

3 4

5

6 From E Link Cost

E local 0A 5 2B 4 1C 4 2D 5 1

From A Link Cost

A local 0B 1 1C 1 2D 3 1E 3 2

From D Link Cost

D local 0A 3 1B 3 2C 3 3E 5 1

All links except 5 have unit cost, link 5 cost = 10 From B Link Cost

B local 0A 1 1C 2 1D 1 2E 4 1

From Link Cost

A C 1 2B C 1 1C C local 0D C 3 3E C 4 2

Routes towards C

Page 17: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 17Internet Routing Protocols: Fundamental Operation

Drawbacks of Distance Vector Routing: Bouncing Effect (2)

A B

C

E D

1

2

3 4

5

6 From E Link Cost

E local 0A 5 2B 4 1C 4 2D 5 1

From A Link Cost

A local 0B 1 1C 1 2D 3 1E 3 2

From D Link Cost

D local 0A 3 1B 3 2C 3 3E 5 1

All links except 5 have unit cost, link 5 cost = 10

Link 2 fails

From B Link Cost

B local 0A 1 1C 2 infD 1 2E 4 1

B’s routing table immediately afterlink 2 fails

From Link Cost

A C 1 2B C 1 infC C local 0D C 3 3E C 4 2

Routes towards C

Routes towards Cimmediately after B’s update of its routing table

A=0, B=1, C=2, D=1,E=2

A transmits its DV before B does

Page 18: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 18Internet Routing Protocols: Fundamental Operation

Drawbacks of Distance Vector Routing: Bouncing Effect (3)

A B

C

E D

1

2

3 4

5

6 From E Link Cost

E local 0A 5 2B 4 1C 4 2D 5 1

From A Link Cost

A local 0B 1 1C 1 2D 3 1E 3 2

From D Link Cost

D local 0A 3 1B 3 2C 3 3E 5 1

From Link Cost

A C 1 2B C 1 3C C local 0D C 3 3E C 4 2

All links except 5 have unit cost, link 5 cost = 10

Routes towards C

A’s DV produces no change at D

From B Link Cost

B local 0A 1 1C 1 3D 1 2E 4 1

However, B updates its routing table based on DV from A (causing the route towards C to change also)

B=0, A=1, C=3, D=1,E=1

B transmits its new DV

Page 19: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 19Internet Routing Protocols: Fundamental Operation

Drawbacks of Distance Vector Routing: Bouncing Effect (4)

A B

C

E D

1

2

3 4

5

6 From E Link Cost

E local 0A 5 2B 4 1C 4 4D 5 1

From A Link Cost

A local 0B 1 1C 1 4D 3 1E 3 2

From D Link Cost

D local 0A 3 1B 3 2C 3 3E 5 1

From Link Cost

A C 1 4B C 1 3C C local 0D C 3 3E C 4 4

From B Link Cost

B local 0A 1 1C 1 3D 1 2E 4 1

All links except 5 have unit cost, link 5 cost = 10

Further DV exchanges produce no change in

routing tables! Both routing and distances have (temporarily) stabilized

Routes towards C

Loop!

Packets for C can now “bounce” between A and B

Page 20: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 20Internet Routing Protocols: Fundamental Operation

Some Solutions for Problems in Distance Vector Routing

Split Horizon: If A routes packets for X via B, it should not announce to B that X is a short distance from A!

Simple algo : Omit from DV any info about destinations routed on the link “Poisonous reverse” algo : Set distance of destination routed on the link to infinity

Triggered Updates: transmit updates as soon as routing table changes, don’t wait for end of update period

A X B

Page 21: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 21Internet Routing Protocols: Fundamental Operation

Routing Protocols: Link State (LS) Routing

Global dispersal of local information Each router: Identifies itself to all its neighbors

Constructs a link state packet (LSP) with:Names of each neighbor Cost of link to each neighbor

Floods its LSP in the network

Stores most recent copy of LSP from every other router

Using LSPs constructs a full map of network topology, and computes shortest route(s) to each destination (using an appropriate shortest path algorithm, such as Dijkstra’s)

Page 22: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 22Internet Routing Protocols: Fundamental Operation

Operation of Link State Routing (1)

Meeting neighbors Xmit special pkt over link

(if pt to pt ) or to a group address (if broadcast n/w or LAN)

Construct Link State Packet (LSP) LSP is sent when: Neighbor changes Link goes up/down Also, periodically

A

B C

E

D

Hello Hello

Hello Hello

A

B

C

E

D

1

2 4

5

6

A B/1 D/1

B A/1 C/1 E/1

C B/1 D/1

E D/1 C/1 B/1

D E/1 A/1

Numbers on links arelink identifiers (not cost)

Letters represent Node names

Name of neighbor Cost of Link to that neighbor

Page 23: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 23Internet Routing Protocols: Fundamental Operation

Operation of Link State Routing (2)

Disseminate LSP to all routers in the network

LSP distrn cannot use routing database use Flooding algorithm

Each LSP has “msg #” and “age” to enable receiving node to distinguish between old and new info

Advantage: LSP can be forwarded without any shortest path computation, so faster

Record # in database < Record # in msg.?

Yes

No

Yes

No

Yes

No

- Add to database, - Broadcast message.

- Replace record by new value. - Broadcast message.

Transmit database value on incoming interface.

Do nothing.

Receive message from A, say

Record in database from A ?

Record # in database = Record # in msg.?

Page 24: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 24Internet Routing Protocols: Fundamental Operation

Operation of Link State Routing: The Flooding Protocol at Work (1)

A

B

C

E

D

1

2 3

4 5

6

B #2 A/inf C/1 E/4

A #2 B/inf D/1

A #1 B #1 C #1 D #1 E #1B/1 A/1 B/1 E/1 D/1D/1 C/1 D/1 A/1 C/1

E/1 B/1

D’s Link State Database(amalgamation of LSPs fromremaining network nodes)

A #1 B #1 C #1 D #1 E #1B/1 A/1 B/1 E/1 D/1D/1 C/1 D/1 A/1 C/1

E/1 B/1

Node name LSP #A

B

C

E

D

1

2 3

4 5

6

A B/1 D/1

B A/1 C/1 E/1

C B/1 D/1

E D/1 C/1 B/1

D E/1 A/1

Link State Packet, LSP

Page 25: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 25Internet Routing Protocols: Fundamental Operation

Operation of Link State Routing: The Flooding Protocol at Work (2)

A

B

C

1

2 3

4 5

6

A #2

B/inf D/1

B #2 A/inf C/1 E/1

B #2 A/inf C/1 E/1

E

D

E

D

A

B

C

1

2

3

4

5

6

A #2

B/inf D/1

B #2 A/inf C/1 E/1

A #2 B #2 C #1 D #1 E #1B/inf A/inf B/1 E/1 D/1D/1 C/1 D/1 A/1 C/1

E/1 B/1

A #2 B #1 C #1 D #1 E #1B/inf A/1 B/1 E/1 D/1D/1 C/1 D/1 A/1 C/1

E/1 B/1

D’s Link State Database

Page 26: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 26Internet Routing Protocols: Fundamental Operation

Operation of Link State Routing: The Flooding Protocol at Work (3)

A

B

C

1

2 3

4 5

6

A #2

B/inf D/1

E

D

A #2 B #2 C #1 D #1 E #1B/inf A/inf B/1 E/1 D/1D/1 C/1 D/1 A/1 C/1

E/1 B/1

D’s Link State Database

No further changes take place in the LS database

D (and all other nodes) can nowcalculate the shortest path toevery destination

Page 27: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 27Internet Routing Protocols: Fundamental Operation

Advantages of Link State Routing

Fast, loopless convergence:Rapid new-information transfer via flooding Local computation of shortest path tree

Supports precise and multiple metrics Full topology database eliminates long convergence time of

DV protocols for unequal cost links One DV database per metric (!) vs small overhead per metric

in LSP

Supports multiple paths to a destination Enables load splitting, which is known to be efficient (less

congestion) Gives smoother rerouting on failure of one path (reliability)

Better representation of external routes Not limited by “infinity” of DV protocols Computation for N routers is O(N logN) versus O(N^2) for DV

Page 28: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 28Internet Routing Protocols: Fundamental Operation

Open Shortest Path First (OSPF)

Operates within an autonomous system (AS)

Therefore, example of an interior gateway protocol (IGP)

Based on the link-state routing algorithm

Page 29: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 29Internet Routing Protocols: Fundamental Operation

OSPF Features (1)

Runs directly over IP (with protocol field = 189) Organized into “ASs” and “areas ”

Area border routers summarize reachable destinations, so that area routers can pick a more optimal exit point

Area 1 Area 2

Area 3

Area backbone routers

AS Boundary routers

Area border routers

Designated routers

Area routers

Legend

OSPF Autonomous System (AS)

External world

Page 30: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 30Internet Routing Protocols: Fundamental Operation

OSPF Features (2)

Reduces adjacencies over broadcast networks by electing a designated router (DR) and backup designated router (BDR)

Page 31: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 31Internet Routing Protocols: Fundamental Operation

OSPF Features (3)

Five link state advertisement (LSA) types: Router links: links that start from the advertising router (flooded in an area) Network links:advertised by designated routers for transit networks (broadcast and non-broadcast) Network summary links: networks reachable from outside the area via area border router Boundary router summary links: path from generating area backbone router to AS boundary routers External links: path from AS bdry router to destinations outside AS

Page 32: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 32Internet Routing Protocols: Fundamental Operation

Border Gateway Protocol (BGP)

Operates across autonomous systems (AS)

Therefore, example of an exterior gateway protocol (EGP)

Based on the distance-vector routing algorithm, but modified to eliminate looping (and its associated problems)

Page 33: Internet Routing Protocols: Fundamental Concepts of Distance-Vector and Link-State Routing

Copyright © 1998 33Internet Routing Protocols: Fundamental Operation

BGP Features

Runs over TCP, which ensures reliable communication Eliminates need for complex error recovery mechanisms Makes BGP message size independent of IP pkt size

BGP routers transmit a sequence of AS #s along the path to a destination

Intermediate router on detecting its AS # terminates the path to prevent a loop

Allows for policy routing: BGP router uses configuration info to rank routes Important when determining transit rules between ASs