cpsc 689: discrete algorithms for mobile and wireless systems

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

Upload: prentice

Post on 05-Jan-2016

37 views

Category:

Documents


0 download

DESCRIPTION

CPSC 689: Discrete Algorithms for Mobile and Wireless Systems. Spring 2009 Prof. Jennifer Welch. Lecture 28. Topic: Token Circulation Sources: Malpani, Chen, Vaidya, & Welch MIT 6.885 Fall 2008 slides. Token Circulation. Circulate a token through all the nodes of a mobile ad hoc network - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

CPSC 689: Discrete Algorithms for Mobile and Wireless Systems

Spring 2009

Prof. Jennifer Welch

Page 2: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 2

Lecture 28

Topic: Token Circulation

Sources: Malpani, Chen, Vaidya, & Welch MIT 6.885 Fall 2008 slides

Page 3: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 3

Token Circulation

Circulate a token through all the nodes of a mobile ad hoc network

Application: ensure totally ordered broadcast in a group communication service

Page 4: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 4

Group Communication Maintain information about group

membership (which nodes are in which group)

Allowing nodes within a group to communicate usually multicast with some ordering properties, notably total

order Originally developed for wired networks

Page 5: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 5

Achieving Total Order Circulate a token through all the nodes in the

network along a virtual ring token carries a sequence number

when token visits a node that wants to bcast a message, it increments the sequence number in the token and tags its message with that sequence number

Unique sequence numbers are used to sort out the proper ordering

Or: token carries the messages themselves append new message to the end of the list deliver messages in order they appear in the token

Page 6: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 6

Getting a Virtual Ring

How to find an efficient embedding of a ring in an arbitrary network, especially one that changes dynamically?

In fact, what does "efficient" mean? What should be measured?

Page 7: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 7

Performance Measures Distinguish between the token being routed to a

node (message is received and forwarded w/o the node "using" the token) and the token visiting a node (node "uses" the token)

Round: minimal length execution fragment in which the token visits each node at least once

Performance measures: round length: number of node visits in a round message overhead: number of bytes sent per round time overhead: time required to complete a round

Page 8: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 8

Bad Virtual Ring Use visit order 1, 2, 3, 4, 5, 6, 1, 2, 3, … in the

following physical network:

Msgs are routed as 1, 3, 5, 2, 5, 3, 1, 4, 6, 2, 5, 2, 6, …

Better order for virtual ring: 1, 3, 5, 2, 6, 4, 1, …

1 3

5

26

4

Page 9: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 9

Lesson Take network topology into account when

determining visit order But global knowledge is expensive to

achieve, and needs constant updating Instead, have token make decision

dynamically, based only on local information, as to where to travel next

Assume nodes know who their neighbors are (e.g., "hello" protocol)

Page 10: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 10

Algorithm Classification Global ("G") vs. Local ("L"):

local: token is forwarded to a neighbor global: token is forwarded to any node in the network

Recency ("R") vs. Frequency ("F"): next recipient is decided based on how recently nodes

have had the token next recipient is decided based on how frequently

nodes have had the token For global algorithms, whether or not token visits

nodes through which the token is routed on its way to current destination (denoted "N" if so)

Page 11: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 11

Algorithm Schema

Token carries some information for each node in the network (either recency or frequency info)

When a node receives the token, it chooses next recipient using the info in the token, updates info appropriately, and forwards token to appropriate neighbor

Page 12: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 12

Algorithm LF (Local-Frequency) Claim: In a static connected graph, LF ensures

that every node is visited infinitely often. Proof: Suppose not.

Let S be the set of starved nodes (visited finitely often). Then there exists a node x that is visited i.o. but has at

least one neighbor in S. Eventually, after all of x's neighbors in S have visited for

the last time, the frequency count for some y in S will be the smallest among all of x's neighbors, and the token will be forwarded to y. Contradiction.

Page 13: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 13

Algorithm LF Claim: Round length of LF is unbounded.

Length of even rounds: 6, 12, 20, 48, 96, … Length of odd rounds: 6, 7, 19, 43, 91, …

1

3 52

4

Page 14: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 14

Algorithm LR Claim: In a static connected graph, LR ensures

that every node is visited i.o. Proof is same as for LF. What about round length?

In a static graph, one can traverse a spanning tree to get a round length of 2n

LR tries to improve by avoiding backtracking Simulation results often achieves round length of n But there exist graphs on which round length is

exponential

Page 15: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 15

Algorithms GR and GF Initially, when all nodes have been visited least

recently/frequently, ties need to be broken somehow (say, by ID).

GR subsequently has no ties; for GF, break ties somehow (say, by ID)

Round length is obviously n. remember, we are just counting number of node visits

in the round length message and time overhead take into account the

relaying that may be necessary

Page 16: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 16

Algorithms GFN and GRN For G*N, first determine node (in entire

network) with smallest frequency/recency count

Then forward token to neighbor on route toward that node; token is to visit that neighbor

GFN performed very poorly in simulations some node x is visited very often, racking up a

large frequency count, causing subsequent rounds to be very long

Page 17: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 17

Bonus Algorithm The best path for the token would be a

Hamiltonian path of the network path in the network that includes every node exactly

once => round length n not every graph has one determining if a graph has one is NP-complete

Algorithm Iterative Search ("IS") uses heuristics to try to find an HP.

Simulation results: worked well if nodes have exact neighbor knowledge othewise not so good

Page 18: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 18

Simulations

Performance measures: Round length Round time Message overhead

Random networks with 20 nodes MAC layer: 802.11 Routing: DSR Network layer: TCP (to avoid token loss)

Page 19: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Simulation: Static Network

LF

GRN

LR, GF, GR

Page 20: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Simulation: Dynamic NetworkGR

LF,LR,GF,GRNLR

Round time Round length

Page 21: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 21

Worst-Case Analysis of LR

In simulation: average round length ~n Matching worst-case upper bound? Unfortunately, no

Exponential upper bound:

O(nD), is max degree, D is diameter Exponential lower bound:

(n3(7/27)n+5)

(confusing typo in paper)

Page 22: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 22

LR Worst-Case Upper-Bound

We want to bound the number of nodes visited in a round

p is visited only once. What about p’s neighbors?

p

Lastnode

p not visited

Page 23: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 23

LR Worst-Case Upper-Bound

Lemma:a. If node q is visited degree(q) + 1 times in an

execution segment, then all of q’s neighbors are visited in the segment.

p

p not visitedNo neighbor q of p visitedmore than degree(q) times

Page 24: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 24

LR Worst-Case Upper-Bound

Lemma:a. If node q is visited degree(q) + 1 times in an

execution segment, then all of q’s neighbors are visited in the segment.

Proof:

q q q q…Executionsegment:

x1 x2

α1

x1 is more recent than any neighbor that was not visited in α1

Page 25: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 25

LR Worst-Case Upper-Bound

Lemma:a. If node q is visited degree(q) + 1 times in an

execution segment, then all of q’s neighbors are visited in the segment.

Proof:

q q q q…Executionsegment:

x1 x2

α1 α2

x3

degree(q) + 1 visits

x1, x2 are more recent than any neighbor that was not visited in α1,α2

Page 26: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 26

LR Worst-Case Upper-Bound

Lemma:b. If q is visited at most k times in an execution,

then no neighbor q’ of q is visited more than (k+1) ·degree(q’) times in the execution.

p

p not visitedNo neighbor q of p visitedmore than degree(q) timesNeighbors of neighbors of p?

Page 27: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 27

LR Worst-Case Upper-Bound

Lemma:b. If q is visited at most k times in an execution,

then no neighbor q’ of q is visited more than (k+1) ·degree(q’) times in the execution.

b. Proof:

q q q…Executionsegment:

q

≤ k + 1 segments

q is not visited⇒ no neighbor q’ visited ≥ degree(q’) timesPart (a)

Page 28: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 28

LR Worst-Case Upper-Bound

Lemma (b): if q is visited at most k times in an execution, then no neighbor q’ of q is visited more than (k+1) ·degree(q’) times in the execution.

Δ = maximum degree, D = diameter of the graph N(A) = neighborhood of A

p

p not visitedNo neighbor q of p visitedmore than degree(q) times

Neighbors of neighbors of p?

Nodes # visitsp 1N(p) ≤ ΔN(N(p)) ≤ Δ(Δ + 1) = Δ2+ Δ…ND(p) ≤ ΔD+ΔD-1+…+Δ

Page 29: CPSC 689:  Discrete Algorithms for Mobile and Wireless Systems

Discrete Algs for Mobile Wireless Sys 29

LR Worst-Case Upper-Bound

Lemma (b): if q is visited at most k times in an execution, then no neighbor q’ of q is visited more than (k+1) ·degree(q’) times in the execution.

Δ = maximum degree, D = diameter of the graph N(A) = neighborhood of A

Nodes # visitsp 1N(p) ≤ ΔN(N(p)) ≤ Δ(Δ + 1) = Δ2+ Δ…ND(p) ≤ ΔD+ΔD-1+…+Δ

Round length is bounded by1 +|N(p)| · Δ +|N2(p)| · (Δ + Δ 2) ++ … +|ND(p)| · (ΔD+ΔD-1+…+Δ ) == n · O( ΔD )