12 routing(1)

32
Data and Computer Data and Computer Communications Communications Eighth Edition Eighth Edition by William Stallings by William Stallings Lecture slides by Lawrie Lecture slides by Lawrie Brown Brown Chapter 12 – Chapter 12 – Routing in Routing in Switched Networks Switched Networks

Transcript of 12 routing(1)

Page 1: 12 routing(1)

Data and Computer Data and Computer CommunicationsCommunications

Eighth EditionEighth Edition

by William Stallingsby William Stallings

Lecture slides by Lawrie BrownLecture slides by Lawrie Brown

Chapter 12 – Chapter 12 – Routing in Switched Routing in Switched NetworksNetworks

Page 2: 12 routing(1)

Routing in Switched NetworksRouting in Switched Networks

"I tell you," went on Syme with passion, "that every "I tell you," went on Syme with passion, "that every time a train comes in I feel that it has broken past time a train comes in I feel that it has broken past batteries of besiegers, and that man has won a battle batteries of besiegers, and that man has won a battle against chaos. You say contemptuously that when one against chaos. You say contemptuously that when one has left Sloane Square one must come to Victoria. I say has left Sloane Square one must come to Victoria. I say that one might do a thousand things instead, and that that one might do a thousand things instead, and that whenever I really come there I have the sense of whenever I really come there I have the sense of hairbreadth escape. And when I hear the guard shout hairbreadth escape. And when I hear the guard shout out the word 'Victoria', it is not an unmeaning word. It out the word 'Victoria', it is not an unmeaning word. It is to me the cry of a herald announcing conquest. It is is to me the cry of a herald announcing conquest. It is to me indeed 'Victoria'; it is the victory of Adam."to me indeed 'Victoria'; it is the victory of Adam."

——The Man Who Was ThursdayThe Man Who Was Thursday, G.K. Chesterton, G.K. Chesterton

Page 3: 12 routing(1)

RoutingRouting in Packet Switched in Packet Switched NetworkNetwork

key design issue for (packet) switched networkskey design issue for (packet) switched networks select route across network between end nodesselect route across network between end nodes characteristics required:characteristics required:

correctnesscorrectness simplicitysimplicity robustnessrobustness stabilitystability fairnessfairness optimalityoptimality efficiencyefficiency

Page 4: 12 routing(1)

Performance CriteriaPerformance Criteria

used for selection of routeused for selection of route simplest is “minimum hop”simplest is “minimum hop” can be generalized as “least cost”can be generalized as “least cost”

Page 5: 12 routing(1)

Example Packet Switched Example Packet Switched NetworkNetwork

Page 6: 12 routing(1)

Decision Time and PlaceDecision Time and Place

timetime packet or virtual circuit basispacket or virtual circuit basis fixed or dynamically changingfixed or dynamically changing

placeplace distributed - made by each nodedistributed - made by each node centralizedcentralized sourcesource

Page 7: 12 routing(1)

Network Information Source Network Information Source and Update Timingand Update Timing

routing decisions usually based on knowledge of routing decisions usually based on knowledge of network (not always)network (not always) distributed routingdistributed routing

• using local knowledge, info from adjacent nodes, info from all using local knowledge, info from adjacent nodes, info from all nodes on a potential routenodes on a potential route

central routingcentral routing• collect info from all nodescollect info from all nodes

issue of update timingissue of update timing when is network info held by nodes updatedwhen is network info held by nodes updated fixed - never updatedfixed - never updated adaptive - regular updatesadaptive - regular updates

Page 8: 12 routing(1)

Routing Strategies - Fixed Routing Strategies - Fixed RoutingRouting

use a single permanent route for each use a single permanent route for each source to destination pairsource to destination pair

determined using a least cost algorithmdetermined using a least cost algorithm route is fixedroute is fixed

at least until a change in network topologyat least until a change in network topology hence cannot respond to traffic changeshence cannot respond to traffic changes

advantage is simplicityadvantage is simplicity disadvantage is lack of flexibilitydisadvantage is lack of flexibility

Page 9: 12 routing(1)

Fixed Fixed RoutingRoutingTablesTables

Page 10: 12 routing(1)

Routing Strategies - FloodingRouting Strategies - Flooding

packet sent by node to every neighborpacket sent by node to every neighbor eventually multiple copies arrive at destinationeventually multiple copies arrive at destination no network info requiredno network info required each packet is uniquely numbered so duplicates each packet is uniquely numbered so duplicates

can be discardedcan be discarded need some way to limit incessant retransmissionneed some way to limit incessant retransmission

nodes can remember packets already forwarded to nodes can remember packets already forwarded to keep network load in boundskeep network load in bounds

or include a hop count in packetsor include a hop count in packets

Page 11: 12 routing(1)

Flooding Flooding ExampleExample

Page 12: 12 routing(1)

Properties of FloodingProperties of Flooding

all possible routes are triedall possible routes are tried very robustvery robust

at least one packet will have taken at least one packet will have taken minimum hop count routeminimum hop count route can be used to set up virtual circuitcan be used to set up virtual circuit

all nodes are visitedall nodes are visited useful to distribute information (eg. routing)useful to distribute information (eg. routing)

disadvantage is high traffic load generateddisadvantage is high traffic load generated

Page 13: 12 routing(1)

Routing Strategies - Random Routing Strategies - Random RoutingRouting

simplicity of flooding with much less loadsimplicity of flooding with much less load node selects one outgoing path for node selects one outgoing path for

retransmission of incoming packetretransmission of incoming packet selection can be random or round robinselection can be random or round robin a refinement is to select outgoing path based on a refinement is to select outgoing path based on

probability calculationprobability calculation no network info neededno network info needed but a random route is typically neither least cost but a random route is typically neither least cost

nor minimum hopnor minimum hop

Page 14: 12 routing(1)

Routing Strategies - Adaptive Routing Strategies - Adaptive RoutingRouting

used by almost all packet switching networksused by almost all packet switching networks routing decisions change as conditions on the routing decisions change as conditions on the

network change due to failure or congestionnetwork change due to failure or congestion requires info about networkrequires info about network disadvantages:disadvantages:

decisions more complexdecisions more complex tradeoff between quality of network info and overheadtradeoff between quality of network info and overhead reacting too quickly can cause oscillationreacting too quickly can cause oscillation reacting too slowly means info may be irrelevant reacting too slowly means info may be irrelevant

Page 15: 12 routing(1)

Adaptive Routing - Adaptive Routing - AdvantagesAdvantages

improved performanceimproved performance aid congestion control aid congestion control but since is a complex system, may not but since is a complex system, may not

realize theoretical benefitsrealize theoretical benefits cf. outages on many packet-switched netscf. outages on many packet-switched nets

Page 16: 12 routing(1)

Classification of Adaptive Classification of Adaptive Routing StartegiesRouting Startegies

based on information sourcesbased on information sources local (isolated)local (isolated)

• route to outgoing link with shortest queueroute to outgoing link with shortest queue• can include bias for each destinationcan include bias for each destination• Rarely used - does not make use of available infoRarely used - does not make use of available info

adjacent nodesadjacent nodes• takes advantage on delay / outage infotakes advantage on delay / outage info• distributed or centralizeddistributed or centralized

all nodesall nodes• like adjacentlike adjacent

Page 17: 12 routing(1)

Isolated Adaptive RoutingIsolated Adaptive Routing

Page 18: 12 routing(1)

ARPANET Routing StrategiesARPANET Routing Strategies1st Generation1st Generation

19691969 distributed adaptive using estimated delay distributed adaptive using estimated delay

queue length used as estimate of delayqueue length used as estimate of delay using Bellman-Ford algorithm using Bellman-Ford algorithm node exchanges delay vector with neighborsnode exchanges delay vector with neighbors update routing table based on incoming infoupdate routing table based on incoming info problems:problems:

doesn't consider line speed, just queue lengthdoesn't consider line speed, just queue length queue length not a good measurement of delayqueue length not a good measurement of delay responds slowly to congestionresponds slowly to congestion

Page 19: 12 routing(1)

ARPANET Routing StrategiesARPANET Routing Strategies2nd Generation2nd Generation

19791979 distributed adaptive using measured delaydistributed adaptive using measured delay

using timestamps of arrival, departure & ACK timesusing timestamps of arrival, departure & ACK times recomputes average delays every 10secsrecomputes average delays every 10secs any changes are flooded to all other nodesany changes are flooded to all other nodes recompute routing using Dijkstra’s algorithmrecompute routing using Dijkstra’s algorithm good under light and medium loadsgood under light and medium loads under heavy loads, little correlation between under heavy loads, little correlation between

reported delays and those experiencedreported delays and those experienced

Page 20: 12 routing(1)

ARPANET Routing StrategiesARPANET Routing Strategies3rd Generation3rd Generation

19871987 link cost calculations changedlink cost calculations changed

to damp routing oscillationsto damp routing oscillations and reduce routing overheadand reduce routing overhead

measure average delay over last 10 secs and measure average delay over last 10 secs and transform into link utilization estimatetransform into link utilization estimate

normalize this based on current value and normalize this based on current value and previous resultsprevious results

set link cost as function of average utilizationset link cost as function of average utilization

Page 21: 12 routing(1)

Least Cost AlgorithmsLeast Cost Algorithms

basis for routing decisionsbasis for routing decisions can minimize hop with each link cost 1can minimize hop with each link cost 1 or have link value inversely proportional to capacityor have link value inversely proportional to capacity

dedefines cost of path between two nodes as sum fines cost of path between two nodes as sum of costs of links traversedof costs of links traversed in network of nodes connected by bi-directional linksin network of nodes connected by bi-directional links where ewhere each link has a cost in each directionach link has a cost in each direction

for each pair of nodes, find path with least costfor each pair of nodes, find path with least cost link costs in different directions may be differentlink costs in different directions may be different

alternatives: alternatives: Dijkstra or Bellman-Ford algorithmsDijkstra or Bellman-Ford algorithms

Page 22: 12 routing(1)

Dijkstra’s AlgorithmDijkstra’s Algorithm

finds shortest paths from given source finds shortest paths from given source node node ss to all other nodes to all other nodes

by developing paths in order of increasing by developing paths in order of increasing path lengthpath length

algorithm runs in stages (next slide)algorithm runs in stages (next slide) each time adding node with next shortest patheach time adding node with next shortest path

algorithmalgorithm terminates when all nodes processed terminates when all nodes processed by algorithm (in set T)by algorithm (in set T)

Page 23: 12 routing(1)

Dijkstra’s Algorithm MethodDijkstra’s Algorithm Method Step 1 Step 1 [Initialization] [Initialization]

T = {s}T = {s} S Set of nodes so far incorporated et of nodes so far incorporated L(n) = w(s, n) for n ≠ sL(n) = w(s, n) for n ≠ s initialinitial path costs to neighboring nodes are simply link costs path costs to neighboring nodes are simply link costs

Step Step 22 [Get Next Node][Get Next Node] find neighboring node not in T find neighboring node not in T withwith least-cost path from s least-cost path from s inincorporate node into Tcorporate node into T also incorporate the edge that is incident on that node and a also incorporate the edge that is incident on that node and a

node in T that contributes to the pathnode in T that contributes to the path

Step Step 33 [Update Least-Cost Paths][Update Least-Cost Paths] L(n) = min[L(n), L(x) + w(x, n)]L(n) = min[L(n), L(x) + w(x, n)] for all nfor all n T T if latter term is minimum, path from s to n is path from s to x if latter term is minimum, path from s to n is path from s to x

concatenated with edge from x to nconcatenated with edge from x to n

Page 24: 12 routing(1)

Dijkstra’s Algorithm ExampleDijkstra’s Algorithm Example

Page 25: 12 routing(1)

Dijkstra’s Algorithm ExampleDijkstra’s Algorithm ExampleIter T L(2) Path L(3) Path L(4) Path L(5) Path L(6

)Path

1 {1} 2 1–2 5 1-3 1 1–4 - -

2 {1,4} 2 1–2 4 1-4-3 1 1–4 2 1-4–5 -

3 {1, 2, 4} 2 1–2 4 1-4-3 1 1–4 2 1-4–5 -

4 {1, 2, 4, 5}

2 1–2 3 1-4-5–3 1 1–4 2 1-4–5 4 1-4-5–6

5 {1, 2, 3, 4, 5}

2 1–2 3 1-4-5–3 1 1–4 2 1-4–5 4 1-4-5–6

6 {1, 2, 3, 4, 5, 6}

2 1-2 3 1-4-5-3 1 1-4 2 1-4–5 4 1-4-5-6

Page 26: 12 routing(1)

Bellman-Ford AlgorithmBellman-Ford Algorithm

find shortest paths from given node find shortest paths from given node subject to constraint that paths contain at subject to constraint that paths contain at most one linkmost one link

findfind the shortest paths with a constraint of the shortest paths with a constraint of paths of at most two linkspaths of at most two links

andand so on  so on 

Page 27: 12 routing(1)

Bellman-Ford AlgorithmBellman-Ford Algorithm

step step 1 [Initialization]1 [Initialization] LL00(n) = (n) = , for all n , for all n s s LLhh(s) = 0, for all h(s) = 0, for all h

step step 2 [Update] 2 [Update] for each successive h for each successive h 0 0

• for each n ≠ s, compute: for each n ≠ s, compute: LLh+1h+1((nn)=)=minminjj[[LLhh((jj)+)+ww((j,nj,n)])]

connect n with predecessor node j that gives minconnect n with predecessor node j that gives min eliminateeliminate any connection of n with different any connection of n with different

predecessor node formed during an earlier iterationpredecessor node formed during an earlier iteration pathpath from s to n terminates with link from j to n from s to n terminates with link from j to n

Page 28: 12 routing(1)

Example of Bellman-Ford Example of Bellman-Ford AlgorithmAlgorithm

Page 29: 12 routing(1)

Results of Bellman-Ford Results of Bellman-Ford ExampleExample

h Lh(2) Path Lh(3) Path Lh(4) Path Lh(5) Path Lh(6) Path

0 - - - - -

1 2 1-2 5 1-3 1 1-4 - -

2 2 1-2 4 1-4-3 1 1-4 2 1-4-5 10 1-3-6

3 2 1-2 3 1-4-5-3 1 1-4 2 1-4-5 4 1-4-5-6

4 2 1-2 3 1-4-5-3 1 1-4 2 1-4-5 4 1-4-5-6

Page 30: 12 routing(1)

ComparisonComparison results from two algorithms agreeresults from two algorithms agree Bellman-FordBellman-Ford

calculation for node n needs link cost to neighbouring calculation for node n needs link cost to neighbouring nodes plus total cost to each neighbour from snodes plus total cost to each neighbour from s

each node can maintain set of costs and paths for each node can maintain set of costs and paths for every other nodeevery other node

can exchange information with direct neighborscan exchange information with direct neighbors can update costs and paths based on information can update costs and paths based on information

from neighbors and knowledge of link costsfrom neighbors and knowledge of link costs DijkstraDijkstra

each node needs complete topologyeach node needs complete topology must know link costs of all links in networkmust know link costs of all links in network must exchange information with all other nodesmust exchange information with all other nodes

Page 31: 12 routing(1)

EvaluationEvaluation

dependent on dependent on processing time of algorithmsprocessing time of algorithms amount of information required from other nodesamount of information required from other nodes

implementation specificimplementation specific both converge under static topology and costsboth converge under static topology and costs both converge to same solutionboth converge to same solution if link costs change, algs attempt to catch upif link costs change, algs attempt to catch up if link costs depend on traffic, which depends on if link costs depend on traffic, which depends on

routes chosen, may have feedback instabilityroutes chosen, may have feedback instability

Page 32: 12 routing(1)

SummarySummary

routing in packet-switched networksrouting in packet-switched networks routing strategiesrouting strategies

fixed, flooding, random,adaptivefixed, flooding, random,adaptive ARPAnet examplesARPAnet examples least-cost algorithmsleast-cost algorithms

Dijkstra, Bellman-FordDijkstra, Bellman-Ford