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 30  Topic: Virtual Node Layers  Sources: Dolev, Gilbert, Lynch, Shvartsman, Welch. Geoquorums. Dolev, Gilbert, Lynch, Schiller, Shvartsman, Welch. Virtual Mobile Nodes. Chockler, Gilbert. Virtual Infrastructure for collision-prone wireless networks. Gilbert PhD thesis. Virtual Infrastructure for wireless ad hoc networks. Brown, Gilbert, Lynch, Newport, Nolte, Spindel. The Virtual Node Layer: A programming abstraction for wireless sensor networks. Dolev, Gilbert, Lahiani, Lynch, Nolte. Timed virtual stationary automata. Dolev, Lahiani, Lynch, Nolte. Self-stabilizing mobile node location management and message routing. Gilbert, Lynch, Mitra, Nolte. Self-stabilizing mobile robot formations with virtual nodes. Nolte PhD thesis. Virtual stationary automata for mobile networks. MIT 6.885 Fall 2008 slides

3 Discrete Algs for Mobile Wireless Sys3 Overview  Platform: Mobile computers with sensors, actuators, wireless communication.  People, robots, vehicles, could use this hardware to: Establish ad hoc networks. Coordinate in running applications:  Collect and process data  Produce models of the environment  Plan activities, disseminate plans  Examples: Rescue workers in disaster areas Soldiers in battle Robots exploring a novel location Cars on highway  But application design for MANETs is very hard, because the networks change unpredictably.

4 Discrete Algs for Mobile Wireless Sys4 To simplify application design:  Virtual Node Layer, consisting of: Virtual Nodes, Client Nodes, and A Local Broadcast service.  Virtual Nodes: Simple abstract machines. Better behaved than physical nodes, e.g., stationary, fail less often. Fail by stopping, recover by restarting in initial state.  Client Nodes similar to physical nodes.  Makes it easier to write applications. Application Virtual Node Layer

5 Discrete Algs for Mobile Wireless Sys5 Virtual Node Layer

6 Discrete Algs for Mobile Wireless Sys6 Virtual Node layer

7 Discrete Algs for Mobile Wireless Sys7 Route message to a designated geographical region Geographical routing (Geocast)

8 Discrete Algs for Mobile Wireless Sys8 Gather, aggregate, analyze, and distribute data. Data management

9 Discrete Algs for Mobile Wireless Sys9 Coordinate activities of robots, people, vehicles in a region. Region coordination

10 Discrete Algs for Mobile Wireless Sys10 Geoquorums  Goal: Implement atomic Read/Write memory in MANETs. Read Write

11 Discrete Algs for Mobile Wireless Sys11 Geoquorums  Uses a Virtual Object Layer: Passive Virtual Objects, at fixed, normally- populated geographical locations. Client Nodes, which can access the VOs directly.  Emulate the VO Layer over the MANET, using Replicated State Machine algorithm and a standard geographical routing algorithm.  Implement Read/Write memory over the VO layer, using a quorum-based algorithm. Atomic Memory Virtual Object Layer

12 Discrete Algs for Mobile Wireless Sys12 Virtual Mobile Nodes  New kind of Virtual Node: Active agent, not just a passive object. Moves according to a pre-planned trajectory.  Applications: Pick up, deliver messages. Highway control: VMN can notify cars about hazards ahead, ambulance approach from behind.

13 Discrete Algs for Mobile Wireless Sys13 An ambulance is coming. Get out of the left lane. Traffic jam ahead. Slow down. Consider another route. High Tech Highway

14 Discrete Algs for Mobile Wireless Sys14 Emulating Virtual Mobile Nodes  Replicated State Machines.  Similar to emulation of Virtual Objects.  It’s all relative: is the same as:

15 Discrete Algs for Mobile Wireless Sys15 Virtual Stationary Nodes  Simplest and most important special case of Virtual Mobile Nodes---no motion!  New VSN model, with more control over timing.  Leader-based implementation.  Self-stabilizing.

16 Discrete Algs for Mobile Wireless Sys16 Application: Point-to-point message routing in MANETs  Geographical routing over VSN layer.  Mobile client location service. Keeps track of locations of Client Nodes. Each Client Node has home location VSNs, which keep track of its current VN region.  Determined by hash function from Client Node id. Client Node sends its physical location to its home locations, using geographical routing. Requester sends location queries to home locations, also using geographical routing.  Point-to-point message routing between Client Nodes. Based on geographical routing and location service.

17 Discrete Algs for Mobile Wireless Sys17 Application: Motion Coordination  Use VSNs to coordinate motion of Client Nodes: VSN can gather, analyze information about its local region, exchange information with neighboring VSNs, plan motion of CNs. CNs can use advice from nearby VSNs to determine their motion.  Examples: Robot motion coordination Highway control, using computers on board the cars. Air-traffic control

18 Discrete Algs for Mobile Wireless Sys18 Robot Motion Coordination  Given a curve, and a set of Client Nodes (robots) at arbitrary locations, move the Client Nodes so that they are (nearly) all on the curve, and (approximately) evenly spaced.  E.g., perimeter of hazardous waste area.

19 Discrete Algs for Mobile Wireless Sys19 VN Virtual Node Approach  Divide region into zones, one VN per zone.  VN coordinates Client Nodes in its zone.  Directs motion of CNs in its zone: Towards the curve. On the curve, to even out spacing.  Communicates with neighboring VNs, sends “extra” clients to neighboring zones. CN

20 Discrete Algs for Mobile Wireless Sys20 Virtual Traffic Light (VTL)  For an intersection without a real traffic light.  Computers in cars can emulate a VN, programmed to be a traffic light.  Any policy desired, e.g., 30 sec in each direction.  Cars just see “red” or “green”, on local displays.  VTL dies when no cars are around.  But then we don’t need a traffic light.

21 Discrete Algs for Mobile Wireless Sys21 Virtual Air-Traffic Controllers (VATCs)  Aircraft in regions of airspace without ground- based controllers, e.g., the ocean.  Need algorithm for arbitrating access to regions.  Use VATCs, emulated by computers on the aircraft.  VATC behaves like human ATC, e.g.: Keeps track of aircraft in local region. Tells neighboring ATCs when it’s OK to hand off an aircraft. Tells aircraft how to move within the local region.  VATCs compatible with current ATC system.

22 Discrete Algs for Mobile Wireless Sys22 Virtual Node Layers in Unreliable MANETs  Nice theoretical results…but: They all assume reliable communication. Real MANETs have lost messages, collisions:  How to cope with message losses?  Three approaches: 1. Mask communication failures, using Contention Manager, Collision Detector services. 2. Implement VNs that have weaker semantics. 3. Self-stabilization.

23 Discrete Algs for Mobile Wireless Sys23 1. Masking Communication Failures  Contention Manager: Gives “active/passive” advice to each node, at each round. Eventually, advises one node per round to be “active”. Implemented by backoff protocols.  Collision Detector: Notifies receiver that it might have missed a message, because of a collision (  ). Completeness: Situations when  must be delivered.  When some message is lost, or  When half or more are lost, or  When a majority are lost, or  When all are lost. Accuracy: Situations when  may be delivered.  Accurate: When some message is lost, or  Eventually Accurate

24 Discrete Algs for Mobile Wireless Sys24 Virtual Node Layers for Networks with Message Losses  Mobile network model: Message collisions, losses Contention manager Collision detector  New algorithm to emulate VN layer over unreliable MANET layer.  Uses consensus-like strategy.  Application: Tracking

25 Discrete Algs for Mobile Wireless Sys25 2. Weaker Semantics  A simple reactive VN layer Simple timing-independent state machines, which react to the arrival of a message by changing state and producing some new messages to send.  With message losses, VNs have an additional failure mode: Can jump to some other “sensible” state---one that would result from receiving some subset of the messages that have been sent.

26 Discrete Algs for Mobile Wireless Sys26 3. Self-Stabilization  Mobile networks are subject to unpredictable failures, changes.  Try as we might to mask problems, sometimes, things will go wrong.  Self-Stabilization: No matter what state the system winds up in, it will gravitate back (quickly) to normal behavior.  A standard notion for traditional distributed algorithms: [Dijkstra’s famous paper, 74] [Dolev’s book, 00]

27 Discrete Algs for Mobile Wireless Sys27 Self-Stabilizing Algorithms for Mobile Networks  Problems for which Lynch's group has SS solutions using VN layers: Communication:  Geographical broadcast: Broadcast a message to everyone in the vicinity of a specified geographic location.  Point-to-point message communication: Allow clients to send messages to nodes with specified ids, wherever they are in the network. Robot motion coordination:  Arrange robots along a known curve in the 2- dimensional plane, approximately evenly spaced.  [Tina Nolte PhD thesis, completed October, 2008]

28 Discrete Algs for Mobile Wireless Sys28 Some Details  Geoquorums [Dolev, Gilbert, Lynch, Shvartsman, Welch 03, 04] [Gilbert PhD thesis 07]

29 Discrete Algs for Mobile Wireless Sys29 GeoQuorums  Virtual Object layer definition Client Nodes Virtual Object automata CNs invoke operations on Virtual Objects from anywhere in the network, receive responses. No other communication mechanism  Emulation algorithm

30 Discrete Algs for Mobile Wireless Sys30 Virtual Object Layer Definition  Client Nodes (Untimed) I/O automata Move arbitrarily Fail/recover Frequent geo-updates:  Real time  Current location Unique identifiers Have outputs that are invocations of operations on the VOs, inputs that are responses.  Virtual Object automata

31 Discrete Algs for Mobile Wireless Sys31 Virtual Object Layer Definition  Client Nodes  Virtual Object automata Atomic Object I/O Automata:  Internal copy of object data + input buffers for requests + output buffers for responses.  [Lynch, Distributed Algorithms, Chapter 13] Fail/recover. Associated with predetermined locations in space.

32 Discrete Algs for Mobile Wireless Sys32 Virtual Object Layer Emulation  Physical network assumptions: Physical mobile nodes  (Untimed) I/O automata  Move arbitrarily, fail/recover  Geo-updates: time, location.  Unique identifiers Communication: Reliable local broadcast service, within each VO region.

33 Discrete Algs for Mobile Wireless Sys33 Summary: Geoquorums  VO Layer consists of Client Nodes + Virtual Objects, where any client can access any object.  Provides relatively stable, persistent data objects, in badly- behaved mobile network.  Assumes Physical Layer, just Physical Nodes + reliable local broadcast.  Emulation uses: Standard GeoCast algorithm. A highly redundant replicated state machine strategy to emulate each VO.  Depends on reliability of local broadcast.

34 Discrete Algs for Mobile Wireless Sys34 Some More Details  Virtual Stationary Nodes [Gilbert PhD thesis 07] [Dolev, Gilbert, Lynch, Schiller, Shvartsman, Welch 04]

35 Discrete Algs for Mobile Wireless Sys35 Virtual Stationary Nodes  VSN Layer definition Client Nodes VSN automata Local broadcast communication  Differences from VO Layer: VSNs are active agents, not just passive objects. Broadcast communication, not invocation/response. Local communication only.

36 Discrete Algs for Mobile Wireless Sys36 VSN Layer Definition  Client Nodes: Essentially as before (Untimed) I/O automata Move arbitrarily Fail/recover Geo-updates Unique identifiers  VSN automata: Active agents, not passive objects (Untimed) I/O automata Associated with predetermined locations in space. Fail/recover Geo-updates (time) Unique identifiers  Local broadcast communication service VCast: CN to nearby CNs VN to/from CNs in its region. VN to neighboring VNs.

37 Discrete Algs for Mobile Wireless Sys37 VSN Layer Emulation  Physical network assumptions: As before. Physical mobile nodes  (Untimed) I/O automata  Move arbitrarily, fail/recover  Geo-updates  Unique identifiers Communication: Reliable local broadcast service, within each VSN region.

38 Discrete Algs for Mobile Wireless Sys38 Summary: VSN Layers  VSN Layer: Client Nodes + Virtual Stationary Nodes + local broadcast communication service.  Provides a relatively stable, reliable, static overlay network.  Many applications.  Physical Layer: Physical Nodes + reliable local broadcast.  Emulation uses highly redundant replicated state machine strategy to emulate each VSN.  Depends on reliability of local broadcast.

39 Discrete Algs for Mobile Wireless Sys39 Some More Details  Virtual Mobile Nodes [Gilbert PhD thesis 07] [Dolev, Gilbert, Lynch, Schiller, Shvartsman, Welch 04]

40 Discrete Algs for Mobile Wireless Sys40 Virtual Mobile Nodes  VMN Layer definition Client Nodes VMN automata Local broadcast communication  Main difference from VSN Layer: The VMNs move, according to predetermined, globally known trajectories.

41 Discrete Algs for Mobile Wireless Sys41 VMN Layer Definition  Client Nodes: As for VSN Layer  VMN automata: Active agents (Untimed) I/O automata Associated with predetermined trajectories in space. Fail/recover Geo-updates Unique identifiers  Local broadcast communication service VCast: CN to nearby CNs VMN to/from nearby CNs VMN to nearby VMNs.

42 Discrete Algs for Mobile Wireless Sys42 Virtual Mobile Node (VMN)  Notion of a virtual node Can perform general computation Moves in a controllable pattern, e.g.  Sweep the plane in a regular pattern  Pseudorandom walk  Implement on top of physical nodes that move in unpredictable/uncontrollable ways  How? A VMN is replicated at a set of physical nodes that changes as the nodes move in and out of the VMN’s path.

43 Discrete Algs for Mobile Wireless Sys43 Physical Network Assumptions  Physical mobile nodes (Untimed) I/O automata Move arbitrarily, fail/recover Geo-updates Unique identifiers  Communication: Reliable local broadcast service.

44 Discrete Algs for Mobile Wireless Sys44 More on Communication  Physical mobile nodes communicate using a physical broadcast service.  Simplifying assumptions: Every node that remains within distance R phys of sender receives the message Upper bound d on delivery time  Strong abstraction of wireless broadcast with a small number of retries.

45 Discrete Algs for Mobile Wireless Sys45 VMN Abstraction  A VMN has some local state (its code is provided by application designer)  A VMN communicates with other entities, called clients; a client can be a physical mobile node or other VMN  Communication is through a virtual broadcast service, similar to the physical one: radius R virt Might repeat, reorder msgs even if physical bcast does not

46 Discrete Algs for Mobile Wireless Sys46 Simple Idea to Simulate a VMN  Use an “agent”, a dynamic process that jumps from physical node to physical node in the direction specified by the VMN path  Generalization of, e.g., Nath & Nicolescu, where moving entity is an arbitrary process instead of a message  Drawback: not robust if current host fails or next part of VMN path is not populated by a physical node.  Our solution: Use replication.

47 Discrete Algs for Mobile Wireless Sys47 Replicating a VMN  Define the mobile point to be circular region of radius R mp that moves on the VMN path: at time t, the center of the mobile point is the position of the VMN  Every physical node that is within the mobile point’s current region replicates the state of the VMN and participates in the simulation protocol.  Each participating physical node keeps a copy of the VMN’s state.

48 Discrete Algs for Mobile Wireless Sys48 Keeping Replicas Consistent  Replicas are kept consistent by exchanging messages concerning the actions to perform on the replicated state using a totally ordered (TO) broadcast service.  Use standard techniques to implement the TO- bcast: Each msg to be TO-sent has a unique timestamp (clock time, sender id) Timestamped msg is sent using physical bcast After msg is received, it is not eligible to be delivered (by the TO bcast service) until > d time after it was sent Deliver eligible msgs in timestamp order

49 Discrete Algs for Mobile Wireless Sys49 Properties of TO-bcast Assume R phys > 2*R mp + d*v max. Then  Msgs are TO-recv’d in the order sent, breaking ties by sender id.  If a physical node in the mobile point TO- sends a msg, then every physical node that stays in the mobile point sufficiently long receives the message (exactly once).

50 Discrete Algs for Mobile Wireless Sys50 VMN Simulation  Based on Lamport’s replicated state machine technique (1978), augmented to support joins, leaves, failure, recovery  One VMN simulation process per physical node  Collection of simulation processes, physical bcast, and TO-bcast together will simulate VMN and virtual bcast  Assumption: VMN’s path is fixed and known; thus so is mobile point’s.

51 Discrete Algs for Mobile Wireless Sys51 Joining the Mobile Point when physical node enters mobile point’s region:  status := joining  TO-send join request w/ timestamp  when node TO-recv’s its own join request: status := listening save subsequent msgs TO-recv’d in pending-actions  when an active node TO-recv’s new join request: TO-send response w/ its copy of VMN’s state  when listening node gets response: status := active set its copy of VMN’s state to that in msg start processing pending actions (more later)

52 Discrete Algs for Mobile Wireless Sys52 While in the Mobile Point Main task is to manage replica of VMN’s state. What can the VMN do?  Receive a message from a client (via virtual bcast service) TO-send msg to all replicas in mobile point when msg is TO-recv’d, enqueue on pending-actions  Initiate an internal or output action periodically check simulated state against state machine transitions for VMN to see if an action is enabled. if so, TO-send a msg to all replicas in mobile point saying to simulate this action. when msg is TO-recv’d, enqueue on pending-actions

53 Discrete Algs for Mobile Wireless Sys53 While in the Mobile Point (cont’d) To simulate transitions of the VMN:  Periodically dequeue pending-actions  If action has not already been simulated: apply VMN’s transition function to current simulated state and this action update simulated state if action is to send a msg to a client (and hasn’t already been sent by another replica):  send the msg via the physical bcast service

54 Discrete Algs for Mobile Wireless Sys54 Leaving the Mobile Point When physical node leaves the mobile point’s current region:  status := idle  reinitialize copy of VMN’s state  discard pending actions

55 Discrete Algs for Mobile Wireless Sys55 Failure & Recovery What if mobile point’s current region becomes depopulated by physical nodes? Current state of VMN is lost.  If no reponse to join request is received within d time: Set copy of VMN’s state to failure-recovery state (as specified by designer of VMN)

56 Discrete Algs for Mobile Wireless Sys56 Relationship between Virtual & Physical Broadcasting  Require R phys > R mp + R virt + 2*loc-update-interval*v max  When a client sends a msg to the VMN using virtual bcast: 1.Client uses physical bcast to send msg to a physical node in the VMN’s mobile point (at time t) 2.Physical node in the mobile point TO-sends the msg (by time t+d) 3.Each physical node in the mobile point TO-recvs msg (by time t+2d+1)  When VMN sends a msg to a client using virtual bcast 1.At least one physical node in the mobile point TO-sends VMN’s intent to do a send 2.Physical nodes receive and enqueue the message 3.At least one physical node sends the message via physical bcast service (duplicates are possible)

57 Discrete Algs for Mobile Wireless Sys57 Correctness of VMN Simulation  Formal proof uses timed I/O automata model.  For each execution E of the simulating system, show there exists a corresponding execution E’ of the virtual system.  Proof is by induction on the sequence of actions in E. E E’ “forward simulation relation”

58 Discrete Algs for Mobile Wireless Sys58 Applications for VMNs  Routing msgs: How to send a message to a specific node? Would like to avoid tracking locations of all nodes flooding  Adapt idea of Chatzigiannakis et al.: Use a single VMN that repeatedly traverses the network collecting and delivering msgs. Sender waits for VMN to come nearby and then sends to VMN Receiver waits for VMN to come nearby, then sends request for any msgs destined for it, which VMN answers Use multiple VMNs to improve latency  Latency and space usage scale with number of VMNs and region size, not number of nodes

59 Discrete Algs for Mobile Wireless Sys59 Applications for VMNs  Routing a msg to a VMN: since VMN paths are known, a third VMN shuttles between sender and destination VMNs carrying the message. SD M

60 Discrete Algs for Mobile Wireless Sys60 Applications for VMNs  Use VMNs to traverse the network and collect sensor data, process it and answer queries  Differs from routing in that data may be aggregated, both regionally and temporally, as it is being collected

61 Discrete Algs for Mobile Wireless Sys61 Applications for VMNs Group communication services  Dolev et al. (2002) showed how to implement group communication services using a single mobile agent that performs a random walk  Use a robust VMN, instead of a fragile token, to collect and deliver group information

62 Discrete Algs for Mobile Wireless Sys62 Applications for VMNs Atomic read-write memory:  GeoQuorums algorithm (Dolev et al. 2003) implements a virtual shared variable based on fixed-location densely populated regions, which maintain replicas of the data that are manipulated with quorum-based algorithms.  Instead, use VMNs to maintain the replicas of the shared variable: can adapt if densely populated areas move can move nearer to areas of the network that issue many operations on the shared variable

63 Discrete Algs for Mobile Wireless Sys63 Discussion  VMN abstraction can ease the task of designing algorithms for MANETs by providing programmable motion some robustness  Drawbacks: depends on a reliable and timely physical communication service assumes a trusted environment expensive in terms of communication and power consumption

64 Discrete Algs for Mobile Wireless Sys64 Open Questions  How to optimize for implementation? Elect a temporary leader in the mobile point which would initiate all transitions on replicas Keep replica state when leaving mobile point and get incremental updates on rejoining Relax strong synchrony assumption using partially synchronous bcast algorithms (e.g., Lamport 1998, Bar-Joseph et al. 2002)  Develop a self-stabilizing simulation  Determine paths of VMNs on the fly, e.g., Track a moving entity Avoid unpopulated areas  Generate new VMNs dynamically, e.g., A new VMN for each entity that enters a geographical area

65 Discrete Algs for Mobile Wireless Sys65 Summary: VMN Layers  VMN Layer: Client Nodes + Virtual Mobile Nodes + local broadcast communication service.  Physical Layer: Physical Nodes + reliable local broadcast.  Emulation uses highly redundant replicated state machine strategy to emulate each VMN.  Depends on reliability of local broadcast.

66 Discrete Algs for Mobile Wireless Sys66 Message Losses  All this work so far assumes that message delivery is reliable.  But what if it isn’t? (and in real mobile networks, it isn’t…)

67 Discrete Algs for Mobile Wireless Sys67 More Details  Masking communication failures, using consensus and collision detectors. [Gilbert PhD thesis 07] [Chockler, Gilbert, Lynch PODC 08]

68 Discrete Algs for Mobile Wireless Sys68 Masking Communication Failures  Unreliable wireless broadcast model: Synchronous rounds Physical Nodes: mobile, fail/recover, geo-update, identifiers. Local wireless broadcast:  Broadcast: Within radius R.  Interference: Up to radius R’. Message losses, collisions.  Assume additional services: Collision Detector Contention Manager R R’

69 Discrete Algs for Mobile Wireless Sys69 Eventual Collision-Freedom  Eventually, if only one node in a local area broadcasts in a round, then its message will be delivered.  “Eventually” here replaces a probabilistic assumption.

70 Discrete Algs for Mobile Wireless Sys70 Collision Detector  Complete: Detects if any message is lost.  Eventually accurate: Eventually no false positives. Alice Bob CD Bob either: Gets both messages or Detects a collision

71 Discrete Algs for Mobile Wireless Sys71 Contention Manager  Reduces contention/collisions Example: Backoff protocol  Each node contends when it wants to broadcast.  Contention manager issues advice to contending nodes: active: It is safe for the node to broadcast. passive: The node should not broadcast.  Contention Manager Properties: Eventually non-interfering: Eventually, nearby nodes are not advised to be active. Eventually regionally fair: Eventually, in any region, if some node contends for sufficiently long, then some contending node is advised to be active for sufficiently long.

72 Discrete Algs for Mobile Wireless Sys72 Emulating Virtual Infrastructure Replicated State Machine, for each VN

73 Discrete Algs for Mobile Wireless Sys73 Emulating a Virtual Node  Each participant is a replica.  Replicas execute a consistency protocol.  Leader + backups  Leader sends, receives messages on behalf of the VN.  Join/leave protocol.

74 Discrete Algs for Mobile Wireless Sys74 Consistency: First Attempt  Use a fault-tolerant distributed consensus algorithm.  For each virtual round: Emulating nodes run a consensus algorithm, to agree on:  Messages for VN to receive.  Message for VN to send.  VN state update. Emulators update their own copies of the VN state. Leader sends message on behalf of the VN.  Problem: Consensus does not terminate until collisions stop. Leads to unbounded-sized, unsynchronized virtual rounds.

75 Discrete Algs for Mobile Wireless Sys75 VN Layer Definition  Client Nodes, Virtual Nodes  Communication: CN-CN, CN-VN, VN-VN VN Layer messages may also be lost. Detect collisions when a message is lost (using VN Layer Collision Detector).  Synchronous rounds Rounds are constant length

76 Discrete Algs for Mobile Wireless Sys76 CHA k 4  Sequence of instances k 1, k 2, k 3,…  For each instance k: Each node proposes an input. Each node receives a history output h, or. Convergent History Agreement (CHA) CHA k 4 propose(x) propose(y) propose(z) CHA k 1 CHA k 2 CHA k 3 CHA k 5 CHA k 6 CHA k 7 h1 h2

77 Discrete Algs for Mobile Wireless Sys77 CHA k 4  A history is a sequence of proposals, one per instance, e.g.: Validity: Each proposal for an instance k that appears in an output history is someone’s actual proposal for instance k. Agreement: Any two output histories for instances k 1 and k 2, k 1 ≤ k 2, share a common k 1 -prefix. Liveness: For some k, every output for any instance k’  k is an actual history (not  ), in which all the elements for instances k,…k’ are actual proposals (not  ). CHA k 1 CHA k 2 CHA k 3 CHA k 5 CHA k 6 CHA k 7

78 Discrete Algs for Mobile Wireless Sys78 Emulating a Series of Virtual Rounds Using CHA  CHA instance k: Proposals are for messages the VN should receive at round k. Returned histories indicate agreed-upon messages for VN to receive at rounds ≤ k.  At round k, each Physical Node i: Broadcasts any Client i messages, receives other Client messages. Decides which messages should be received by VN at round k, and proposes them to CHA instance k. If CHA outputs , PN i doesn’t know what the VN receives, doesn’t emulate the VN, but emulates Client i detecting a collision. If CHA outputs a history:  Emulates the VN receiving the messages indicated in the history, through round k.  When  appears in the history, emulate the VN receiving no messages but detecting a collision.  (If leader) Determines, broadcasts VN’s output messages for round k.

79 Discrete Algs for Mobile Wireless Sys79 CHA Protocol, Instance k  Simplified version: version in the paper has optimizations to reduce communication.  Each node begins instance k with a proposal for the current instance, and a history through instance k-1.  Ballot := (history, proposal)  Three rounds: Round 1 [ballot]:  If advice = active then broadcast(ballot) Round 2 [veto1]:  If collision occurred in round 1 then broadcast(veto) Round 3 [veto2]:  If collision occurred in round 2 then broadcast(veto) Generate new history through instance k:

80 Discrete Algs for Mobile Wireless Sys80 Generate New History  Use colors: If green or yellow, use the (unique) history you received in round 1, augmented with the associated proposal. If orange or red, use the history from your most recent green or yellow round, augmented with  s. red orange yellow green Result Veto 2Veto 1Ballot Accept Reject

81 Discrete Algs for Mobile Wireless Sys81 CHA output red orange yellow green Result Veto 2Veto 1Ballot If round is green, then output your new history. If round is yellow, orange, or red, then output .

82 Discrete Algs for Mobile Wireless Sys82 Analysis: Key Idea 1  For any instance k, the colors assigned by any two nodes differ by at most one shade. If some node assigns green to instance k, then all nodes assign either green or yellow. If some node “accepts the ballot” and outputs a history for instance k, then all nodes receive the ballot for instance k, and use it to define their new histories. If some node assigns red to instance k, then all nodes assign either red or orange. If some node “rejects the ballot” at instance k, then no node uses it to define its new history, and no node outputs a history at instance k.

83 Discrete Algs for Mobile Wireless Sys83 Analysis: Key Idea 2  After the network, collision detector, and contention manager stabilize, eventually, every round is green. When the underlying network is well-behaved, then ballots are received, and no vetoes are received.  Used to prove liveness properties for the emulated VN: Eventual collision freedom. Eventual accuracy of the collision detector. Contention manager eventually well-behaved.

84 Discrete Algs for Mobile Wireless Sys84 Emulating Entire VN Layer  Emulate each VN.  Complications: 1.Must also emulate communication between VNs. 2.VN emulators may interfere with each other, causing collisions.  Coping with the complications: Define static schedule for VN broadcasts:  Non-conflicting: Neighboring VNs are not scheduled at the same virtual round.  Fair: Every VN is scheduled periodically. Use schedule to avoid contention in VN emulation. Use 2 instances of CHA:  One for all the scheduled VNs. to agree on messages they broadcast and receive in virtual round k,  The other for unscheduled VNs, to agree on messages they receive in round k.

85 Discrete Algs for Mobile Wireless Sys85 Summary: Masking Communication Failures  VN Layer: Client Nodes + Virtual Stationary Nodes + local broadcast communication service + collision detector + contention manager.  Physical Layer: Physical Nodes + unreliable local broadcast + collision detector + contention manager.  Emulation: Replicated state machine strategy, with leaders to reduce communication. Convergent History Agreement (CHA) consensus protocols for emulators of each VN to agree on messages sent and received. Static scheduling, to emulate multiple VNs concurrently.

86 Discrete Algs for Mobile Wireless Sys86 Summary: Masking Communication Failures  CHA emulation guarantees strong consistency semantics for emulated VN Layer.  Protocol is fairly heavyweight.  Still could fail in practice: Depends on reliable collision detection, various “eventual properties”.


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

Similar presentations


Ads by Google