Abstract

Accurate and reliable routing protocols with Quality of Service (QoS) support determine the mission-critical application efficiency in WSNs. This paper proposes a model-checking design driven framework for designing the QoS-based routing protocols of WSNs, which involves the light-weight design process, the timed automata model, and the alternative QoS verification properties. The accurate feedback of continually model checking in the iterative design process effectively stimulates the parameter tuning of the protocols. We demonstrate the straightforward and modular characteristics of the proposed framework in designing a prototype QoS-based routing protocol. The prototype study shows that the model-checking design framework may complement other design methods and ensure the QoS implementation of the QoS-based routing protocol design for WSNs.

1. Introduction

Wireless sensor networks (WSNs) as the multihop self-organizing networks usually provide vital support for mission-critical applications [1] but have many design challenges such as routing [2], topology control [3], and coverage [4]. Quality of Service (QoS) support may determine the routing efficiency and effectiveness of real-time WSNs due to the constrained energy supply, bandwidth, and delay [5].

In order to design the QoS-based routing protocols for WSNs, we usually verify and evaluate the correctness and performance of these protocols using testing, simulation, and formal verification. Testing usually analyzes the implementations of these protocols and finds the protocol defects, but it is often achieved at a cost and cannot analyze all the conditions of these protocols. Simulation is commonly used in QoS-based routing protocol analysis, but it cannot analyze all the protocol behaviors. Formal verification, for example, model checking, can describe and analyze QoS-based routing protocols accurately and can make up the deficiency of testing and simulation [68]. Moreover, model checking can drive the design of some applications and systems, such as the interactive systems [9] and the web application [10] and may design the QoS-based routing protocols from model driven engineering to verification driven engineering [11].

In order to effectively design the QoS-based routing protocols for the mission-critical applications of WSNs, the paper proposes a model-checking driven design framework and demonstrates the effectiveness and advantages by the accurate feedback of continually model checking in the iterative design process. The rest of the paper is organized into five sections. Section 2 briefly introduces related work. Section 3 presents the model-checking driven design framework. Section 4 introduces a prototype of the QoS-based routing protocol. Section 5 presents the protocol verification and design improvement. Finally, the conclusions are offered in Section 6.

Akkaya and Younis [12] presented an energy-aware QoS routing protocol for WSNs with best-effort traffic and validated the effectiveness of the protocol through simulation. Ben-Othman and Yahya [13] proposed a QoS aware multipath routing protocol based on the concept of service differentiation to control the delay and then used the NS-2 simulations to evaluate the performance of the protocol for WSNs. Sun et al. [14] presented a game-theoretic approach to coordinate the QoS routing for WSNs and used NS-2 to verify its performance with simulations. Cheng et al. [15] used the geographic opportunistic routing for QoS provisioning in WSNs and evaluated the protocol through NS-2 simulations and tests on the hardware nodes. Hu et al. [16] proposed a multihop heterogeneous cluster-based optimization algorithm (MHCOA) for WSNs and also used NS-2 simulation to show the better performance of MHCOA in heterogeneous WSNs.

Akbaş and Turgut [17] presented a routing protocol with QoS support for wireless sensor and actor networks and carried out a series of simulations in OPNET modeler to analyze the performance of the protocol. Hammoudeh and Newman [18] presented an adaptive routing protocol with QoS metrics to meet application requirements of WSNs and used the Dingo WSN simulator to evaluate the performance of the protocol. Tschirner et al. [19] presented the automata-based models for biomedical sensor networks (BSN) and successfully used the driven model-checking technique to complement the simulation techniques to validate QoS properties of BSN.

In the above-mentioned related work, the simulation-based method is the main design verification technique for the QoS-based routing protocols of WSNs [20], but it is possible that some errors which may only occur under special conditions cannot be found in the simulations; thus the QoS metrics may not meet the routing requirements of WSNs in the mission-critical applications.

3. Model-Checking Driven Design Framework

To ensure that the QoS-based routing protocol can save energy, reduce the transmission delay, increase the probability of successful transmission to the sink node, and provide high QoS for WSNs we propose the model-checking driven design framework consisting of the design process, the timed automata model, and the verification properties.

3.1. Design Process

In the model-checking driven design framework for the QoS-based routing protocols of WSNs, the model-checking driven design process shown in Pseudocode 1 uses the iterative and incremental development. A QoS-based routing protocol of WSNs is designed through repeated cycles and in smaller parts at one time and iteratively enhanced through model checking until the full protocol is implemented. At each iteration, the design improvement is made and one new QoS metric is added.

Input the network (), QoS metrics ()
Design QoSRP: the prototype of the QoS − based routing protocol with the metric
while () do
 Model QoSRP using Timed Automata
 Verify QoSRP via Model Checking and Output the verification results
 Evaluate the verification results and improve QoSRP
 if ()
  Redesign QoSRP with the metrics
 endif
endwhile
Output QoSRP

In the model-checking driven design process, we assume there are nodes in WSNs and QoS metrics from the application requirements of WSNs and, firstly, design one prototype of the QoS-based routing protocol using the QoS metric of , namely, QoSRP, which we can react with and is simple enough to be understood and implemented easily; then QoSRP is modeled using timed automata [21, 22], verified via model checking, and improved as a result of evaluating the verification results. After taking the first iteration of the design improvement, we add one new QoS metric as the new feature to redesign QoSRP and continue to perform the process.

3.2. Timed Automata Model

In the model-checking driven design framework, we define the timed automata model, including the timed automaton of the sink node and the timed automaton of the sensor nodes according to the behavior of nodes in WSNs.

The timed automaton of the sink node is formally described as

The timed automaton of the sensor nodes is formally described as

In the timed automata model of WSNs, is the probe information sending channel of the sink node, is the message transmitting starting channel of the sensor nodes, and is the message transmitting ending channel of the sensor nodes. When the timed automata work, the clock values increase all with the same speed, and, along the state transitions in every automaton of the sink node or one sensor node, clock values being compared to integers form the guards, which may enable or disable state transitions and inhabit the possible behaviors in the mission-critical applications of WSNs.

3.3. Verification Properties

In the model-checking driven design framework, we select four CTL properties, including no deadlock, network connectivity, delivery rate of data packet, and transmission delay [19], which may be used for model checking.

(1) No Deadlock. This property can be formally specified as follows:

(2) Network Connectivity. Any node of WSNs should communicate with the sink node, no matter directly or through the multihop paths within a certain time, and the isolated nodes should not exist in theory. This property can be formally specified as follows:

(3) Packet Delivery Success Rate. The channel access failure, data packet collision, information transmission error caused by the thermal noise, and external interference may result in the loss of the packets. Packet delivery success rate refers to the ratio of the number of packets successfully received by the sink node and the number of packets sent to the sink node by the sensor nodes. For example, if the sensor nodes send 10 packets to the sink node, we need to verify the packet delivery rate reaching 90%, this property can be formally specified as follows:

(4) Transmission Delay. Transmission delay is the effectiveness of data packets, which must be transmitted to the sink node through the multihop paths in a bounded time. This property of the transmission delay time not exceeding of sending a packet to the sink node by the sensor node can be formally specified as follows:

4. A Prototype of the QoS-Based Routing Protocol: QoSRP

We design a prototype of the QoS-based routing protocol for WSNs, namely, QoSRP. Assuming there are nodes in WSNs, including one sink node and sensor nodes, represents one node, where and the node is the sink node. is the link cost between the node and the node , where , , , and . is the end-to-end optimal transmission cost of the node and the sink node. We define , where ,   represents the set of sensor nodes without the optimal next-hop neighbor nodes, and is the set of sensor nodes with the optimal next-hop neighbor nodes.

(1) Initialization. In an initial state, every node in WSNs broadcasts the “detecting” message consisting of its location information, ideal transmitting radius, and residual energy information by flooding communication and calculates the link costs between it and other nodes according to the received “detecting” messages in the network. We select two QoS metrics, including the transmitting delay and the residual energy over the data transfer paths for calculating the link costs. All link costs of are stored in the node and if the node does not receive the “detecting” message of the node , , where is the ideal maximum value. Then, the sink node starts the process of obtaining the least cost paths. At first, , therefore, we can get

(2) Iteratively Updating the End-to-End Optimal Transmission Costs. For the node in WSNs, where , it updates its according to (3). Consider

According to (14), QoSRP selects as the node in the optimal path, removes from , and adds into . Consider

(3) Finding the Optimal Path and Steadily Sending Data. The sink node periodically broadcasts a message to form one optimal path; other nodes select a node as the parent node within the set of until all nodes can route to the sink node. After forming one optimal path, the sensor nodes steadily send data to the sink node via the path in one period.

5. Protocol Verification and Design Improvement

5.1. Protocol Modeling

We model QoSRP based on the timed automata model using the model checker UPPAAL [23]. In usual scenarios, all sensor nodes are modeled with the parametric timed automata in UPPAAL.

First of all, we set up a set of identifiers to record all nodes. Assuming that there are sensor nodes in WSNs, . In QoSRP, the identifier of the sink node is , and the identifier of one other node is , where . The behaviors of one sensor node in WSNs can be described using two-timed automaton: and . The timed automaton of shown in Figure 1 describes the sink node, and the timed automaton of shown in Figure 2 is responsible for message sending and receiving of other sensor nodes.

Not all nodes in a real-time system are turned on simultaneously, and we constrain the turn-on times of sensor nodes in during which any sensor node can be turned on. In Figure 1, indicates whether an acknowledge message of the node is received by the sink node and before the sink node receives the acknowledge message, .

and , respectively, indicate that one node starts transmitting messages and ends a message transmission; and are synchronized with and . means that the sink periodically sends probe information and is synchronization with ; indicates the connection matrix of the nodes in WSNs. represents the number of packets sent to the sink node by the node and also ensures that the node can eventually connect to the sink node if .

In Figure 2, the time automaton of is divided into two phases. The first phase in is to find out the minimum cost path from the node to the sink node, and the second phase is to the transmit data. In , represents the number of packets received by the node from the other node , and represents the number of packets sent by the node . We can compare and to illustrate the packet transmission success rate.

In Figure 2, indicates the shortest distances of the node to the sink node, and is the link communication cost between two nodes. In , the variable of records the identifier of the node sending messages. follows the task processing mechanism of first-come, first-served in TinyOS [24] and considers the transmission delay in modeling message sending. Message transmission may need a few seconds, change the order of message sending and receiving, and affect the protocol implementation, so it cannot be ignored. Therefore we add the variable of simulating the message delay, where and DELAY is the maximum value of the message transmission delay.

5.2. Protocol Verification

We verify QoSRP about the properties such as no deadlock, network connectivity, delivery rate of data packet, and transmission delay [19]. Table 1 is the verification results in the first iteration in which the QoS metric is the residual energy over the data transfer paths, and it shows that the performance properties were not satisfied if the sensor nodes send fewer packets to the sink node, and the packet successful delivery rates did not satisfy the network QoS requirements.

5.3. Design Improvement

According to the verification results shown in Table 1, the performance of the current QoSRP still requires to be improved, so we continue to tune the parameters shown in Figures 1 and 2, such as , , , , and , and optimize QoSRP through model checking.

Now we combine the two QoS metrics of the transmitting delay and the residual energy over the data transfer paths to redesign QoSRP. The pseudocode of the redesigned QoSRP in one period is given in Pseudocode 2. According to the model-checking driven design framework, the new QoSRP is reevaluated through model checking and Table 2 presents the verification results which show a better performance of the protocol.

Input the network (), QoS metrics (Residual_Energy,  Transmitting_Delay)
Ouput QoSRP: the impoved prototype of the QoS − based  routing  protocol
BEGIN
 for node (  to  )
  Broadcast Detecting_Message(, , )
 endfor
 for node (  to  )
  for node (  to  )
    // Calculate   only for verifications
 //   for the normalization function
  endfor
 for node (  to  )
  Update
 endfor
 repeat
  Adjust
  Evalute QoS
 until Find one optimal path
 for node (  to  )
  Sending data via the optimal path
 endfor
END

6. Conclusions

The QoS-based routing protocols are the mission-critical application requirements of WSNs and involve many verification and evaluation techniques such as testing, simulation, and formal verification. This paper proposes a model-checking driven framework for designing these protocols, including the iterative design process, the timed automata model, and the alternative verification properties. We design a prototype of the QoS-based routing protocol and demonstrate continuing improving the protocol using the proposed framework and UPPAAL model checking. The results of the prototype study show that the model-checking driven design framework is a straightforward and modular method and supports the light-weight iterative redesign for designing QoS-based routing protocols of WSNs, and the feedback of continually model checking accurately drives the performance improving of the protocols of real-time WSNs.

Conflict of Interests

The authors declare no conflict of interests.

Acknowledgments

This work was supported by the National Natural Science Foundation of China (Grant no. 60905040), the Basic Research Program of Jiangsu Province (Natural Science Foundation) (Grant no. BK20131382), the 11th Six Talent Peaks Program of Jiangsu Province (Grant no. XXRJ-009), China Postdoctoral Science Foundation (Grant no. 2013M531393), and Jiangsu Planned Projects for Postdoctoral Research Funds (Grant no. 1102102C).