200 likes | 303 Views
Programming Computers Embedded in the Physical World. Liviu Iftode, Andrzej Kochut University of Maryland Cristian Borcea , Chalermek Intanagonwiwat, Ulrich Kremer Rutgers University. Distributed Computing Goes Outdoors. Left Hill. Right Hill.
E N D
Programming Computers Embedded in the Physical World Liviu Iftode, Andrzej Kochut University of Maryland Cristian Borcea, Chalermek Intanagonwiwat, Ulrich Kremer Rutgers University
Distributed Computing Goes Outdoors Left Hill Right Hill • How to program an unknown number of mobile systems • to execute a user-defined application in a certain • geographical area? • Traditional distributed computing hard to apply • The programming model must be simple to use • Networking aspects should be hidden from programmer
An Insightful Analogy (1) • Application accesses data through variables • Variables mapped to physical memory locations • OS guarantees reference consistency • Access time has an (acceptable) upper bound Variable access Application Virtual address space Page table Physical memory
An Insightful Analogy (2) • Shared virtual memory makes distributed programming easy • Application accesses distributed data through shared variables • Runtime system translates variable accesses into message passing Variable accesses Distributed Application Shared virtual address space Page table + Message passing Physical memories
From Indoor to Outdoor Computing Virtual Address Space Space Region Variables Spatial References Spatial references mapped to systems embedded in the physical space Variables mapped to physical memory ? Reference consistency Bounded access time ?
Space Regions Hill = new Space({lat, long}, radius); {lat,long} radius
Spatial References {Hill:robot[0]} Hill {Hill:robot[1]} {Hill:motion} • Refer to systems embedded in physical space • Defined as {space:property} pairs • Indexes used to distinguish among similar systems in • the same space region • - Distinct indexes must map to distinct systems • Same index must map to the same system (reference consistency)
Reference Consistency • At first access, a spatial reference is mapped to an embedded system located in the specified space • Mapping maintained in a Binding Table • Subsequent accesses to the same spatial reference uses the Binding Table to locate the corresponding embedded system {space, property, index} {network_address, location}
Bounding the Access Time • How to bound the time to access a spatial reference? • Discover an unmapped system for a new spatial reference • Mapped systems may move, go out of space, or disappear • Solution: associate an explicit timeout with the spatial reference access try{ {Hill:robot[0], timeout}.camera = ON; }catch(TimeoutException e){ // the programmer decides the next action }
Spatial Programming (SP) • Programs outdoor distributed applications using spatial references • Shields programmers from networking details • Space is a first order programming concept • Embedded systems named by their expected locations and properties • Network dynamics tolerated through timeouts
Spatial Programming Example Application: Water the hottest spot on the Left Hill Mobile sprinkler with temperature sensor Right Hill Left Hill Hot spot for(i=0;i<1000;i++) try{ if ({Left_Hill:Hot[i], timeout}.temp > Max_temp) Max_temp = {Left_Hill:Hot[i], timeout}.temp; Max_id = i; }catch(TimeoutException e) break; {Left_Hill:Hot[Max_id]}.water = ON;
Smart Messages (SM) • Smart Messages: distributed programming platform based on execution migration (similar to mobile agents) • Composed of multiple code and data bricks • Carry their own routing as a code brick (self-routing) • Cooperative nodes • Virtual Machine: execution environment for SMs • Tag Space: name-addressed memory persistent across SM executions • Code Cache: most recently used SM code bricks
Spatial Programming Implementation using Smart Messages • SP application translates into an SM • Embedded system properties: Tags • SM self-routing • Content-based routing using tags • Geographical routing • Reference consistency: unique tags are created on the mapped systems and stored as network addresses in the Binding Table • Spatial reference access translates into an SM migration to the mapped node
SP using SMs: Example Mobile sprinkler with temperature sensors Right Hill Left Hill Hot spot Spatial Reference Access Max_temp = {Left_Hill:Hot[1], timeout}.temp; {Left_Hill,Hot,1} {yU78GH5,location} BT ret = migrate_geo(location, timeout); if ret == LocationUnreachable ret = migrate_tag(yU78GH5, timeout); if (ret == OK) && (location == Left_Hill) return readTag(temp); else throw TimeoutException Smart Message Code Brick
Prototype Implementation • SP library over SM implemented in Java • Testbed: HP iPAQs equipped with 802.11 cards and running Linux
Conclusions • Spatial Programming makes outdoor distributed computing simple to program • Volatility, mobility, configuration dynamics, ad-hoc networking are hidden from programmer • Spatial Programming implemented using Smart Messages
Thank you! http://discolab.rutgers.edu/sm
Space Composition Right Hill Left Hill {(Left_Hill + Right_Hill):robot[0]}
Relative Spaces Right Hill Left Hill {rangeOf({Left_Hill:robot[0]}, radius):robot[0]}
Space Casting Left Hill Right Hill {Right_Hill:robot[0]} Left Hill Right Hill {Left_Hill:{Right_Hill:robot[0]}}