[IEEE 2007 2nd IEEE Workshop on Networking Technologies for Software Define Radio Networks - San...

2
Poster Abstract: ProSe - A Programming Tool for Rapid Prototyping of Sensor Networks Mahesh Arumugam Sandeep S. Kulkarni Cisco Systems, Inc. Michigan State University San Jose, CA 95134 East Lansing, MI 48823 [email protected] [email protected] I. INTRODUCTION . Read/Write model. In this model, in one atomic Existing platforms (e.g., nesC/TinyOS [1]) for pro- step, a sensor can either (1) read the state of one of gramming sensor networks use event-driven program- its neighbors, or (2) write its own variables. ming model [2]. As identified in [2], [3], while an event- . Write all with collision (WAC) model. In this driven platform has the potential to simplify concur- model, in one atomic step, a sensor can update its rency by reducing race conditions and deadlocks, the own state and the state of all its neighbors. However, programmer is responsible for stack management and if two or more sensors simultaneously try to update flow control. To simplify programming sensor networks, the state of a sensor, say k, then the state of k several macroprogramming primitives are proposed (e.g., remains unchanged. Thus, this model captures the [4], [5], [6], [7], [8]). However, the designer of such broadcast nature of sensor communication, primitives has to still implement them in nesC/TinyOS Transformation algorithms for WAC model can be and most of these primitives still require the programmer classified as: (a) deterministic TDMA transformation to specify protocols in nesC/TinyOS. [9] and (b) probabilistic CSMA transformation [10]. We propose ProSe, a programming tool for sensor In TDMA based transformation, in WAC model, each networks that enables one to: (1) specify protocols in sensor executes the enabled actions and writes its state to simple, abstract models (e.g., shared-memory, read/write all its neighbors in its TDMA slots. Also, the algorithm models), (2) reuse existing fault-tolerant protocols (e.g., in [10] allows one to correctly simulate a program for leader election, routing, target tracking, etc) from written for shared-memory model in sensor networks. the literature in the context of sensor networks, and ProSe transforms the input program into WAC model (3) automatically transform the protocols to the com- and generates the corresponding nesC/TinyOS code. It putational model of sensor networks (i.e., write all with also wires the generated code with a MAC layer (cf. collision model) and generate/deploy code. Furthermore, [11] for nesC code snapshots generated by ProSe). ProSe hides the deficiencies of nesC/TinyOS platform III. PROSE: CASE STUDY and enables rapid prototyping and quick deployment. II. PROSE: OVERVIEW We specify a routing tree maintenance program II* PROSE: OVERVIEW (RTMP) in shared-memory model in ProSe as shown Programs in ProSe are specified in terms of guarded in Figure I I. RTMP is based on [13], where sensors commands; each command/action is of the form: are arranged in a logical grid. It constructs a spanning guard - statement, tree with the base station (at K0,0)) as the root. Each sensor classifies its neighbors as high or low neighbors where guard is a predicate over program variables, depending on their (logical) distance to the base station. and statement updates program variables. An action g Also, each sensor maintains an inversion count (inv). - st is enabled when g evaluates to true and to execute The inversion count of the base station is 0. If j's that action, st is executed. Shalred-memory model. In this model, in one 'ProSe provides the abstraction for determining whether a sensor (say, k) atomic step, a sensor can read its state as well as has failed or not. Towards this end, sensor j accesses the public variable ' ~~~~~~~~~~~~~up.k of k. If it iS TRUE, then k iS alive; otherwise, k has failed. up.k is its neighbors and write its own variables, implemented by ProSe using a heartbeat protocol (e.g., [12]). 1-4244-13 16-8/07/$25.00 ©B2007 IEEE 57

Transcript of [IEEE 2007 2nd IEEE Workshop on Networking Technologies for Software Define Radio Networks - San...

Page 1: [IEEE 2007 2nd IEEE Workshop on Networking Technologies for Software Define Radio Networks - San Diego, CA, USA (2007.06.18-2007.06.21)] 2007 2nd IEEE Workshop on Networking Technologies

Poster Abstract: ProSe - A Programming Tool forRapid Prototyping of Sensor Networks

Mahesh Arumugam Sandeep S. KulkarniCisco Systems, Inc. Michigan State UniversitySan Jose, CA 95134 East Lansing, MI 48823

[email protected] [email protected]

I. INTRODUCTION . Read/Write model. In this model, in one atomicExisting platforms (e.g., nesC/TinyOS [1]) for pro- step, a sensor can either (1) read the state of one of

gramming sensor networks use event-driven program- its neighbors, or (2) write its own variables.ming model [2]. As identified in [2], [3], while an event- . Write all with collision (WAC) model. In thisdriven platform has the potential to simplify concur- model, in one atomic step, a sensor can update itsrency by reducing race conditions and deadlocks, the own state and the state of all its neighbors. However,programmer is responsible for stack management and if two or more sensors simultaneously try to updateflow control. To simplify programming sensor networks, the state of a sensor, say k, then the state of kseveral macroprogramming primitives are proposed (e.g., remains unchanged. Thus, this model captures the[4], [5], [6], [7], [8]). However, the designer of such broadcast nature of sensor communication,primitives has to still implement them in nesC/TinyOS Transformation algorithms for WAC model can beand most of these primitives still require the programmer classified as: (a) deterministic TDMA transformationto specify protocols in nesC/TinyOS. [9] and (b) probabilistic CSMA transformation [10].We propose ProSe, a programming tool for sensor In TDMA based transformation, in WAC model, each

networks that enables one to: (1) specify protocols in sensor executes the enabled actions and writes its state tosimple, abstract models (e.g., shared-memory, read/write all its neighbors in its TDMA slots. Also, the algorithmmodels), (2) reuse existing fault-tolerant protocols (e.g., in [10] allows one to correctly simulate a programfor leader election, routing, target tracking, etc) from written for shared-memory model in sensor networks.the literature in the context of sensor networks, and ProSe transforms the input program into WAC model(3) automatically transform the protocols to the com- and generates the corresponding nesC/TinyOS code. Itputational model of sensor networks (i.e., write all with also wires the generated code with a MAC layer (cf.collision model) and generate/deploy code. Furthermore, [11] for nesC code snapshots generated by ProSe).ProSe hides the deficiencies of nesC/TinyOS platform III. PROSE: CASE STUDYand enables rapid prototyping and quick deployment.

II. PROSE: OVERVIEW We specify a routing tree maintenance programII*PROSE:OVERVIEW (RTMP) in shared-memory model in ProSe as shown

Programs in ProSe are specified in terms of guarded in Figure I I. RTMP is based on [13], where sensorscommands; each command/action is of the form: are arranged in a logical grid. It constructs a spanning

guard - statement, tree with the base station (at K0,0)) as the root. Eachsensor classifies its neighbors as high or low neighbors

where guard is a predicate over program variables, depending on their (logical) distance to the base station.and statement updates program variables. An action g Also, each sensor maintains an inversion count (inv).

- st is enabled when g evaluates to true and to execute The inversion count of the base station is 0. If j'sthat action, st is executed.

Shalred-memory model. In this model, in one 'ProSe provides the abstraction for determining whether a sensor (say, k)atomic step, a sensor can read its state as well as has failed or not. Towards this end, sensor j accesses the public variable' ~~~~~~~~~~~~~up.kof k. If it iS TRUE, then k iS alive; otherwise, k has failed. up.k isits neighbors and write its own variables, implemented by ProSe using a heartbeat protocol (e.g., [12]).

1-4244-13 16-8/07/$25.00 ©B2007 IEEE57

Page 2: [IEEE 2007 2nd IEEE Workshop on Networking Technologies for Software Define Radio Networks - San Diego, CA, USA (2007.06.18-2007.06.21)] 2007 2nd IEEE Workshop on Networking Technologies

parent (p.j) is a low neighbor, then inv.j = inv.(p.j); IV. SUMMARYOtherwise, it sets inv.j=inv.(p.j)+1- If the inversion ProSe hides low-level details from the designer. ProSecount exceeds a certain threshold (CMAX), the sensor also preserves fault-tolerance properties of original pro-removes itself from the tree. gram during transformation. Based on our results from

1 program RoutingTreeMaintenance [11], [17] on prototyping target tracking and power2 sensor j; management protocols with ProSe we expect ProSe to3 const int CMAX; p4 var enable domain experts design sensor network protocols5 public int inv.j, d.j;6 public boolean up.j; rather than experts in sensor networks7 private int p. j8 begin9(d.k < d.j) && (up.k == TRUE) && REFERENCES10(inv.k < CMAX) && (inv.k < inv.j)11 -> p.j = k; inv.j = inv.k; [1] D. Gay and et al, "The nesC language: A holistic approach to121 (d.k < d.j) && (up.k == TRUE) && networkedembeddedsystems"ProgrammingLanguageDesign13 (inv.k+1 < CMAX) && (inv.k+1 < inv. j) s14 -> p.j =k; inv.j = inv.k+1; and Implementation, 2003.151 (p.j != NULL) && [2] A. Adya and et al "Cooperative task management without16 ((up. (p.j) == FALSE) (inv. (p.j) >= CMAX) A | ,17 ((d.(p.j) < dist.j) && (inv.j != inv.(p.j))) manual stack management or, event driven programming is18 ((d.(p.j) > dist.j) && (inv.j != inv.(p.j)+1))) not the opposite of threaded programming," USENIX Annual19 -> p.j = NULL; inv.j = CMAX; C201 (p.j == NULL) && (inv.j < CMAX) Technical Conference, 2002.21 -> inv.j = CMAX; [3] 0. Kasten and K. Romer, "Beyond event handlers: Program-

ming sensor networks with attributed state machines," Informa-Fig. 1. Routing tree maintenance program in shared-memory model tion Processing in Sensor Networks, 2005.

[4] M. Welsh and G. Mainland, "Programming sensor networksusing abstract regions," Networked Systems Design and Imple-

ProSe transforms RTMP into nesC using [9] and wires mentation, 2004.the generated program (ProSe-RTMP) with SS-TDMA [5] R. Newton and M. Welsh, "Region streams: Functional macro-

programming for sensor networks," Data Management for Sen-[14]. We simulated ProSe-RTMP and MintRoute [15] sor Networks, 2004.using TOSSIM [16], where the inter-sensor separation is [6] K. Whitehouse and et al, "Hood: A neighborhood abstraction10 ft and link reliability is 90%. Each sensor executes the for sensor networks," Mobile Systems, Applications, and Ser-write-all action of the program once in every 2 seconds. vices, 2004.

[7] R. Gummadi, 0. Gnawali, and R. Govindan, "Macro-Once the initial routing tree is constructed, we fail some programming wireless sensor networks using kairos," Dis-sensors and measure the convergence time. tributed Computing in Sensor Systems, 2005.

[8] K. Whitehouse, F. Zhao, and J. Liu, "Semantic streams: A^0 roSe-RTMP (Latency)

1 00 framework for declarative queries and automatic data interpreta--80 0 ProSe-RTMP (Latency) < M 5 failures Tech.

ProSe-RTMP (Active RadioTime)8 10failures tion," Microsoft Research, Tech. Rep. MSR-TR-2005-45, 2005.C: 70 MintRoute (Latency/Active Radio Time) 0 80 20fiue

)60 50 faiures [9] S. S. Kulkami and M. Arumugam, "Transformations for write-.50 60 = 100 failures all-with-collision model," Computer Communications, 2006.240 /ProSe-RTMP [10] T. Herman, "Models of self-stabilization and sensor networks,"o40~~~~~~~~~~~~~~~~)430° Workshop on Distributed Computing, 2003.-J 20 MintRoute [11] M. Arumugam, "Rapid prototyping and quick deployment ofE10> sensor networks," Ph.D. dissertation, Michigan State University,

5x5 7x7 1 Oxl0 14x14 20x20 5x5 10x1020x20 5x5 10x1020x202006.Network size Network size [12] M. G. Gouda and T. M. McGuire, "Accelerated heartbeat

(a) (b) protocols," International Conference on Distributed ComputingSystems, 1998.

Fig. 2. (a) initial latency and (b) convergence time. Black bars show the [13] Y.-R. Choi and et al, "Stabilization of grid routing in sensoractive radio time during the convergence period, networks," Aerospace Computing, Information, and Communi-

cation, 2006.

As shown in Figure 2, MintRoute converges to a new [14] 5. 5. Kulkarni and M. Arumugam, "SS-TDMA: A self-stabilizing mac for sensor networks," in Sensor Network Op-

routing tree quickly. By contrast, ProSe-RTMP converges erations, 2006.within 30-50 seconds. MintRoute is pessimistic in nature, [15] A. Woo and D. Culler, "Taming the challenges of reliablei.e., it maintains a moving average of link estimates of multihop routing in sensor networks," Conference on Embedded

allactive links. Whereas, RTMP program is optimi 'Networked Sensing Systems (SenSys), 2003.

all active links. Whereas, RTMP program is optimistic [16] P. Levis, N. Lee, M. Welsh, and D. Culler, "TOSSIM: Accuratein nature, i.e., whenever a sensor chooses one of its and scalable simulation of entire tinyOS applications," Embed-neighbors as its parent, it does not change its parent ded Networed Sensor Systems, 2003.

unles te paenthas aild orthetreeis orruted On [17] M. Arumugam and et al, "A case study on prototyping powermanagement protocols for sensor networks," Symposium on

the other hand, the active radio time during recovery iS Stabilization, Safety, and Security of Distributed Systems, 2006.small with ProSe-RTMP.

58