IDEA1: A validated SystemC-based system-level design and simulation environment for wireless sensor networks
© Du et al; licensee Springer. 2011
Received: 15 May 2011
Accepted: 27 October 2011
Published: 27 October 2011
This article presents IDEA1, a SystemC-based system-level design and simulation framework for WSNs. It allows the performance evaluation (e.g., packet delivery rate, transmission latency and energy consumption) at high level, but with elaborate models of the hardware and software of sensor nodes. Many hardware components are modeled and the IEEE 802.15.4 standard is implemented. IDEA1 uses a clock-based synchronization mechanism to support simulations with cycle accurate communication and approximate time computation. The simulation results have been validated by a testbed of 9 nodes. The average deviation between the IDEA1 simulations and experimental measurements is 4.6%. The performances of IDEA1 have also been compared with NS-2. To provide a similar result (deviation less than 5%) at the same abstraction level, the simulation of IDEA1 is 2 times faster than NS-2. Moreover, with the hardware and software co-simulation feature, IDEA1 provides more detailed modeling of sensor nodes. Finally, IDEA1 is used to study a real-time industrial application in which a wireless sensor and actuator network is deployed on a vehicle to measure and control vibrations. By the simulation, some preliminary designs based on IEEE 802.15.4 protocols and two different hardware platforms are evaluated.
In recent years, numerous applications of wireless sensor networks (WSNs) have been developed. Different applications have diverse requirements; for example, a real-time industrial application requires short packet delivery latency, but a lifetime of weeks is often enough. In contrast, a remote environment monitoring system prefers a long lifetime of years with a low duty cycle. To meet the diversity of these requirements, designers need to consider a great number of node-level design choices (e.g., energy consumption of hardware components and processing capability) and many protocol-level parameters (e.g., anti-collision algorithms and routing approaches). Simulation is a cheap and quick way to perform many experiments with different hardware prototypes and network settings ; thus, a simulation tool is needed to explore the huge design space at an early stage before devoting too much time and resources.
The requirements of small size and low cost result in limited energy supply on sensor nodes. In order to extend the network lifetime, many efforts have been taken to reduce the energy consumptions of hardware, software, communication protocols and applications. Therefore, it is necessary to accurately predict the energy consumption of WSN, which requires detailed models of the hardware and software (HW/SW) of sensor nodes.
Many simulation tools for WSN have been developed by using different methodologies such as general-purpose network simulation, operating system (OS) emulation, instruction set simulation and System-Level Description Language (SLDL). However, most of them are implemented in general programming languages such as C++ and Java that do not support directly the HW/SW co-simulation. Only a few simulators designed in SLDLs provide native support to model concurrency, pipelining, structural hierarchy, interrupts and synchronization primitives of embedded systems .
As an SLDL, SystemC is a C++ class library for system and hardware design . It can model the embedded system at different abstraction level and allow designers to focus on the system functionalities by hiding the unnecessary details of communication and computation. Four SystemC-based WSN simulators [4–7] have been developed; however, none of them has been validated with experimental measurements or evaluated comprehensively by comparing with other simulators.
To exceed this limitation, a novel SystemC-based WSN simulator named IDEA1 (hIerarchical DEsign plAtform for Wsn and Architectural Node exploration) is developed. A testbed of 9 sensor nodes has been built to validate the simulation results of IDEA1. The deviation of IDEA1 simulations and the experimental measurements is small enough to be acceptable by the general system-level simulations. The performances of IDEA1 have also been compared with NS-2 which is the most used simulator in Mobile Ad hoc NETwork (MANET) research . With the HW/SW co-simulation feature, IDEA1 provides more detailed information of sensor node operations than NS-2, which can help designers to better analyze the energy dissipation of networks. Benefiting from the efficient simulation kernel of SystemC and our optimized model implementation, the simulation speed of IDEA1 is much faster than NS-2.
IDEA1 allows rapid performance evaluation at system level. The simulation results include packet delivery rate, transmission latency and power consumption. Many commercial off-the-shelf (COTS) hardware components, such as MICAz and MICA2, are modeled. The IEEE 802.15.4 standard  is implemented. It has been widely utilized in WSN applications since it is designed for low data rate, short distance and low-power-consumption applications in conformity with the constraints of WSN systems .
One important feature of IDEA1 is the accurate prediction of energy consumption of each sensor node and the whole network. It implements a clock-based synchronization mechanism to provide performance evaluation with cycle accurate communication and approximate time computation as a bus-functional model defined in . The energy model implemented in IDEA1 takes into account the power consumptions of all operation modes of each hardware component and transitions between different modes.
This paper is organized as follows. Section 2 summarizes the related works and the position of IDEA1 with respect to other simulators. Section 3 introduces the design and architecture of IDEA1. Section 4 validates its simulation results by some testbed measurements and evaluates its performance by comparing with NS-2. Section 5 demonstrates its usability and design flow by studying a real industrial application of WSN in vibration control. Section 6 concludes this paper and introduces the future work.
2 Related work
At present, WSN simulations mainly involve two parts: node system modeling and network modeling. The node system includes the hardware and software of a sensor node; the network modeling handles the interconnections among nodes. According to the key techniques they adopt, the existing WSN simulators can be divided into 3 categories: network simulators, node emulators and node simulators. Network simulators refer to the general-purpose network simulators that have been applied to WSN simulations. They emphasize on the network modeling and are enhanced with WSN-specific node models. Node emulators principally focus on the modeling of embedded software execution. They include the operating system emulators and instruction set simulators (ISS) of the processing unit on sensor nodes. Node simulators are generally developed in SLDLs which can provide behavioral models of sensor nodes and are compatible to the design flow of embedded systems.
A more detailed analysis of the simulation and recent simulators for WSN can be found in our previous work . In this paper, we focus on specifying the distinguished features of IDEA1 while introducing many typical simulators in each category.
2.1 Network simulators
Many general-purpose network simulators, such as NS-2  and OMNeT++ , have been utilized in WSN simulations. NS-2 is a discrete event, object-oriented simulator. SensorSim  is the first contribution for NS-2 to WSN simulation, where an 802.11 network is modeled with considerations of power models of hardware components. However, it has the deficiency of lacking a CPU model, and IEEE 802.11 is not widely adopted in WSN applications because of the high power consumption. An NS-2 IEEE 802.15.4 model is proposed in , while an energy model is added in . However, NS-2 does not scale well in terms of memory usage and simulation time . OMNeT++ adopts component-based programming model. An OMNeT++ IEEE 802.15.4 model is implemented in . The performance of IEEE 802.15.4 standard in the context of cyber-physical systems has been evaluated. PAWiS  is an OMNeT++ based WSN simulator that features the power consumption estimation.
Besides the extensions to general-purpose network simulators, some WSN-specific network simulators have also been developed. NetTopo  is an integrated simulator that provides the simulation of virtual WSN and the visualization of real testbeds. It also supports the interaction between the simulated WSN and real testbeds.
Generally, the network simulators specialize in network modeling and support a complete protocol stack. They have the advantages of extensibility, heterogeneity support and easy to use. However, the simulation models implemented in these simulators are difficult to be reused in system design or executed on real nodes; moreover, the energy consumption estimation is usually based on some simple assumptions of the sensor node operations; for example, the processor and radio-frequency (RF) transceiver have same operating state, but in fact the processor can be in sleep mode when the transceiver is listening to channels. IDEA1 overcomes these drawbacks by component-based hardware modeling of sensor nodes. Every hardware component is modeled as an individual module which operates independently. SystemC-based IDEA1 is not only a simulator but also a system design environment for WSN. Having a sensor node model, it is possible to evaluate its network performance. Once the requirements of final system are met, the real implementation of HW/SW components can start from this description.
2.2 Node emulators
TOSSIM  is an operating system emulator designed for the execution of TinyOS applications. It offers a controlled environment facilitating the development of algorithms and the study of system behaviors. ATEMU  is an instruction-level cycle accurate emulator written in C which has an ISS of AVR processor as the simulation kernel. It also supports other peripheral devices on MICA2 mote like the radio. Avrora  improves the performance of ATEMU in scalability.
Node emulators provide the highest behavioral and timing accuracy of software execution. The embedded software developed for physical platforms can be executed directly in the simulation framework with little or no modifications. However, they are generally constrained to specific predefined hardware platforms or operating systems. Due to the system-level abstraction, IDEA1 can quickly model the behaviors of an application based on a certain hardware platform at different timing-accurate levels, which accelerates the model development and simulation speed.
2.3 Node simulators
Wireless sensor network simulator (WISENES)  is developed in Specification and Description Language (SDL) which is a high-level abstraction language widely used in communication protocol design. The key feature of WISENES is that its simulation models are reusable in system design. However, it only contributes to the software implementation, but not the HW/SW co-design.
Kashif Virk et al.  have developed a SystemC-based modeling framework for WSN. It models the applications, real-time operating systems, sensors, processor and transceiver at node level and signal propagations at network level. However, only a behavior waveform of media access control (MAC) layer (states of the sending and receiving tasks) has been presented in . The SNOPS framework  is a transaction-level modeling (TLM)-based WSN simulator. A sensor node transmits or receives a data packet to or from an environment model by transaction exchanges. In , it is proved that the SNOPS framework requires 49.7% less simulation time than PAWiS . ATLeS-SN (Arizona Transaction-Level Simulator for Sensor Network)  is another TLM-based sensor network simulation environment developed in SystemC. It models a sensor node in 3 components: application specification, network stack implementation and sensor system. The physical channel is modeled as a component. ATLeS-SN demonstrated the feasibility of using TLM for sensor network application, but no standard networking protocol has been implemented.
SystemC Network Simulation Library (SCNSL)  is a networked embedded system simulator, written in SystemC and C++. It includes 3 modules: node (SystemC), node-proxy (SystemC) and network (C++). During the initialization stage, each node registers its information (e.g., location, TX power and RX sensitivity) at a network class which maintains the network topology and transmits packets to other nodes. The node-proxy is an interface between the network and nodes. By using node-proxy, nodes can be designed as pure SystemC modules so as to exploit all advantages of SystemC in HW/SW co-design and verification. SCNSL demonstrates a great perspective for system-level simulation of WSN system, but it still has some limitations such as node-level simulation without any specific hardware platform or energy model.
Emphasizing the modular design, but not like ATLeS-SN, IDEA1 models a sensor node exactly according to its hardware architecture. Each hardware component is modeled as an individual module. By doing this, the behaviors of hardware components can be accurately captured, which is the basis of energy consumption estimation. Many COTS processors and transceivers have been modeled, including AT-MEL ATMega128, Microchip PIC16LF88, TI CC2420, TI CC1000 and Microchip MRF24J40. They are basic components of some COTS motes (e.g., MICA2 and MICAz).
The software, such as applications and protocols, is implemented in separated modules which can control the operations of processor. Many applications and one of the most used WSN communication protocols, the IEEE 802.15.4 standard, have been implemented.
An energy model has been developed to enable the accurate energy consumption prediction. It has been calibrated by some experimental measurements.
A graphical user interface (GUI) has been developed to facilitate the system configuration, the observation of network topology and the analysis of simulation results.
The simulation results of IDEA1 have been validated by a testbed consisting of 9 nodes.
The performances of IDEA1 have also been compared with NS-2.
3 Design and architecture of IDEA1
In this section, the design and architecture of IDEA1 are presented, including the design framework, HW/SW modeling, energy model and user interface.
3.1 Architecture of IDEA1
The node system is a complex model comprising two parts, hardware model and software model. The hardware components of a sensor node generally include a processing unit, a transceiver, several sensors and a battery. The software model consists of protocol stack and application implementations. All nodes are connected to a same network object via their proxies. At the initialization phase, every node registers its information at the network module. During simulation, the network object calculates the distance between the source and its destination and forwards the packet according to the radio propagation models. If two packets arrive at a node simultaneously, a collision occurs. The SystemC kernel acts as the simulation engine. It schedules events and updates the states of modules every simulation cycle. All active processes are invoked sequentially at the same simulator time, which creates an illusion of concurrency. A GUI based on Qt platform  is developed to integrate all parts, which can facilitate the system configuration, network topology visualization, simulation control and result analysis.
In the node hardware model, the sensor is simulated as a stimuli generator that is an interface specifying how the physical environmental parameters vary in spatial and temporal terms. The processing unit converts the analog signal generated by the sensor module into digital format by a built-in analog to digital convertor (ADC) and sends the data frame to the transceiver via a serial peripheral interface (SPI) bus. The transceiver emits packets into network by different media access protocols. The transceiver reports the clear channel assessment (CCA) result and some interrupts (e.g., receipt of a packet) to the processing unit. The processing unit and transceiver are modeled as finite state machines (FSMs). During simulation, the state transition traces of each component are recorded. Each state is associated with a current consumption (CC) based on either experimental measurements or values in datasheets. The duration and current consumption of each transition between two states are also identified. Based on this information, the battery module calculates the energy consumption of each component and its residual capacity according to particular battery models during runtime.
3.2 Design framework of IDEA1
3.3 Hardware and software modeling of microcontroller
Many COTS hardware components have been modeled in IDEA1. To introduce the design process, as an example, the node prototype used in this paper is a sensor node developed in our laboratory, named as N@L (Node@Lyon). It is mainly composed of a PIC16LF88 microcontroller and an MRF24J40 transceiver. Its key feature is power efficient. The current consumption of active operation mode of PIC16LF88 is only 0.93-1.2mA . Another feature is hardware support of IEEE 802.15.4 standard by MRF24J40.
In this model, the microcontroller is woken up periodically by a built-in timer to perform the sensing operation and try to transmit the data to its destination (a coordinator). When in the SENSING state, it performs the sensing operating which is modeled by data generation in the sensor module and analog to digital conversion in the microcontroller module. After conversion, the microcontroller stores the sensor data in a buffer. It will go to either SLEEP or IDLE state depending on the application specifications if the data size is less than a certain value (the payload field size of protocol-defined packet); otherwise, it will go to TX state and send the sensor data to the transceiver via SPI. It will quit the TX state until the transmission finishes. After a transmission, the microcontroller may stay in TX state and transmit another packet, or it will go to SLEEP or IDLE state. When in IDLE state, if a packet is received, it will be informed by an interrupt from transceiver and go to RX state. If the packet is intended to other nodes, the microcontroller needs to forward it to its destination.
The FSM of microcontroller is controlled by software executions and interrupts generated by transceivers. The embedded software is divided into different tasks, such as data processing, ADC configuration and SPI communication. The execution time of each task is calculated according to their assembly codes. For example, the time taken by PIC16LF88 to complete an analog to digital conversion is 65.974 µ s, including 54 µ s computation time (108 instructions with 8 MHz clock frequency) and 11.974 µ s acquisition time (minimum required acquisition time ). The computation time includes the hardware configuration and result reading.
3.4 RF transceiver modeling
MRF24J40 provides full hardware supports of the IEEE 802.15.4 standard. The three IEEE 802.15.4 media access algorithms have been modeled, including unslotted carrier sense multiple access with collision avoidance (CSMA-CA), slotted CSMA-CA and guaranteed time slots (GTS). Three finite state machines of transceiver are developed according to these MAC algorithms. Due to the limit of space, only the model of the most complex algorithm, slotted CSMA-CA, is presented. In this section, we first briefly introduce some important conceptions of IEEE 802.15.4. Secondly, the design of transceiver models is described.
The minimum duration of a superframe (aBaseSuperframe Duration) is 960 symbols corresponding to 15.36 ms if the data rate is 250 kbps.
If it is a coordinator, the BEACON ACQUIREMENT/TRANSMISSION state is to broadcast a beacon packet; for a device node, it is BEACON ACQUIREMENT. On a successful receipt of beacon packet, the node may go to RX state if it has no data to send, or it continue with the transmission in the previous superframe. The process of slotted CMA-CA algorithm is similar to the unslotted algorithm except the backoff period boundaries of every node should be aligned with the superframe slot boundaries and the MAC sublayer should ensure that the PHY commences all of its transmissions on the boundary of a backoff period. One backoff period includes 20 symbols.
For the CSMA-CA algorithms, firstly, the number of backoff (NB) is initialized to 0. Then, the algorithm starts counting down a random number of backoff periods. When the timer of backoff expires, the algorithm performs channel assessment. If the channel is idle, the node starts transmitting; otherwise, NB is increased. If NB does not reach the maximum number of backoff (macMaxCSMABackoff), the algorithm backoffs again; otherwise, the channel access operation fails.
3.5 Energy model
where E ijk presents the energy consumption of the k th state of the j th component of node i, and E ijl presents the energy consumption of the l th state transition of the j th component of node i. The node has N components consuming energy. Each component has M states and O transitions. During the simulation, the state transition traces of each component are recorded; thus, the time spent on different states and transitions, t ijk and t ijl , are known. Based on this information, the battery module calculates the energy consumptions of each component as well as the network lifetime.
3.6 Graphical user interface
The GUI illustrated in Figure 5 consists of three major parts: system configuration table (top-left of the main window) managing all the system parameters, network topology widget (top-right) showing the relative positions of all nodes and the radio connections among them, and a console (bottom) displaying the simulation log.
Packet Delivery Rate (PDR): It is the ratio of the number of packets successfully received to the number of packets generated by nodes.
Average Latency (AL): Latency of a packet is the duration from the generation of the last sensor data in the packet to the receipt of this packet by coordinator. AL is an average latency of all packets that successfully received by coordinator.
Energy Consumption per Packet (ECPkt): ECPkt is the average energy consumed for successfully transmitting one packet.
Average Power Consumption (APC): APC is utilized to measure the average power consumption per node.
4.1 Experimental validation
In this section, the energy model is first calibrated, and then, the simulation results are validated by some experimental measurements of a testbed.
4.1.1 Calibration of energy model
One resistor of 1 Ω was placed series with the power supply of a node (named as node0) in order to measure the current consumption of node0. An instrumentation amplifier  with a gain of 76 is utilized to amplify the voltage across the resistor. A Tektronix MSO2012 mixed signal oscilloscope  is used to track current trace with the highest possible resolution. Tektronix MSO2012 provides a 1 GS/s sample rate. For the low current consumption of sleep mode, we use a digital multimeter that can capture extremely small current.
Current consumptions of N@L motes (3
6.7 mA/720 µ s
6.7 mA/720 µ s
4.1.2 Validation of simulation results
The average deviations between IDEA1 simulations and testbed measurements are 5.2, 3.2, 6.5 and 3.4%, respectively. Therefore, the average deviation for the four metrics is 4.6% which can be accepted for general simulations.
With a small sample rate (0.1, 1, 10 and 31.25), the system is light-loaded and every node can finish its transmission before a new sensor data arrives; thus, the PDR s and AL s remain stable. Since the average number of successful transmitted packets per sample interval is almost the same for different sample intervals, a bigger sample interval comprises longer period of sleep mode and its ECPkt is larger. The power consumption augments due to the decrease in sleep period. The largest sample rate without transmission overlapping is 31.25 Hz.
When the sample rates are 100 or 1,000 Hz, the latency results of experimental measurements are not available. The sample interval is too short that nodes sometimes cannot finish one transmission before the next sensing operation. The nodes may start a new one immediately after a transmission; thus, for a switch of the I/O pin of coordinator, we cannot determine when the sensor data are received by node0. The available testbed and simulation results show that the PDR s decrease and the other three metrics augment due to the increase in collisions and less number of packets successfully received by the coordinator. However, the latency is very small when the sample rate is 1,000. In this case, the system is completely saturated, and many new sensor data are read during one transmission. Because the payload size of the packet frame is one, only the latest read data can be sent for the next transmission; thus, the latency is short.
4.2 Performance evaluation
In this section, the same application of Section 4.1 is studied by NS-2 and IDEA1. The performances of IDEA1 are evaluated by comparing with NS-2. The NS-2 model used in this paper is based on an existing IEEE 802.15.4 NS-2 model in release 2.34 . The model has been modified significantly, since it was built complying with an earlier standard edition (IEEE 802.15.4 draft D18), which has been replaced by the latest revised release IEEE Std 802.15.4-2006. The extensions provided in  have also been added, such as sleep mode and symbol period CCA duration implementation.
NS-2 simulations are written in two languages, C++ and OTcl (Object-oriented Tcl). In general, C++ is used to implement protocol and OTcl is for simulation configuration. Therefore, once the network system implementation is complied as an executable file, many simulations of various configurations of system parameters can be executed by just modifying the OTcl script. However, this makes NS-2 hard to learn for beginners. IDEA1 just uses one programming language, C++. All the system parameters are defined in an XML and read by the executable simulation code without recompilation.
The hardware prototype used for this application is N@L motes, and the energy model is calibrated according to the testbed measurements presented in Section 4.1. The nodes use slotted IEEE 802.15.4 CSMA-CA algorithm to access channel. Many cases with various configurations of parameters (mainly BO, SO and sample rates) have been studied. To investigate the effect of SO and BO, SO is fixed to 0 and BO is set to 0, 1 and 2, which results in a constant active period of 15.36 ms and a superframe of 15.36, 30.72 and 61.44 ms, respectively. Other parameters are set to the values defined by default in the IEEE 802.15.4 standard. Each simulation includes 10,000 samples, for example, when sample rate is 0.1, the application lasts 27.8 h. Each case is simulated 100 times with different seeds for the generators of random backoff slot numbers.
4.2.1 Simulation results of IDEA1 and NS-2
In this section, the phenomena illustrated in Figure 11, 12, 13 and 14 are briefly explained. In the next section, the deviation of the simulation results between IDEA1 and NS-2 will be explained. As the sample rate increases from 0.1 to 1,000, the system goes through 3 different stages, i.e., lightly loaded, transition to saturation and saturated.
When the sample rates are small, the system is lightly loaded. During this stage, the sample interval is long enough for every node to accomplish its transmission before the next sensing operation, and the average numbers of transmitted packets during one sample interval are same for different sample rates; thus, the PDR s and AL s remain stable. The ECPkt s decrease as the sample interval becomes shorter. For a fixed sample rate, the smallest BO consumes the most energy since one sample interval includes more superframes and the nodes have to wake up to track the beacon packet at the beginning of each superframe. The AL of a bigger BO is larger than that of a smaller BO. If some nodes cannot transmit their sensor data in one active portion of a superframe, they have to wait until the next superframe to resume their transmissions. A bigger BO causes a longer inactive portion.
As the sample rate increases, the number of sensor data need to be sent per unit time augments and PDR begins to decrease due to the increase in collisions. The PDR s with bigger BO begin to decrease first, because SO is the same and a bigger BO means that one sample interval includes less number of active portions. During the period of transition to saturation, the AL increases. Some nodes cannot complete their transmissions before the next sample interval begins, and the last one or two nodes have to continue their old transmissions in the new sample interval. Due to more fierce competition of channel usages with other nodes, these transmissions are longer than the cases with a smaller sample rate and AL will increase compared with the lightly loaded stage. The smallest energy consumption occurs at the beginning of the transition to saturation. In this case, every node can accomplish its transmission before new sensor data arrives, but the interval between the last node turns to sleep and the next sensor data arrives is so short that the nodes spend the least energy in sleep mode. As the sample rate continues to increase, the energy consumption augments due to the increase in collisions.
When the system becomes completely saturated, nodes always have several pending data need to be sent. If a node read two new sensor data during one transmission, only the last sensor data will be sent and the first one will be discarded. The duration for the last sensor data stayed in the buffer is smaller; therefore, AL decreases. The ECPkt s remain constant for the same BO because the number of successfully transmitted packets per superframe is almost same. In addition, for a fixed sample rate, since one superframe includes a longer inactive portion if BO is larger, its ECPkt is bigger.
As the sample rate increases from 0.1 to 1,000, the APC s augments, because more sensor data need to be sent per unit time. For a same sample rate, the power consumption of a smaller BO is larger than a bigger BO, since a smaller BO means more number of beacon receiving and shorter inactive portion of a superframe.
4.2.2 Result deviations between IDEA1 and NS-2
The deviations of the simulation results between IDEA1_HW and NS-2 of the four metrics are 2.7, 8.9, 49.3 and 45.8%, respectively. The ones between IDEA1_NOHW and NS-2 are 1.0, 2.6, 8.3 and 7.2%. Therefore, the average deviation between IDEA1_HW and NS-2 is 26.7%, and the one between IDEA1_NOHW and NS-2 is 4.8%. The former is bigger since more detailed information of HW/SW operations has been considered. Especially when the sample rate is low, the deviations of ECPkt and APC results between IDEA1 and NS-2 are very large, because the SPI communications of microcontroller and transceiver account for a very great proportion of the power consumptions. For example, the SPI communication takes 42.4% of the power consumption of microcontroller when sample rate is 0.1. The simulation results proved that IDEA1 provides more accurate modeling of real WSN system. A more detailed power consumption analysis will be provided in next section.
4.2.3 Detailed analysis of power consumptions
Figure 15 shows the average power consumption of hardware components in different operation modes. The transceiver consumes much more energy than the microcontroller and the energy consumed in the sleep mode is very little.
Besides the power consumptions of active and sleep operating mode, we can also divide the power consumption of microcontroller into more detailed parts, including sleep, analog to digital conversion, SPI communications between transceiver and microcontroller, as illustrated in Figure 16. The microcontroller spend most of its energy for processing data and executing codes, a part of its energy for SPI communication and a little energy for analog to digital conversion and in sleep mode. The consumption of SPI communication is too big to be ignored, especially when sample rate is small.
4.2.4 Simulation time
All the simulations are executed individually on a server with an Intel 2.66 GHz Xeon X3230 processor and a 4.6 GB memory. For the application lasting 27.8 h with a sample rate of 0.1 Hz, the simulation times of IDEA1 and NS-2 are 7.35 and 24.0 min, respectively. The high-speed simulation of IDEA1 profits mainly from the efficient simulation kernel of SystemC and our optimized model implementation. SystemC provides a wait mechanism which can set relative processes to inactive state until an interesting event occurs. In our model, this event interrupt method is used in the while statement of FSM implementation. Instead of checking the states of microcontroller and transceiver every simulation cycle, their FSMs are woken up only when an interesting event occurs, which can reduce the simulation time significantly.
5 A case study
In previous sections, the simulation accuracy of IDEA1 has been validated by testbed measurements and its performance has been evaluated by comparing with NS-2. Now, IDEA1 is ready to be used in real projects. In this section, an industrial application of WSN in vibration control is studied.
5.1 Industrial application
The sensor network is composed of several nodes and a coordinator. The nodes measure periodically the vibration of their given positions by a piezoelectric sensor and transmit the data to a coordinator which collects the sensor data of all nodes. The coordinator is connected to a host that analyzes the collected data and implements control algorithms by an actuator network. The main challenges of designing this sensor network are the high sample rate and real-time requirements. The node should read the sensor data with 1 kHz sample rate and send the data to the coordinator within a short latency. At the early stage, some preliminary designs based on the existing hardware platforms and network protocols need to be evaluated.
At first, the eight nodes deployed on the vehicle roof are modeled. The nodes and coordinator form a star topology. All nodes can communicate with the coordinator directly. The nodes store sensor data temporarily in a data buffer and send the sensor data to the coordinator if the data in buffer is more than a certain value (the payload field size of the protocol-defined packet). A sample occupies one byte. Payload presents the number of samples in a packet. Since the sample rate is constant, a small payload results in more packets to be sent, causing more collisions and thus lower PDR. In contrast, a large payload leads a longer time for transmitting a packet, which increases the possibilities of channel access failures and causes lower PDR too. The best PDR, hence, occurs in the case with a moderate payload. However, payload should be as short as possible. A smaller payload means the first sensor data in the packet need to wait a shorter time to be sent.
The application has been tested on the MICAz and N@L motes, respectively, in IDEA1. The goal is to evaluate whether the IEEE 802.15.4 sensor network based on these two platforms can successfully transmit all the sensor data within a short time. The four metrics presented in Section 4 are used to evaluate the network performance: PDR, AL, ECPkt and APC. The three MAC algorithms in IEEE 802.15.4 standard are implemented. Because the maximum number of GTSs defined in the IEEE 802.15.4 standard is 7, but the current application consists of 8 nodes, a TDMA-based GTS algorithm proposed in  is also implemented. It is more suitable for industrial applications which require low packet delivery latency. The contention access period (CAP) is set to 0. The contention free period (CFP) is divided into 8 equal parts, called node slot, which are allocated to nodes off-line. During its slot, the node wakes up if it has data to transmit. Transmissions do not require ACKs since they happen during GTSs without contention. This algorithm can be implemented easily by software on the MICAz and N@L platforms.
5.2 Simulation results
Simulation results of OF MICAz and N@L motes
APC of microcontroller(µ W)
APC of transceiver(µ W)
5.2.1 Comparisons of MAC algorithms
The CSMA-CA algorithms are not appropriate for this industrial application due to the low PDR s, which is caused by the large number of collisions. The sample rate is too high that the system is overloaded.
Due to the constraints of the maximum GTS slots number of the IEEE 802.15.4 standard, the number of nodes in this simulation is set to 7. The original IEEE 802.15.4 GTS algorithm requires a minimum length of CAP period that is 440 symbols (7.04 ms). Because the packet is transmitted after the CAP portion, the AL is high. During one superframe of 30.72 ms, 30.72 sensing operations are performed, but only 30 sensor data can be sent in one packet; the PDR s cannot therefore be 100%. This algorithm is implemented by software in MICAz and by hardware in N@L. For MICAz mote, after receiving a beacon packet, the microcontroller can set the transceiver to sleep mode until its GTS slot; however, for N@L mote, the transceiver performs automatically and it keeps in active mode during the CAP portion of a superframe. Therefore, the power consumption of this algorithm based on N@L motes is much bigger than that of MICAz motes.
For the TDMA-based GTS algorithm, the PDR s can attain 100%, which prove that the TDMA-based GTS algorithm can reliably transmit the sensor data to the coordinator. However, this IEEE 802.15.4 sensor network fails to meet the real-time requirement of this application. Although the average latency of packets can attain 7.0 ms, Payload is 10 samples which mean that the first sample data should wait 17 ms to be received by the coordinator. This latency of sensor data is too high to generate a real-time control action.
5.2.2 Comparisons of hardware platforms
The PDR s of N@L are bigger than MICAz, because the MAC algorithms are implemented in MRF24J40 by hardware and the sensing operation in PIC16LF88 has limited impact on the communication process.
The AL s of N@L are larger than MICAz, since the SPI communication between PIC16LF88 and MRF24J40 is slower than that between ATMEL ATMega128 and TI CC2420. In order to transmit one packet of several bytes from PIC16LF88 to MRF24J40, the address needs to be sent before each byte. However, ATMega128 only has to transmit one address for a whole packet.
Microchip PIC16LF88 is a power-efficient microcontroller. With an extra low-power-consumption microcontroller, the APC s of N@L is smaller than MICAz, although the power consumption of MRF24J40 is much higher than CC2420.
6 Conclusion and future work
This paper presented IDEA1, a system-level simulator for WSN. It enables the design space exploration at an early stage. It models the sensor node in SystemC, which makes the simulation to be a part of the HW/SW design of sensor nodes. It supports a modular design of sensor nodes and WSN applications. Many COTS hardware platforms have been modeled and the IEEE 802.15.4 standard has been implemented. Energy models based on real experimental measurements have also been developed. The average deviation between the IDEA1 simulations and the experimental measurements is 4.6%. IDEA1 can provide more detailed modeling of sensor network than NS-2 but with less simulation time. The simulation results proved that the hardware and software operations of SPI communication cannot be ignored. By a case study of industrial application, the usability and design process of IDEA1 in real development of WSN systems have been demonstrated. IDEA1 can help the system designers to evaluate some primary designs with low timing and financial cost.
In the future, firstly, we are planning to provide IDEA1 as an open-source tool. To enhance its capability of modeling the real systems, some typical sensor chips will be modeled by SystemC and the interaction between sensors and environment will be studied. More communication protocols, especially high-data-rate protocols, will be implemented.
- Halkes GP, Langendoen KG: Experimental evaluation of simulation abstractions for wireless sensor network mac protocols. EURASIP J Wirel Commun Netw 2010, 2010: 24:1-24:2.View ArticleGoogle Scholar
- Sachdeva G, Dömer R, Chou P: System modeling: a case study on a wireless sensor network. University of California, Irvine, Tech. Rep. CECS-TR-05-12 2005.Google Scholar
- IEEE Std 1666--2005 IEEE Standard SystemC Language Reference Manual. Institute of Electrical and Electronics Engineers; 2006.Google Scholar
- Fummi F, Quaglia D, Stefanni F: A systemcbased framework for modeling and simulation of networked embedded systems. Proceedings of the Forum on Specification and Design Languages 2008, 49-54.Google Scholar
- Virk K, Hansen K, Madsen J: System-level modeling of wireless integrated sensor networks. Proceedings of the International Symposium on System-on-Chip 2005, 179-182.Google Scholar
- Hiner J, Shenoy A, Lysecky R, Lysecky S, Ross AG: Transaction-level modeling for sensor networks using systemc. In Proceedings of the 2010 IEEE International Conference on Sensor Networks, Ubiquitous, and Trustworthy Computing, ser. SUTC '10. Washington, DC, USA: IEEE Computer Society; 2010:197-204.View ArticleGoogle Scholar
- Damm M, Moreno J, Haase J, Grimm C: Using transaction level modeling techniques for wireless sensor network simulation. Proceedings of the Conference on Design, Automation and Test in Europe, ser. DATE '10 2010, 1047-1052.Google Scholar
- Kurkowski S, Camp T, Colagrosso M: Manet simulation studies: the incredibles. SIGMOBILE Mob Comput Commun Rev 2005, 9: 50-61. 10.1145/1096166.1096174View ArticleGoogle Scholar
- ieee Standard for Information technology-Telecommunications and information exchange between systems- Local and metropolitan area networks-Specific requirements Part 15.4: Wireless Medium Access Control (MAC) and Physical Layer (PHY) Specifications for Low-Rate Wireless Personal Area Networks (WPANs). Institute of Electrical and Electronics Engineers; 2006.Google Scholar
- Baronti P, Pillai P, Chook VW, Chessa S, Gotta A, Hu YF: Wireless sensor networks: a survey on the state of the art and the 802.15.4 and zigbee standards. Comput Commun 2007, 30(7):1655-1695. 10.1016/j.comcom.2006.12.020View ArticleGoogle Scholar
- Cai L, Gajski D: Transaction level modeling: an overview. In CODES+ISSS '03: Proceedings of the 1st IEEE/ACM/IFIP International Conference on Hardware/Software Codesign and System Synthesis. ACM, New York, NY, USA; 2003:19-24.Google Scholar
- Du W, Navarro D, Mieyeville F, Gaffiot F: Towards a taxonomy of simulation tools for wireless sensor networks. Proceedings of the 3rd International ICST Conference on Simulation Tools and Techniques, ser. SIMUTools '10 2010, 52:1-52:7.Google Scholar
- Fall K, Varadhan K:The ns Manual (formerly ns Notes and Documentation). 2009. [Online] [http://www.isi.edu/nsnam/ns/doc/ns_doc.pdf]Google Scholar
- Varga A: The omnet++ discrete event simulation system. Proceedings of the European Simulation Multiconference (ESM'2001) 2001.Google Scholar
- Park S, Savvides A, Srivastava MB: Sensorsim: a simulation framework for sensor networks. In Proceedings of the 3rd ACM International Workshop on Modeling, Analysis and Simulation of Wireless and Mobile Systems, ser. MSWIM '00. ACM, New York, NY, USA; 2000:104-111.View ArticleGoogle Scholar
- Zheng J, Lee MJ: Will IEEE 802.15.4 make ubiquitous networking a reality?: A discussion on a potential low power, low bit rate standard. IEEE Commun. Mag 2004, 42(6):140-146.View ArticleGoogle Scholar
- Ramachandran I, Das AK, Roy S: Analysis of the contention access period of ieee 802.15.4 mac. ACM Trans Sen Netw 2007, 3: 1-29. 10.1145/1210669.1210670View ArticleGoogle Scholar
- Naoumov V, Gross T: Simulation of large ad hoc networks. In Proceedings of the 6th ACM International Workshop on Modeling Analysis and Simulation of Wireless and Mobile Systems, ser. MSWIM '03. ACM, New York, NY, USA; 2003:50-57.Google Scholar
- Xia F, Vinel A, Gao R, Wang L, Qiu T: Evaluating ieee 802.15.4 for cyber-physical systems. EURASIP J Wirel Commun Netw 2011, 14. Article ID 596397Google Scholar
- Glaser J, Weber D, Madani SA, Mahlknecht S: Power aware simulation framework for wireless sensor networks and nodes. EURASIP J Embedded Syst 2008, 2008: 3:1-3:16.Google Scholar
- Shu L, Wu C, Zhang Y, Chen J, Wang L, Hauswirth M: Nettopo: beyond simulator and visualizer for wireless sensor networks. SIGBED Rev 2008, 5: 2:1-2:8.View ArticleGoogle Scholar
- Levis P, Lee N, Welsh M, Culler D: Tossim: accurate and scalable simulation of entire tinyos applications. In Proceedings of the 1st International Conference on Embedded Networked Sensor Systems, ser. SenSys '03. ACM, New York, NY, USA; 2003:126-137.View ArticleGoogle Scholar
- Polley J, Blazakis D, McGee J, Rusk D, Baras JS: ATEMU: a fine-grained sensor network simulator. First Annual IEEE Communications Society Conference on Sensor and Ad Hoc Communications and Networks, 2004. IEEE SECON 2004 2004, 145-152.View ArticleGoogle Scholar
- Titzer BL, Lee DK, Palsberg J: Avrora: scalable sensor network simulation with precise timing. In Proceedings of the 4th international symposium on Information processing in sensor networks, ser. IPSN '05. IEEE Press, Piscataway, NJ, USA; 2005.Google Scholar
- Kuorilehto M, Hännikäinen M, Hämäläinen TD: Rapid design and evaluation framework for wireless sensor networks. Ad Hoc Netw 2008, 6: 909-935. 10.1016/j.adhoc.2007.08.003View ArticleGoogle Scholar
- Qt - A cross-platform application and UI framework. [Online] [http://qt.nokia.com/]
- Picmicro mid-range mcu family reference manual[http://ww1.microchip.com/downloads/en/devicedoc/33023a.pdf]
- LT1014 amplifier. Linear Technology; [Online] [http://cds.linear.com/docs/Datasheet/10134fd.pdf]
- Tektronix MSO2012 mixed signal oscilloscope, Tektronix. [Online] [http://www.tek.com/]
- Chen F, Talanis T, German R, Dressler F: Realtime enabled IEEE 802.15.4 sensor networks in industrial automation. 2009 IEEE International Symposium on Industrial Embedded Systems. IEEE 2009, 136-139.View ArticleGoogle Scholar
This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.