������������ ���������������������� � Active�Sensor�Networking � In!network�dynamic�computations. � Scripting�allows�for�data�processing�near�source. � Reduces�network�traffic�and�saves�energy. � Uncontrolled�environments�result�in�bad�data. � Requires�reprogramming�of�motes�already�in� Written�by�Phillip�Levis deployment. David�Gay � Programs�need�support�for�a�large�application� David�Culler domain. Presented�by�Stephen�Nann � Requires�a�new�architecture�for�in!network�programming� models. ���������������������������������� � ���������������������������������� � ������������ ������������ � Maté VM�Limitations � Base�Requirements � Concise�programs�for�only�one�application� � Flexibility domain. � Support�wide�range�of�applications. � Explicit�synchronization�operations�have�to�be� � Concurrency implemented�by�programmer. � Automatic�implementation�of�safe�and�effective� parallelism. � Propagation�done�with�explicit�code�forwarding� � Propagation and�a�simple�local�broadcast. � Forward�code�reliably�and�efficiently�with�support�for� � Complex�and�limited�instruction�set. larger�programs. � Only�3�types�of�event�handlers. ���������������������������������� � ���������������������������������� � ������������ ��������� � � Application�Specific�Virtual�Machines�(ASVM) � Template�Components � Hardware�and�Software�independence. � Concurrency�Manager � Handles�the�execution�of�code�within�threads. � Programming�with�high�level�languages. � Ensures�race!free�and�deadlock!free�execution. � Reprogrammable�with�small�bytecoded capsules. � Scheduler � Protects�motes�from�malicious�programs. � Executes�threads�in�FIFO�Round�Robin�fashion�with�fine� � Customizable�instruction�set�and�event�triggering. granularity. � Uses�Trickle�algorithm�for�propagation. � Capsule�Manager � Supports�large�application�domain. � Handles�the�storage�and�loading�of�capsules. � Propagates�capsules. ���������������������������������� � ���������������������������������� � 1
��������� � ��������� � � Extension�Components � Handlers�– code�routines�that�run�in�response�to� system�events. � Operations�! functional�code�units. � Capsules�– store�the�code�sections�for� propagation. ���������������������������������� ! ���������������������������������� " �����$���������%����� �� �������&������ � Threads�are�executed�by�fetching�the�next�bytecode � Operations�note�access�to�a�shared�resource. from�the�capsule�store. � New�capsules�are�analyzed�for�shared�resources. � byteLength allows�the�Scheduler�to�keep�track�of�the� � Handlers�are�only�allowed�to�run�if�it�can�access�all� threads�PC. the�required�shared�resources. � Allows�multiple�threads�to�run�concurrently. � Two�Phase�Locking � Start�– hold�all�resources,�can�release�with�execution. � Finish�– releases�all�of�the�held�resources. � Reboots�when�new�code�arrives�to�reset�all� variables. � Option�for�explicit�synchronization. ���������������������������������� # ���������������������������������� �� �����$�'��������� �� �����()�������� � Handlers � Defined�by�user�to�react�to�certain�system�events. � Connected�to�operations. � Trigger�a�thread�to�execute�code�in�response�to�a� � Propagate�new�code�to�every�node. specified�event. � Use�selective�execution�– only�some�nodes�use�the�code. � Examples:�Timers,�Route�forwarding�request,� � Three�network�trickles ASVM�boot. � Version�Packets�– 32�bit�version�numbers�of�all�installed� capsules. � Capsule�Status�Packets�– which�fragments�a�node�needs. � Capsule�Fragments�– pieces�of�a�capsule. ���������������������������������� �� ���������������������������������� �� 2
�����()�������� *������ ����� � Operations � Description�File�with� scripts�defined. � Defined�by�user�to�perform�application�specific� computations. � Specify�3�things: � Primitives�– language�specific� � Language � Ex.�jump � Functions � ASVM�supports�a�particular�language�by�including�the� � Handlers primitives�it�uses�to�compile. � The�toolchain � Functions�– language�independent� generates�TOS�source� � Ex.�Send() code�and�maps� � User�tailors�to�a�specific�application�by�implementing� opcodes. appropriate�functions�and�handlers. ���������������������������������� �� ���������������������������������� �� (+��������,����)�-����% (+��������,����)�-����% � Applications � RegionsVM � Vehicle�tracking�written�in�TinyScript. � QueryVM Languages � Periodic�data�collection�with�in�network�aggregation. TinyScript � � Written�in�TinySQL. BASIC�like�dynamic�typing. � � Aggregation�libraries�compiled�to�Motlle. No�dynamic�allocation. � Motlle � TinySQL supports�new�aggregation�queries�written�in� � C�like�syntax. � Motlle. Supports�vectors,�lists,�strings,�and�first!class�functions. � All�handlers�transmitted�in�one�capsule.��No�incremental�changes to� � running�programs. ���������������������������������� �� ���������������������������������� �� (+��������,� $���������% (+��������,� .��'� ����� 24�shared�resources�and�a�128�byte�handler. Trickle�algorithm. � � Locking�and�Unlocking 100�byte�handler�injected. � � Few�microseconds. Average�reprogram�≈ 40�s. � � Looking�for�a�shared�resource Worst�case�≈ 85�s. � � <�1�ms ASVM�only�had�to�send�71B�handler�rather�than�19kB�image. � � Manager�can�provide�shared�data�safety�with�little�overhead�cost. � ���������������������������������� �! ���������������������������������� �" 3
$����/�� ���0 $�1'������� � Difficult�to�predict�what�data�will�look�like�from�each� � ASVM�has�6%�more�overhead. mote. � ASVM�has�20%�better�energy�efficiency�with� propagation. � Programming�in�high�level�language�increases� � ASVM�provides�customizable�instructions�and�event� execution�time�due�to�interpretation. handling. � Initial�code�image�is�much�larger. � ASVM�provides�automatic�race�and�deadlock� � Increased�overhead�due�to�race�and�deadlock� checking. checking. � ASVM�provides�a�more�energy�efficient�propagation� � Propagation�technique�is�slow�and�requires�3� algorithm�with�support�for�larger�programs. transmissions. � ASVM�allows�for�greater�language�and�application� flexibility. ���������������������������������� �# ���������������������������������� �� 2�������� ���������������������������������� �� 4
Recommend
More recommend