330 likes | 447 Views
Actor Languages and Applications. Gul Agha University of Illinois at Urbana-Champaign http://osl.cs.uiuc.edu. All recent failures occurred in bridges that passed regular visual inspection Visual inspection alone is not adequate. Monitor Infrastructure.
E N D
Actor Languages and Applications Gul Agha University of Illinois at Urbana-Champaign http://osl.cs.uiuc.edu
All recent failures occurred in bridges that passed regular visual inspection Visual inspection alone is not adequate Monitor Infrastructure Seoul, South Korea (October 1994) Silver Bridge Collapse (1967) Hwy 19 Overpass Collapse Quebec (2006) I-35 Bridge Collapse in MN (2007) Buckled gusset plate (2003)
Use Smart Sensors for Continuous Structural Health Monitoring Sensing Processing Energy Harvesting Deployment Communication Coordination
Superstructures (December 9, 2010) “Adding sensors and other devices to bridges, tunnels and buildings can turn them into ‘smart structures’ capable of sensing and, in some cases, even responding to problems.”
Wireless Smart Sensors Inspect Bridge (December 30, 2009) “Dubbed the Illinois Structural Health Monitoring Project, the sensor network was designed to create a reliable alternative to traditional structure inspection techniques, which can be expensive and unreliable.” “The researchers' technology uses concurrent and distributed real-time processing to solve the issues of cost effectiveness and safety.”
Long-term deployment of 114 wireless sensor nodes on the Jindo Bridge, South Korea Full-Scale SHM System Deployment
Jindo Bridge Project Jindo Bridge Haenam South Korea Jindo
The Illinois Approach Illinois SHM Project Forum Illinois SHM software is used by 75 groups in 15 countries
Examples of Actor Systems • Erlang: web services, telecom • E-on-Lisp, E-on-Java: P2P systems • SALSA (UIUC/RPI), Charm++ (UIUC): scientific computing • Ptolemy (UCB): real-time systems • ActorNet (UIUC): sensor networks • Scala (EPFL), Coqa (JHU), Kilim: experimental • Orleans (Microsoft): cloud computing • DART (Google) web apps, cloud.. • ….
Example Actor Applications • Martian Rover (1990s) • Charm++ molecular dynamics software • Accounts for 10% of cycles at NCSA • Twitter's message queuing • LiftWeb Framework (Scala for web applications) • Image processing in MS Visual Studio 2010 • Vendatta game engine (Erlang) • Battelship gallactica has 1M people playing • Facebook Chat System (Erlang)
Actor anatomy Object Actor = encapsulated state + behavior + independent control + mailbox
Synchronization Constraints • Constrain the “local” order of processing messages • Usually specified as disabling conditions on message • Function of local state and message contents • These have delay semantics i.e. disabled messages are buffered • Implementations: Disabling constraints in AF, Pattern matching in Erlang, Scala
Bi-directional Channel protocols • Specify contracts (protocols) to describe a session between two actors • Statically and/or dynamically verify adherence to these contracts A Protocol B
TCP Protocol – State Machine SYN SYN+ACK ACK SYN SYN+ACK ACK Start Established
Sliding Window Protocol (n=3) Sender Receiver ime T
T1 ACK2,T3 ACK3,T1 Sliding Window Protocol ACK2 ACK3 ACK3 ACK3,ACK1,ACK2 T1 T2,ACK1 ACK1 ACK1 T2 T2 T3,ACK1,ACK2 ACK3,ACK1,T2 T3 T3 ACK2 ACK1,ACK2,ACK3 ACK3 ACK2,ACK3,ACK1 ACK1 T1 T1,ACK2,ACK3 ACK2 Sender Window Size = 3
Sliding Window Protocol - Synchronizer synchronizer SlidingWindowProtocol (sender, receiver, int size) { int lastFrame; int lastAck; disable receiver.message (data, int framen) when lastFrame – lastAck >= size; trigger: receiver.message (data, int framen) -> lastFrame = lastFrame + 1; sender.ack (int ackn) -> lastAck = lastAck + 1; } S. Frolund and G. Agha
service goal connection platform capacity level of service Web Applications and Mobile Clouds • The Mobile Web is no longer a homogeneous platforms … • Web applications are targeted to various contexts. Static Constraints Dynamic Constraints Open Systems Lab
Separation of Concerns • Location: Where to run? Where to create? • Many computation can be performed at either end. • Examples: content generation, intensive computation. • Good deployment depends on execution context. • Timing: When to load? How much to load? • Service and content are served from the server. • Examples: load on demand, preload, batch load. • Execution contexts have their preferred policy. Open Systems Lab
Context Management System P. Chang and G. Agha Open Systems Lab
Specifying Concurrent behaviors • New languages for coordination, deployment, monitoring, agent communication • Meta-programming, computational reflection
Concolic Testing • Combine symbolic and concrete testing • Concrete testing to generate witnesses • Collect constraints • Negate constraints to generate new paths • When constraints can’t be solved, use randomization • Approximations for dynamic memory • Partial order reductions
Needham-Schroeder and TMN Protocol • Tested a C implementations of a security protocols (Needham-Schroeder and TMN) with a known attacks • Took less than 15 seconds on a machine with 1.8GHz Xeon processor and 2 GB RAM to discover attacks in both of them • In contrast, a software model-checker (VeriSoft) took 8 hours to find attack in the Needham-Schroeder Protocol
Honeywell’s DEOS real-time scheduling kernel • Operating system developed for use in small business aircraft • jCUTE found the subtle time-partitioning error in < 1 minute • Java Pathfinder from NASA Ames ran out of memory on the original program • Had to test manually created abstraction • Took 11 minutes to discover the same error in the abstraction
Monitoring Approach • Cannot always solve constraints • Add monitors • Distributed Systems • Global state is distributed • Decentralized monitoring for efficiency
Decentralized Monitoring Example “If a receives a value from b then b calculated the value after receiving request from a” valRcv → @b((valComputed @a(valReq))) valComputed @a(valReq) @a(valReq) (valComputed @a(valReq)) b valComputed a valReq valRcv valReq valRcv → @b((valComputed @a(valReq)))
Computation Lattice Predictive Analysis Event Trace Dynamic Vector Clocks + )
Computation Lattice Predictive Analysis Event Trace • Check if all linear orders satisfy (pLTL) • Naïve algorithm has complexity O(||2L*W) • Our algorithm has complexity O(LW||) Dynamic Vector Clocks + )
Modeling Quantitave Properties • How to reason about quantitative aggregate properties? • Energy consumption • Throughput • Quality of service • Large state space often ignores symmetries • Properties are statistical in nature • Behavior of system may have Markovian approximation
… Modeling Global State State Vectors to representing a probabilistic superposition of possible states No commitment in the model toa unique state
Distributed Model of Time • Global synchronous wall clock • Synchronization is too tight • Too detailed an execution model • Asynchronous, distributed time • Vector clocks are too expensive • Application behavior is complicated Need a more expressive model of time: • Notion of distance and distribution. • Space-Time cone of causal influence. t Future causality R P Q Not Causally related x S Past causally connected y Light Cones
Distributed Time and Probability • Events separated in space are separated in time: • Scheduling delays • Latency and communication delays • Such delays are probabilistic in nature • Probabilistic cone t Future causality Q’ R Q P Not Causally related with high probability x x S Past causally connected y S’