Where we are in the ourse More fun in the Network Layer! We ve covered packet forwarding Now we ll learn about roung Applicaon Transport Network Link Physical SE 61 University of Washington 1
Roung versus orwarding orwarding is the process of sending a packet on its way Roung is the process of deciding in which direcon to send traffic orward! packet Which way? Which way? Which way? SE 61 University of Washington
Improving on the Spanning Tree Spanning tree provides basic connecvity e.g., some path Bà Roung uses all links to find best paths e.g., use B, BE, and E Unused A B A B E E SE 61 University of Washington
Perspecve on Bandwidth Allocaon Roung allocates network bandwidth adapng to failures; other mechanisms used at other mescales Mechanism Load-sensitive routing Routing Traffic Engineering Provisioning Timescale / Adaptation Seconds / Traffic hotspots Minutes / Equipment failures Hours / Network load Months / Network customers SE 61 University of Washington
elivery Models ifferent roung used for different delivery models Unicast ( 5.) Broadcast ( 5..7) Mulcast ( 5..8) Anycast ( 5..9) SE 61 University of Washington 5
Goals of Roung Algorithms We want several properes of any roung scheme: Property Meaning orrectness inds paths that work Efficient paths Uses network bandwidth well air paths oesn t starve any nodes ast convergence Recovers quickly after changes Scalability Works well as network grows large SE 61 University of Washington 6
Rules of Roung Algorithms ecentralized, distributed secng All nodes are alike; no controller Nodes only know what they learn by exchanging messages with neighbors Nodes operate concurrently May be node/link/message failures Who s there? SE 61 University of Washington 7
Topics IPv, IPv6, NATs and all that Shortest path roung istance Vector roung looding Link-state roung Equal-cost mul-path Inter-domain roung (BGP) Last me This me SE 61 University of Washington 8
Topic efining best paths with link costs These are shortest path routes G E A B Best? H SE 61 University of Washington 9
What are Best paths anyhow? Many possibilies: Latency, avoid circuitous paths Bandwidth, avoid slow links Money, avoid expensive links G E Hops, to reduce switching But only consider topology Ignore workload, e.g., hotspots A H B SE 61 University of Washington 10
Shortest Paths We ll approximate best by a cost funcon that captures the factors Olen call lowest shortest 1. Assign each link a cost (distance). efine best path between each pair of nodes as the path that has the lowest total cost (or is shortest). Pick randomly to any break es SE 61 University of Washington 11
Shortest Paths () ind the shortest path A à E All links are bidireconal, with equal costs in each direcon an extend model to unequal costs if needed G A B H 10 E 1 SE 61 University of Washington 1
Shortest Paths () ABE is a shortest path dist(abe) = + + 1 = 7 This is less than: dist(abe) = 8 dist(abe) = 9 dist(ae) = 10 dist(abe) = 10 G A B H 10 E 1 SE 61 University of Washington 1
Shortest Paths () Opmality property: Subpaths of shortest paths are also shortest paths ABE is a shortest path àso are AB, AB, BE, B, E A G B H 10 E 1 SE 61 University of Washington 1
Sink Trees Sink tree for a desnaon is the union of all shortest paths towards the desnaon Similarly source tree ind the sink tree for E G A B H 10 E 1 SE 61 University of Washington 15
Sink Trees () Implicaons: Only need to use desnaon to follow shortest paths Each node only need to send to the next hop orwarding table at a node A Lists next hop for each desnaon Roung table may know more G B H 10 E 1 SE 61 University of Washington 16
Topic How to compute shortest paths given the network topology With ijkstra s algorithm G A B H 10 E 1 Source tree for E SE 61 University of Washington 17
Edsger W. ijkstra (190-00) amous computer scienst Programming languages istributed algorithms Program verificaon ijkstra s algorithm, 1969 Single-source shortest paths, given network with non-negave link costs By Hamilton Richards, -BY-SA-.0, via Wikimedia ommons SE 61 University of Washington 18
ijkstra s Algorithm Algorithm: Mark all nodes tentave, set distances from source to 0 (zero) for source, and (infinity) for all other nodes While tentave nodes remain: Extract N, a node with lowest distance Add link to N to the shortest path tree Relax the distances of neighbors of N by lowering any berer distance esmates SE 61 University of Washington 19
Inializaon ijkstra s Algorithm () G We ll compute shortest paths from A E 10 0 1 A B H SE 61 University of Washington 0
Relax around A ijkstra s Algorithm () E G 10 10 0 1 A B H SE 61 University of Washington 1
Relax around B ijkstra s Algorithm () G istance fell! 7 7 E 8 10 0 1 A B H 6 SE 61 University of Washington
ijkstra s Algorithm (5) Relax around 7 G 0 A B 7 10 E 1 7 istance fell again! 8 H 9 6 SE 61 University of Washington
ijkstra s Algorithm (6) Relax around G (say) 7 G 0 A B 7 10 idn t fall E 7 1 8 H 9 6 SE 61 University of Washington
ijkstra s Algorithm (7) Relax around (say) 7 G 0 A B 7 10 Relax has no effect E 7 8 1 H 9 6 SE 61 University of Washington 5
ijkstra s Algorithm (8) Relax around E 7 G 0 A B 7 10 E 1 7 8 H 9 6 SE 61 University of Washington 6
ijkstra s Algorithm (9) Relax around 7 G 0 A B 7 10 E 1 7 8 H 9 6 SE 61 University of Washington 7
ijkstra s Algorithm (10) inally, H done 7 G 0 A B 7 10 E 1 7 8 H 9 6 SE 61 University of Washington 8
ijkstra omments inds shortest paths in order of increasing distance from source Leverages opmality property Runme depends on efficiency of extracng min-cost node Superlinear in network size (grows fast) Gives complete source/sink tree More than needed for forwarding! But requires complete topology SE 61 University of Washington 9
Topic How to compute shortest paths in a distributed network The istance Vector (V) approach Here s my vector! Here s mine SE 61 University of Washington 0
istance Vector Roung Simple, early roung approach Used in ARPANET, and RIP One of two main approaches to roung istributed version of Bellman-ord Works, but very slow convergence aler some failures Link-state algorithms are now typically used in pracce More involved, berer behavior SE 61 University of Washington 1
istance Vector Secng Each node computes its forwarding table in a distributed secng: 1. Nodes know only the cost to their neighbors; not the topology. Nodes can talk only to their neighbors using messages. All nodes run the same algorithm concurrently. Nodes and links may fail, messages may be lost SE 61 University of Washington
istance Vector Algorithm Each node maintains a vector of distances (and next hops) to all desnaons 1. Inialize vector with 0 (zero) cost to self, (infinity) to other desnaons. Periodically send vector to neighbors. Update vector for each desnaon by selecng the shortest distance heard, aler adding cost of neighbor link Use the best neighbor for forwarding SE 61 University of Washington
istance Vector () onsider from the point of view of node A an only talk to nodes B and E Inial vector To ost A 0 B E G H G A H B 10 E 1 SE 61 University of Washington
istance Vector () irst exchange with B, E; learn best 1-hop routes To B E says says A B 0 E 0 G H B E + +10 10 A s ost A s Next 0 -- B -- -- 10 E -- -- -- Learned berer route G A H B 10 E 1 SE 61 University of Washington 5
istance Vector () Second exchange; learn best -hop routes To B E says says A 10 B 0 1 E 0 G H B E + +10 8 0 1 6 11 1 8 10 7 1 7 A s ost A s Next 0 -- B 6 B 1 E 8 B 7 B 7 B -- G A H B 10 E 1 SE 61 University of Washington 6
istance Vector () Third exchange; learn best -hop routes To B E says says A 8 B 0 1 E 0 G 6 H 5 B E + +10 8 18 1 6 11 8 1 7 10 7 1 7 16 9 1 A s ost A s Next 0 -- B 6 B 8 B 7 B 7 B 7 B 9 B G A H B 10 E 1 SE 61 University of Washington 7
istance Vector (5) Subsequent exchanges; converged To B E says says A 7 B 0 1 E 0 G 6 H 5 B E + +10 8 17 1 6 11 8 1 7 10 7 1 7 16 9 1 A s ost A s Next 0 -- B 6 B 8 B 8 B 7 B 7 B 9 B G A B H 10 E 1 SE 61 University of Washington 8
istance Vector ynamics Adding routes: News travels one hop per exchange Removing routes When a node fails, no more exchanges, other nodes forget But parons (unreachable nodes in divided network) are a problem ount to infinity scenario SE 61 University of Washington 9
V ynamics () Good news travels quickly, bad news slowly (inferred) X esired convergence ount to infinity scenario SE 61 University of Washington 0
Various heuriscs to address e.g., Split horizon, poison V ynamics () reverse (on t send route back to where you learned it from.) But none are very effecve Link state now favored in pracce Except when very resource-limited SE 61 University of Washington 1
Topic How to broadcast a message to all nodes in the network with flooding Simple mechanism, but inefficient lood! SE 61 University of Washington
looding Rule used at each node: Sends an incoming message on to all other neighbors Remember the message so that it is only flood once Inefficient because one node may receive mulple copies of message SE 61 University of Washington
looding () onsider a flood from A; first reaches B via AB, E via AE G E A B H SE 61 University of Washington
looding () Next B floods B, BE, B, BG, and E floods EB, E, E, E gets copies G E E and B send to each other A B H SE 61 University of Washington 5
looding () floods, H; floods ; floods G; G floods G gets another copy G E A B H SE 61 University of Washington 6
looding (5) H has no-one to flood and we re done G E Each link carries the message, and in at least one direcon A B H SE 61 University of Washington 7
looding etails Remember message (to stop flood) using source and sequence number So next message (with higher sequence number) will go through To make flooding reliable, use ARQ So receiver acknowledges, and sender resends if needed SE 61 University of Washington 8
Topic How to compute shortest paths in a distributed network The Link-State (LS) approach lood! then compute SE 61 University of Washington 9
Link-State Roung One of two approaches to roung Trades more computaon than distance vector for berer dynamics Widely used in pracce Used in Internet/ARPANET from 1979 Modern networks use OSP and IS-IS SE 61 University of Washington 50
Link-State Secng Nodes compute their forwarding table in the same distributed secng as for distance vector: 1. Nodes know only the cost to their neighbors; not the topology. Nodes can talk only to their neighbors using messages. All nodes run the same algorithm concurrently. Nodes/links may fail, messages may be lost SE 61 University of Washington 51
Link-State Algorithm Proceeds in two phases: 1. Nodes flood topology in the form of link state packets Each node learns full topology. Each node computes its own forwarding table By running ijkstra (or equivalent) SE 61 University of Washington 5
Phase 1: Topology isseminaon Each node floods link state packet (LSP) that describes their poron of the topology Node E s LSP flooded to A, B,,, and Seq. # A 10 B 1 G A B H 10 E 1 SE 61 University of Washington 5
Phase : Route omputaon Each node has full topology By combining all LSPs Each node simply runs ijkstra Some replicated computaon, but finds required routes directly ompile forwarding table from sink/ source tree That s it folks! SE 61 University of Washington 5
orwarding Table SE 61 University of Washington 55 To Next A B E -- G H A B E G H 1 10 Source Tree for E (from ijkstra) E s orwarding Table
Handling hanges On change, flood updated LSPs, and re-compute routes E.g., nodes adjacent to failed link or node iniate B s LSP Seq. # A E G s LSP Seq. # B E G ailure! G XXXX SE 61 University of Washington 56 A H B 10 E 1
Handling hanges () Link failure Both nodes noce, send updated LSPs Link is removed from topology Node failure All neighbors noce a link has failed ailed node can t update its own LSP But it is OK: all links to node removed SE 61 University of Washington 57
Handling hanges () Addion of a link or node Add LSP of new node to topology Old LSPs are updated with new link Addions are the easy case SE 61 University of Washington 58
Link-State omplicaons Things that can go wrong: Seq. number reaches max, or is corrupted Node crashes and loses seq. number Network parons then heals Strategy: Include age on LSPs and forget old informaon that is not refreshed Much of the complexity is due to handling corner cases (as usual!) SE 61 University of Washington 59
V/LS omparison Goal istance Vector Link-State orrectness istributed Bellman-ord Replicated ijkstra Efficient paths air paths Approx. with shortest paths Approx. with shortest paths Approx. with shortest paths Approx. with shortest paths ast convergence Slow many exchanges ast flood and compute Scalability Excellent storage/compute Moderate storage/compute SE 61 University of Washington 60