Article

Mixed Criticality Scheduling for Industrial Wireless Sensor Networks Xi Jin 1 , Changqing Xia 1 , Huiting Xu 2 , Jintao Wang 1,3 and Peng Zeng 1, * 1 2 3

*

Laboratory of Networked Control Systems, Shenyang Institute of Automation, Chinese Academy of Science, Shenyang 110016, China; [email protected] (X.J.); [email protected] (C.X.); [email protected] (J.W.) College of Information Science and Engineering, Northeastern University, Shenyang 110819, China; [email protected] School of Computer and Control Engineering, University of Chinese Academy of Science, Beijing 100049, China Correspondence: [email protected]; Tel.: +86-24-2397-0232

Academic Editor: Albert M. K. Cheng Received: 2 June 2016; Accepted: 23 August 2016; Published: 27 August 2016

Abstract: Wireless sensor networks (WSNs) have been widely used in industrial systems. Their real-time performance and reliability are fundamental to industrial production. Many works have studied the two aspects, but only focus on single criticality WSNs. Mixed criticality requirements exist in many advanced applications in which different data flows have different levels of importance (or criticality). In this paper, first, we propose a scheduling algorithm, which guarantees the real-time performance and reliability requirements of data flows with different levels of criticality. The algorithm supports centralized optimization and adaptive adjustment. It is able to improve both the scheduling performance and flexibility. Then, we provide the schedulability test through rigorous theoretical analysis. We conduct extensive simulations, and the results demonstrate that the proposed scheduling algorithm and analysis significantly outperform existing ones. Keywords: mixed criticality; industrial wireless sensor networks; scheduling algorithm; scheduling analysis

1. Introduction Wireless sensor networks (WSNs) make industrial systems low-cost and easy-to-use. Additionally, industrial wireless standards, e.g., WIA-PA (wireless network for industrial automation–process automation) [1], WirelessHART [2,3] and ISA 100.11a (international society of automation) [4], have been developed to promote the popularization of wireless technology. The real-time performance and reliability are essential to industrial systems. Industrial WSNs, as the communication media in industrial systems, must be capable of supporting real-time and reliable communications. The strict requirements on the real-time performance and reliability are different from normal WSNs. Researchers have proposed some scheduling and analyzing methods, e.g., [5–10], to improve the two aspects. However, these previous works do not consider the mixed criticality network. Mixed criticality means that different data flows have different levels of importance (or criticality) [11]. For example, Figure 1 shows an industrial WSN for cement manufacturing. The rotary kiln is the most important equipment. If the rotary kiln has some exceptions and its temperature data are lost or miss the deadline, workers cannot take measures in time. This will lead to production inefficiency. By contrast, for the temperature data of pre-heaters, even if they cannot be delivered to the destination within the deadlines, the temperature of materials can be sensed in the pre-calciner. Therefore, the temperature data of the rotary kiln have more importance or higher criticality than

Sensors 2016, 16, 1376; doi:10.3390/s16091376

www.mdpi.com/journal/sensors

Sensors 2016, 16, 1376

2 of 20

those of pre-heaters. Usually, in mixed criticality networks, when the important equipment has an exception, its sensed data have to be quickly and reliably delivered to the control room. This process needs more network resources. In a network, flows with different levels of importance coexist. For resource-constrained WSNs, when resources cannot guarantee the requirements of all levels, the data flows that belong to less importance levels should be discarded. The discard strategy is applied in almost all of the mixed criticality systems [12]. Thus, the flows are dynamic in mixed criticality networks. To guarantee the real-time performance and reliability, previous works on industrial single criticality WSNs apply totally centralized methods to manage networks, e.g., [5,13,14]. However, the totally centralized methods have difficulty coping with dynamic flows. Raw materials

temperature

gateway

preheater

pressure pressure temperature Coal

speed motor current

cooler temperature

precalciner rotary kiln

Figure 1. An industrial wireless sensor network in a cement factory.

Intuitively, two types of methods can be used to schedule data flows in mixed criticality WSNs. The first type is to schedule flows based on criticality monotonic priorities. The criticality monotonic scheduling assigns the higher priority to the important flows and schedules them first. This method does not cope with the dynamism and transmits important flows as soon as possible. In this method, the criticality is considered as the temporality. However, actually, they are not equivalent. The criticality means the importance, while the temporality means the urgency. The temperature data of the rotary kiln are the most important, but the pressure data of pre-heaters are more urgent than those, since the change of pressure is the most frequent. If the temperature data are transmitted first, the urgent pressure data will miss their deadline, even though there are idle network resources after their deadlines. Thus, the criticality monotonic scheduling algorithm cannot utilize resources efficiently and is not suitable for mixed criticality systems. This has also been demonstrated in [15]. The second type is to use the algorithms that have been proposed for previous mixed criticality systems, such as uniprocessor/multiprocessor systems [16–18] and networks [19–21], to solve our problem. However, industrial WSNs are different from the previous systems. To guarantee the strict requirements on the real-time performance and reliability, the main problem to be solved is how to avoid the collision and interference between parallel data flows. Mixed criticality uniprocessor/mulitprocessor systems only consider independent processors and do not have the interference between parallel tasks. Mixed criticality wired networks and IEEE 802.11-based wireless networks are based on CSMA (carrier sense multiple access) protocols, which are unacceptable by industrial WSNs due to the unpredictability (we give more clarifications on the differences between our system and others in Section 2). Therefore, previous algorithms cannot be used without modification in mixed criticality industrial WSNs. In this paper, we present a holistic scheduling solution to guarantee the real-time and reliability requirements of data flows in resource-constrained industrial WSNs. Our scheduling method is implemented in the application layer. According to the generated schedules, each network node transmits or receives packets in the MAC (medium access control) layer. The scheduling method of the application layer manages all data flows based on global information. Thus, it can get the optimized solution. Some MAC protocols, e.g., [22,23], are proposed to improve the real-time performance and reliability for industrial wireless sensor networks. They are flexible and scalable, but are difficult to

Sensors 2016, 16, 1376

3 of 20

optimize globally because they transmit packets based on local information. We list our contributions as follows. First, we introduce the concept of mixed criticality into resource-constrained industrial WSNs. The mixed criticality concept distinguishes important data flows from less important data flows. It provides a new vision for resource-constrained networks to meet the high performance requirement of important flows. Second, we propose a scheduling algorithm for the mixed criticality network. The scheduling algorithm not only implements the optimized global management for all flows, but also reserves network resources for dynamic adjustments to enhance the real-time performance and reliability of important flows. It makes a trade-off between the scheduling performance and the flexibility. Performance evaluations demonstrate that the proposed scheduling algorithm outperforms existing ones. Third, we present a schedulability analysis for the proposed scheduling algorithm. We analyze end-to-end delay for flows and determine whether they are all schedulable. Simulation results show that our schedulability analysis is more effective than existing ones. The rest of the paper is organized as follows. Section 2 introduces related works. Section 3 presents our system model. Section 4 formulates our problem as a satisfiability modulo theories instance. Section 5 proposes a heuristic scheduling algorithm for mixed criticality WSNs. Section 6 presents the delay analysis and the schedulability test. Section 7 shows simulation results. Section 8 concludes this paper. 2. Related Works Scheduling algorithms and schedulability analysis methods have been widely studied in single criticality WSNs. The work in [13] proposes a real-time scheduling algorithm and analyzes the schedulability for industrial WSNs with linear topology, and the work in [24] presents similar methods for binary-tree networks. Based on the above two works, the work in [25] takes the impact of packet copying into account to enhance the channel utilization, and the work in [14] supports spatial reuse to improve the schedulability. For mesh topology networks, the authors of [5,6,26] propose a scheduling analysis, a fixed priority scheduling algorithm and two dynamic priority scheduling algorithms to meet the real-time requirement of industrial applications. However, these previous works do not consider the mixed criticality requirement. Mixed criticality is first proposed in uniprocessor systems [16,27]. Then, it is introduced to multiprocessor systems [17,18], controller area networks [19], network-on-chips [28,29], wired networks [20,30] and IEEE 802.11-based wireless networks [21]. Uniprocessor systems [16,27] and controller area networks [19] do not support parallel tasks (or data flows); while the serial mode is unsuitable for industrial WSNs. The works in [17,18] focus on homogeneous multiprocessor systems. As there is no interference between executing tasks, they do not need to consider how to avoid the interference. However, in industrial WSNs, the interference must be avoided. Network-on-chips use wormhole switching. For one data flow, the network-on-chip has to provide all nodes that the data flow uses simultaneously [28,29], whereas the industrial WSN only provides two nodes for one hop. Wired networks [20,30] and IEEE 802.11-based wireless networks [21] are based on the CSMA protocol, which is unacceptable by reliable industrial systems. Therefore, the previous system models are different from industrial WSNs. In WSNs, some works about critical data flows have been proposed. The IEEE 802.15.4 standard, which is widely used by WSNs, supports a hybrid TDMA/CSMA MAC protocol. In the TDMA frame, the guaranteed time slots (GTSs) can be assigned for transmitting critical data flows. For the hybrid protocol, the works in [31,32] propose time slot assignment algorithms to improve the performance of critical data flows. However, due to the unpredictability of the CSMA protocol, industrial WSNs cannot apply the hybrid protocol. The work in [22] considers a pure TDMA protocol. It proposes the PriorityMAC protocol, which is a distributed method and allows critical data flows to be transmitted

Sensors 2016, 16, 1376

4 of 20

as soon as possible. The PriorityMAC protocol assumes that the most important data flows are urgent; while in the mixed criticality industrial WSN, the importance and the urgency are independent of each other. We have researched mixed criticality industrial WSNs in our previous work [33]. In that work, the network adopts a totally centralized management, and the end-to-end delay is calculated. However, this strict centralized management is not flexible enough, and all exceptions have to be submitted to the centralized manager and wait to be processed. In this paper, our proposed mixed criticality network supports the dynamic adaptive strategy. The classical RM (rate-monotonic) scheduling policy, which first schedules the flow with a shorter period, is a basic scheduling strategy and has been widely used in industrial WSNs [1,2]. We will extend the classical RM policy and allow the important data flows to preempt the resources assigned to less important data flows. Then, we will analyze the schedulability of our extended RM policy. 3. System Model Industrial WSNs must support the strict requirements on real-time performance and reliability. Therefore, we consider an industrial WSN as follows. It consists of a gateway and some sensor devices (as shown in Figure 1). We use the node set N = {n1 , n2 , ...} to denote these nodes. The physical layer of our industrial WSNs is specified by the IEEE 802.15.4 protocol. It supports 16 non-overlapping channels. However, due to external interference, not all of them can be accessed all of the time. We denote the number of available channels as M (1 ≤ M ≤ 16). Our network serves the flow set F = { f 1 , f 2 , ...}. Each element f i is characterized by < Ti , Πi , χi >. Each flow f i periodically generates a packet at its period Ti and then sends it to the destination via the routing path Πi . The relative deadline of each packet is equal to the period Ti , i.e., a packet is released at the time t, and it must be delivered to its destination before the time (t + Ti + 1). In industrial wireless protocol, e.g., [1,2], periods conform to the expression: b × 2a

(1)

where a is an integer value and b is the unit-period. To keep consistent with related works on mixed criticality systems, our network also supports two criticality levels, L-crit (low criticality) and H-crit (high criticality). The dual-criticality model can be easily extended to the multi-criticality model. If the flow f i is important, its criticality level χi is denoted as H. Otherwise, its criticality level χi is L. When the system is running in the normal mode without any exception, all flows are delivered to their destinations within deadlines. If an important equipment has an exception, the corresponding data must be submitted frequently and via two paths to avoid faults on a single path. Thus, in our system model, the H-crit flows have two parameter sets: the L-crit parameters < Ti ( L), Πi ( L) > in the normal mode; the H-crit parameters < Ti ( H ), Πi ( H ) > in the exception mode and Ti ( H ) ≤ Ti ( L). Πi ( L) is a path that is used by the H-crit flow in the normal mode. Πi ( H ) contains two paths that are used by the H-crit flow in the exception mode, and the two paths transmit the same packet to improve the reliability. In order to clearly distinguish these paths, they are denoted as Πi ( L) = {πi∗ } and Πi ( H ) = {πi0 , πi00 }. The path πi∗ (and πi0 , πi00 ) is the set of links from the source to the destination. In this paper, we do not consider how to select routing paths. We assume all paths have been given before generating schedules. The dynamism this paper addresses refers to using different parameters in different modes. Transmitting a packet through the j-th link of the path πi∗ (or πi0 , πi00 ) is called the transmission τij∗ (and τij0 , τij00 ). Each transmission has two attributes < nα , n β >, which denote the transmission’s source and destination, respectively. As the constrained-resources must provide enough services to H-crit flows, the L-crit flows cannot be transmitted when exceptions happen. Therefore, L-crit flows only have a parameter set < Ti ( L), Πi ( L) >. To improve the reliability of industrial networks, we adopt the TDMA scheme in the MAC layer. The network manager, which is connected to the gateway, assigns a time slot and a channel offset to each transmission. A transmission only is scheduled at the given time

Sensors 2016, 16, 1376

5 of 20

slot and on the given channel offset. Packets are generated periodically, and the schedules of corresponding transmissions have the same period. The schedules with the same period are organized within a superframe [2]. Transmitting a packet from the source to the destination has to be done in a superframe. Thus, superframes repeat themselves periodically, and then, flows can be transmitted successfully. Figure 2a shows a simple network, which contains two flows f 1 and f 2 . When the system is in normal mode, the flows use their L-crit parameters. Their periods are eight time slots and four time slots, and their paths are {e52 , e21 } and {e98 , e87 , e74 , e41 }, where eij denotes the link from the node ni to the node n j . Figure 2b shows their superframes with different periods. CH and TS denote channel offset and time slot. 1 2

f1

3

4

6

7

5

8

f2

9

 1=H T1(L)=8 T1(H)=4  1*  '1  ''1

 2=L T2(L)=4  2*

(a) the 1st period the f2 superframe

the 2nd period the f2 superframe

CH1 5 2 CH2 2 1

...

5 2 2 1

...

the 1st period the 2nd period the 3rd period ... the f1 superframe the f1 superframe the f1 superframe CH1 8 7 7 4 4 1 8 7 7 4 4 1 8 7 7 4 4 1 8 7 CH2 9 8 9 8 9 8 9 8 ... TS1 TS2 TS3

TS4 TS5 TS6

TS7 TS8 TS9 TS10 TS11 TS12 TS13 TS14

(b) the 2nd period the 1st period ... of the hyper-frame of the hyper-frame 8 7 7 4 4 1 5 2 8 7 7 4 4 1 8 7 CH1 5 2 8 7 7 4 4 1 CH2 9 8 2 1 9 8 9 7 2 1 9 8 ... TS1 TS2 TS3

TS4 TS5 TS6

TS7 TS8 TS9 TS10 TS11 TS12 TS13 TS14

(c) Steal slots the 1st period

the 2nd period

the 3rd period

...

CH1 5 6 8 7 3 1 5 6 8 7 3 1 5 6 8 7 3 1 5 6 8 7 CH2 9 8 6 3 5 2 2 1 9 8 6 3 5 2 2 1 9 8 6 3 5 2 2 1 9 8 6 3 TS1 TS2 TS3

TS4 TS5 TS6

...

TS7 TS8 TS9 TS10 TS11 TS12 TS13 TS14

(d) Figure 2. Graph routing and superframe. (a) A network; (b) superframes with different periods; (c) a hyper-frame; (d) the flow f 2 steal slots from the flow f 1 .

Two types of improper schedules will lead to transmission interference, which seriously affects the network reliability. The first type, called node interference, is that more than one transmission uses the same node at the same time slot. Each node is only equipped with one transmitter. Therefore, one node cannot serve more than one transmission at the same time. The second type is called scheduling interference, which means that more than one transmission is scheduled at the same time slot and on the same channel. These overlapping transmissions cannot be separated. To avoid transmission interference between different superframes, we consider all superframes as a hyper-frame whose period is the lowest common multiple of all superframes. According to the period’s Expression (1), the hyper-period T = LCM( T1 , T2 , ...) = max { Ti }. Figure 2c shows the hyper-frame ∀ fi ∈F

of the simple example. We only consider how to schedule flows in the first hyper-period, since after that, all schedules are repeated periodically. The network manager generates all schedules under two situations: Situation 1: when the network is deployed; and Situation 2: when the deployment is changed. Due to the requirement of industrial applications being fixed, the deployment is not often changed. Thus, the schedules may be generated several times, but not frequently. According to this schedule information, it obtains the working modes of each node at every time slot and then

Sensors 2016, 16, 1376

6 of 20

delivers them to the corresponding nodes. For the schedules in Figure 2c, from TS1 to TS4, working modes of the node n2 are {receive, send, idle, idle}. When a node intends to send a transmission of L-crit flows, it waits for a constant time and then listens whether its channel is used. If the channel is used by H-crit flows, the node discards its transmission. Otherwise, the node sends the transmission. Note that although the node uses the carrier sense technique to determine whether an L-crit transmission is discarded or not, it is different from the CSMA scheme. Since for L-crit flows, the node performs carrier sense within time slots of the TDMA frame, if the L-crit transmission is not discarded, it is also scheduled based on the TDMA scheme. When a node intends to send a transmission of H-crit flows, it immediately sends it at the beginning of the assigned time slot. The scheduling algorithm assigns the proper time slot and channel for each transmission and prevents H-crit transmissions from interfering with other H-crit transmissions. Therefore, H-crit transmissions are sent directly without checking the channel. In this way, the H-crit flow can steal slots from L-crit flows when it needs more resources to cope with exceptions [34]. Note that the H-crit flow using H-crit parameters is not permitted to steal slots that are used by any other H-crit flows even if these H-crit flows are using L-crit parameters. Figure 2d shows an example of mixed criticality schedules. The period of the H-crit flow f 1 is changed from eight to four, and the new path {e56 , e63 , e31 } begins to be used. In this case, there are not enough time slots. The H-crit transmission 3 → 1 (the gray block) steals the resource of the L-crit transmission 7 → 4. Based on the stealing strategy, the dynamic adjustment can be supported. The schedulable flow set is defined as follows. When the system is in the normal mode, the flow set is schedulable if all flows characterized by L-crit parameters can hit their deadlines. When there are exceptions in the system, the flow set is schedulable if all H-crit flows can hit their deadlines no matter which parameters they are using. 4. Mixed Criticality Scheduling Problem Statement Based on the above system model, we describe the mixed criticality scheduling problem as follows. Given the network and the flow set F, our objective is to schedule transmissions in the time slot and channel dimensions, such that the flow set is schedulable. To explain the problem more clearly, we formulate the problem as a satisfiability modulo theories (SMT) specification. The transmission τij∗ (and τij0 , τij00 ) is assigned the sij∗ -th (and sij0 -th, sij00 -th) time slot and the rij∗ -th (and rij0 -th, rij00 -th) channel offset. Note that a transmission is scheduled periodically. Therefore, the transmission uses all of the time slots sij + g · Ti (∀ g ∈ [0, These assignments must respect the following constraints. (a)

T )) Ti

in a hyper-frame.

Channel offset constraint:

∀ f i , ∀ j ∈ [1, |πi∗ |], 1 ≤ rij∗ ≤ M

(b)

For each transmission, its assigned channel offset must be in M available channels. This expression is for transmissions in the path πi∗ . Other transmissions τij0 and τij00 in paths πi0 and πi00 have the same constraint, and we omit them for simplicity. Releasing sequence constraint: ∗ ∗ ∀ f i , ∀ j ∈ [1, |πi∗ | − 1], si,j < si,j +1

(c)

In a routing path, the transmission τi,j+1 is released after the transmission τi,j is scheduled. We still omit paths πi0 and πi00 . Real-time constraint: ∀ f i , 1 ≤ si,∗|π ∗ | ≤ Ti ( L) i

All transmissions cannot miss deadlines. Likewise, si,0 |π 0 | and si,00|π 00 | have the same constraint. i

i

Sensors 2016, 16, 1376

(d)

7 of 20

Interference constraint: Assigning resources to transmissions must prevent the happening of node interference and scheduling interference. We use δ(τa , τb ) to denote whether there exists interference between τa and τb , δ(τa , τb ) = (τa ∩ τb = ∅)?(η (s a , sb ) ∧ (r a = rb )) : η (s a , sb ) where η (s a , sb ) =

W ∀h∈[0, TTa ),∀k∈[0, TT )

(s a + h · Ta = sb + k · Tb ) means whether the assigned time

b

slots of τa and τb overlap each other. If the two transmissions do not use the same node, i.e., τa ∩ τb = ∅, then they can be scheduled at different time slots or on the different channel offsets. Otherwise, there exists node interference, and they cannot be scheduled at the same time slot. The transmissions of the H-crit flow f i are classified into three sets Γi∗ = {τij∗ |∀ j ∈ [1, |πi∗ |]}, Γi0 = {τij0 |∀ j ∈ [1, |πi0 |]} and Γi00 = {τij00 |∀ j ∈ [1, |πi00 |]}. For the L-crit flow f i , Γi0 = Γi00 = ∅, and then, ∀ f i ∈ F, Γi = Γi∗ ∪ Γi0 ∪ Γi00 . Thus, the interference constraint in the normal mode and exception mode are as follows. (d.1)

Normal mode:

∀τa , τb ∈

_

Γi∗ , δ(τa , τb ) = 0

∀ fi ∈F

(d.2)

Exception mode:

∀ f i , f g ∈ F, χi = χ g = H, ∀τa ∈ Γi , ∀τb ∈ Γ g , δ(τa , τb ) = 0 The mixed criticality scheduling problem is NP-hard [11]. Our SMT specification can be solved by some solvers, such as Z3 [35] and Yices [36]. These solvers can find satisfying assignments for quite many problems, and their solutions have been the excellent standard to evaluate the effectiveness of other methods [37]. However, the running time may be unacceptable for complex networks and flow sets. Therefore, we propose a heuristic scheduling algorithm in Section 5 to solve the problem. 5. Scheduling Algorithm In this section, we first introduce how to schedule transmissions, and then, based on these schedules, we determine working modes of each node at every time slot. 5.1. A Slot-Stealing Scheduling Algorithm We propose a slot-stealing scheduling algorithm based on RM (StealRM). The proposed StealRM optimizes the solution according to the global information and permits transmissions to share the same resource when the transmissions have different levels of criticality. Hence, the schedules can be adaptively adjusted based on the requirements of H-crit flows. The proposed StealRM is shown in Algorithm 1. Each flow is assigned as the RM priority. If two flows have the same RM priority, the flow with the smaller ID has the higher priority. The transmission’s priority is equal to its flow’s priority. The set R contains all of schedulable transmissions (Lines 1 and 17), and the set R0 denotes released transmissions at the current time slot (Line 3). At every time slot t, we first sort elements of R0 according to the decreasing order of priorities, and τ1 in the set R0 has the highest priority (Line 4). Then, for each transmission τa in the set R0 , we check whether it can be scheduled at the current time slot without any interference (lines between 7 and 21). Let F (τa ) denote the flow that the transmission τa belongs to (Line 6). The set YtHL contains the transmissions that have been scheduled at the time slot t and belong to H-crit flows with L-crit parameters. The sets YtH and YtL correspond to those in H-crit flows with H-crit parameters and L-crit flows, respectively. The transmissions in the set Y 0 and the transmission τa cannot steal slots from each other. According to the criticality level of τa , the set Y 0 is assigned different transmissions (lines between 7 and 12). If the transmission τa belongs to an H-crit flow with H-crit parameters,

Sensors 2016, 16, 1376

8 of 20

then it cannot steal slots from other H-crit transmissions (lines between 7 and 8). Y H and Y HL may contain the transmissions belonging to the same flow with τa . These transmissions do not interfere the ∗ } needs to be excluded from Y H and Y HL (Line 8). Similarly, if the scheduling of τa . Thus, the set {∀τig transmission τa belongs to an H-crit flow with L-crit parameters, then it cannot steal slots from any other transmissions (lines between 9 and 10). If the transmission τa belongs to an L-crit flow, then its slots cannot be stolen by L-crit flows and H-crit flows with L-crit parameters (lines between 11 and 12). When there is no node interference between τa and Y 0 and at least one channel is idle (Line 13), the transmission τa can be scheduled at this current time slot. Θ(Y 0 ) denotes the channels that have been used by Y 0 . However, if the current time slot has exceeded its deadline, the flow set is unschedulable (Lines 14 and 15). Otherwise, the time slot and channel offset of the transmission τa are assigned (Line 16), and the schedulable transmission set R and the scheduled transmission set YtH (YtL and YtHL ) are updated (lines between 17 and 23). Algorithm 1 StealRM. Require: the flow set F Ensure: the scheduling results ∀s a and ∀r a 1:

the schedulable transmission set R ← {τi1∗ , τi10 , τi100 |∀ f i ∈ F };

2:

for ∀t ∈ [1, T ] do

3:

R0 ← R;

4:

sort R0 according to the decreasing order of priorities;

5:

for each a from 1 to | R0 | do

6:

i ← F (τa );

7:

if χi == H and τa ∈ Γi0 ∪ Γi00 then Y0 ←

8: 9:

else if

Y0 ← (

10: 11:

Y0 ← (

14: 15:

if



∀h∈[0, T T( L) )

YtL+T ( L)×h ) ∪ ( i

i

else

12: 13:

∗ (YtH+T ( H )×h ∪ YtHL ∪ + Ti ( H )×h ) − {∀ τig }; i ∀h∈[0, T T( H ) ) i χi == H and τa ∈ Γi∗ then

V ∀τb ∈Y 0



∀h∈[0, T T( L) )



∀h∈[0, T T( H ) )

0 00 (YtH+T ( H )×h ∪ YtHL + T ( H )×h )) − {∀ τig , τig }; i

i

YtL+T ( L)×h ) ∪ ( i



∀h∈[0, T T( H ) )

YtHL + T ( H )×h ); i

(τa ∩ τb i 6= ∅) and |Θ(Y 0 )| < M ithen

if t exceeds the deadline of f i then return unschedulable;

16:

s a ← t; r a ← a random channel that is not in Θ(Y 0 );

17:

R ← R − {τa }+ the next transmission of τa ;

18:

if χi == H and τa ∈ Γi0 ∪ Γi00 then

19: 20: 21: 22: 23: 24:

∀h ∈ [0, T T( H ) ), YtH+T ( H )×h ← YtH+T ( H )×h + {τa }; i i i else if χi == H and τa ∈ Γi∗ then HL ∀h ∈ [0, T T( L) ), YtHL + Ti ( L)×h ← Yt+ Ti ( L)×h + { τa }; i else

∀h ∈ [0, T T( L) ), YtL+T ( L)×h ← YtL+T ( L)×h + {τa }; i i i return ∀s a and ∀r a ;

i

Sensors 2016, 16, 1376

9 of 20

The number of iterations of the for loop in Line 2 and the for loop in Line 5 is O(|T |) and O(|Γ|), respectively. The complexity of Line 4, Line 13 and Line 19 is O(|Γ|log|Γ|), O(|Γ|) and O( TT ), respectively. Therefore, the time complexity of Algorithm 1 is O(|T ||Γ|2 TT ). min

min

5.2. Node Working Mode Nodes have three working modes, including transmit mode (S), receive mode (R) and idle mode. H =< S (or R), r > to denote that at the time slot t, the node n transmits (or receives) We use wα,t a α L denotes that the node n serves L-crit flows. Algorithm 2 H-crit flows on the channel r a . Similarly, wα,t α determines the working mode for each node. For each transmission, we have assigned a time slot and a channel offset in Algorithm 1. According to the assignments, the working modes of the sender node and receiver node of the transmission can be obtained (lines between 4 and 9). The time complexity of Algorithm 2 is O(|Γ| TT ). min

Algorithm 2 Working mode. Require: the scheduling results ∀s a and ∀r a Ensure: all w∗L,∗ and w∗H,∗ 1:

all w∗L,∗ and w∗H,∗ are initiated as idle mode;

2:

for ∀τa ∈ Γ do

3:

i ← F (τa ); < nα , n β > are the sender and receiver of τa ;

4:

if χi == H then

5: 6: 7: 8: 9: 10:

H ←< S, r a >; ∀h ∈ [0, T T( H ) ), wα,s a + Ti ( H )× h i T H ∀h ∈ [0, T ( H ) ), w β,sa +T ( H )×h ←< R, r a >; i i else L ←< S, r a >; ∀h ∈ [0, T T( L) ), wα,s a + Ti ( L )× h i T L ∀h ∈ [0, T ( L) ), w β,sa +T ( L)×h ←< R, r a >; i i return all w∗L,∗ and w∗H,∗ ;

Note that a node may serve two flows at the same time slot, but the two flows must have different criticality levels. Otherwise, node interference occurs. At the beginning of the time slot t, the node H . Then, in a constant time, if it needs to send an H-crit flow or has received a works in mode wα,t L . flow, it continues working as the same mode at this time slot. Otherwise, it works in mode wα,t L However, when its mode wα,t is S, it must determine whether the assigned channel is clear or not before it sends the flow. If the channel has been occupied by H-crit flows, the flow has to be discarded. The switch time between different modes is very short compared with a time slot. For example, the switch time of the transceiver CC2420 is just 200 µs, while a time slot is 10 ms. Generally, at a time slot, most nodes only serve one flow or are idle, while only a few nodes serve two flows. 6. Scheduling Analysis In this section, we analyze the worst case end-to-end delay for each flow and use the delay to test the schedulability of the flow set. If the worst case delay of all flows does not exceed deadlines, the flow set is schedulable. For the sake of simplicity, we first explain how to compute the worst case delay in single-criticality networks (in Section 6.1) and then extend it to mixed criticality networks (in Section 6.2).

Sensors 2016, 16, 1376

10 of 20

6.1. Analyzing Method for Single-Criticality Networks Besides transmitting time, the end-to-end delay is introduced by the interference from higher priority flows. Therefore, in Section 6.1.1, we present the analyzing method of the total interference. In Section 6.1.2, we distinguish the different types of interference and compute the worst case delay. 6.1.1. Total Interference During the time interval between the release and completion of the flow f k , all of the active transmissions that belong to the higher priority flows may have node interference or scheduling interference to the flow f k . Therefore, in the worst case, the total interference is equal to the number of those higher-priority transmissions. The method of computing the workload in a period has been proposed in multiprocessor systems [38]. The mapping between the multiprocessor system model and the network model has been explained in the work [6], in which a channel corresponds to a processor and a flow is scheduled as a task. Therefore, we propose our analyzing method based on the work [38], which is the start-of-the-art analysis for multiprocessor systems. To make our paper self-contained, we first simply introduce the method of multiprocessor systems and then present our method. For the simplicity of expression, the multiprocessor system uses the same notations as our network model. For multiprocessor systems, the calculation of the worst case delay of the task f k is based on the level-k busy period (as shown in Definition 1). Definition 1. Level-k busy period for multiprocessor systems: The level-k busy period is the time interval [t0 , tk ), in which tk is the finish time of the task f k , and t0 satisfies the following conditions: 1. 2. 3.

t0 < tr where tr is the release time of the task f k . ∀t ∈ [t0 , tr ], at the time t, all processors are occupied by higher-priority tasks. ∀t < t0 , ∃t0 ∈ [t, t0 ], at the time t0 , at least one processor is occupied by lower-priority tasks. If there is no t0 that satisfies all conditions, then t0 = tr .

The level-k busy period is determined by the workload of all higher-priority tasks. The set P¯ ( f k ) contains the tasks with higher priority than the task f k . If the task f i ( f i ∈ P¯ ( f k )) has a job that is released earlier than the level-k busy period and its deadline is in the busy period, then the task f i has the carry-in workload in the level-k busy period. Otherwise, the task has no carry-in workload. The two types of workloads are presented as follows, and the length of the level-k busy period is x. (1)

(2)

In the level-k busy period, if the task f i has no carry-in workload, the upper bound of its workload is:   x WkNC ( f i , x ) = · ci + min{ x mod Ti , ci } Ti where ci is the execution time of the task f i . If the task f i has the carry-in workload, the upper bound of its workload is: WkCI ( f i , x )



=

 max{ x − ci , 0} · ci + ci + α Ti

where α = min{max{max{ x − ci , 0} − ( Ti − Di ), 0}, ci − 1} and Di is the worst case delay of the task f i . Based on the upper bounds of workload, two types of interference of the task f i to the task f k are as follows: IkNC ( f i , x ) = min{max{WkNC ( f i , x ), 0}, x − ck + 1} IkCI ( f i , x ) = min{max{WkCI ( f i , x ), 0}, x − ck + 1}

Sensors 2016, 16, 1376

11 of 20

Therefore, the total interference suffered by the task f k is: Ωk ( x, P¯ NC ( f k ), P¯ CI ( f k )) =



∀ f i ∈ P¯ NC ( f k )

IkNC ( f i , x ) +



∀ f i ∈ P¯ CI ( f k )

IkCI ( f i , x )

where P¯ NC ( f k ) and P¯ CI ( f k ) denote the set of tasks without carry-in workload and the set of tasks with carry-in workload, respectively. In a busy period, at most M − 1 higher-priority tasks have carry-in workload. Therefore, the set P¯ CI contains M − 1 tasks that have maximal values of IkCI ( f i , x ) − IkNC ( f i , x ). Other tasks are in the set P¯ NC . In the following, we propose our analyzing method. Industrial WSNs apply strict periodic schedules based on superframes, which can reduce system complexity and run time overhead. While in multiprocessor systems and previous works about WSNs, schedules are variable, i.e., the assigned time slots to a task (or a flow) are non-periodic, so our workload bounds are not the same as previous ones. Our workload bounds are computed with Theorem 1. Definition 2 defines the level-k busy period in the network. Definition 2. Level-k busy period for networks: The level-k busy period is the time interval [t0 , tk ), in which tk is the finish time of the flow f k and t0 satisfies the following conditions: 1. 2. 3.

t0 < tr where tr is the release time of the flow f k . ∀t ∈ [t0 , tr ], at the time t, all channels are occupied by higher-priority flows or there exists node interference between the scheduled flows and the flow f k . ∀t < t0 , ∃t0 ∈ [t, t0 ], at the time t0 , there is no node interference, and at least one channel is occupied by lower-priority flows or idle. If there is no t0 that satisfies all conditions, then t0 = tr .

Theorem 1. The workload bounds can be computed with: WkNC ( f i , x )

=

WkCI ( f i , x )



=

 x · ci + min{ x Ti

mod Ti , ci },

(2)

where ci is the number of hops in the path πi , i.e., ci = |πi | Proof of Theorem 1. The computation of the non-carry-in workload WkNC ( f i , x ) is shown in Figure 3a. j k There are Tx complete periods and a scheduling window ( x mod Ti ). In the scheduling window, i at most ci workloads exist. Therefore, the expression of the non-carry-in workload is shown as Equation (2). Ti

Ti

Ti

x mod Ti

time

x (a) Ti

Ti

A

Ti

x

Ti

B

(b) Figure 3. Illustration of Theorem 1. (a) WkNC ( f i , x ); (b) WkCI ( f i , x ).

time

Sensors 2016, 16, 1376

12 of 20

In the following, we compute WkCI as shown in Figure 3b. The notations A and B denote the two incomplete periods, respectively. We know that A < Ti , B < Ti and A + B = ( x mod Ti ) or ( x mod Ti + Ti ). We discuss the two cases as follows. Case 1: A + B = x mod Ti . We draw out the windows A and B in Figure 4a. We consider four different value ranges of the windows A and B as shown in Table 1, in which if A ≥ Ti − Di and B ≥ Di ; it is Case 2. If A < Ti − Di , then there is no workload in A. If B ≥ Di , then all execution time ci must be the available workload. In this case, the workload can also be expressed as min{ B, ci }. Therefore, only if A < Ti − Di , the workload is min{ B, ci }. If A ≥ Ti − Di and B < Di , the time interval Ti − Di does not contain any workload. Therefore, the available window A + B is equal to ( x mod Ti ) − ( Ti − Di ). Ti x mod Ti

Di Ti

B

B

A

A (a)

(b)

Figure 4. Computation of WkCI . (a) A + B = x mod Ti ; (b) A + B = x mod Ti + Ti . Table 1. The workload in the incomplete period under different value ranges of A and B. Workload

A < Ti – D i

A ≥ Ti – D i

B ≥ Di B < Di C1

ci min{ B, ci } min{ B, ci }

Case 2 min{ x mod Ti − ( Ti − Di ), ci } min{ x mod Ti − ( Ti − Di ), ci }

In Case 1, we can get that the total workload is: 

 x · ci + C1 Ti

(3)

The notation C1 denotes the workload in the incomplete period as shown in Table 1. It is equal to min{ B, ci } or min{ x mod Ti − ( Ti − Di ), ci }. j k Case 2: A + B = x mod Ti + Ti , which is shown in Figure 4b. In this case, there are

x − Ti Ti

complete periods. In the windows A and B, at most ci + min{ x mod Ti , ci } workloads exist. Therefore, the workload of Case 2 is:   x − Ti · ci + ci + min{ x mod Ti , ci } Ti 



 x · ci + min{ x Ti

mod Ti , ci }

(4)

Comparing with Equations (3) and (4), the upper bound of workload is Equation (4). Since ( x mod Ti ) is not less than B and ( x mod Ti ) − ( Ti − Di ), Equation (4) is the same as Equation (2). The theorem holds. Due to the two types of workload having the same computing formula, we do not distinguish them in the following and use Wk ( f i , x ) to denote them. Based on the workload bound, the interference of the flow f i to the flow f k is: Ik ( f i , x ) = min{max{Wk ( f i , x ), 0}, x − ck + 1}

Sensors 2016, 16, 1376

13 of 20

Thus, the total interference suffered by the flow f k is: Ωtotal ( x, P¯ ( f k )) = k



Ik ( f i , x )

∀ f i ∈ P¯ ( f k )

6.1.2. Worst Case Delay in Single-Criticality Networks Ωnk ( x, P¯ ( f k )) and Ωsk ( x, P¯ ( f k )) denote node interference and scheduling interference suffered by the flow f k in the level-k busy period. If there exists a node interference at a time slot, the flow f k cannot be transmitted at this time slot, no matter how many channels are idle, i.e., the flow f k is delayed one time slot due to the node interference. However, only when M transmissions are scheduled at a time slot, the flow f k suffers scheduling interference and is delayed for one time slot. In the worst case, all of the node interference and scheduling interference will introduce delay to the flow f k . Therefore, the worst case delay is:  s  Ωk ( x, P¯ ( f k )) Ωnk ( x, P¯ ( f k )) + + ck (5) M From Equation (5), we know that node interference introduces more delay. Since the sum of node interference and scheduling interference is Ωtotal ( x, P¯ ( f k )), so when as much as possible node k interference occurs, the end-to-end delay is the worst case. The upper bound of node interference introduced by h consecutive hops of the flow f i to the flow f k is computed as: Rk,i (h) =

max

∀ a∈[1,ci −h]

{|{τiy |∀τiy , y ∈ [ a, a + h], ∃τkz such that τiy ∩ τkz 6= ∅}|}

Thus, the workload introduced by transmissions that have node interference is: Wkn ( f i , x )



=

 x · Rk,i (ci ) + Rk,i (min{ x Ti

mod Ti , ci })

Then, Ikn ( f i , x ) = min{max{Wkn ( f i , x ), 0}, x − ck + 1} and: Ωnk ( x, P¯ ( f k )) =



∀ f i ∈ P¯ ( f k )

Ikn ( f i , x )

Then, we can get that the worst case delay of the flow f k in the single-criticality network is: $ Dk =

Ωnk ( x, P¯ ( f k )) +

Ωtotal ( x, P¯ ( f k )) − Ωnk ( x, P¯ ( f k )) k M

%

+ ck

From the definition of the level-k busy period, we know that the length x is the upper bound of the delay Dk (shown in Theorem 2). Theorem 2. For the flow f k and the level-k busy period, the following holds: x ≥ Dk Proof of Theorem 2. We assume by contradiction that x < Dk . From the definition of the level-k busy period (Definition 2), we know that the finish times of the busy period and the flow f k are the same, and t0 must be less than (the first condition) or equal to tr (when t0 does not satisfy at lest one condition). If x < Dk , then tr < t0 , as shown in Figure 5. It is not consistent with the definition. The above assumption does not hold.

Sensors 2016, 16, 1376

14 of 20

Dk x

tr

t0

ck tk

Figure 5. Illustration of Theorem 2.

According to Theorem 2, the solution of Equation (6) is the upper bound of end-to-end delay Dk . $ x=

Ωnk ( x, P¯ ( f k )) +

Ωtotal ( x, P¯ ( f k )) − Ωnk ( x, P¯ ( f k )) k M

%

+ ck

(6)

Equation (6) can be solved by the iterative fixed point search [39]. The iterative calculation of x starts with x = ck ; until the value of x does not change. 6.2. Mixed Criticality Scheduling Analysis In dual-criticality networks, there are three types of worst case delay. (1) (2) (3)

DkL : the worst case end-to-end delay of the L-crit flow. DkHL : the worst case end-to-end delay of the H-crit flow with the L-crit parameter. DkH : the worst case end-to-end delay of the H-crit flow with the H-crit parameter.   Ωtotal ( x,Q)−Ωnk ( x,Q) k We use D ( x, Q, c) to denote Ωnk ( x, Q) + + c. The methods of computing M

these types of delay are similar. The only difference is that the higher-priority flows they suffered are different, i.e., their interference sets Q are different. H-crit flows have multiple paths. These paths suffer different interference and cause different delays. Therefore, we use sub-flows f k∗ , f k0 and f k00 to distinguish them. If there are H-crit flows with H-crit parameters in networks, L-crit flows can be discarded. Therefore, when we compute the delay DkL , all flows have L-crit parameters. Thus, DkL = D ( x, QkL , c∗k ), where QkL = { f i∗ |∀ f i∗ , Ti ( L) < Tk ( L)} and c∗k = |πk∗ |. Similarly, for H-crit flows with L-crit parameters, the interference set is QkHL = { fi0 , fi00 |∀ fi0 , ∀ fi00 , χi = H, Ti ( H) < Tk (L)} ∪ { fi∗ |∀ fi∗ , Ti (L) < Tk (L)}. Thus, DkHL = D(x, QkHL , c∗k ), where c∗k = |πk∗ |. An H-crit flow with its H-crit parameter suffers the interference from H-crit flows with H-crit parameters. The H-crit flow has two sub-flows fk0 and fk00 . For these sub-flows, their interference set is QkH = { fi0 , fi00 |∀ fi0 , ∀ fi00 , χi = H, Ti ( H) < Tk ( H)} ∪ { fi∗ |∀ fi∗ , χi = H, Ti (L) < Tk ( H)} and c0k = |πk0 |, c00k = |πk00 |. Thus, Dk0H = D(x, QkH , c0k ) and Dk00H = D(x, QkH , c00k ), and then, DkH = max{Dk0H , Dk00H }. According to the above delays, the schedulability test is as follows. For the L-crit flow fk , if DkL ≤ Tk (L), it is schedulable; otherwise, unschedulable. For the H-crit flow fk , if DkHL ≤ Tk (L) and DkH ≤ Tk ( H), it is schedulable; otherwise, unschedulable. If all flows in a flow set are schedulable, the set is schedulable. 7. Evaluation In this section, we conduct experiments to evaluate the performance of our proposed methods. 7.1. Scheduling Algorithm We consider three comparison methods: (1) SMT uses the Z3 solver [35], which is a high-performance solver being developed at Microsoft Research and whose solution has been regarded as an excellent standard, to solve our SMT specification (Section 4); (2) noStealRM applies the

Sensors 2016, 16, 1376

15 of 20

RM priority and does not allow slots to be stolen; (3) StealCM allows slots to be stolen and applies the criticality monotonic priority. Our method is StealRM. The performance metric we used is the schedulable ratio, which is defined as the percentage of flow sets for which a scheduling algorithm can find a schedulable solution. We randomly generate a number of test cases to evaluate these methods. For each test case, the number of channels M and the number of nodes | N | are given. According to the √ suggestion | N|d2 27

in the work [40], these nodes are placed randomly in the square area A, and A = , where 2π the transmitting range d is 40 m. Except the gateway, each node has a data flow from itself to the gateway or vice versa. There are two necessary schedulability conditions for flow sets: (1) the network utilization U is not larger than one; (2) the utilization of each node is not larger than one. If a flow set does not satisfy the two conditions, it cannot be scheduled. Thus, in order to make flow sets available, we specify the network utilization U (U < 1) and use the method UUniFast [41] to assign the utilization ui for each flow, where U = ∑ ui . Then, if the flow set can satisfy the condition (2), it is an available ∀ fi ∈F

schedulable ratio

flow set. Otherwise, discard it, and repeat the process until an available set is found. The period of each flow can be obtained according to Ti = uci . The high-crit probability of the flows is controlled by i the parameter ρ. Routing paths are selected randomly. In order to make test cases solvable by the Z3 solver, the parameters are set as ρ = 0.3, M = 2 and U = 0.8. For each configuration, 100 test cases are checked using the four algorithms. Figure 6 shows their schedulable ratios. Our algorithm StealRM is close to the result of Z3. In these simple test cases, the method StealCM has similar results with our algorithm StealRM. Figure 7 shows the average execution time of the solvable test cases in Figure 6. When the number of nodes is 25, the execution time of the method SMT is about 16.5 min. We also use the method SMT to solve the network with 30 nodes, but cannot get the result within 3 h. Except the method SMT, the execution time of other methods is not more than 10 milliseconds. Therefore, from the perspective of execution time, heuristic algorithms are significantly more efficient than the method SMT. 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 10

SMT

StealRM

StealCM

noStealRM

15 20 the number of nodes

25

Figure 6. Schedulability comparison among all methods. SMT, satisfiability modulo theories; StealRM, slot-stealing scheduling algorithm based on rate-monotonic; StealCM, slot-stealing scheduling algorithm based on criticality monotonic.

execution time (ms)

1.E+06

1.E+05 1.E+04 1.E+03

SMT

StealRM

1.E+02

StealCM

noStealRM

1.E+01 1.E+00 10

15 20 the number of nodes

25

Figure 7. Execution time comparison among all methods.

Since the execution time of the method SMT is too long, the following experiments do not contain it. Figure 8 shows the schedulable ratios of the three scheduling algorithms. For each

Sensors 2016, 16, 1376

16 of 20

point in the figure, 500 test cases are randomly generated. From the figure, we can know that our algorithm StealRM has the highest schedulable ratio no matter with which parameters, while the algorithm noStealRM has the worst result. Therefore, the stealing mechanism can significantly improve the algorithm’s performance. Our algorithm StealRM has better performance than the algorithm StealCM, especially when the node numbers are higher. This demonstrates that: (1) the priority should correspond to the urgency, but not the importance, while the stealing mechanism reflects the importance; (2) the urgency and the importance have to be distinguished, except in very small networks. Comparing among these subfigures, we observe that schedulable ratios decrease with the increases of ρ, | N |, U and M. The reasons are as follows. An H-crit flow can be regarded as two L-crit flows. Thus, a larger value of the parameter ρ leads to more flows, which are hard to schedule. A test case contains | N | − 1 flows. Likewise, the larger | N | makes scheduling hard. The network utilization U corresponds to the network workload. Heavy workloads lead to scheduling failures. Note that comparing with Figure 8a, Figure 8d has three additional channels, but its schedulable ratios decrease. Because the two subfigures generate test cases according to the respective numbers of channels. Their test cases are different. Although the number of channels increases, the utilization is not changed. When the utilization U is constant, with the increase of the number of channels M, the packets that need to be transmitted increase. The increased packets will introduce more interference, which have a negative impact on the scheduling performance. Therefore, Figure 8d has a lower schedulable ratio than Figure 8a. 1

schedulable ratio

schedulable ratio

1 0.8 0.6

0.4 0.2 0

StealRM StealCM noStealRM

0.8 0.6 0.4

0.2 0

20

30

40

50

60

70

80

90

20

the number of nodes (a)

40

50

60

70

80

90

80

90

the number of nodes

(b) 1

schedulable ratio

1

schedulable ratio

30

0.8 0.6

0.4 0.2

0.8 0.6

0.4 0.2 0

0 20

30

40

50

60

70

80

the number of nodes (c)

90

20

30

40

50

60

70

the number of nodes (d)

Figure 8. Schedulability comparison among StealRM, StealCM and noStealRM. (a) M = 6, U = 0.5, ρ = 0.3; (b) M = 6, U = 0.5, ρ = 0.4; (c) M = 6, U = 0.6, ρ = 0.3; (d) M = 9, U = 0.5, ρ = 0.3.

Figure 9 shows the average execution time of Figure 8. As the results are similar, we only show two subfigures for Figure 8a,d. Comparing with our algorithm StealRM, the algorithms StealCM and noStealRM need more time to find feasible solutions. Therefore, their execution time slightly increases. From the figure, we know that our algorithm StealRM does not introduce extra time cost. For the three algorithms, the execution time increases with the increases of the number of nodes, since more data flows need to be scheduled.

17 of 20

200

execution time (ms)

execution time (ms)

Sensors 2016, 16, 1376

StealRM

160

StealCM

120

noStealRM

80 40

0 20

30

40

50

60

70

80

200

StealRM

160

StealCM

120

noStealRM

80

40 0 20

90

30

40

50

60

70

80

90

the number of nodes

the number of nodes

(a)

(b)

Figure 9. Average execution time. (a) M = 6, U = 0.5, ρ = 0.3; (b) M = 9, U = 0.5, ρ = 0.3.

7.2. Analyzing Method The comparison method is SingleAna, in which flow sets are tested using the single-criticality analysis. Our mixed criticality analysis method is MixedAna. The performance metrics are the analyzable ratio (the percentage of flow sets which are tested as schedulable by an analyzing method) and the pessimism ratio (the proportion of analyzed delay to the delay observed in StealRM). Figure 10 shows the comparison of the analyzable ratios. For each point, 500 test cases are analyzed. Our method MixedAna outperforms SingleAna. The analyzable ratios decrease with the increases of these parameters. The reasons are similar to those in Figure 8. The increases of U and M lead to more packets, and the increases of | N | and ρ lead to more flows. These will cause more interference. Thus, the analysis introduces more pessimism, and the analyzable ratios decrease. Figure 11 shows the pessimism ratios of experiments in Figure 10. The pessimism ratios of MixedAna are less than two, while the pessimism ratios of SingleAna are all larger than two. This is because the interference that does not exist between H-crit and L-crit flows is eliminated in MixedAna. 1

analyzable ratio

analyzable ratio

1 0.8 0.6 0.4

MixedAna

0.2

SingleAna

0

0.1

0.2

0.8 0.6 0.4 0.2 0

0.3

0.4

0.5

0.1

0.6

0.2

0.3

(a)

0.5

0.6

0.4

0.5

0.6

(b) 1

analyzable ratio

1

analyzable ratio

0.4

U

U

0.8

0.6 0.4 0.2

0.8 0.6 0.4

0.2 0

0 0.1

0.2

0.3

0.4

0.5

0.6

0.1

0.2

0.3

U

U

(c)

(d)

Figure 10. Schedulability comparison among analyzing algorithms. (a) | N | = 20, M = 6, ρ = 0.1; (b) | N | = 20, M = 6, ρ = 0.3; (c) | N | = 20, M = 9, ρ = 0.1; (d) | N | = 60, M = 6, ρ = 0.1. MixedAna, mixed criticality analysis.

18 of 20

4.5 4 3.5 3 2.5 2 1.5 1

MixedAna

pessimism ratio

pessimism ratio

Sensors 2016, 16, 1376

SingleAna

0.1

0.2

0.3

0.4

0.5

4.5 4 3.5 3 2.5 2 1.5 1

0.6

0.1

0.2

0.3

U

0.2

0.5

0.6

0.4

0.5

0.6

(b) pessimism ratio

pessimism ratio

(a) 4.5 4 3.5 3 2.5 2 1.5 1 0.1

0.4

U

0.3

0.4

0.5

0.6

4.5 4 3.5 3 2.5 2 1.5 1 0.1

0.2

0.3

U

(c)

U

(d)

Figure 11. Delay comparison with StealRM being used as the baseline. (a) | N | = 20, M = 6, ρ = 0.1; (b) | N | = 20, M = 6, ρ = 0.3; (c) | N | = 20, M = 9, ρ = 0.1; (d) | N | = 60, M = 6, ρ = 0.1.

8. Conclusions Multiple criticality levels coexist in advanced industrial applications. They share the network resource, but their requirements for the real-time performance and reliability are different. In this paper, we propose a scheduling algorithm to guarantee their different requirements and then analyze the schedulability for this scheduling algorithm. Simulation results show that our scheduling algorithm and analysis have more performance than existing ones. In the future work, we will propose a routing algorithm for mixed criticality WSNs to enhance the reliability and design a network deployment method and a parameter adjustment method to improve the schedulability. Finally, we will implement these algorithms in a real network. Acknowledgments: We would like to thank the anonymous reviewers for their constructive comments. This work was partially supported by the Important National Science and Technology Specific Project (2013ZX03005004) and the National Natural Science Foundation of China (61502474 and 61233007). Author Contributions: X.J.proposed the scheduling and analyzing algorithms. C.X. and J.W. designed experiments. X.J., H.X. and P.Z. wrote the paper. Conflicts of Interest: The authors declare no conflict of interest.

References 1. 2. 3. 4. 5.

Liang, W.; Zhang, X.; Xiao, Y.; Wang, F.; Zeng, P.; Yu, H. Survey and experiments of WIA–PA specification of industrial wireless network. Wirel. Commun. Mob. Comput. 2011, 11, 1197–1212. Std, IEC. Industrial Communication Networks—Wireless Communication Network and Communication Profiles–WirelessHART; IEC 62591; International Electrotechnical Commission: Geneva, Switzerland, 2009. Nobre, M.; Silva, I.; Guedes, L.A. Routing and scheduling algorithms for wirelessHART networks: A survey. Sensors 2015, 15, 9703–9740. Quang, P.T.A.; Kim, D.S. Throughput-aware routing for industrial sensor networks: Application to ISA100. 11a. IEEE Trans. Ind. Inf. 2014, 10, 351–363. Saifullah, A.; Xu, Y.; Lu, C.; Chen, Y. Real-time scheduling for WirelessHART networks. In Proceedings of the 2010 IEEE 31st Real-Time Systems Symposium (RTSS), San Diego, CA, USA, 30 November–3 December 2010; pp. 150–159.

Sensors 2016, 16, 1376

6.

7. 8. 9. 10. 11. 12. 13.

14. 15. 16.

17.

18.

19. 20. 21.

22. 23.

24.

25. 26.

19 of 20

Saifullah, A.; Xu, Y.; Lu, C.; Chen, Y. End-to-end delay analysis for fixed priority scheduling in WirelessHART networks. In Proceedings of the 2011 17th IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS), Chicago, IL, USA, 11–14 April 2011; pp. 13–22. Zhang, H.; Cheng, P.; Shi, L.; Chen, J. Optimal DoS attack scheduling in wireless networked control system. IEEE Trans. Control Syst. Technol. 2015, 24, 843–852. Cheng, P.; Qi, Y.; Xin, K.; Chen, J.; Xie, L. Energy-efficient data forwarding for state estimation in multi-hop wireless sensor networks. IEEE Trans. Autom. Control 2015, 61, 1322–1327. Liu, X.; Hou, K.M.; de Vaulx, C.; Shi, H.; Gholami, K.E. MIROS: A hybrid real-time energy-efficient operating system for the resource-constrained wireless sensor nodes. Sensors 2014, 14, 17621–17654. Yu, S.; Zhang, X.; Liang, W. Concurrent transmission performance modeling of wireless multimedia sensor network and its experimental evaluation. Inf. Control 2016, 45, 328–334. Baruah, S.; Bonifaci, V.; D’Angelo, G.; Li, H.; Marchetti-Spaccamela, A.; Megow, N.; Stougie, L. Scheduling real-time mixed-criticality jobs. IEEE Trans. Comput. 2012, 61, 1140–1152. Burns, A.; Davis, R. Mixed criticality systems-a review. Tech. Rep. 2015, 1, 1–61. Zhang, H.; Soldati, P.; Johansson, M. Optimal link scheduling and channel assignment for convergecast in linear WirelessHART networks. In Proceedings of the WiOPT 2009 7th International Symposium on Modeling and Optimization in Mobile, Ad Hoc, and Wireless Networks, Seoul, Korea, 23–27 June 2009; pp. 1–8. Chipara, O.; Lu, C.; Roman, G.C. Real-time query scheduling for wireless sensor networks. IEEE Trans. Comput. 2013, 62, 1850–1865. Huang, H.M.; Gill, C.; Lu, C. Implementation and evaluation of mixed-criticality scheduling approaches for sporadic tasks. ACM Trans. Embed. Comput. Syst. 2014, 13, 1–25. Vestal, S. Preemptive scheduling of multi-criticality systems with varying degrees of execution time assurance. In Proceedings of the RTSS 2007 28th IEEE International Real-Time Systems Symposium, San Antonio, TX, USA, 3–6 December 2007; pp. 239–243. Burns, A.; Fleming, T.; Baruah, S. Cyclic executives, multi-core platforms and mixed criticality applications. In Proceedings of the 2015 27th Euromicro Conference on Real-Time Systems (ECRTS), Lund, Sweden, 8–10 July 2015; pp. 3–12. Lee, J.; Phan, K.M.; Gu, X.; Lee, J.; Easwaran, A.; Shin, I.; Lee, I. Mc-fluid: Fluid model-based mixed-criticality scheduling on multiprocessors. In Proceedings of the 2014 IEEE Real-Time Systems Symposium, Rome, Italy, 2–5 December 2014; pp. 41–52. Burns, A.; Davis, R.I. Mixed criticality on controller area network. In Proceedings of the 2013 25th Euromicro Conference on Real-Time Systems (ECRTS), Paris, France, 9–12 July 2013; pp. 125–134. Cros, O.; Fauberteau, F.; George, L.; Li, X. Mixed-criticality over switched ethernet networks. Ada User J. Proc. Workshop Mixed Crit. Ind. Syst. 2014, 35, 138–143. Addisu, A.; George, L.; Sciandra, V.; Agueh, M. Mixed criticality scheduling applied to jpeg2000 video streaming over wireless multimedia sensor networks. In Proceedings of the 2013 19th International Conferecne on Embedded and Real-Time Computing Systems and Applications (RTCSA) Workshop on Mixed Criticality Systems (WMC), Taipei, Taiwan, 19–21 Augest 2013; pp. 55–60. Shen, W.; Zhang, T.; Barac, F.; Gidlund, M. PriorityMAC: A priority-enhanced MAC protocol for critical traffic in industrial wireless sensor and actuator networks. IEEE Trans. Ind. Inf. 2014, 10, 824–835. Hussain, S.W.; Khan, T.; Zaidi, S.H. Latency and energy efficient MAC (LEEMAC) Protocol for event critical applications in WSNs. In Proceedings of the CTS 2006 International Symposium on Collaborative Technologies and Systems, Las Vegas, NV, USA, 14–17 May 2006; pp. 370–378. Soldati, P.; Zhang, H.; Johansson, M. Deadline-constrained transmission scheduling and data evacuation in WirelessHART networks. In Proceedings of the 2009 European Control Conference, Budapest, Hungary, 23–26 August 2009. Zhang, H.; Osterlind, F.; Soldati, P.; Voigt, T.; Johansson, M. Time-optimal convergecast with separated packet copying: Scheduling policies and performance. IEEE Trans. Veh. Technol. 2015, 64, 793–803. Saifullah, A.; Xu, Y.; Lu, C.; Chen, Y. Priority assignment for real-time flows in WirelessHART networks. In Proceedings of the 2011 23rd Euromicro Conference on Real-Time Systems (ECRTS), Porto, Portugal, 5–8 July 2011; pp. 35–44.

Sensors 2016, 16, 1376

27.

28. 29.

30.

31. 32. 33. 34.

35. 36. 37.

38.

39. 40.

41.

20 of 20

Baruah, S.; Vestal, S. Schedulability analysis of sporadic tasks with multiple criticality specifications. In Proceedings of the ECRTS ’08 Euromicro Conference on Real-Time Systems, Prague, Czech Republic, 2–4 July 2008; pp. 147–155. Burns, A.; Harbin, J.; Indrusiak, L.S. A wormhole noc protocol for mixed criticality systems. In Proceedings of the IEEE Real-Time Systems Symposium (RTSS), Rome, Italy, 2–5 December 2014; pp. 184–195. Tobuschat, S.; Axer, P.; Ernst, R.; Diemer, J. IDAMC: A NoC for mixed criticality systems. In Proceedings of the 2013 IEEE 19th International Conference on Embedded and Real-Time Computing Systems and Applications (RTCSA), Taipei, Taiwan, 19–21 August 2013; pp. 149–156. Carvajal, G.; Fischmeister, S. An open platform for mixed-criticality real-time ethernet. In Proceedings of the IEEE Design, Automation & Test in Europe Conference & Exhibition, Grenoble, France, 18–22 March 2013; pp. 153–156. Koubâa, A.; Alves, M.; Tovar, E.; Cunha, A. An implicit GTS allocation mechanism in IEEE 802.15. 4 for time-sensitive wireless sensor networks: Theory and practice. Real-Time Syst. 2008, 39, 169–204. Zhan, Y.; Xia, Y.; Anwar, M. GTS size adaptation algorithm for IEEE 802.15. 4 wireless networks. Ad Hoc Netw. 2016, 37, 486–498. Jin, X.; Wang, J.; Zeng, P. End-to-end delay analysis for mixed-criticality wirelesshart networks. IEEE/CAA J. Autom. Sin. 2015, 2, 282–289. Li, B.; Nie, L.; Wu, C.; Gonzalez, H.; Lu, C. Incorporating emergency alarms in reliable wireless process control. In Proceedings of the ACM/IEEE Sixth International Conference on Cyber-Physical Systems, Seattle, WA, USA, 14–16 April 2015; pp. 218–227. De Moura, L.; Bjørner, N. Z3: An efficient SMT solver. In Tools and Algorithms for the Construction and Analysis of Systems; Springer: London, UK, 2008; pp. 337–340. Dutertre, B.; de Moura, L. System description: Yices 1.0. In Proceedings of the Satisfiability Modulo Theories Competition, Seattle, WA; USA, 17–19 August 2006. Pellizzoni, R.; Paryab, N.; Yoon, M.K.; Bak, S.; Mohan, S.; Bobba, R.B. A generalized model for preventing information leakage in hard real-time systems. In Proceedings of the IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS), Seattle, WA, USA, 13–16 April 2015; pp. 271–282. Guan, N.; Stigge, M.; Yi, W.; Yu, G. New response time bounds for fixed priority multiprocessor scheduling. In Proceedings of the 30th IEEE Real-Time Systems Symposium, Washington, WA, USA, 1–4 December 2009; pp. 387–397. Joseph, M.; Pandya, P. Finding response times in a real-time system. Comp. J. 1986, 29, 390–395. Camilo, T.; Silva, J.S.; Rodrigues, A.; Boavida, F. Gensen: A topology generator for real wireless sensor networks deployment. In Software Technologies for Embedded and Ubiquitous Systems; Springer: Heidelberg, Germany, 2007; pp. 436–445. Bini, E.; Buttazzo, G.C. Measuring the performance of schedulability tests. Real-Time Syst. 2005, 30, 129–154. c 2016 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access

article distributed under the terms and conditions of the Creative Commons Attribution (CC-BY) license (http://creativecommons.org/licenses/by/4.0/).

Mixed Criticality Scheduling for Industrial Wireless Sensor Networks.

Wireless sensor networks (WSNs) have been widely used in industrial systems. Their real-time performance and reliability are fundamental to industrial...
3MB Sizes 1 Downloads 6 Views