Hwajung Lee. Why graph algorithms ? It is not a “graph theory” course! Many problems in networks can be modeled as graph problems. Note that -The topology.

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Chapter 4 Distributed Bellman-Ford Routing
Joining LANs - Bridges. Connecting LANs 4 Repeater –Operates at the Physical layer no decision making, processing signal boosting only 4 Bridges –operates.
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
Lecture 7: Synchronous Network Algorithms
Routing Protocol.
Minimum Spanning Trees
Minimum Spanning Trees
Courtesy: Nick McKeown, Stanford
Global State Collection. Global state collection Some applications - computing network topology - termination detection - deadlock detection Chandy-Lamport.
1 Minimum Spanning Trees Gallagher-Humblet-Spira (GHS) Algorithm.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
© nCode 2000 Title of Presentation goes here - go to Master Slide to edit - Slide 1 Reliable Communication for Highly Mobile Agents ECE 7995: Term Paper.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 22 Introduction to Computer Networks.
Chapter 4 Distance Vector Problems, and Link-State Routing Professor Rick Han University of Colorado at Boulder
Slide Set 15: IP Multicast. In this set What is multicasting ? Issues related to IP Multicast Section 4.4.
TCOM 501: Networking Theory & Fundamentals
A Distributed Algorithm for Minimum-Weight Spanning Trees by R. G. Gallager, P.A. Humblet, and P. M. Spira ACM, Transactions on Programming Language and.
1 Computer Networks Routing Algorithms. 2 IP Packet Delivery Two Processes are required to accomplish IP packet delivery: –Routing discovering and selecting.
Lecture 16 Distributed Graph (Routing) Algorithms Source: (1) Book “Distributed Systems: an Algorithmic Approach”, S. Gosh, Chapter “Graph.
Interval Routing Presented by: Marc Segal. Motivation(1) In a computer network a routing method is required so that nodes can communicate with each other.
Routing Algorithms (Ch5 of Computer Network by A. Tanenbaum)
Complexity of Bellman-Ford Theorem. The message complexity of Bellman-Ford algorithm is exponential. Proof outline. Consider a topology with an even number.
Distributed Algorithms 2014 Igor Zarivach A Distributed Algorithm for Minimum Weight Spanning Trees By Gallager, Humblet,Spira (GHS)
Broadcast & Convergecast Downcast & Upcast
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
1 Pertemuan 20 Teknik Routing Matakuliah: H0174/Jaringan Komputer Tahun: 2006 Versi: 1/0.
Routing in Communication Networks Routing: Network layer protocol that guides information units to correct destinations. A complex collection of decision.
1 Computer Communication & Networks Lecture 22 Network Layer: Delivery, Forwarding, Routing (contd.)
Network Layer introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol  datagram format  IPv4.
WAN technologies and routing Packet switches and store and forward Hierarchical addresses, routing and routing tables Routing table computation Example.
Graph Algorithms Many problems in networks can be modeled as graph problems. -The topology of a distributed system is a graph. - Routing table computation.
Minimum Spanning Tree Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) such that the sum of the weights of all the edges is minimum.
COSC 2007 Data Structures II Chapter 14 Graphs III.
10.- Graph Algorithms Centro de Investigación y Estudios Avanzados del Instituto Politécnico Nacional Introduction Routing Algorithms Computation of Shortest.
TCP Traffic and Congestion Control in ATM Networks
Network and Communications Ju Wang Chapter 5 Routing Algorithm Adopted from Choi’s notes Virginia Commonwealth University.
Data Communications and Networking Chapter 11 Routing in Switched Networks References: Book Chapters 12.1, 12.3 Data and Computer Communications, 8th edition.
Complexity of Bellman-Ford
A correction The definition of knot in page 147 is not correct. The correct definition is: A knot in a directed graph is a subgraph with the property that.
Spring 2006CS 3321 Intradomain Routing Outline Algorithms Scalability.
1 Computer Communication & Networks Lecture 21 Network Layer: Delivery, Forwarding, Routing Waleed.
Routing Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute of Information.
Minimum Spanning Tree. Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) such that the sum of the weights of all the edges is minimum.
Tree Constructions Distributed Algorithms for Multi-Agent Networks Instructor: K. Sinan YILDIRIM.
Global State Collection
A Framework for Reliable Routing in Mobile Ad Hoc Networks Zhenqiang Ye Srikanth V. Krishnamurthy Satish K. Tripathi.
Computer Networks22-1 Network Layer Delivery, Forwarding, and Routing.
2/14/2016  A. Orda, A. Segall, 1 Queueing Networks M nodes external arrival rate (Poisson) service rate in each node (exponential) upon service completion.
Spring 2000CS 4611 Routing Outline Algorithms Scalability.
Graph Algorithms Why graph algorithms ? It is not a “graph theory” course! Many problems in networks can be modeled as graph problems. Note that -The topology.
Spring Routing: Part I Section 4.2 Outline Algorithms Scalability.
Minimum Spanning Tree Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) such that the sum of the weights of all the edges is minimum.
Graph Algorithms Many problems in networks can be modeled as graph problems. -The topology of a distributed system is a graph. - Routing table computation.
CS 6401 Intra-domain Routing Outline Introduction to Routing Distance Vector Algorithm.
ECE 544 Protocol Design Project 2016 Nirali Shah Thara Philipson Nithin Raju Chandy.
Network Layer.
CS60002: Distributed Systems
Intra-Domain Routing Jacob Strauss September 14, 2006.
Routing: Distance Vector Algorithm
Routing in Packet Networks Shortest Path Routing
CS 3700 Networks and Distributed Systems
Intradomain Routing Outline Introduction to Routing
CS 640: Introduction to Computer Networks
Minimum Spanning Tree.
CS 3700 Networks and Distributed Systems
Global State Collection
Lecture 8: Synchronous Network Algorithms
Network Layer.
Presentation transcript:

Hwajung Lee

Why graph algorithms ? It is not a “graph theory” course! Many problems in networks can be modeled as graph problems. Note that -The topology of a distributed system is a graph. - Routing table computation uses the shortest path algorithm - Efficient broadcasting uses a spanning tree - Maxflow algorithm determines the maximum flow between a pair of nodes in a graph.

 Shortest path routing  Distance vector routing  Link state routing  Routing in sensor networks  Routing in peer-to-peer networks

Autonomous System AS0 AS1 AS2AS3 Intra-AS vs. Inter-AS routing Shortest Path First routing algorithm is the basis for OSPF Each AS is under a common administration

(borrowed from Cisco documentation

Most shortest path algorithms are adaptations of the classic Bellman-Ford algorithm. Computes shortest path if there are no cycle of negative weight. Let D(j) = shortest distance of j from initiator 0. Thus D(0) = 0 0 j k w(0,m), 0 (w(0,j)+w(j,k)), j The edge weights can represent latency or distance or some other appropriate parameter. Classical algorithms: Bellman-Ford, Dijkstra’s algorithm are found in most algorithm books. What is the difference between an ( ordinary ) graph algorithm and a distributed graph algorithm? m

Revisiting Bellman Ford : basic idea Consider a static topology Process 0 sends w(0,i),0 to neighbor i {program for process i} do message = (S,k)  S < D(i)  if parent ≠ k  parent := k fi; D(i) := S; send (D(i)+w(i,j),i) to each neighbor j ≠ parent;  message (S,k)  S ≥ D(i) --> skip od Computes the shortest distance to all nodes from an initiator node The parent pointers help the packets navigate to the initiator Current distance

Chandy & Misra’s algorithm : basic idea Consider a static topology Process 0 sends w(0,i),0 to neighbor i {for process i > 0} do message = (S,k)  S < D  if parent ≠ k  send ack to parent fi; parent := k; D := S; send (D + w(i,j), i) to each neighbor j ≠ parent; deficit := deficit + |N(i)| -1  message (S,k)  S ≥ D  send ack to sender  ack  deficit := deficit – 1 ÿ deficit = 0  parent  i  send ack to parent od Combines shortest path computation with termination detection. Termination is detected when the initiator receives ack from each neighbor

An important issue is: how well do such algorithms perform when the topology changes? No real network is static! Let us examine distance vector routing that is adaptation of the shortest path algorithm

Distance Vector D for each node i contains N elements D[i,0], D[i,1], D[i,2] … Initialize these to  {Here, D[i,j] defines its distance from node i to node j.} - Each node j periodically sends its distance vector to its immediate neighbors. - Every neighbor i of j, after receiving the broadcasts from its neighbors, updates its distance vector as follows:  k≠ i: D[i,k] = min k (w[i,j] + D[j,k] ) Used in RIP, IGRP etc D[j,k]=3 means j thinks k is 3 hops away

Node 1 thinks d(1,3) = 2 Node 2 thinks d(2,3) = d(1,3)+1 = 3 Node 1 thinks d(1,3) = d(2,3)+1 = 4 and so on. So it will take forever for the distances to stabilize. A partial remedy is the split horizon method that will prevent 1 from sending the advertisement about d(1,3) to 2 since its first hop is node 2 Observe what can happen when the link (2,3) fails.  k≠ i: D[i,k] = min k (w[i,j] + D[j,k] ) Suitable for smaller networks. Larger volume of data is disseminated, but to its immediate neighbors only Poor convergence property

Each node i periodically broadcasts the weights of all edges (i,j) incident on it (this is the link state ) to all its neighbors. The mechanism for dissemination is flooding. This helps each node eventually compute the topology of the network, and independently determine the shortest path to any destination node using some standard graph algorithm like Dijkstra’s. Smaller volume data disseminated over the entire network Used in OSPF

 Each link state packet has a sequence number seq that determines the order in which the packets were generated.  When a node crashes, all packets stored in it are lost. After it is repaired, new packets start with seq = 0. So these new packets may be discarded in favor of the old packets!  Problem resolved using TTL

Theorem. The message complexity of Bellman-Ford algorithm is exponential. Proof outline. Consider a topology with an even number nodes 0 through n-1 (the unmarked edges have weight 0) k k2k 0 n n-3n n-4n-2 Time the arrival of the signals so that D(n-1) reduces from (2 k+1 - 1) to 0 in steps of 1. Since k = (n-1)/2, it will need 2 (n+1)/2 -1 messages to reach the goal. So, the message complexity is exponential.

Conventional routing tables have a space complexity O(n). Can we route using a “smaller” routing table? Yes, by using interval routing. This is the motivation. conditionport number Destination > id 0 destination < id1 destination = id(local delivery) (Santoro and Khatib)

 Determine the interva l to which the destination belongs.  For a set of N nodes 0.. N-1, the interval [p,q) between p and q ( p, q < N ) is defined as follows:  if p < q then [p,q) = p, p+1, p+2,.... q-2, q-1  if p ≥ q then [p,q) = p, p+1, p+2,..., N-1, N, 0, 1,..., q-2, q-1 [3,5) [5,1) [1,3)

N=11 Labeling is the crucial part

Label the root as 0. Do a pre-order traversal of the tree. Label successive nodes as 1, 2, 3 For each node, label the port towards a child by the node number of the child. Then label the port towards the parent by L(i) + T(i) + 1 mod N, where - L(i) is the label of the node i, - T(i) = # of nodes in the subtree under node i (excluding i), Question 1. Why does it work? Question 2. Does it work for non-tree topologies too? YES, but the construction is somewhat tricky.

Interval routing on a ring. The routes are not optimal. To make it optimal, label the ports of node i with i+1 mod 8 and i+4 mod 8.

Optimal interval routing scheme on a ring of six nodes

Works for static topologies. Difficult to adapt to changes in topologies. But there is some recent work on compact routing in dynamic topologies (Amos Korman, ICDCN 2009)

Easily adapts to changes in topology, and uses small routing tables, so it is scalable. Attractive for large networks, like P2P networks. a.a.a a.a.b a b When new nodes are added or existing nodes are deleted, changes are only local.

source destination Pastry P2P network

Chang-Robert’s algorithm {The root is known} {main idea} Uses probes and echoes, and keeps track of deficits C and D as in Dijkstra-Scholten’s termination detection algorithm first probe --> parent: = sender; C=1 forward probe to non-parent neighbors; update D echo --> decrement D probe and sender ≠ parent --> send echo C=1 and D=0 --> send echo to parent; C=0 For a graph G=(V,E), a spanning tree is a maximally connected subgraph T=(V,E’), E’  E,such that if one more edge is added, then the subgraph is no more a tree. Used for broadcasting in a network with O(N) complexity. Question: What if the root is not designated? Parent pointer

Many applications of exploring an unknown graph by a visitor (a token or mobile agent or a robot ). The goal of traversal is to visit every node at least once, and return to the starting point. - How efficiently can this be done? - What is the guarantee that all nodes will be visited? - What is the guarantee that the algorithm will terminate? Think about web-crawlers, exploration of social networks, planning of graph layouts for visualization or drawing etc. DFS (or BFS) traversal is well known, so we will not discuss about it

Rule 1. Send the token towards each neighbor exactly once. Rule 2. If rule 1 is not applicable, then send the token to the parent. Tarry’s algorithm is one of the oldest (1895) A possible route is: Nodes and their parent pointers generate a spanning tree.

Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) E’  E such that the sum of the weights of all the edges is minimum. Applications Minimum cost vehicle routing On Euclidean plane, approximate solutions to the traveling salesman problem, Lease phone lines to connect the different offices with a minimum cost, Visualizing multidimensional data (how entities are related to each other) We are interested in distributed algorithms only The traveling salesman problem asks for the shortest route to visit a collection of cities and return to the starting point.

Review (1) Prim’s algorithm and (2) Kruskal’s algorithm. Theorem. If the weight of every edge is distinct, then the MST is unique.

Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) such that the sum of the weights of all the edges is minimum. Applications On Euclidean plane, approximate solutions to the traveling salesman problem, Lease phone lines to connect the different offices with a minimum cost, Visualizing multidimensional data (how entities are related to each other) We are interested in distributed algorithms only The traveling salesman problem asks for the shortest route to visit a collection of cities and return to the starting point.

Review (1) Prim’s algorithm and (2) Kruskal’s algorithm. Theorem. If the weight of every edge is distinct, then the MST is unique.

 GHS is a distributed version of Prim’s algorithm.  Bottom-up approach. MST is recursively constructed by fragments joined by an edge of least cost Fragment

Challenge 1. How will the nodes in a given fragment identify the edge to be used to connect with a different fragment? A root node in each fragment is the root/coordinator

Challenge 2. How will a node in T1 determine if a given edge connects to a node of a different tree T2 or the same tree T1 ? Why will node 0 choose the edge e with weight 8, and not the edge with weight 4 ? Nodes in a fragment acquire the same name before augmentation.

 Each fragment has a level. Initially each node is a fragment at level 0.  (MERGE) Two fragments at the same level L combine to form a fragment of level L+1  (ABSORB) A fragment at level L is absorbed by another fragment at level L’ (L < L’). The new fragment jhas a level L’. (Each fragment in level L has at least 2 L nodes)

To test if an edge is outgoing, each node sends a test message through a candidate edge. The receiving node may send accept or reject. Root broadcasts initiate in its own fragment, collects the report from other n odes about eligible edges using a convergecast, and determines the least weight outgoing edge. test reject accept

Let i send test to j Case 1. If name (i) = name (j ) then send reject Case 2. If name (i)≠name (j)  level (i)  level (j) then send accept Case 3. If name (i) ≠ name (j)  level (i) > level (j) then wait until level (j) = level (i) and then send accept/reject. WHY? (Note that levels can only increase). Q: Can fragments wait for ever and lead to a deadlock? test reject test

repeat 1 Test edges as outgoing or not 2 Determine lwoe - it becomes a tree edge 3 Send join (or respond to join) 4 Update level & name & identify new coordinator/root until done

 Basic (initially all branches are basic)  Branch (all tree edges)  Rejected (not a tree edge) Branch and rejected are stable attributes

Merge The edge through which the join message is exchanged, changes its status to branch, and it becomes a tree edge. The new root broadcasts an ( initiate, L+1, name ) message to the nodes in its own fragment. Example of merge initiate

Absorb T’ sends a join message to T, and receives an initiate message. This indicates that the fragment at level L has been absorbed by the other fragment at level L ’. They collectively search for the lwoe. The edge through which the join message was sent, changes its status to branch. initiate Example of absorb

merge

absorb 3

At least two messages ( test + reject ) must pass through each rejected edge. The upper bound is 2|E| messages. At each of the log N levels, a node can receive at most (1) one initiate message and (2) one accept message (3) one join message (4) one test message not leading to a rejection, and (5) one changeroot message. So, the total number of messages has an upper bound of 2|E| + 5N logN