A Deadline-Aware and Distance-Aware Packet Scheduling Algorithm for Wireless Multimedia Sensor Networks

We propose a wireless differentiated queuing service (WDQS) algorithm to meet the diverse delay requirements in wireless multimedia sensor networks (WMSNs). WDQS adopts novel latest departure time (LDT) scheduling criteria to differentiate forwarding emergency by considering the packets’ lifetime, the known delay it has already experienced, and the remaining delay it will experience. We also propose an effective approach to estimate the unknown delay for the remaining journey without any message overhead by exploiting the query mechanism of the sink. We further discuss analytically the packet's lifetime setting to meet the end-to-end (e2e) delivery requirement. The simulation results verify our analytical discussion and show performance improvements in terms of e2e delay and packet drop rate.


Introduction
The integration of low-power wireless networking technologies with inexpensive hardware such as complementary metaloxide semiconductor (CMOS) cameras and microphones is now enabling the development of WMSNs, where wirelessly interconnected smart devices are deployed to retrieve video and audio streams, still images, and scalar sensor data [1]. WMSNs promise a wide range of potential applications in both civilian and military areas, such as surveillance sensor networks, law-enforcement reports, traffic control systems, advanced health care delivery, automated assistance to elderly telemedicine, and industrial process control [2].
A WMSN often consists of a large number of sensors, which constantly generate all kinds of traffic, including target detection data, measurement data, and video flows. The packets of these event-driven data belong to different levels of emergencies and have their own valid periods. Thus, the packets are required to be delivered to the sink before their expiration deadlines which are their quality-of-service (QoS) requirements. There are two challenges for WMSNs to support a huge amount of data that has diverse deadlines. First, the sensor nodes have very limited resources of energy supply, bandwidth, memory, and processing capability due to the physically small size of sensors. The limited resources require a fair and efficient utilization. Second, the packets with the same level of emergency have the same deadline requirement. The packets from the sensors which are far from the sink have to traverse more hops to reach the sink than the packets from the sensors which are close to the sink. Thus the delay requirement of remote event report packets at every intermediate node is more stringent than that of nearby event report packets.
Packet scheduling is an important scheme to address the QoS requirement issues in WMSNs. Generally, packet scheduling assigns priorities to traffic flows with QoS considerations. Then packets are queued and scheduled according to the assigned priorities, which are related to the effective periods of event reports. If a packet cannot be sent to the sink in time, it will be discarded, resulting in high packet drop rate. With the limited resource in WMSNs, the packets of the most emergent event, which have the closest deadline, should be serviced with the highest priority. On the other hand, the geographic distribution of sensors also has impact on the scheduling priorities. The delay requirement of the packets from the remote sensors is more stringent than that of nearby 2 International Journal of Distributed Sensor Networks event report packets, so they should be serviced with higher priority. For these considerations, packet scheduling should be both deadline-aware and distance-aware [3].
Multiple kinds of packet scheduling algorithms have been already proposed. However most of them are not both deadline-aware and distance-aware. We find that our previous proposed differentiated queueing scheduling (DQS) fits WMSNs well. DQS is first put forward for the traditional wired network in [4]. It has been extended into wireless area in [5] and been improved in [6]. DQS queues packets at intermediate node by their LDT. The smaller the LDT, the higher the priority. A packet's LDT is determined by its lifetime, the known delay which it has already experienced and the remaining delay which it will experience. A packet's deadline is determined by the difference between the known delay and its lifetime. The known delay and remaining delay correspond to the distance from its source to the sink since our study is based on geographic routing. Thus the packet's priority is related to its deadline and the distance from its source to the destination. We can see DQS is both deadline-aware and distance-aware to meet the requirements of WMSNs. But how to estimate the unknown remaining delay and how to set the packet's lifetime have not been resolved in DQS.
In this paper, we propose a new packet scheduling algorithm: wireless differentiated queuing service (WDQS) for WMSNs. WDQS inherits the enqueue principle of DQS and resolves these two problems of DQS. Our contributions include the following.
(i) Effective delay estimation approach. We propose an effective delay estimation for the remaining journey of a packet to implement WDQS by exploiting the unique characteristics of WMSNs. Our approach introduces no extra message overhead and energy consumption into WMSNs.
(ii) Packet lifetime setting and performance analysis. We discuss the packet's lifetime setting approach and get the general setting conditions. We also analyze the e2e performance of traffic in WMSNs when applying WDQS.
The reminder of this paper is organized as follows. Section 2 presents the related works. Section 3 describes the system model. Section 4 proposes WDQS including scheduling principle, remaining delay estimating approach, packet's lifetime setting approach, and algorithm implementation. Section 5 verifies WDQS via simulations. Finally, the paper is summarized in Section 6.

Related Works
Multiple kinds of packet scheduling algorithms have been already proposed for traditional networks [7]. Priority Queuing (PQ) [8], Queue Length Threshold (QLT) [9], and proportional differentiation approaches such as Hybrid Proportional Delay (HPD) [10] and Waiting-time Priority (WTP) [11] are based on static priority. Earliest Deadline First (EDF) [12] assigns packets with static deadlines. It will service the packets before their deadlines to guarantee their delay requirements. In the core stateless algorithms such as Core Stateless Fair Queuing (CSFQ) [13], all the packets are tagged by the edge nodes and the core nodes schedule the packet by its tag.
Few existing packet scheduling algorithms are dedicated to WMSNs. The literature [14,15] applied EDF to WMSNs. The algorithms proposed in the literature [16] determine a packet's priority according to its elapsed hops. The reference [17] categorized dynamically real-time packets with high priority to preemptive data packets in the queues. Some algorithms proposed in the literature [18][19][20] focus on fairness and energy consumption rather than deadlineaware and distance-aware scheduling. Velocity Monotonic Scheduling (VMS) [3] assigns the priority of a packet based on its requested velocity which is the ratio of the packet's deadline and elapsed time to its Euclidean distance from the arriving node to the destination. It is one of the most suitable algorithms for WMSNs so far. It is both deadline-aware and distance-aware. However the distance is the Euclidean distance rather than the distance which a packet really passed.

System Model
We study packet scheduling algorithms on multitier heterogeneous architecture which is shown in Figure 1 [21], where the high tier is composed of high-end cameras, the middle tier is composed of low-end image sensors, and the bottom tier is composed of scalar sensors. Sensors from different tiers work in a coordinated way to detect and identify targets. When the scalar sensors or image sensors find some targets entering, the high-end cameras start to shoot and identify the targets through image processing.
The number of scalar and image sensors is large in WMSNs since they have simple circuit and low costs. These two types of sensors generally have the same task that is target detection. In this case, they collectively have the same traffic characteristics and requirements. Although each of them generates small amount of data and requires low bandwidth for communications, the aggregated traffic from these kinds of sensors is not ignorable. There are fewer camera sensors in WMSNs. However, they have stringent QoS requirement for their real-time video traffic. The real-time and non-realtime traffic often coexists in the same WMSNs. How to provide QoS guarantee for the mixed traffic for WMSNs is an important research issue [22].

Wireless Differentiated Queueing Service (WDQS)
As mentioned in Section 1, WDQS inherits the enqueue principles of DQS and resolves the problems which DQS has to face. In this section we will first describe the enqueue principles of DQS, then propose a delay estimating approach for the remaining journey of a packet, next put forward the packet lifetime setting conditions, at last describe the implementation of WDQS.   WDQS is based on the following assumptions. Any application should have a maximum e2e delay ( ). If an application can have an arbitrary , it can be set to a certain value artificially. should be treated as the lifetime of the associated packet. If a packet is confirmed that its lifetime has expired, it should be dropped immediately.
The notions in Table 1 are used to present our proposed WDQS.

Enqueue Principle of DQS.
Suppose that parameters with subscript " " denote that they are for node . To simplify the discussion, the propagation delay is not addressed since it is a constant for a given path. Therefore, for a path consisting of nodes, we can have the following relation for the sojourn of a packet arriving at node : wherẽis the actual delay that the packet experiences at node ,̂is the effective packet's maximum delay allowed at node subject to its e2e delay, ∑ −1 =1̃i s the delay that the packet has already experienced before it arrives at node , and ∑ = +1̃i s the delay that the packet will experience after it leaves node . So the LDT of this packet at node is given by (2) DQS will enqueue packets according to the value of at node . Thus, packets with smaller will be serviced earlier. In multihop WMSNs, ∑ =1̃d epends on the distance from the source node to node and ∑ = +1̃d epends on the remaining distance from node to the sink. According to (1) the longer the distance from the source to the sink, the smaller the value of ; thus DQS is distance-aware. Also according to (2), the smaller the value of and , the smaller the value of , so DQS is deadline-aware. Thus DQS is one of the most suitable packet scheduling algorithms of WMSNs.

Delay Estimation.
From what was mentioned, we can see that the value of LDT of a packet (i.e., ) is critical to implement WDQS. It is difficult to implement WDQS since although the value of , , and is known, the delay for the remaining journey (i.e., ∑ = +1̃) can not be known in advance and is difficult to evaluate at node . One possible approach is constantly sending probe packets and estimating the delay for the remaining journey by the replied messages [5]. This approach introduces extra message overhead and consumes more energy, which are both limited resources in WMSNs. We exploit the unique characteristics of WMSNs to estimate the delay for the remaining journey as follows.
There are some characteristics of WMSNs different from traditional wireless networks: (1) the destination of sensors' packets are the same sink; (2) the distance between sensor nodes and the sink is fixed; (3) the sink sends out querying packet periodically; (4) sensors' position information is available; thus, We can evaluate the value of more easily by taking advantage of these characteristics in WMSNs. Because of the characteristics (1), (2), and (4), the shortest path from node to the sink is constant. According to characteristic (5), ∑ = +1̃i s the delay along the remaining shortest path. According to characteristic (3), the querying packets will arrive at node along the shortest path from the sink. So we can evaluate ∑ = +1̃b y the e2e delay of the querying packet from the sink to node .
Suppose sink is the querying packet's departure time and is the querying packet's arrival time at node . So the e2e delay of a querying packet from the sink to node is given by The sink sends out querying packets periodically, and the value of is updated accordingly. In practice, we adopt a weighted average approach to update the delay for the remaining journey ; that is, where (0 ≤ ≤ 1) is the smoothing factor. On the first arriving of the query packet, we set = . is updated by (4) on receiving the querying packets.
With the approach in (4), we can estimate the delay from node to the sink as Together with (2), the LDT for a packet is computed as follows: By (6), Packets with longer distance to the sink and later deadline will be serviced by WDQS with a higher priority. Note that the estimation of the delay for the remaining journey exploits the existing sink's query mechanism and thus introduces no extra message overhead and resource consumption to WMSNs.

Packets' Lifetime Setting and Performance
Analysis. The real-time packets have stringent delay requirements so they must have higher priority than the scalar packets at the intermediate nodes. WDQS makes sure that all the real-time packets are delivered in time.
According to (6) only the packet's lifetime can be set artificially to affect its position in the queue of WDQS and further affect its QoS. If a real-time packet is serviced earlier than other scalar packets, its lifetime must be set to a smaller value. However, if is too small it might be discarded before reaching the destination. So in this section, we will discuss the approaches of lifetime setting. Then we will also analyze the forwarding ratio and e2e delay performance with these approaches. In the following discussion, we assume that the arrival process functions of the scalar packet and the realtime packet are known, and the notions in Table 2 are used.  (6), and are given by In order to queue real-time packets always in front of scalar packets, there must be < ; that is where < can be set artificially. But if is small enough, there may be > , and the real-time packet would be inserted into the queue behind some scalar packets. We will discuss how to set the lifetime of real-time packets and the scalar packets to meet the condition of < in the following network scenarios.
(1) If ( ) > , the bandwidth can not satisfy the requirement of real-time communications. The network can not support this case.
(2) If ( ) + ( ) < , there are adequate bandwidths for node to forward all the packets. All the packets' QoS requirements are met.
(3) Case of ( ) + ( ) ≥ but ( ) < . The packet lifetime setting approach in this case is much more complicated, which is discussed in detail next.
Our lifetime setting approach for case (3) is making and meet the following condition expression: It is proved as follows.
International Journal of Distributed Sensor Networks 5 Because ≤ , we have If (10) is met, we get Suppose of every real-time packet is smaller than of all the scalar packets which are waiting in the queue; the forwarding rate for scalar packets at node is − ( ). Suppose again that a scalar packet arrives at node with packets already in the buffer queue; the queueing delay of this scalar packet at node will bẽ With (12), we get This scalar packet's experienced delay from the source to node is ∑ −1 =1̃. We can then infer its departure time at the source as When a real-time packet is always serviced first, there is no queuing delay for it. So if a real-time packet arrives at node at the same time, its departure time is ≈ since the propagation delay is very small. So With (14) there will be + > + ; that is, < . Thus we prove that if (10) is met, < .

Performance
Analysis. Now let us look into the performance of real-time traffic. In our analysis, we study the metrics of the forwarding ratio and the e2e delay. The forwarding ratio is defined as the ratio of the forwarding rate to the arriving rate.
Obviously, when (10) is met, all the real-time packets will be serviced earlier than the scalar packets. Thus, all arriving real-time packets are forwarded and there is no queueing delay; that is, = 1 and = 0. When (10) is not met, there exists a critical queue length cr determining the enqueueing order of real-time and scalar packets. If the queue length is less than cr , the real-time packets are always queued in front of the scalar packets. Otherwise, some scalar packets will go ahead of a real-time packet. Suppose the time reaching cr is cr , when = .
According to (6), when + = + , there would be = . It means at cr , − = − . What is more is that there are only scalar packets in the queue before cr . From this perspective, Then, We can get the value of cr from the above equation by applying the specific forms of arrival rate. Based on cr , we study the following two cases.
(i) ≤ cr : the performance of this case is the same as that in the case satisfying (10).

Implementation of WDQS.
In this subsection, we discuss the implementation of WDQS in WMSNs. WDQS requires a slight modification to the packet format. Figure 2 shows the packet format expected by WDQS. The field TYPE distinguishes the packet and is one of the following: report packet and querying packet. SP refers to the position of its source node. All the report packets' destinations are the sink. Querying packets come from the sink and they are broadcasting packets. So we need not indicate the destination position in the packet header. In the report packets' header, sink is zero, and and are set by sensor nodes. In querying packets' header, sink is set by the  (6) to ((3), (4)) Figure 3: Calculation process of the LDT at node .  sink. LEN is the length of the entire packet and CRC is the checksum. Figure 3 shows the calculating process of when a packet arrives at node .

Simulation
We implement and study WDQS in NS2. 200 sensor nodes were randomly positioned in a 100 × 100 sensor field. Node parameters such as radio range were carefully chosen to mirror typical sensor mote values [23]. One of these nodes was chosen as the sink to which all source data was sent. Realtime packets' source nodes and scalar packets' source nodes were randomly chosen and generate Poission traffics. In order to communicate source data to the sink, we employed a simple CSMA/CA based MAC protocol and Geographic and Energy Aware Routing (GEAR) [24]. The parameter settings are shown in Table 3. According to the routing mechanism of GEAR, the area of sensor fields, and the radio range of a sensor node, the number of nodes of the longest path from source to sink is = 3. With the parameters in Table 3, we have the following conditional expression according to (10): We conduct two sets of experiments. The first set of experiments verify the effectiveness of lifetime setting condition. The second set of experiments compare WDQS with some famous packet scheduling algorithms.

Experiment Set 1. In this set of experiments
is fixed and = 200 ms. We conduct 9 experiments to study packets' e2e delay and drop rate with the change of . The value of of every experiment is shown in Table 4. In the table, the first three meet (10), the middle three < but do not meet (10), and the last three are much larger than . The results are shown in Figures 4 and 5. Figure 4 shows the e2e delay of real-time packets and scalar packets. Figure 5 shows the packet drop rate. From the simulation results we find the following.
(i) In the first three experiments, the e2e delay of realtime packets is very small and that of scalar packets is much larger. The drop rate of real-time packets is much smaller than that of scalar packets. That is because when (10)  (ii) In the middle three experiments, the e2e delay of real-time packets increases and that of scalar packets decreases. Drop rates of these two kinds of packets become close to each other. That is because when < but do not meet (10), packets are fair forwarded, real-time packets and scalar packets share the bandwidth equitably.
(iii) In the last three experiments, the e2e delay of realtime packets increases further and that of scalar packets drops further. The drop rate of real-time packets becomes much larger and that of scalar packets becomes smaller. That is because when is much larger than , scalar packets are forwarded with higher priority while real-time packets only take the remaining bandwidth.
From the simulation results, we can see the conditional expression (24) is reasonable. That is to say the conditional expression (10) is suitable for WMSN applications.

Experiment Set 2.
In this set of experiments we compare WDQS with FCFS, EDF, DM, and VMS. FCFS is selected as an opponent in order to show the great improvements of network performances made by WDQS compared with nonpriority scheduling algorithms. EDF and DM are famous scheduling algorithms, priorities of which are all related to the packet's lifetime. VMS is one of the most suitable algorithms for WMSNs so far as mentioned in Section 2, priorities of which are also related to the packet's lifetime. We compare with these algorithms in order to show the performance improvements compared with the same type of algorithms. We let = 200 ms and = 100 ms which meet (10). We simulate three times to study e2e delay and drop rate with the change of . Other parameters and experiment topology are the same as the first set of experiments. The results are shown in Figures 6 and 7. From the simulation results we find that the e2e delay and the drop rate of WDQS are the smallest. Packet's e2e delay and drop rate of FCFS are much larger than those of WDQS. That is to say WDQS improves the network performance greatly and it has better performance than other packet scheduling algorithms which are chosen. All in all, the simulation results in this section show that our proposed WDQS improves the network performances in WMSNs and the packet lifetime setting approach is effective.

Conclusion
We have studied the QoS issues in WMSNs and propose a WDQS algorithm for packet scheduling to support the QoS requirements of WMSN applications. We put forward an estimating approach of remaining delay and a conditional expression of lifetime setting in order to calculate the LDT of a packet which affects the packet's position in the queue.