## 2 Virtualization in Wireless Sensor Networks
### Node Virtualization  
The birth of newer sensing application areas has motivated a new ecosystem that requires the sharing of resources from a hardware perspective. The sensor node is the basic unit of a WSN and its efficient utilization is vital to the overall performance of the entire wireless network. The ability to virtualize the application services running on the network produces benefits that are analogous to those of virtualization in computing systems. There are two strategies that have been adopted to address the virtualization of sensor nodes. These are the Sequential and the Simultaneous execution methods [87]. The Sequential execution method [87] is a rather less efficient means of virtualization because the application tasks run in sequence. In simultaneous execution, each process or task is given a time slice or quantum, and context-switching occurs based on the time slices allocated [88]. Sensor node virtualization allows for the running of several application tasks on a single node. This model overcomes the cost imperatives that accompany the redundant deployment of sensor nodes. Traditionally, sensor nodes are application-specific in a single domain and these sensor nodes are not used for any other application. A new sensor node is deployed in the event of a new sensing application. A major drawback associated with multiple applications sharing a sensor hardware is that the devices have limited resources. The real estate on the current sensor nodes is such that the platforms for virtualization cannot fit into the hardware resources available, particularly in terms of computation, \begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Platform** & **SenShare** & **Pavenet** & **Agilla** & **Squawk VM** & **VMStar** \\ \hline Programming Model & Event-driven & Thread & Tuple-space and & Thread & Thread \\ Real-time Performance & Yes & Yes & No & No & No \\ Communication & CTP & Not & Not discussed & 6 LoWPAN, & Not \\ Protocols & & discussed & Not discussed & CTP, LQRP & discussed \\ Decoupling & Yes & No & Yes & No & No \\ Programming & & nesC & C & Assembly & J2 ME & Java \\ Language & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison table for wireless sensor middleware and VM-based platform. communication and storage capabilities. Advances in processor technologies have yielded more power-efficient processors with larger memory spaces and computing power. Virtualization platforms can therefore be hosted in these nodes. Node virtualization addresses some of these challenges by creating a platform that will enable resource sharing and application management on a single node. Multiple applications can run on the node using a virtualization framework [83]. The basic concept of node virtualization is shown in Figure 3.  
Virtualization can also be achieved through type 1 or type 2 virtualization. Type 1 (also called bare metal) and type 2 (also called hosted) [89] have been used in a myriad of operating systems for WSN virtualization. Node level virtualization can be achieved using sensor operating systems (OS) or virtual machine/middleware- (VM/M) based solutions [90]. These two approaches assume different architectures when realizing virtualization. In the OS approach, the OS handles the multiple services that run on the node. Event-driven and thread programming models are dominant. In the VM/M approach, the VM system operates above the host operating system. This is shown in Figure 4. The approach is split into three: OS-based, middleware and VM-based approaches. Some efforts are noted in Table 3 for improving node virtualization based on the different OSs, the different types of middleware and the different VM-based platforms in use. Some qualitative metrics are presented to compare the different platforms.