Dynamic Three Level Priority Packet Scheduling Scheme For Wireless Sensor Network

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

IPASJ International Journal of Electronics & Communication (IIJEC)

Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm


A Publisher for Research Motivation........ Email: editoriijec@ipasj.org
Volume 2, Issue 8, August 2014 ISSN 2321-5984

Volume 2, Issue 8, August 2014 Page 16

ABSTRACT
Packet scheduling is one of the most important functions of the nodes in the wireless sensor networks. This
scheduling of packets according to the priorities whether real time or non-real time is of vital importance to
decrease end to end transmission delay of data and average waiting time of sensors in the network. The results show
that the proposed dynamic three level scheduling algorithm performs well in terms of end to end transmission delay
and average waiting time when compared to the existing conventional scheduling algorithms FCFS and multilevel
queue scheduling.
Keywords: Priority scheduling, FCFS (FIFO), Multilevel queue packet scheduling, Real time and non-real time data,
Wireless Sensor networks etc.
1. INTRODUCTION
Scheduling different types of packets at sensor nodes in the wireless sensor network is one of the important network
design issues. To ensure the fairness and minimum latency of data packets the delivery of data packets must be done
according to the priorities of the packets in the queues of sensor nodes .For example, the data packets which are sensed
for real time applications must be given higher priority when compared to the other applications that are non-real time.
The already existed packet scheduling methods in wireless sensor networks use First Come First Serve (FCFS)
algorithm that schedule and process the data packets (tasks) according to the arrived time of the packets so that this
scheme is not efficient scheduling scheme if we consider end to end delay of the packets, as it takes a lot of time to
reach Base Station. The nodes in the intermediate level requires the change in the data delivery order in their queue in
buffer based on the in the existing techniques and also these already existed scheduling schemes are static and they do
not change to the traffic dynamic changes. For example, any real time data packet arrives late which is to be processed
in a specified amount of time, the scheduler which is static in nature cannot change the order of delivery of the real
time packet which restricts the effective operation of wireless sensor networks. Hence the intermediate nodes require
changing of the order of delivery of packets according to the packet priority based on their importance and delivery
dead line. As the proposed algorithm is dynamic in nature which means that the order of packets to be delivered must
be changed according to the network conditions and also according to the arrival of the packets and their priorities. As
the real time emergency data packets are considered to be having highest priority and are kept in the first queue, the
data packets that are not real in nature must be given lower priority compared to the real time data packets and so only
the execution of the data packets that are not real are preempted by the higher priority real time emergency data
packets. The packets in the second priority queue will be processed till consecutive time slots and after timeslots
the priority 3 packets gets processed so that the fairness is achieved by this type of scheduling. This proposed
scheduling scheme is suitable for applications of both the real time and data which is not real time. In application
scenario, it can be used in smart homes to check the health condition of people who are of old age(real time emergency
application) and to check and control the temperature of the room (non- real time application).
2. RELATED WORKS
In this section, different task scheduling schemes that are existing in wireless sensor networks are discussed. Basically
Tiny OS is the most commonly used OS (Operating system) in sensor networks .The Tiny OS task scheduling scheme
is again divided into preemptive and non- preemptive (cooperative) scheduling schemes. The other scheduling
mechanisms in sensor networks are
a. Non preemptive Scheduling mechanism: This mechanism is similar to the cooperative scheduling mechanism
discussed above scheduling does not depend on any priority criteria.
DYNAMIC THREE LEVEL PRIORITY
PACKET SCHEDULING SCHEME FOR
WIRELESS SENSOR NETWORK
A. Hari
1
and K. Riyazuddin
2


1
M. Tech (DECS), AITS, Rajampet, A.P, India

2
Asst.Prof, Department of ECE, AITS, Rajampet, A.P, India
IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation........ Email: editoriijec@ipasj.org
Volume 2, Issue 8, August 2014 ISSN 2321-5984

Volume 2, Issue 8, August 2014 Page 17

b. Preemptive scheduling mechanism: This is also discuss which is one of the scheduling mechanism of Tiny OS
which is already discussed.
c. Real time packet scheduling mechanism: In sensor nodes the packets are scheduled depending on the respective
priority of the packet and the real time packets which are treated as the highest priority have to be delivered to base
station (or sink) with less amount of delay .
d. Non real time packet scheduling mechanism: The non-real time tasks( data packets) are given the lower priority
when compared to real time tasks and so they are preempted by the real time tasks as they have higher priority
compared to that of the non-real time data packets and in the absence of real time packets the non-real time tasks
follow the first come first serve i.e. processing of packets according to the arrival time of the packets or on basis of
shortest job first and are delivered to Base Station.
e. FCFS (First Come First Serve) scheduling mechanism: In this scheduling mechanism [12], the data packets are
processed according to the arrival time of the packets and they experience a long waiting time because the packets that
arrive late from the lower level nodes have to wait for a long time until the data packets that have arrived earlier from
intermediate nodes are executed which is a great limitation in this type of scheduling.
f. Earliest Deadline First (EDF): This scheduling mechanism depends on the deadline factor of the data packets. If
the data packets are available at ready queue then the EDF scheduling scheme selects the data packet of earliest dead
line to transmit first and hence this scheduling mechanism is more effective regarding end to end delay and average
waiting time.
g. Multilevel Queue scheduling mechanism: In this type of mechanism the ready queue of tasks (data packets) in each
sensor node is divided into two or more number of levels and the number of queues in each node depends on the level
to which the particular node belongs to which means that the node at lowest level has less number of queues when
compared to the upper levels to decrease the end to end delay .In [9] Lee et. shown a multilevel scheduling algorithm to
eliminate problems in [8].In this multilevel queue scheduling the data packets are scheduled to each queue based on the
priority of the packet whether high or low, high priority packets (tasks) in one queue and low priority packets (tasks) in
other queue and so on.
3. PROPOSED THREE LEVEL SCHEME
Under this sub section, we discuss the proposed dynamic three level scheduling scheme. As discussed in the previous
sections the existing scheduling algorithms have one or the other limitations either in terms of priority or fairness. For
example in preemptive priority scheduling the continuous arrival of real time data places the other type of data and the
data packets from lower level nodes to starvation which restricts the fairness and in non-preemptive scheduling
algorithm, the real time emergency data have to suffer long waiting time due to the other tasks execution as in this type
of scheduling there is no preference to the priority of the data packets which is not suitable for large scale sensor
network dynamic applications and in multilevel queue scheduling, the nodes at the lowest levels have a single ready
queue consisting of both real time data and the data that is not real time , but they should be processed (executed)
depending on their priorities ,if it is not the case, the real time data packets which are emergency experience long
delays till they could be processed. Thus the proposed dynamic three level scheduling algorithms outperforms the
existing scheduling algorithms in terms of delay and average waiting time by crossing all the limitations.
3.1 Working Principle of the algorithm
In this algorithm we have considered that the nodes are set themselves in number of levels depending on the hop
distance from the base station that means the nodes at a distance of one hop are all together considered themselves to be
at a level 1 and the nodes at a distance of 2 hops are set themselves into level 2 and so on and forms themselves into
different levels from the base station. And in each node of a sensor network we have considered three levels of queues
and each level having its own priorities, priority 1(pr1) ,prioirty2(pr2) and prority3(pr3) queues.
The following figure specifies the same.
IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation........ Email: editoriijec@ipasj.org
Volume 2, Issue 8, August 2014 ISSN 2321-5984

Volume 2, Issue 8, August 2014 Page 18




The real time data packets are considered to go to pr1 queue and the non-real time data packets are again differentiated
like the non-real time data from lower level nodes are send to the second priority queue (pr2) and the data packets
which are from the local nodes are send to the queue having third (least) priority (pr3) . Here we have chosen three
queues because of the following reasons 1. The reason for giving higher priority to real time tasks is to meet all the
goals of WSNs. 2.To achieve minimum end to end delay for the remotely sensed data packets the data packets sensed at
remote lower nodes are given the second priority.3.The remaining tasks that are sensed at local nodes are given least
priority and to achieve fairness they can preempt the pr2 tasks if the pr2 are continuously arriving for a particular
timeslots. The size of the higher priority queue is considered to be less as the real time tasks which it is holding may
not arrive continuously and in more number and the remaining queues are more in size compared to that of pr1 queue
and they are of same size. Each node at a particular level is given a particular time slot to sense, process and transmit
the data packet to the node in the next level. A node receiving a data packet from lower level node has to sense, process
and forward the packet with in a allocated time slot. If the data remains in the ready queue of a particular node during
its allocated time slot then the remaining data can be processed in the next time slot and the other case if the processing
of all data packets in queue are processed with in a allocated time slot then the node goes to sleep state to preserve
energy. Moreover the timeslots for each level is not fixed and varied according to the level number because the
timeslots needed for lower levels is less compared to that of the timeslots required by the upper or intermediate levels
because the functions of nodes at lower levels is only to sense process and transmit but the functions of upper and
higher levels include receiving of data packets and data aggregation in addition to the above mentioned functions of the
lower level nodes. At a particular level the real time emergency data which is to be transmitted in small amount of time
is processed in short time of the particular timeslot of the level and the remaining time of the time slot, the other
priority data packets can be processed as there is a very low probability of getting real time data.
4. ANALYSING THE PERFORMANCE:
In this section we propose the formulae for end to end delay and average waiting time for transmitting tasks of different
priorities and analyze the proposed algorithms performance regarding end to end delay and average waiting time.
4.1. End to end delay:
4.1.1. Priority 1 (pr1) Real time data queue:
Let us consider the real time emergency data is being sensed in the node i which is in a level lk. This particular node
i transmits the higher priority pr1 data packets to base station through the intermediate l (k-1) nodes at each level. We
consider a scenario where by every time a real time data packet enters to an active node j which is at next level, a data
packet which is not real time is being processed at that particular node j in the upper level and so the data delivery at
j node is preempted by the real time task and then after the processing of real time task the non-real time task which
is being processed at j gets processed. The end to end delay for a data packet to reach the base station from the node
where it is sensed is a combination of the following factors and the delay is the addition of all of them.
a. Transmission Delay
It is the delay that is required for placing the data packet from node into the medium. It is given by the ratio of size of
data packet (data pr1) to the transmission speed (st) and is given as follows.
IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation........ Email: editoriijec@ipasj.org
Volume 2, Issue 8, August 2014 ISSN 2321-5984

Volume 2, Issue 8, August 2014 Page 19


b. propagation delay
It is the delay required to transmit the data packet from source to destination. It is given as the ratio of total distance
from source to destination (Dsd) to transmission speed (Spd) and is given as follows

c. Number of levels
The total end to end data transmission delay comprises of the number of levels also because the data packet have to
travel the total number of levels to reach the base station. Here the total number of levels is considered to be Lk.
d. Processing time
The processing time of each data packet is also considered to calculate the overall delay so it is also considered and let
the processing time of real time packet to be pr1proc(t)
e .Overhead time
This include all the extra time for instance like the time taken for context switching preemption etc. It is taken as
Textraoverhead. Now the end to end data transmission delay for a real time data packet is given by Delay pr1 >=Lk x
(1)
So the end to end delay for the real time data packets consisting of npr1 in number is given by Delay
>= .(2)

4.1.2. Priority 2 (pr2) Non Real Time data Queue
The end to end delay of this type of queue also consists of above discussed factors and here pr2 tasks are preempted by
real time tasks. If we consider a case of Fig1 as an example where a real time data packet (task) is sensed in the node
having number 11 later it is then moved to the base station by passing through some of the intermediate nodes present
in the way to the base station those are 9,6 and 2 we consider that the second priority pr2 data packets are being
processed in those nodes so the processing of these pr2 tasks are pre empted by the real time task just arrived and the
processing of pr2 tasks at each node starts again after execution of real time task. So the parameter end to end
transmission delay of non-real time pr2 tasks is given by Delay pr2
>= (3)
Where data pr2 is the size and pr2proc (t) is the time taken for the processing (execution) of non-real time second
priority (pr2) data.
4.1.3. Priority 3 (pr3) Non Real Time data Queue
The end to end delay for this type of data in best case when no data is present in pr1 and pr2 queues is almost equal to
end to end delay of pr1 data except for the difference in the data packet sixe of pr2 data. According to algorithm
proposed we consider the pr3 tasks are processed by preempting the pr2 tasks if pr2 tasks are continuously arriving for
consecutive time slots and there are no tasks available at pr1 queue and only tasks are available at pr2 queue.
So the delay for pr3 tasks is given by Delay pr1 >
= (4)
Where datapr3 is the packet size and pr3proc (t) is the time taken for execution (processing) of data that is not real
time, third priority pr3 data. T(k) is the length of the timeslot.
4.2 Average waiting time:
The average waiting time taken by a task or a data packet can be calculated as ratio of the total time taken by the task to
transmit from source to destination through number of intermediate nodes to the number of nodes the task has
transmitted through and so it is nothing but the ratio of total end to end delay of a particular task to the number of
nodes (or levels) the task has passed through to reach base station and is given by Average waiting time
.(5)
The above formula is applied to all the types of data whether real time or non-real time data to get the total average
waiting time and at the same time average waiting time of the tasks at each particular node can be calculated by
IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation........ Email: editoriijec@ipasj.org
Volume 2, Issue 8, August 2014 ISSN 2321-5984

Volume 2, Issue 8, August 2014 Page 20

dividing the delay between the particular nodes to number of nodes between which the delay is calculated so that we
can calculate average waiting time at each node or level.
5. RESULTS
We have simulated the proposed dynamic three level priority scheduling scheme using MATLAB simulator compared
the performance of algorithm with the previous existing scheduling schemes FCFS and multilevel queue scheduling
schemes. We have first measured the performance of all the tasks (both real time tasks and the tasks that are not real
time) regarding end to end transmission delay and average waiting time by using the proposed Three Level Priority
(TLP) scheduling scheme and then compared it with the end to end data transmission delay of all tasks calculated using
FCFS and multilevel algorithms. We also have evaluated the performance of only real time tasks in regarding end to
end delay and average waiting time the fast delivery of real time data is the significant feature of Wireless Sensor
Networks.In the simulation we have used the network size of 100x100 in both the dimensions. Nodes are uniformly
distributed over the network. The type of the task is differentiated depending on the size of the data packet , the data
packet with low size and low processing time are considered as the real time.
Simulation parameters:
Parameter values
Network size 100x100 meter
Data Transmission speed
and receive speed
0.01n joules/bit/m 3
Data Energy Consumption 50n joules/bit
Data propagation speed 200x106 m/sec
Initial node energy 0.8joules
After calculation of end to end data transmission delay for different types and priorities of packets and also for the real
time data packets (tasks) we can calculate the average waiting time in both cases by using the formula (5) and then plot
the overall average waiting time for the tasks in reaching the base station from their respective nodes and then calculate
the average waiting at each node or level.

Fig2: end to end transmission delay for all types of data
IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation........ Email: editoriijec@ipasj.org
Volume 2, Issue 8, August 2014 ISSN 2321-5984

Volume 2, Issue 8, August 2014 Page 21

Fig2 illustrates the proposed TLP algorithms performance regarding end to end data transmission delay by comparing
the delay with the other scheduling algorithms delay and shows that it performs better compared to other schemes as
the end to end data transmission delay of the data packets are lower by using the proposed scheduling scheme as in the
proposed algorithm the priority for the data packets coming from lower level nodes is given after real time data packets
so the overall end to end data transmission delay of the all types of data packets is less when we use the proposed type
of scheduling scheme when compared to the other schemes where the priority for the data packets coming from lower
level nodes is not given.

Fig3: Average waiting time for all types of data
Fig3 shows the average waiting time of all types of data and it illustrates that the average waiting time of data packets
is less when we use the proposed scheduling algorithm when compared to that of the FCFS and multilevel queue
scheduling due to the same reason discussed for the previous figure that is giving preference to data packets from lower
level nodes.

Fig4: Average waiting time for all types of data at each node level
The above figure illustrates the average waiting time at each node through which the data packets passed and it also
specifies that the proposed TLP scheme out performs the other two existing schemes regarding average waiting time.

Fig5: end to end data transmission delay for real time data packets.
Fig5 illustrates that the proposed dynamic three level scheduling algorithm has better performance regarding end to
end data transmission delay for real time data when compared to other scheduling algorithms as in the proposed
algorithm the higher priority is given to emergency real time data packets to meet the overall goals of WSN
IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation........ Email: editoriijec@ipasj.org
Volume 2, Issue 8, August 2014 ISSN 2321-5984

Volume 2, Issue 8, August 2014 Page 22


Fig 6: Average waiting time for real time data


Fig7: Average waiting time for real time data at each node (level)
Fig 6 and 7 also illustrates that the proposed TLP scheduling scheme outperforms the other scheduling algorithms for
real time data in terms of average waiting time showing low average waiting time for the data packets since priority is
given to real time data packets where in the other scheduling algorithms this preference is not given. But one of the
limitations in the proposed algorithm is the requirements of energy in the network , the proposed scheduling scheme
may be somewhat low efficient in terms of energy when compared to the other two schemes because the scheme
requires a few processing time slots to differentiate the data packets into three different queues based on their priorities
as well as context saving and switching at times of preemption, but the growing demand for WSN-based solutions
which support applications that are real time and also ensure them with minimum average waiting time and end to end
data transmission delay so the proposed scheme is considered as high efficient scheme.
6. CONCLUSION
In the paper, we have proposed a dynamic three level efficient scheduling algorithm for wireless sensor networks
considering the prioritization of data packets to meet the goals of WSN and also to reduce the delay time of the packets
coming from lower level nodes by giving preference to real time packets and then to data packets from lower level
nodes respectively. So the proposed scheduling scheme adapts better to the requirements that are changing in WSN
applications and schedules the real time data packets with higher priority maintaining a minimum amount delay from
source to destination and also it schedules the lowest priority tasks of lower priority reaches the base station with
fairness and does not starve for long amount of time. Experimental results shows that the proposed scheduling
algorithm showed better performance in terms of delay and average waiting time when compared to that of the existed
FCFS and multilevel queue scheduling algorithms.
REFERENCES
[1] J. Liu, N. Gu, and S. He, An energy-aware coverage based node scheduling scheme for wireless sensor networks,
in Proc. 2009 International Conf. Young Computer. Scientists, pp. 462468
IPASJ International Journal of Electronics & Communication (IIJEC)
Web Site: http://www.ipasj.org/IIJEC/IIJEC.htm
A Publisher for Research Motivation........ Email: editoriijec@ipasj.org
Volume 2, Issue 8, August 2014 ISSN 2321-5984

Volume 2, Issue 8, August 2014 Page 23

[2] X. Xu, , J. Bi, and W. Liu, Adaptive nodes scheduling approach for clustered sensor networks, in Proc. 2009
IEEE Symp. Comput. Commun., pp. 3439.
[3] K. Mizanian, R. Hajisheykhi, and A. H. Jahangir, RACE: a real-time scheduling policy and communication
architecture for largescale wireless sensor networks, in Proc. 2009 Commun. Netw. Services Research Conf., pp.
458460.
[4] Y. Wang, D. Wang, W. Fu, and D. P. Agrawal, Hops-based sleep scheduling algorithm for enhancing lifetime of
wireless sensor networks, in Proc. 2006 IEEE International Conf. Mobile Adhoc Sensor Syst., pp. 709714.
[5] X. Xu, Y. H. Hu, J. Bi, and W. Liu, Adaptive nodes scheduling approach for clustered sensor networks, in Proc.
2009 IEEE Symp. Comput. Commun., pp. 3439
[6] B. Zeng, Y. Dong, and D. Lu, Cooperation-based scheduling algorithm in wireless multimedia sensor networks,
in Proc. 2011 International Conf. Wireless Commun., Netw. Mobile Comput., pp14
[7] X. Yu, X. Xiaosong, and W. Wenyong, Priority-based low-power task scheduling for wireless sensor network, in
Proc. 2009 International Symp. Autonomous Decentralized Syst., pp. 15.
[8] Y. Zhao, Q. Wang, W. Wang, D. Jiang, and Y. Liu, Research on the priority-based soft real-time task scheduling
in TinyOS, in Proc. 2009 International Conf. Inf. Technol. Comput. Sci., vol. 1, pp. 562565.
[9] E. M. Lee, A. Kashif, D. H. Lee, I. T. Kim, and M. S. Park, Location based multi-queue scheduler in wireless
sensor network, in Proc. 2010 International Conf. Advanced Commun. Technol., vol. 1, pp. 551555.

You might also like