announcements
play

Announcements Reprogramming HW2: Due on 3/16 (Wed), 2:30pm Mat: - PDF document

Middleware for Wireless Announcements Reprogramming HW2: Due on 3/16 (Wed), 2:30pm Mat: mobile code Hard deadline! Agilla: mobile agent Midterm Open book, note Chenyang Lu CSE 467S 1 Chenyang Lu CSE 467S 2


  1. Middleware for Wireless Announcements Reprogramming • HW2: Due on 3/16 (Wed), 2:30pm • Maté: mobile code • Hard deadline! • Agilla: mobile agent • Midterm • Open book, note Chenyang Lu CSE 467S 1 Chenyang Lu CSE 467S 2 Motivation for Mobile Code Summary: Maté • Instruction Set • Need to reprogram sensors after deployment • Concise : utilizes the least amount of network • Change parameters bandwidth • Change/add/remove modules • Tailorable: can be modified for special operations • Change whole program • Virtual Machine • Manual installation on a large number of nodes • Small footprint : fits in rene2 (1KB data, 16KB code) is impractical • Resilient : cannot crash the mote • Energy : tradeoff between deployment and execution Chenyang Lu CSE 467S 3 Chenyang Lu CSE 467S 4 Mobile Agents : Limitations of (Just) Mobile Code A Motivation Example • Whole network runs one application • Cannot adapt to changes in • Goals • Environment 2 1 • Network 3 • Lack coordination between nodes 4 Chenyang Lu CSE 467S 5 Chenyang Lu CSE 467S 6

  2. Agilla Approach System Architecture • Agent mobility • Clone and move to designated physical Node (2,1) Node (1,1) locations Agents Agents migrate • Inter-agent coordination remote access Neighbors Neighbors Tuplespace Tuplespace • Operations on local and remote tuple spaces Agilla Middleware Agilla Middleware TinyOS TinyOS MICA2 Mote MICA2 Mote Chenyang Lu CSE 467S 7 Chenyang Lu CSE 467S 8 Agent Migration Location-Based Addressing • Two types of migration instructions: • Move: smove , wmove • Clone: sclone , wclone clone(4,6) (3,3) (3,1) (3,2) clone(3,5) • Two variants of each: • Strong (2,2) clone(3,3) clone(3,1) • Weak Fire Detection move(3,4) (1,3) (1,1) Agent Chenyang Lu CSE 467S 9 Chenyang Lu CSE 467S 10 Tuplespace-based Coordination Tuplespace Instructions • Inter-agent coordination done through tuple spaces • Shared memory interface Local Remote • Pattern matching using tuples • out : insert • rout : insert • Shared locally, accessible remotely • in : remove • rinp : probing remove blocking • rd : read • rrdp : probing read • inp : probing remove • rrdpg : probing group OUT(< string: fir> ,< loc: 1,1> ) IN(< type: string> ,< loc: 1,1> ) read of all neighbors • rdp : probing read Note: all are non- Tuplespace blocking, rrdpg saves results on heap Chenyang Lu CSE 467S 11 Chenyang Lu CSE 467S 12

  3. Examples Example: Fire Tracking Agent • If a neighbor is on fire • Clone to all neighbors within 1.4 grid hops of the fire • Periodically repeat to maintain dynamic perimeter • Sleeps 1.25 – 6 seconds during each epoch Chenyang Lu CSE 467S 13 Chenyang Lu CSE 467S 14 Agilla Conclusions Readings • New paradigm for programming sensor • P. Levis and D. Culler, “Maté: a Virtual Machine for Tiny Networked Sensors.” ASPLOS, Dec 2002. networks • (Strongly recommend) C.-L. Fok, G.-C. Roman, and C. Lu, "Rapid • flexible coordination Development and Flexible Deployment of Adaptive Wireless • adaptive and open software structure Sensor Network Applications," ICDCS, June 2005. • Chien-Liang Fok, Gruia-Catalin Roman, and Chenyang Lu, "Mobile • reasonable performance Agent Middleware for Sensor Networks: An Application Case • Demonstrated feasibility of mobile agents in Study," IPSN/SPOTS, April 2005. sensor networks • Todos • Agilla Project: http://www.cs.wustl.edu/mobilab/projects/agilla/ • Better programming models • More real-world experience • Security Chenyang Lu CSE 467S 15 Chenyang Lu CSE 467S 16 Operating Systems Real-Time POSIX • TinyOS • Standard of UNIX • Real-time POSIX • Supported by many operating systems • Real-time schedulability analysis • Variants of UNIX • Linux • Many commercial RTOS, e.g., VxWorks • Windows provides similar services Chenyang Lu CSE 467S 17 Chenyang Lu CSE 467S 18

  4. Supervisor mode To Be Covered • On processors with supervisor mode, you can do the • Supervisor mode following only in supervisor (kernel) mode • Execute privileged instructions and access special hardware • Process management • Set real-time priority • Scheduling • Device driver • Access to a separate address space (the kernel space) • Race condition • This is the mode in which the operating system usually runs. • Provide protective barriers between programs. • Prevent applications from corrupting OS data. Chenyang Lu CSE 467S 19 Chenyang Lu CSE 467S 20 Supervisor Mode (2) ARM supervisor mode • Careful about memory access (e.g., • Use SWI instruction to enter pointers) when supervisor mode, similar to subroutine: • programs run in supervisor mode SWI CODE_1 • Or processor has no supervisor mode • Sets PC to 0x08. • Support supervisor mode? • Argument to SWI is passed to • SHARC, ATMEL: No supervisor mode code. • Pentium, ARM: Yes • Saves CPSR in SPSR. Chenyang Lu CSE 467S 21 Chenyang Lu CSE 467S 22 Trap Exception • Trap (software interrupt): an exception • Exception: internally detected error. generated by an instruction. • Exceptions are caused by instruction • Ex. enter supervisor mode. execution • Ex. call a service routine • unpredictable • ARM uses SWI instruction for traps. • Build on top of interrupt mechanism. • SHARC offers three levels of software • Exceptions are usually prioritized and interrupts. vectorized. • Called by setting bits in IRPTL register. Chenyang Lu CSE 467S 23 Chenyang Lu CSE 467S 24

  5. Terms • Interrupt: generate by external devices • Exception: generate by CPU due to software errors • Ex. div by 0 • Trap: generate by software using instructions (enter supervisor mode: open file, read from network etc.) Chenyang Lu CSE 467S 25

Recommend


More recommend