Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Successfully reported this slideshow.

Like this presentation? Why not share!

No Downloads

Total views

571

On SlideShare

0

From Embeds

0

Number of Embeds

3

Shares

0

Downloads

13

Comments

0

Likes

1

No embeds

No notes for slide

- 1. Data and ComputerData 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 SwitchedRouting in Switched NetworksNetworks
- 2. 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 pasttime a train comes in I feel that it has broken past batteries of besiegers, and that man has won a battlebatteries of besiegers, and that man has won a battle against chaos. You say contemptuously that when oneagainst chaos. You say contemptuously that when one has left Sloane Square one must come to Victoria. Ihas left Sloane Square one must come to Victoria. I say that one might do a thousand things instead, andsay that one might do a thousand things instead, and that whenever I really come there I have the sense ofthat whenever I really come there I have the sense of hairbreadth escape. And when I hear the guard shouthairbreadth escape. And when I hear the guard shout out the word 'Victoria', it is not an unmeaning word.out the word 'Victoria', it is not an unmeaning word. It is to me the cry of a herald announcing conquest. ItIt is to me the cry of a herald announcing conquest. It is to me indeed 'Victoria'; it is the victory of Adam."is 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
- 3. RoutingRouting in Packet Switchedin 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
- 4. 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”
- 5. Example Packet SwitchedExample Packet Switched NetworkNetwork
- 6. 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
- 7. Network Information SourceNetwork Information Source and Update Timingand Update Timing routing decisions usually based on knowledge ofrouting decisions usually based on knowledge of network (not always)network (not always) distributed routingdistributed routing • using local knowledge, info from adjacent nodes, info from allusing 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
- 8. Routing Strategies - FixedRouting Strategies - Fixed RoutingRouting use a single permanent route for eachuse 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
- 9. FixedFixed RoutingRouting TablesTables
- 10. 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 duplicateseach 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 tonodes 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
- 11. FloodingFlooding ExampleExample
- 12. Properties of FloodingProperties of Flooding all possible routes are triedall possible routes are tried very robustvery robust at least one packet will have takenat 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
- 13. Routing Strategies - RandomRouting Strategies - Random RoutingRouting simplicity of flooding with much less loadsimplicity of flooding with much less load node selects one outgoing path fornode 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 ona 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 costbut a random route is typically neither least cost nor minimum hopnor minimum hop
- 14. Routing Strategies - AdaptiveRouting Strategies - Adaptive RoutingRouting used by almost all packet switching networksused by almost all packet switching networks routing decisions change as conditions on therouting 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 irrelevantreacting too slowly means info may be irrelevant
- 15. Adaptive Routing -Adaptive Routing - AdvantagesAdvantages improved performanceimproved performance aid congestion controlaid congestion control but since is a complex system, may notbut 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
- 16. Classification of AdaptiveClassification 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
- 17. Isolated Adaptive RoutingIsolated Adaptive Routing
- 18. ARPANET Routing StrategiesARPANET Routing Strategies 1st Generation1st Generation 19691969 distributed adaptive using estimated delaydistributed adaptive using estimated delay queue length used as estimate of delayqueue length used as estimate of delay using Bellman-Ford algorithmusing 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
- 19. ARPANET Routing StrategiesARPANET Routing Strategies 2nd 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 betweenunder heavy loads, little correlation between reported delays and those experiencedreported delays and those experienced
- 20. ARPANET Routing StrategiesARPANET Routing Strategies 3rd 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 andmeasure average delay over last 10 secs and transform into link utilization estimatetransform into link utilization estimate normalize this based on current value andnormalize this based on current value and previous resultsprevious results set link cost as function of average utilizationset link cost as function of average utilization
- 21. 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 sumfines 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
- 22. Dijkstra’s AlgorithmDijkstra’s Algorithm finds shortest paths from given sourcefinds shortest paths from given source nodenode ss to all other nodesto all other nodes by developing paths in order of increasingby 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 processedterminates when all nodes processed by algorithm (in set T)by algorithm (in set T)
- 23. Dijkstra’s Algorithm MethodDijkstra’s Algorithm Method Step 1Step 1 [Initialization][Initialization] T = {s}T = {s} SSet of nodes so far incorporatedet 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 costspath costs to neighboring nodes are simply link costs StepStep 22 [Get Next Node][Get Next Node] find neighboring node not in Tfind neighboring node not in T withwith least-cost path from sleast-cost path from s inincorporate node into Tcorporate node into T also incorporate the edge that is incident on that node and aalso 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 StepStep 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 ∉∉ TT if latter term is minimum, path from s to n is path from s to xif 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
- 24. Dijkstra’s Algorithm ExampleDijkstra’s Algorithm Example
- 25. Dijkstra’s Algorithm ExampleDijkstra’s Algorithm Example Iter 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
- 26. Bellman-Ford AlgorithmBellman-Ford Algorithm find shortest paths from given nodefind shortest paths from given node subject to constraint that paths contain atsubject to constraint that paths contain at most one linkmost one link findfind the shortest paths with a constraint ofthe shortest paths with a constraint of paths of at most two linkspaths of at most two links andand so onso on
- 27. Bellman-Ford AlgorithmBellman-Ford Algorithm stepstep 1 [Initialization]1 [Initialization] LL00(n) =(n) = ∞∞, for all n, for all n ≠≠ ss LLhh(s) = 0, for all h(s) = 0, for all h stepstep 2 [Update]2 [Update] for each successive hfor each successive h ≥≥ 00 • for each n ≠ s, compute:for each n ≠ s, compute: LLh+1h+1((nn)=)=minmin jj[[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 differentany 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 nfrom s to n terminates with link from j to n
- 28. Example of Bellman-FordExample of Bellman-Ford AlgorithmAlgorithm
- 29. Results of Bellman-FordResults of Bellman-Ford ExampleExampleh 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
- 30. ComparisonComparison results from two algorithms agreeresults from two algorithms agree Bellman-FordBellman-Ford calculation for node n needs link cost to neighbouringcalculation 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 foreach 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 informationcan 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
- 31. EvaluationEvaluation dependent ondependent 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 onif link costs depend on traffic, which depends on routes chosen, may have feedback instabilityroutes chosen, may have feedback instability
- 32. 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

No public clipboards found for this slide

Be the first to comment