fundamentals of computer networks ece 478/578 lecture #16: routing instructor: loukas lazos dept of...

Post on 20-Dec-2015

219 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Fundamentals of Computer NetworksECE 478/578

Lecture #16: RoutingInstructor: Loukas Lazos

Dept of Electrical and Computer EngineeringUniversity of Arizona

What is Routing?Construct directions from starting point to destination

2

3

Forwarding vs. RoutingForwarding: data plane

Directing a data packet to an outgoing linkIndividual router using a forwarding table

Routing: control planeComputing paths the packets will followRouters talking amongst themselvesIndividual router creating a forwarding table

4

Why Does Routing Matter?End-to-end performance

Quality of the path affects user performancePropagation delay, throughput, and packet loss

Use of network resourcesBalance of the traffic over the routers and linksAvoiding congestion by directing traffic to lightly-loaded links

Transient disruptions during changesFailures, maintenance, and load balancingLimiting packet loss and delay during changes

Different Types of RoutingRouting in a GPS device

Routing in computer networksShortest pathSmallest delayHighest reliabilityAvoid congested nodes

5

Routing as a Graph ProblemNetwork is mapped into a graph G(V,E), where each link has an associated cost

Cost: delay, financial cost, probability of failure, etc.

6

Distance Vector AlgorithmConstruct a one-dimensional array (vector) of distances to all other nodesExchange info with immediate neighborsUpdate distances based on received informationStop sending updates as soon as no change occursExample: Assume unit cost for each link

7

Distance Vector – Global ViewGlobal view of the network

8

A B C D E F G

A 0 1 1 1 1

B 1 0 1

C 1 1 0 1

D 1 0 1

E 1 0

F 1 0 1

G 1 1 0

Distance Vector – Local ViewDest Cost Next

Hop

B 1 B

C 1 C

D –

E 1 E

F 1 F

G –

9

Dest Cost Next Hop

A 1 A

C 1 C

D –

E –

F –

G –

Dest Cost Next Hop

A 1 A

B 1 B

D 1 D

E –

F –

G –

Dest Cost Next Hop

A –

B –

C 1 C

E –

F –

G 1 G

Dest Cost Next Hop

A 1 A

B –

C –

D –

F –

G –

Dest Cost Next Hop

A 1 A

B –

C –

D –

E –

G 1 G

Dest Cost Next Hop

A –

B –

C –

D 1 D

E –

F 1 F

Distance Vector – 1st UpdateDest Cost Next

Hop

B 1 B

C 1 C

D 2 C

E 1 E

F 1 F

G 2 F

10

Dest Cost Next Hop

A 1 A

C 1 C

D 2 C

E 2 A

F 2 A

G –

Dest Cost Next Hop

A 1 A

B 1 B

D 1 D

E 2 A

F 2 A

G 2 G

Dest Cost Next Hop

A 2 C

B 2 C

C 1 C

E –

F 2 G

G 1 G

Dest Cost Next Hop

A 1 A

B 2 A

C 2 A

D –

F 2 A

G –

Dest Cost Next Hop

A 1 A

B 2 A

C 2 A

D 2 G

E 2 E

G 1 G

Dest Cost Next Hop

A 2 F

B –

C 2 D

D 1 D

E –

F 1 F

Distance Vector – 2nd UpdateDest Cost Next

Hop

B 1 B

C 1 C

D 2 C

E 1 E

F 1 F

G 2 F

11

Dest Cost Next Hop

A 1 A

C 1 C

D 2 C

E 2 A

F 2 A

G 3 C

Dest Cost Next Hop

A 1 A

B 1 B

D 1 D

E 2 A

F 2 A

G 2 G

Dest Cost Next Hop

A 2 C

B 2 C

C 1 C

E 3 C

F 2 G

G 1 G

Dest Cost Next Hop

A 1 A

B 2 A

C 2 A

D 3 A

F 2 A

G 3 A

Dest Cost Next Hop

A 1 A

B 2 A

C 2 A

D 2 G

E 2 E

G 1 G

Dest Cost Next Hop

A 2 F

B 3 D

C 2 D

D 1 D

E 3 F

F 1 F

Failure of F – G Link

12

Failure of F – G Link Step 1A/Dest Cost Next

Hop

B 1 B

C 1 C

D 2 C

E 1 E

F 1 F

G 2 F

13

B/Dest Cost Next Hop

A 1 A

C 1 C

D 2 C

E 2 A

F 2 A

G 3 C

C/Dest Cost Next Hop

A 1 A

B 1 B

D 1 D

E 2 A

F 2 A

G 2 G

D/Dest Cost Next Hop

A 2 C

B 2 C

C 1 C

E 3 C

F 2 G

G 1 G

E/Dest Cost Next Hop

A 1 A

B 2 A

C 2 A

D 3 A

F 2 A

G 3 A

F/Dest Cost Next Hop

A 1 A

B 2 A

C 2 A

D –

E 2 E

G –

G/Dest Cost Next Hop

A –

B 3 D

C 2 D

D 1 D

E –

F –

Failure of F – G Link Step 2A/Dest Cost Next

Hop

B 1 B

C 1 C

D 2 C

E 1 E

F 1 F

G –

14

B/Dest Cost Next Hop

A 1 A

C 1 C

D 2 C

E 2 A

F 2 A

G 3 C

C/Dest Cost Next Hop

A 1 A

B 1 B

D 1 D

E 2 A

F 2 A

G 2 G

D/Dest Cost Next Hop

A 1 A

B 2 C

C 1 C

E 3 C

F –

G 1 G

E/Dest Cost Next Hop

A 1 A

B 2 A

C 2 A

D 3 A

F 2 A

G –

F/Dest Cost Next Hop

A 1 A

B 2 A

C 2 A

D –

E 2 E

G –

G/Dest Cost Next Hop

A –

B 3 D

C 2 D

D 1 D

E –

F –

Failure of F – G Link Step 3A/Dest Cost Next

Hop

B 1 B

C 1 C

D 2 C

E 1 E

F 1 F

G 3 C

15

B/Dest Cost Next Hop

A 1 A

C 1 C

D 2 C

E 2 A

F 2 A

G 3 C

C/Dest Cost Next Hop

A 1 A

B 1 B

D 1 D

E 2 A

F 2 A

G 2 G

D/Dest Cost Next Hop

A 2 C

B 2 C

C 1 C

E 3 C

F 3 C

G 1 G

E/Dest Cost Next Hop

A 1 A

B 2 A

C 2 A

D 3 A

F 2 A

G –

F/Dest Cost Next Hop

A 1 A

B 2 A

C 2 A

D 4 A

E 2 E

G –

G/Dest Cost Next Hop

A 3 D

B 3 D

C 2 D

D 1 D

E 4 D

F –

Failure of F – G Link Step 4A/Dest Cost Next

Hop

B 1 B

C 1 C

D 2 C

E 1 E

F 1 F

G 3 C

16

B/Dest Cost Next Hop

A 1 A

C 1 C

D 2 C

E 2 A

F 2 A

G 3 C

C/Dest Cost Next Hop

A 1 A

B 1 B

D 1 D

E 2 A

F 2 A

G 2 G

D/Dest Cost Next Hop

A 2 C

B 2 C

C 1 C

E 3 C

F 3 C

G 1 G

E/Dest Cost Next Hop

A 1 A

B 2 A

C 2 A

D 3 A

F 2 A

G 4 A

F/Dest Cost Next Hop

A 1 A

B 2 A

C 2 A

D 4 C

E 2 E

G 4 A

G/Dest Cost Next Hop

A 3 D

B 3 D

C 2 D

D 1 D

E 3 F

F 4 D

A advertises a distance of infty to E and updates its neighborsC advertises a distance of 2 to E via AB advertises a distance of 3 to E via CA updates its table and advertises a distance of 4 via BC updates its table and advertises a distance of 5 via A…

Count-to-Infinity Problem

17

Solutions for Count-to-Infinity Problem Sol A: Use a maximum hop count instead of infinity

Sol B: Split HorizonDo not send updates on the neighbor that provided the info for a particular route. E.g.: B does not send an update for E to A, since it learned about E from A

Sol C: Split Horizon with Poison ReverseB advertises a route of cost infinity to E to ensure that A does not use B to get to E

Solutions do not always work for loops with more than 3 nodes

18

Routing Information Protocol (RIP)Distance-vector algorithm where vertices are networks and not hosts

Valid hop count (distances) 1-15, with 16 representing infinity

Limited to fairly small networks

19

20

Link-State Routing

Path-selection modelDestination-based

Flood information regarding immediate neighbors to all nodes

Each node obtains a complete map of the network

32

2

1

14

1

4

5

3

21

Shortest-Path Problem Given: network topology with link costs

c(x,y): link cost from node x to node yInfinity if x and y are not direct neighbors

Compute: least-cost paths to all nodesFrom a given source u to all other nodesp(v): predecessor node along path from source to v

32

2

1

14

1

4

5

3

u

v

p(v)

22

Dijkstra’s Shortest-Path AlgorithmIterative algorithm

After k iterations, know least-cost path to k nodes

S: nodes whose least-cost path definitively knownInitially, S = {u} where u is the source nodeAdd one node to S in each iteration

D(v): current cost of path from source to node vInitially, D(v) = c(u, v) for all nodes v adjacent to u… and D(v) = ∞ for all other nodes vContinuously update D(v) as shorter paths are learned

23

Dijsktra’s Algorithm

1 Initialization: 2 S = {u} 3 for all nodes v 4 if v adjacent to u {5 D(v) = c(u,v) 6 else D(v) = ∞ 7 8 Loop 9 find w not in S with the smallest D(w)10 add w to S 11 update D(v) for all v adjacent to w and not in S: 12 D(v) = min{D(v), D(w) + c(w,v)} 13 until all nodes in S

24

Dijkstra’s Algorithm Example

32

2

1

14

1

4

5

3

32

2

1

14

1

4

5

3

32

2

1

14

1

4

5

3

32

2

1

14

1

4

5

3

25

Dijkstra’s Algorithm Example

32

2

1

14

1

4

5

3

32

2

1

14

1

4

5

3

32

2

1

14

1

4

5

3

32

2

1

14

1

4

5

3

26

Shortest-Path Tree• Shortest-path tree from u • Forwarding table at u

32

2

1

14

1

4

5

3

u

v

w

x

y

z

s

t

v (u,v)w (u,w)x (u,w)y (u,v)z (u,v)

link

s (u,w)t (u,w)

Dijkstra Table

27

Step S v w x y z s t

D(v) P(v) D(w) P(w) D(x) P(x) D(y) P(y) D(z) P(z) D(s) P(s) D(t) P(t)

0 u 3 u 2 u u u u u u

1 u,w 3 u - - 3 w u u 6 w u

2 u, w, v - - - - 3 w 5 v u 6 w u

3 u,w,v,x - - - - - - 5 v u 6 w 8 x

4 u,w,v,x,y

- - - - - - - - 6 y 6 w 8 x

5 u,w,v,x,y,s,z

- - - - - - - - 6 y - - 8 x

6 u,w,v,x,y,s,z,t

- - - - - - - - - - - - 8 x

28

Link-State RoutingEach router keeps track of the state of its incident links

Link-state: working or non-workingCost (delay, throughput)

Each router floods the link state in the entire networkEvery router gets a complete view of the network

Each router runs Dijkstra’s algorithm to obtain shortest paths to all other destinations

Link-state protocolsOpen Shortest Path First (OSPF)Intermediate System – Intermediate System (IS-IS)

29

Determining the State of a LinkBeaconing

Periodically exchange “hello” messages with neighborsDetect a failure after a threshold number of unanswered “hellos”

HELLOA

HELLOB HELLOB

HELLOCB C

A

Distributing Link-State InfoFlood the entire network

Every node forwards link-state packet on all links but the incoming one

30

Link-State PacketsPackets to be distributed

Sequence number prevents nodes from using old messagesAge determines a time to live for the packet (why do we need this?)

31

32

When to Initiate FloodingTopology change

Link or node failureLink or node recovery

Configuration changeLink cost change

PeriodicallyRefresh the link-state informationTypically (say) 30 minutesCorrects for possible corruption of the data

Link State vs. Distance VectorLink State

Tell every node in the network about your immediate neighbors

Distance VectorTell only to your neighbors about every node in the network

33

Open Shortest Path First ProtocolFormat of an OSPF message

Version: 1-4, 1:Hello msg, 2: request, 3:send, 4: AckArea Id: area where node is connected in case of hierarchical routingAuthentication type: 0:none, 1:simple pswd, 2: MAC

34

Type 1: cost of linksType 2: networks connectedOther types: Hierarchy infoLS Age: TTLLink-state ID, Advertising router:

32-bit address of routerLength: length in bytes of the LSALink ID, data, type: identify the link Type of Service (TOS): Allows assignment of different metrics for

different services for the same link

Link State Advertisements (LSA)

35

Link MetricsHop count: Assign a metric of one at every hop

Least-cost route Least-hops route

Delay: Delay= Tack – Tarr = (Td – Tarr) + Tt + 2 TpWeight assigned to each link = average delay for packets passing through

Problems with simply using delayInstability: A heavily loaded link would oscillate between busy and idle statesWide value range: a link could look hundreds of time more expensive than

another – may cause very long routes

36

Suppression of the Dynamic RangeNew metric based on link utilization

Highly loaded link never shows a cost more than three times its idle costThe most expensive link is only seven times the cost of the least expensiveA high–speed satellite link is more attractive than a low speed terrestrial link Cost is a function of link utilization only at moderate to high loads

37

Link Metrics in the Real WorldFor the most part metrics are static

No dynamic adjustment, but hardcoded by network administrators

Avoids route oscillation problems

Most commonly used metric

w = c/B, where c is a constant and B is the link bandwidth

38

Hierarchical RoutingA scalable solution for very large networksCluster routers into areas or regions

39

Hierarchical RoutingReduction in table size comes at a cost

The route between a particular node pair may not necessarily be the shortest

For large networks, how many levels should the hierarchy have?

Example: Network with 720 nodes1 level:

720 entries

2 levels: 24 regions and 30 nodes per region29 (local) + 23 (region) = 52 entries

3 levels: 8 clusters; 9 regions/cluster; 10 routers/region9 (local) + 8 (region) + 7 (cluster) = 24 entries

40

top related