Agilla: Mobile Agent Middleware for Wireless Sensor Networks

Motivation
Agilla: Mobile Agent Middleware
for Wireless Sensor Networks
¾ Existing sensor network software lacks flexibility
‰
‰
Entire network runs just one application
Cannot adapt to changes in
• the environment
• the network
• user requirements
Chenyang Lu
Department of Computer Science and Engineering
2
Agilla: A Flexible Middleware for
Sensor Networks
Example: Forrest
¾ Three applications: 1) Environmental Monitoring,
2) Fire Detection, 3) Fire Tracking
¾ Sensor network as a shared computing resource
‰
Flexible application deployment
Env. monitoring agent
Fire detection agent
Fire tracking agent
3
Example: Cargo Tracking
Agilla’s System Architecture
¾ Thousands of containers leave/join network per day
¾ Software need to be changed on the fly due to
‰
‰
‰
‰
‰
4
Node @ (2,1)
Node @ (1,1)
Agents
Departure and arrival of containers
Container’s country and company
Change in security levels
Change in security policies
Change in tracking technologies
Agents
migrate
Neighbor
List
Tuplespace
Middleware Services
¾ Agilla: support rapid and flexible deployment of
software in wireless sensor networks
5
remote
access
Tuplespace
Neighbor
List
Middleware Services
Agilla Middleware
Agilla Middleware
TinyOS
TinyOS
6
1
Agilla’s Computational Model
Tuple Space-Based Coordination
¾
Content-addressable shared memory
‰
PC
Stack
Condition
Codes
Code
‰
Clone
or
Migrate
¾
Tuple – A set of data fields
Template – A pattern that matches particular tuples
Provides spatiotemporal decoupling in unreliable networks
“rout”
“in”
Heap
Two variants of each:
1) Strong (code + state)
2) Weak (code only)
“in”
“out”
Tuplespace
Tuplespace
7
8
Agilla Tuple Space API
Location-Base Addressing
¾ Remotely accessible localized tuple spaces
out
in
¾ Stores context information
¾ Facilitates inter-agent communication
Tuplespace
¾ Nodes are addressed by location
(3,3)
(3,1)
(3,2)
Local
out:
in:
rd:
inp:
rdp:
regrxn:
deregrxn:
insert
remove
read
probing remove
probing read
register reaction
deregister reaction
Remote
rout:
rinp:
rrdp:
rrdpg:
(2,2)
insert
probing remove
probing read
probing group read (1-hop)
(1,1)
9
Our Test Bed
¾
¾
¾
¾
¾
¾
11
Fire Detection
Agent
(1,3)
10
Implementation on TinyOS 1.1.13
Agilla is available for Mica2 and MicaZ motes
‰ 4 agents/node
Agent Injector
‰ Written in Java
‰ Remote Injection via RMI
Key Challenges
‰ Network bandwidth
• Compact instructions
‰ Memory
• ROM: 54.7KB of 128KB
• RAM: 3.5KB of 4KB
‰ Message loss
• Agent-level ARQ
clone to (3,3)
clone to (3,1)
6x9 Mica2 Mote
Test Bed
Multi-hop Grid
One base station
12
2
Performance Evaluation:
Agilla Instruction Execution Times
migration vs. remote tuple space access
Local
Operations
Migration instructions are more
reliable because of hop-by-hop
acknowledgements…
Remote
Operations
…but remote tuplespace operations
have less overhead
13
Initial Experiences
14
Fire Tracking Video
¾ Fire Detection & Tracking
‰
Presented at IPSN 2005
¾ Intruder Detection and Tracking
‰
‰
Agents guard network perimeter and follow intruders
Periodically report intruder location to base station
¾ Cargo & Inventory Management
‰
‰
‰
In collaboration with Boeing
Mobile agents load manifests from RFID, find items, detect
security breaches, and send alert to Internet gateways.
Demo at SenSys 2005 (coming)
15
16
Video available at: http://mobilab.wustl.edu/projects/agilla
Related Work
Agilla Summary
¾ Distributing inanimate code modules
¾ Mobile agent middleware simplifies application
deployment & increases network flexibility
¾ Agilla middleware services
‰
‰
XNP [xbow’03], Deluge [sensys’04], MNP [icdcs’05],
SOS [mobisys’05]
Maté/Bombilla [asplos’02]
‰
¾ Mobile Agent-Like Middleware
‰
‰
‰
Sensorware [mobisys’03]
• Weak migration only
Smart Messages [Kang‘04]
• No remote interactions
• Single thread per node
‰
‰
Agent mobility
Tuple space-based coordination
Location-centric addressing
Context discovery
¾ Empirical results: deploying sensor network
applications on Agilla is reliable and efficient
17
18
3
References
Agimone: Middleware Support for
Seamless Integration of Sensor and
IP Networks
C.-L. Fok, G.-C. Roman, and C. Lu, Rapid Development and
Flexible Deployment of Adaptive Wireless Sensor Network
Applications, International Conference on Distributed Computing
Systems (ICDCS'05), June 2005.
Agilla: http://mobilab.wustl.edu/projects/agilla
• Source Code
• Documentation
• Tutorials
• Experience Reports
Chenyang Lu
Department of Computer Science and Engineering
19
Motivating Application:
Cargo Tracking
Problem Statement
Ship
¾ Weak radio => low radio range => isolated networks
=> reduced utility
Train
¾ Communication restrictions can be eased by
connecting WSNs using a common IP network
¾ Custom application-specific software is written to
connect sensor and IP networks
‰
‰
Customer, Shipper, DHS, CBP
Shipping Yard
Sensor and IP networks have vastly different characteristics
and capabilities
Not reusable, error prone, inflexible
Truck
21
Background:
Two Distinct Middlewares
Node (1,1)
Mobile Agent Model
Node (2,1)
Agents
Agents
AQL
AQL
AQL
AQL
AQL
AQL
AQL
AQL
migrate
remote
access
Neighbors
Tuple Space
Tuple Space
Neighbors
Agilla Middleware
Agilla Middleware
TinyOS
TinyOS
MICA2 Mote
MICA2 Mote
Agilla: Sensor Network Middleware
• Mobile Agents
• Host-level tuple spaces
• Host-level neighbor list
Severe resource limitations
22
¾ Mobile agent: unit of execution that can relocated
across hosts
¾ Multiple mobile agents can run on each host
¾ High degree of spatio-temporal decoupling => need
shared data space with uniform interfaces.
Limone: IP Network Middleware
• Mobile Agents
• Agent-level tuple spaces
• Agent-level neighbor list
Resource rich
23
24
4
Agilla and Limone Programming
Models
Tuple Space Model
¾
Tuple: collection of data
¾
¾
Tuple space: shared data space containing tuples
Template: patterns which match tuples
‰
‰
¾
Agilla
<15, “str”, false>
<15, *, false> matches <15, “str”, false>
Common tuple space operations:
‰
‰
‰
‰
out(t): add tuple t to tuple space
rd(T): copy tuple matching template T from tuple space
in(T): remove tuple matching template T from tuple space
react(T, c): execute code segment C when tuple matching template
T is placed in tuple space
¾ Simple bytecode
language
¾ Hosted on custom VM
¾ Handful of well-known
data types
Limone
¾ Java programming
language
¾ Hosted on Java VM
¾ Rich data types
25
Agimone
26
Agimone Services
¾
Shared data space
‰
‰
‰
¾
Sensor network discovery
‰
‰
‰
Network Architecture
AgimoneAgent has own Agilla TS
Agilla agents access TS directly
AgimoneAgent wraps Agilla TS in
Limone TS API
AgimoneAgent advertises self with
Limone Registry
Limone Registry distributes ad to
other AgimoneAgents
Ads stored in AgimoneAgent’s
Agilla tuple space
System Components
27
28
Agimone Services (Continued)
Cargo Tracking Revisited
¾ Inter-Network Migration
¾
‰
‰
Watchdog Agents
‰
Multi-step process
Though internally
complex, appears simple
to Agilla agent developer
‰
‰
‰
¾
Monitors sensors
Sends alert tuple to base station
Port authority’s Limone agent
reacts to it
17 lines of Agilla code, 11 lines
of Java code
Intrusion Search Agent
‰
Searches multiple WSNs for alert
tuples
‰
23 lines of Agilla code, no
additional Java code
•
29
Autonomously crosses WSN
boundaries
30
5
Performance:
Agimone Services
Experimental Setup
100Mbps Ethernet
115kbps serial
IBM R40 Laptop
• 1.5GHz Pentium M
• 512MB RAM
• Windows XP
Mica2 Mote on Gateway
• 7.4MHz Atmel 128L
• 4KB RAM
• TinyOS
¾ TS operations between mote and PC take 10-11 ms,
regardless of type or direction
¾ Cross-WSN migration takes ~85 ms
¾ As size of agent increases, serial link becomes
bottleneck
31
Performance:
Middleware Overhead
32
Other Integration Frameworks
¾
Hourglass [J. Shneidman, et al. 04] and Stream-Based Overlay
Networks [P. Pietzuch, et al. 06]
‰
¾
Tenet [R. Govindan, et al. 05]
¾
SERUN [J. Liu, et al. 05]
‰
In-and-Out latency
¾
‰
‰
¾
‰
End-to-End Migration Latency
¾
Native implementation done using simple message passing
27.39ms faster to move in and out of one WSN
78.39ms faster round-trip across two WSNs
Routes data from WSN to Internet, but does not support
applications
PCs directly control sensors; no support for autonomous task
migration
Embedded microservers control sensors; tasks cannot migrate
across microservers
IrisNet [P. Gibbons, et al. 03]
‰
Applies database abstraction to desktop PCs with sensing
peripherals (e.g., webcams)
Performance loss, but high developer productivity
33
Conclusions
34
References
¾ Agimone is a middleware that integrates sensor and
IP networks
¾ Implementation of a cargo tracking application
demonstrated that Agimone simplifies development
¾ Inter-network tuple space accesses take 10-11ms,
and migration takes ~85ms
¾ Some performance overhead, but increased
productivity
G. Hackmann, C.-L. Fok, G.-C. Roman and C. Lu, Agimone:
Middleware Support for Seamless Integration of Sensor and IP
Networks, International Conference on Distributed Computing in
Sensor Systems (DCOSS'06), June 2006.
http://mobilab.wustl.edu/projects/agilla
• Source Code
• Documentation
• Tutorials
• Experience Reports
35
36
6