Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.

Similar presentations


Presentation on theme: "CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch."— Presentation transcript:

1 CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch

2 Discrete Algs for Mobile Wireless Sys2 Lecture 15  Topic: Link Reversal  Sources: Gafni & Bertsekas Busch et al. Charron-Bost et al. Park & Corson MIT 6.885 Fall 2008 slides

3 Discrete Algs for Mobile Wireless Sys3 directed spanning treedirect all the linksred node is sinkreverse red link Motivation for Link Reversal  Assume communication channels in the system can be modeled as an undirected graph (i.e., bidirectional links)  Link reversal algorithms impose logical directions on the edges (or links) of the graph; at certain times the directions on some edges are reversed to achieve some goal.  Example: Suppose goal is to send info to a distinguished node D.

4 Discrete Algs for Mobile Wireless Sys4 Outline  Gafni & Bertsekas (1981) introduced “link reversal” algorithms for constructing and maintaining paths to a destination node and proved their correctness.  Busch, Surapaneni & Tirthapura (2003) analyzed the complexity of the GB link reversal algorithms --- worst-case time and work.  Charron-Bost, Gaillard, Welch & Widder (2008) gave a more fine-grained analysis of work complexity for a more general algorithm.  Park & Corson (1997) modified the GB “partial reversal” algorithm to detect when nodes are partitioned from the destination --- result is the Temporally Ordered Routing Algorithm (TORA) for MANETs.

5 Discrete Algs for Mobile Wireless Sys5 Motivation [GB]  Network contains a distinguished “central station”.  Central station collects information from other nodes via “contingency routes”.  Construct contingency routes that provide redundant routes to station are loop-free don’t require flooding rely only on local information

6 Discrete Algs for Mobile Wireless Sys6 Abstract Graph Problem Definition: a directed acyclic graph (DAG) with a distinguished node D is destination-oriented if D is the one and only sink in the graph. Problem statement: Given a DAG with distinguished node D that is not destination-oriented, convert it into a destination- oriented DAG by reversing the directions of some of the links. D 1 2 D 1 2

7 Discrete Algs for Mobile Wireless Sys7 Full Reversal Algorithm  Whenever a node is a sink (but not the destination), reverse all its incident links, i.e., all its incident links become outgoing  Assuming perfect knowledge of state of the link and ability to instantaneously change it some other algorithms relax this assumption

8 Discrete Algs for Mobile Wireless Sys8 Full Reversal Algorithm Example D 1 23 456 D 1 23 456 D 1 23 456 D 1 23 456 D 1 23 456 D 1 23 456

9 Discrete Algs for Mobile Wireless Sys9 Implementation of Full Reversal Agorithm: The Pair Algorithm  Each node i keeps a pair ( ,i), where  is an integer; pair is called height  Link between two nodes is considered to be directed from node with higher height to node with lower height  At each iteration, if a node i has no outgoing links, then set  to 1 greater than the maximum  -value of all of i’s neighbors at the previous iteration.

10 Discrete Algs for Mobile Wireless Sys10 Pair Algorithm Example (0,3) D 1 23 456 (0,0) (0,1)(0,2) (0,4)(0,5)(0,6) D 1 23 456 (0,0) (0,1)(0,2)(0,3) (0,6)(0,5) (0,4) (0,6) D 1 23 456 (0,0) (0,1) (0,2) (1,3) (0,5) (0,4) (2,6) D 1 23 456 (0,0) (0,1) (2,2) (1,3) (0,5) (0,4) D 1 23 456 (0,0) (0,1) (2,2)(3,3) (2,6)(3,5) (0,4) D 1 23 456 (0,0) (0,1) (2,2) (3,3) (4,4) (3,5)(4,6)

11 Discrete Algs for Mobile Wireless Sys11 Partial Reversal Algorithm  Try to reduce the number of link reversals by having a sink node reverse only some of its incident links. Whenever a node is a sink (but not the destination): reverse all incoming links that have not been reversed since last time this node did a reversal

12 Discrete Algs for Mobile Wireless Sys12 Partial Reversal Algorithm Example D 1 23 456 D 1 23 456 D 1 23 456 D 1 23 456 D 1 23 456 D 1 23 456

13 Discrete Algs for Mobile Wireless Sys13 "Implementation" of Partial Reversal Algorithm: The Triple Algorithm  Use a triple ( , ,i) for the height.  At each iteration, if a node i has no outgoing links, then, using the neighbors’ heights from the previous iteration, set  to 1 greater than the minimum  -value of any neighbor set  to 1 less than the smallest  -value of all neighbors with the new  -value (if no such neighbor then don’t change  )  Why does this implement partial reversal?

14 Discrete Algs for Mobile Wireless Sys14 Triple Algorithm Example D 1 23 456 (0,0,0) (0,5,1) (0,2,2) (0,1,3) (0,4,4)(0,3,5)(0,2,6) D 1 23 456 (0,0,0) (0,5,1)(0,2,2)(0,1,3) (0,4,4)(0,3,5)(0,2,6) D 1 23 456 (0,0,0) (0,5,1)(0,2,2)(1,1,3) (0,4,4)(0,3,5)(0,2,6) D 1 23 456 (0,0,0) (0,5,1)(1,0,2)(1,1,3) (0,4,4)(0,3,5)(1,0,6) D 1 23 456 (0,0,0) (0,5,1)(1,0,2)(1,1,3) (0,4,4)(1,-1,5)(1,0,6) D 1 23 456 (0,0,0) (0,5,1)(1,0,2)(1,1,3) (1,-2,4)(1,-1,5)(1,0,6)

15 Discrete Algs for Mobile Wireless Sys15 Analysis of Link Reversal Algorithms  [GB] proved correctness of a general class of algorithms that includes the full and partial reversal algorithms: Every algorithm in the class terminates in a finite number of iterations with a destination-oriented DAG.

16 Discrete Algs for Mobile Wireless Sys16 [GB] Correctness Proof  Define an abstraction of the heights: taken from a set A that is countable infinite totally ordered partitioned into n disjoint subsets, one per node (other than D), s.t.  each subset is countably infinite and unbounded  there is an operator on each subset under which it is an Abelian group  Link (i,j) is considered to be directed from node i to node j if a i is larger than a j in the total order

17 Discrete Algs for Mobile Wireless Sys17 General Algorithm [GB]  Given a vector v = (v 1, v 2, …, v n ), where v i is the (generalized) height of node i, algorithm M has these properties: M(v) is a set of vectors (nondeterministic) if no sinks in v, then M(v) is empty for each v' in M(v):  either v' i = v i  or v' i = g i (v i ) (only allowed if node i is a sink in v) g i (v i ) > v i and depends only on heights in v of node i and i's neighbors some unbounded increase condition for g i (A3)

18 Discrete Algs for Mobile Wireless Sys18 Why Nondeterminism?  Execution of algorithm is a sequence of vectors, starting with some initial assignments of heights, where each vector v' in the sequence is contained in M(v), where v is the preceding vector  If there is one or more sinks in the graph, then at each step, one or more of the sinks can take a step timing and order of steps is immaterial captures asynchronous execution

19 Discrete Algs for Mobile Wireless Sys19 Correctness of General Algorithm  Acyclic: follows because the heights are totally ordered  Proposition 1: algorithm terminates in a finite number of iterations (no sinks, other than the destination D) since acyclic and no sinks, every node has a directed path to D  Proposition 2: once a node has a directed path to D, it is never is a sink

20 Discrete Algs for Mobile Wireless Sys20 Complexity of Link Reversal Algorithms  [GB] proved correctness of a general class of algorithms that includes the full and partial reversal algorithms: Every algorithm in the class terminates in a finite number of iterations with a destination-oriented DAG.  But how many iterations? I.e., what is the complexity?

21 Discrete Algs for Mobile Wireless Sys21 [BST, BT] Complexity Results algorithmtimework pair algorithm (n2)(n2) (n2)(n2) triple algorithm  (n a* + n 2 )  time = number of iterations with maximum concurrency  work = number of link reversals  n = number of nodes with no path to destination  a* = max  – min  in initial state Worst case bounds

22 Discrete Algs for Mobile Wireless Sys22 Counting Reversals  Both examples had all sink nodes reversing in parallel at each iteration.  [GB], and [BST,BT], show that the order in which reversals are done is immaterial -- resulting DAG is always the same.  [BST,BT] proof uses notion of a dependency graph of reversals: number of node reversals is number of vertices in dependency graph time is at least the depth of the dependency graph

23 Discrete Algs for Mobile Wireless Sys23 Upper Bounds  Pair algorithm: [BST,BT] prove that each node reverses at most n times, implying O(n 2 ) reversals taking O(n 2 ) time (if sequential)  Triple algorithm: [BST,BT] prove that each node reverses at most a* + n times, so O(n a* + n 2 ) reversals taking O(n a* + n 2 ) time (if sequential)

24 Discrete Algs for Mobile Wireless Sys24 Lower Bounds for Pair Algorithm Bad graph for work: D12 n -1 n Bad graph for time: D12 n/2 n/2+1n/2+2 n -1 n [BST,BT] prove each node in right half of chain reverses n/2 times. These reversals must be sequential since neighbors cannot be sinks simultaneously   (n 2 ) time. node i does i reversals =>  (n 2 ) reversals

25 Discrete Algs for Mobile Wireless Sys25 Lower Bounds for Triple Algorithm Bad graph for work (links alternate direction): D12 n -1 n Bad graph for time: [BST] prove each node in the red oval reverses  (a* + n) times. These reversals must be sequential since neighbors cannot be sinks simultaneously   (n a* + n 2 ) time. [BST] prove node i reverses  (a* + i) times =>  (n a* + n 2 ) reversals n/2+1 D12 n/2 n -1 n n -2 n/2+2

26 Discrete Algs for Mobile Wireless Sys26 Some Additional Questions  What about the original, abstract, full and partial reversal algorithms? not hard to show that the pair algorithm implements full reversal not at all straightforward to see that the triple algorithm implements partial reversal  Are unbounded counters necessary for doing link reversal?  Is the generalized height approach useful for developing alternative algorithms, or would some other formalism be better?  Can we find the exact expression for the time and work complexity of link reversal algorithms for any node and in any graph?

27 Discrete Algs for Mobile Wireless Sys27 [CGWW]  New formulation of FR and PR using only binary labels on the links  Simple distributed algorithm for finding routes in acyclic graphs  Identify sufficient conditions on initial labeling for correctness  FR and PR are special cases  Easy to state new algorithms (use different initial labelings)  Much simpler proof of correctness first known proof that PR preserves acyclicity

28 Discrete Algs for Mobile Wireless Sys28 LR Algorithm Schema  Input is a directed acyclic graph G* with distinguished node D each link labeled with 0 ("unmarked) or 1 ("marked")  while there exists a sink v ≠ D do: if v has an incident unmarked link then reverse all incident unmarked links flip the labels on all incident links else // all of v's incident links are marked reverse all incident links // leave them marked LR1: LR2:

29 Discrete Algs for Mobile Wireless Sys29 LR Example LR2 LR1 110 D LR2 LR1 110 D 101 D 101 D 110 D

30 Discrete Algs for Mobile Wireless Sys30 Special Cases of LR Algorithm  Full Reversal: Initially all labels are 1 Only ever execute LR2 step All labels are always 1  Partial Reversal: Initially all labels are 0 Execute both LR1 and LR2 Labels change

31 Discrete Algs for Mobile Wireless Sys31 PR Example with LR D 1 23 456 D 1 23 456 0 0 00 0 00 0 D 1 23 456 0 0 0 1 1 0 00 D 1 23 456 1 1 1 0 0 0 0 0 D 1 23 456 0 0 0 0 1 0 01 D 1 23 456 0 0 0 0 1 11 0

32 Discrete Algs for Mobile Wireless Sys32 Basic Definitions  Given undirected graph G:  G* is a directed version of G  a chain in G* corresponds to an (undirected) path in G; might not have all links directed the same way  a circuit in G* corresponds to an (undirected) cycle in G; might not form a directed cycle

33 Discrete Algs for Mobile Wireless Sys33 LR Terminates Theorem: LR terminates. Proof: At least one node takes a finite number of steps (D). Suppose in contradiction at least one node takes an infinite number of steps. uv finite number of steps infinite number of steps Case 1: After u's last step, link is directed toward u.

34 Discrete Algs for Mobile Wireless Sys34 LR Terminates Case 2: After u's last step, link is directed toward v. uv finite number of steps infinite number of steps Case 2.1: After v's next step, link is directed toward u. uv finite number of steps infinite number of steps

35 Discrete Algs for Mobile Wireless Sys35 LR Terminates Case 2: After u's last step, link is directed toward v. uv finite number of steps infinite number of steps Case 2.2: After v's next step, link is still directed toward v. Then it must be labeled 0. uv 0 After v's next step, link is directed toward u (labeled 1). uv 1

36 Discrete Algs for Mobile Wireless Sys36 LR Preserves Acyclicity Theorem: If LR input is a DAG in which every circuit satisfies a certain condition AC, then every step maintains acyclicity. Theorem: If every node of a DAG has the same label on all its incoming links (a "uniform" labeling), then every circuit satisfies condition AC.

37 Discrete Algs for Mobile Wireless Sys37 Comparing Initializations all 1's (FR) all 0's (PR) uniform labeling satisfy condition AC maintain acyclicity all binary link labelings

38 Discrete Algs for Mobile Wireless Sys38 What about Complexity of LR?  No systematic study until work of Busch, Surapaneni, and Tirthapura (2003)  They studied work total number of reversals done by all nodes and time total number of rounds, assuming maximum concurrency for sinks reversing of [GB]'s pair and triple algorithms  Results were of this form: for every n, there exists a graph with n nodes in which  (f(n)) reversals are done /  (f(n)) rounds are executed.

39 Discrete Algs for Mobile Wireless Sys39 [BST,BT] Bounds Again algorithmtimework pair (n2)(n2) (n2)(n2) triple  (n a* + n 2 )  time = number of iterations  work = number of node reversals  n = number of nodes with no path to destination  a* = max  – min  in initial state Worst case bounds

40 Discrete Algs for Mobile Wireless Sys40 [CGWW] Contributions  Expression for the exact number of steps (work) taken by any node in any graph during the generic algorithm  Expression depends only on the input graph  Has simple formulas when specialized to FR and PR  Exact formula helps in finding best and worst topologies

41 Discrete Algs for Mobile Wireless Sys41 Work Complexity Overview  For any node v, define a nonnegative quantity   Every time v takes a step,  decreases by either 1 or 2  When other nodes take steps,  is unchanged  Once v has a directed path to D,  = 0

42 Discrete Algs for Mobile Wireless Sys42 Work Complexity Pattern for FR Number of reversals by node v equals number of links directed away from D in the chain to v. Quantity decreases by 1 when v takes a step. D D D D D D D D 11 22 34

43 Discrete Algs for Mobile Wireless Sys43 Work Complexity Overview  Break  into 2 pieces:  =  -   Show  never changes  Show  increases by either 1 or 2 when v takes a step  Increment depends on a classification of v into one of 3 groups ( S, N, or O )  Thus  decreases by either 1 or 2 whenever v takes a step

44 Discrete Algs for Mobile Wireless Sys44 Work Complexity Overview  Consider any execution of LR starting with a graph whose circuits all satisfy condition AC.  Let k be initial value of  for node v. initial group of vnumber of reversals by v S (k+1)/2 N k/2 O k

45 Discrete Algs for Mobile Wireless Sys45 Work Complexity of FR Corollary: Number of steps taken by v in FR is min, over all chains between v and D, of number of links directed away from D. Worst case graph is chain with all edges directed away from D: total work complexity is n(n+1)/2

46 Discrete Algs for Mobile Wireless Sys46 Work Complexity of PR Corollary: Number of steps taken by v in PR is  min, over all chains b/w v and D, of number of nodes on the chain with two incoming unmarked chain links, if v is a sink or a source (plus 1 in some cases)  If v is neither a sink nor a source, then the number of steps is twice the above quantity Worst-case graph is chain with links that alternate direction: total work complexity is n 2 /4+1 (for even n)

47 Discrete Algs for Mobile Wireless Sys47 Discussion of [CGWW]  Fresh approach to specify and analyze link reversal algorithms of [GB]  Developed a generalization of the algorithms bounded space complexity  Exact expression for work complexity of any node in any graph for general algorithm [BST,BT] work was exact for pair algorithm but not exact for triple algorithm

48 Discrete Algs for Mobile Wireless Sys48 Open Question  Time complexity: can we come up with a formula for the last round at which a given node takes a step (assuming all sinks take steps simultaneously at each round)?

49 Discrete Algs for Mobile Wireless Sys49 Effect of Partitions  The full and partial reversal algorithms work if nodes are not partitioned from the destination.  What happens if they are?  Full reversal: D1 23 D1 23 D1 23 D1 23

50 Discrete Algs for Mobile Wireless Sys50 Park & Corson, 1997 (TORA)  Temporally Ordered Routing Algorithm  Modify GB partial reversal algorithm for routing messages in mobile ad hoc networks  Use n copies of the link reversal algorithm, one for each possible destination node.  Detect when a node has been partitioned from a destination and stop trying to sending messages to it  Height is a 5-tuple.

51 Discrete Algs for Mobile Wireless Sys51 TORA System Assumptions  Undirected communication graph G  Nodes have unique ids.  Bidirectional communication on all edges.  Set of links changes with time.  Nodes may also fail.  Nodes know their neighbors (because of some lower level protocol).  Nodes communicate through message broadcast with all neighbors.  Transmitted packets are received correctly and in order of transmission, but with some delay Different than the previous papers

52 Discrete Algs for Mobile Wireless Sys52 TORA Overview  Creating routes: A node initiates establishment of a route to destination only if all its adjacent links are undirected. Route creation essentially assigns directions to undirected links.  Maintaining routes: When directed portions of the graph deviate from being destination oriented, perform reversals to try to restore this property.  Erasing routes: Detect partitions, and accommodate, by “clearing" all the links in the portion disconnected from the destination, that is, making them undirected again.

53 Discrete Algs for Mobile Wireless Sys53 Heights in TORA [ , oid, r, , i ] reference level delta time this ref. level was started (from synch’d clocks or logical clocks) id of node originating this ref. level reflection bit orders nodes with same ref. level id of node, breaks ties

54 Discrete Algs for Mobile Wireless Sys54 Maintaining Routes in TORA If node i loses last outgoing link:  due to a link failure (Case Generate): set ref level to (current time, i, 0), a full reversal  due to a height change and nbrs don’t have same ref level (Case Propagate):  adopt max ref level and set  to effect a partial reversal nbrs have same ref level with r = 0 (Case Reflect):  adopt new ref level, set r to 1, set  to 0 (full reversal) nbrs have same ref level with r = 1 and oid = i (Case Detect):  Partition! Start process of erasing routes.

55 Discrete Algs for Mobile Wireless Sys55 TORA Example – Partition 6 1234 5 Generate 6 1234 5 Propagate 6 1234 5 Reflect 6 1234 5 Propagate 6 1234 5 Detect

56 Discrete Algs for Mobile Wireless Sys56 TORA Example in Detail 6 123 4 5 Node 3 generates new ref level (8,3,0), bcasts new height to all neighbors (0,0,0,0,6) (0,0,0,2,5) (0,0,0,2,4)(0,0,0,1,3)(0,0,0,2,2)(0,0,0,3,1) (8,3,0,0,3) Link (3,6) fails at time 8

57 Discrete Algs for Mobile Wireless Sys57 TORA Example in Detail 6 123 4 5 Nodes 2 and 4 propagate ref level (8,3,0), bcast new height to all neighbors (0,0,0,0,6) (0,0,0,2,5) (0,0,0,2,4)(8,3,0,0,3)(0,0,0,2,2)(0,0,0,3,1) (8,3,0,–1,4)(8,3,0,–1,2)

58 Discrete Algs for Mobile Wireless Sys58 TORA Example in Detail 6 123 4 5 Nodes 1 and 5 reflect ref level (8,3,1), bcast new height to all neighbors (0,0,0,0,6) (0,0,0,2,5) (8,3,0,0,3)(8,3,0,–1,2)(0,0,0,3,1) (8,3,1,0,5) (8,3,1,0,1) (8,3,0,–1,4)

59 Discrete Algs for Mobile Wireless Sys59 TORA Example in Detail 6 123 4 5 Nodes 2 and 4 propagate ref level (8,3,1), bcast new height to all neighbors (0,0,0,0,6) (8,3,1,0,5) (8,3,0,0,3)(8,3,0,–1,2)(8,3,1,0,1) (8,3,1,–1,4)(8,3,1,–1,2) (8,3,0,–1,4)

60 Discrete Algs for Mobile Wireless Sys60 (8,3,1,–1,4) TORA Example in Detail 6 123 4 5 Node 3 detects partition from destination 6 (0,0,0,0,6) (8,3,1,0,5) (8,3,0,0,3)(8,3,1,–1,2)(8,3,1,0,1)

61 Discrete Algs for Mobile Wireless Sys61 Effects of Time Errors  Clocks are used to establish temporal order of the link loss events.  Logical clocks could also be used to establish this order.  What happens if the logical time order isn't the same as the real time order?  They claim that the resulting algorithm is still in the BG general class.  They conclude that it's good to use clocks that are sufficiently synchronized so that the time between failures is much greater than the clock error.

62 Discrete Algs for Mobile Wireless Sys62 Conclusion  No simulation results. But, they do have a table of claimed worst-case complexity of many algorithms.  Possible improvements: Over time, the DAG may become less optimally directed than it was initially. They claim that initially, the  s give the minimum distance (in hops) to d, but this can degrade with changes. We could enhance the protocol by periodically propagating refresh packets outwards from d, to reset the reference level to 0 (?) and restore the meaning of the  s to be the shortest distances  Such a strategy could also support correction of corrupted state information.  Refreshes should occur at a low rate, in the background.


Download ppt "CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch."

Similar presentations


Ads by Google