Enhanced Buffer Management Policy and Packet Prioritization for Wireless Sensor Network

— Limited storage of the sensor node is one of the main causes of packet drop in the Wireless sensor network (WSN). Frequent link disconnection is also another cause of packet drop. Due to lack of continues end-to-end connection; neighbouring nodes might not be able to connect with one another. Hence, communication may be setup with the help of store and forward approach between the source and destination. In that case, the sensor node may not be capable of storing a chunk of data since the buffer is available in a small amount. In order to store the data packets in the buffer when the link is down, an effective buffer management scheme is highly needed to keep the data packets for a long time until the link is re-established. This paper proposes a new buffer management scheme called Packet Priority Heterogonous Queue (PPHQ), which based on prioritizing and classifying the packets into different categories to minimize the loss of important packets. Unlike the existing Multi-layer WSN, that treats the data packets differently; we considered the data packets such as; temperature, humidity, and pressure to be same. However, the classification of different packet types is based on the sensor’s information value. We completely divide the whole buffer into different queues, and thus the newly arrived packets are inserted in their corresponding queue. The buffer will then prioritize and schedule on which packet to be stored or transmit first when the buffer is overloaded. Our result exhibits that PPHQ scheme indeed provides minimum packet drop as well as maximum throughput compared to existing Multi-layer WSN buffer management schemes.


I. INTRODUCTION
Wireless sensor network (WSN) is a set of sensor nodes dispersed in a dedicated field to monitor and capture target environment factors such as temperature, humidity and pressure. Each sensor node comprises of a radio transmission device, a small built in microprocessor and a storage unit. These component parts are equipped together and made accessible as a single functioning application. The sensor nodes sense and collect physical information from the ambient environment, the processor executes basic operational instructions as well as employs as a router and the radio transmitter send the data to base station [1], [2]. Thereafter, the sink node will send the data to the outside world through a gateway.
Moreover, when the sensor node attempts to transmit a packet and the link is down or the path of the destination is not available, the node cannot hold the packet for a long time and discards the packet due to the limited memory. Consequently, the sensor node can only process low data rate. In such situations, the node must be available with larger resources in terms of storage space and residual energy to keep the packets in the buffer for long time. One of finest sensor nodes is IMOTE2 invented by crossbow technology [3], [4]. Nevertheless, with no loss of generality we can argue that wireless sensor network are made for to handle very low data rate as well as resource-restrained nodes [5]. Energy and storage are mostly available in very restricted amount. Although sensor nodes are designed to operate low data rate, at the time of packet transfer to the sink node, an intermediate node might have to relay packets coming from various sources at once. These sorts of nodes could be severely burdened and due to restricted storage space, the buffer will begin to overflow [6]. This might further lead to loss in useful packets and retransmission of the similar data might be required. Packet retransmission may cause higher energy depletion. Furthermore, the buffer overflow could also have bad effects over the end application.
There are some other buffer management approaches introduced in the different computer networks such as Delay Tolerant Network (DTN), Mobile Ad Hoc Network (MANET) and Vehicular Ad Hoc Network (VANET). However, it is very challenging for their methods to be applied due to the limited resource in wireless sensor network. Furthermore, the wireless network is varied greatly from other wired networks. When it comes to sensor network design, there is merely single Output Queue, that is linked to a just one radio transmitter. Thus, without having a good buffer strategy, the transmitter queue will employ as First-In-First-Out (FIFO) manner.The main differences between our proposed method and Multi-layer WSN is that, we assume our network to be a single layer, whereas Multilayer WSN adopts a multi-layer network.
In this paper we investigate the various packet types in which may be available within the sensor network scenarios. We introduce a buffer management scheme that classifies these packets into various categories. Afterward, the buffer is split up into various priority queues and each packet is placed into its respective queue. The proposed buffer scheme is employed and then packets are serviced and put into the output transmitter queues.
When new packet arrives and there is no room space in the buffer to be inserted, our buffer management scheme will determine whether the new arriving packets must be discarded or an old existing packet in the buffer is removed to accommodate the current arriving packet. In case that the size of the arriving packets is larger, then the buffer scheme will determine how many packets have to be discarded from the queue to adjust the queue size. Wireless sensor network is not similar to existing traditional network. From the sensor network scenarios, there could be several kinds of packets. In that case, the Quality of Service (QoS) is needed because each packet type is different as well as unique. The key goal of the buffer management scheme is to provide the optimum service priority to the various packet types specifically.
Our objective is to achieve the optimum packet delivery as well as an efficient buffer management in order to keep all important packets based on priority in the buffer in presence of network disconnection.
The rest of this paper is organized as following; section 2 describes the existing problem as a literature review. In section 3, we illustrate our proposed scheme for sensor network. In section 4, we analyse the experimental result of the simulation. Lastly, section 5 is the conclusion of the main work of the paper.

II. MATERIAL AND METHOD
In this part, we look at some of the previous related works on buffer management that exist in different type of network. MANET, DTN and WSN have all difference schemes in terms of buffer management policy. However, buffer management scheme for DTN is not applicable to either WSN or MANET because of their different design and topology. A node in DTN will hold and retain the packet until a path or connection is available as the buffer management policy is dependent on combination of packet scheduling to cope with the problem of limited encounter opportunity between communication nodes [7]. In [8], [8], [9] MANET, nodes will discard the packet if not found a connected link to the destination. On the other hand, when a node in MANET receives packets, it will decide which packet has the shortest route available at the moment.
In WSN, since the energy and storage are available in a very small amount, the intermediate node will start overflowing when received more packets from different sources simultaneously. Therefore, challenges of achieving an efficiency buffer management for limited resource WSN come to be widely open.
Shwe, et al. [11] proposed a Multi-layer WSN buffer management scheme which decreases the number of packet drop by dividing network topology into three logically layers based on sensors' information. When the data packet arrives at sensor node, the buffer will then select the packets according to their different layers and information they have.
The disadvantage of their proposed approach is that, sensor nodes are assigned to gather three different data packets such as (humidity, temperature and pressure) from the sensing area. The sensor nodes that are assigned to read humidity will accept only the packets containing humidity information and consider them as relevant. Other packets that consist both temperature or pressure values are irrelevant packets and be dropped. Finally, the transmitter queue forwards different packets in FIFO manner. Similar work is done by Shu, et al. [12] who proposed another buffer management policy. This policy classifies the packets into different types as well as prioritizes the buffer for separate queues distinctively and corresponding packets are inserted.
There are many algorithms proposed for buffer management including FIFO, Last-In-First-Out (LIFO) and priority queues to improve packet delivery as well as QoS of network. Algorithms based on FIFO approach are not complicated to be understood and implemented, although their performances might not be ideal.
Nasser, Karim, & Taleb [13] proposed a Dynamic Multilevel Priority (DMP) packet scheduling algorithm where sensor nodes organized in a tiered design. Sensor nodes, which have exactly equal hop range away from the base station are assumed to be placed at the similar hierarchical level. In addition, Time Division Multiplexing Access (TDMA) algorithm is utilized to prioritize packets from various layers.
Other work is Xiong, et al. [14] who presented a multi queue LIFO queueing method. The proposed method divides the queue of each sensor node into several weighted sub queues virtually then each packet from sub queues are then transported depending on the weight of the packet received at the base station (BS). Data packets in sub-queues with greater weights are given higher priority in servicing and hence fairness is more enhanced.
Qiu, Feng, et al. [15] introduced a technique employing queuing network design to assess the buffer volume capability and its network performance. They presented the notion of keeping nodes in the network to discover the actual transmission and arrival rate, as well as to estimate the congestion time within the network.
Boroumand, Kalemati, & Abbaspour [16] characterized different packets as real-time and non-real-time and used two different priority queues with each one of them have varied weight. Packet priority is determined on the basis of kind of traffic load each packet can experience within the travelled route. The packets that might encounter higher traffic congestion in the queue will be given most priority to get serviced and transmitted.
Aside from that, another better solution for limited storage of the sensor node is a network coding system as proposed by [17]. A buffer management scheme is based on network coding system to distribute the data of the sensor's buffer along the different routes from source node to the destination using network coding on all packets. Through buffer distribution from source to destination route, the algorithm allocates the buffer load among the sensor nodes and provides uniform buffer utilization. Furthermore, in terms of packet drop, the proposed algorithm recovers the lost packets from available data dispersed on the route from source node to the sink node.
In this study, a packet priority heterogeneous queue (PPHQ) scheme is proposed to handle the buffer issue of the sensor node. Fig. 1 illustrates the framework model of the proposed scheme. The whole buffer is partitioned into four queues; Input Queue, Main Buffer Queue, Output Queue and Aged queue.The Input Queue is a temporary queue in which a newly arrived packets are kept for a limited period. The Main Buffer Queue is where all different packets are prioritized based on packet content. Output Queue is the transmitting queue where packets are forwarded. Finally, Aged Queue is used to store important packets that could not be transmitted.
The proposed scheme employs two policies; queueing policy and transmission policy. The queuing policy determines how to accommodate the incoming packets in the buffer, while the transmission policy determines the order in which the packets must be forwarded based on priority. Our aim is to have a buffer management strategy to effectively provide a shared storage space among packets of different types, in order that the whole network throughput will be improved. The fundamental features of this scheme include packet classification, queue management, division of the main buffer, transmission priority, message (time to live) TTL and dropping policy.

A. Packet Classification
Each sensor node categorizes the incoming packets into three different types and hence all packets will be inserted in their corresponding queue. The first packet type is important packets that hold both control instructions sent by base station and sensor readings containing information of temperature and humidity. Hence, they will be placed in the top priority queue as they carry valuable data.
The second type of packet is normal packets which may contain all types of control packets and have the second priority queue. These types of packets will be inserted in the middle queue. The third type of packets is less important packets, which may contain hello messages and advertisement messages that nodes generate at short interval of time. They will be put in low heterogeneous queue in the main buffer.
In any scenario, we will make certain not lose any important packets and meanwhile letting other packets to get discarded.

B. Queue Management
Buffer sharing describes the volume of buffer size available to a particular queue and states how the space is allocated among the different types of queues.
As mentioned earlier, our proposed PPHQ scheme introduces a concept of which the whole buffer is partitioned into four logical queues consisting Input Queue, Main Buffer Queue, Output Queue and Aged Queue.
The Input Queue is a temporary queue that stores the new incoming packets and sort out those packets based on their arrival time. Afterwards, the packets from Input Queue are transferred to the Main Buffer Queue where packets are arranged and prioritized according to the type and information they have.
Thereafter, the Output Queue gets the packets from the Main Buffer by the order of their arrival time and try to transmit them right away. If the Output Queue fails to send the important packets, they are transferred to the Aged Queue where it remains for a short while. Packets from Aged queue are then inserted into the Low Queue with the hope of second chance to be retransmitted.

C. Division of Main Buffer Based on Priority
In our network scenario, every sensor node composes of an overall buffer size B, distributed by T types of different queues. The whole buffer volume is split up into T number of queues in accordance with the expected arriving packet type.
Based on proposed buffer management scheme, the main buffer consists three layers of priority queues (Top, Middle and Low heterogeneous) as shown in Fig. 1. The meaning of heterogeneous in middle and low queue layers is that different types of packets are being stored in it. Each queue only will accept packets with the matching type. The volume of top, middle and lower queues are T, M and L, respectively. Hence, the total size of these three queues cannot overreach the total volume of the main buffer, T + M + L <= B.
The first priority is for the important packets. A and G denotes important packets and those packets will be placed in the top priority queue.
The second priority is given to normal packets. B is used to denote normal packets and is stored in the middle heterogeneous queue. This queue supports two types of message sorting. For the first type of sorting, the packets from the same type are prioritized based on their arrival time for instance, packet type B1, B2, B3, B4.
The other type is G (aged packets) which shares the queue with B. If the heterogeneous queue contains both B and G (for instance, B2, B1, G1), G packets will always be at the top and sorted based on their packet priority. G will always remain at the top queue because it carries valuable information. The third priority is for less important packets. C is used to denote less important packets, and those packets are inserted in the low heterogeneous queue. These types of packets contain advertising messages that nodes exchange between them periodically. Typically, they generate network overhead. In that case, if the buffer is full, these packets are dropped and replaced with the aged packets G since C has lower priority and less important.
The top queue layer is only for important packets consisting of packets A or G. Note that G is originated from A. Any packets A that could not be transmitted will be labelled as G and transferred to the Aged Queue. As seen in the Fig. 1, G will always be promoted to the top queue and have opportunity to be retransmitted as they contain important information.

D. Transmission Priority
In our buffer management policy, packets stored in the main buffer are ordered and transmitted based on priority. Therefore, we give the most chance for packets in the top priority queue. We set for top queue to get more attempts to send important packets in multiple times compared to any other level of queues in the main buffer. However, we permit the important packets to be sent by three times in any time slot. Normal packets in the middle queue are assigned for two messages to be transmitted on every time unit. Moreover, less important packets in the lower queue are set to one message only to be sent per each time slot.
As seen in Fig. 2, every t second, a message will be sent from the main buffer to the Output Queue since A>B>C. Therefore, A has higher probability in sending attempts as A>B. Whereas B has more sending attempts than C.

Fig. 2. Packet scheduling and transmission priority
Once all messages received at the Output Queue, packets will be transmitted in the order they arrive. Hence, the packet schedule for important, normal and less important would have a different priority. Meanwhile, the priority ratio for packet transmission of the three different packets is set to be 3:2:1 respectively as shown in Fig. 3.

E. Message TTL
If the Output Queue fails to transmit the packets, all other packets are dropped except for important packets. Afterwards, important packets are put in the Aged Queue for future retransmissions. The unsent important packets are considered to be old packets, and then labelled as 'G' in order to differentiate from 'A' packets that contain fresh messages.
If the Output Queue becomes empty for any chance and there is no 'A' packets in the top queue at the time, the algorithm checks time to live (TTL) of the old packets in the Aged Queue. A fresh packet that has not exceeded beyond its expiry period is picked up. Thereafter, a second chance is being given to the Aged Packets (G) that has below certain threshold value to be retransmitted again since G has more priority than B and C.
If TTL <= THR, then we insert G packet to the Output Queue to be resent again. Otherwise the packet will remain in the Aged Queue. In that case, we set expiry policy for unsent packets and message TTL parameter will be applied. G packets will be expired after 60 second if they are remained in the Aged Queue. After the expiration period elapsed and they will not be given a second chance to be retransmitted.

F. Dropping Policy
The dropping policy of our scheme deals with the rules whether to accept or reject a newly incoming packet as well as discarding an existing saved packet to make room for the new packets. The judgment of packet selection is done based on the type of incoming packets. Our dropping policy is based on Drop Oldest Packet (DOP) in the buffer.
As stated previous, we adaptably categorize the incoming packets into three types; important, normal and less important. Newly arrived packets are always placed in their respective queues when the buffer is not occupied but the discard policy will be applied if the buffer is filled up.
In the event where the main buffer has no vacant space for newly arrived packets, our proposed drop policy DOP is applied. DOP policy performs as follows. If the incoming packet is of normal type and the space of the middle queue is already full, then the oldest packet in the queue will be removed and be replaced with the newly received packet.
Despite that, if the receiving packet is of important type, our policy discards oldest one from the top queue so as to accommodate the newly arriving important packet. In case the incoming packet is of less important, then oldest packet is discarded from low heterogeneous queue to accommodate the newly arrived packet. A similar rule is applied to all different queues except for aged packet type. All aged packets are sent to the low heterogeneous queue to replace existing packets during the process of retransmission.
On the other hand, if the Output Queue fails to transmit the packets, it will drop all the other packets except important packets which will then be inserted to the Aged Queue and held in there for further action. Upon receiving the important packets at the Aged Queue, they will be considered as aged packets or old packets, and then be relabelled as 'G' in order to differentiate from 'A' packets having fresh messages.
In that case, when the Aged Queue becomes full, the oldest packet will be sent to low heterogeneous queue and the less important packet will be dropped as show in Fig. 4. Therefore, packets labelled G will always get promoted to the upper levels until successful retransmission is done. We consider this policy in order not to lose any important packets.
To conclude, considering the worst-case scenario, when a queue in the main buffer is full for more than t amount of time, the queue should drop the lowest priority message to accommodate new messages from the Input Queue. This applies to all queues in the main buffer. However, dropping only happens at the low heterogeneous queue after t amount of time when a message from the Aged Queue needs to be transferred to the heterogeneous queue and the queue is full.
Our goal is to maximize the delivery rate of important packets as well as minimize the amount of packet loss in order to achieve a full packet reception. We simulated our proposed scheme on MATLAB simulator using shortest hop path routing. In our simulation, we used 100 nodes for the experiment which are deployed randomly in a 100m x 100m area and the transmission range for each node was set to 30 meters. We also set the packet rate from 5000 to 10000 bit/second. The length of the data packet is 30 bytes and the control packet is 15 bytes. We used buffer size of 10kb in the simulation.
In order to get optimum design parameters for WSN, we firstly analyse the effect of packet loss on our proposed PPHQ buffer management. Secondly, we evaluate and compare the performance of proposed scheme with MULTI-LAYER WSN scheme. Secondly, we evaluate and compare the performance of proposed scheme with MULTI-LAYER WSN scheme.

A. Calculating Total Dropped Packets in PPHQ Scheme
Based on the above simulation scenario, we computed and compared the number of packet drop for each packet type in our proposed scheme. In general, varying the number of nodes in a network has great effects on packet drop. As illustrated in Fig. 5, when the number of nodes increases, the number of the packet drop increases. We calculated the number of packet drop of the important, normal and less important types. It is shown that as the number of network nodes increases, the loss of important packets is minimum. The number of packet drop for the normal packets is moderate and less important packets are dropped at highest rate. The number of packet drop for less important packet is much higher than other packets in the proposed scheme.
Therefore, the packet drop of important packets is not significant in our algorithm. When the buffer is occupied and there is no vacant space to accommodate new arriving packet, the highest priority is given to the important packets. Thus, normal and less important packets are dropped since they have lower priority according to our buffer management policy.

B. Performance Evaluation: Proposed PPHQ Scheme vs MULTI -LAYER WSN Scheme
The performance of PPHQ is evaluated in three different scenarios with respect to the increasing bit rate (load). For each scenario, the performance of our proposed scheme are measured and compared with Multi-layer WSN scheme in term of the throughput, packet delivery ratio and average end-to-end delay. Fig. 6 shows the effect of load on overall throughput of a WSN. The results imply different efficiency achieved by both PPHQ and Multi-layer WSN scheme when the bit rate was increased from 5000 to 10000 bits/s. As the amount of bit rate increases, the amount of throughput for PPHQ shows higher throughput compared to the Multi-layer WSN. These results clearly indicate that PPHQ scheme has better performance in terms of the average throughput compared to the Multi-layer WSN. In fact, PPHQ achieved 12.39% better compared to Multi-layer WSN scheme. The reason is that, the proposed PPHQ selects higher priority packets when executing forwarding and scheduling strategy. In the other hand, the Multi-layer WSN transmits the different packet types randomly with no priority functionality as the transmitter queue employs FIFO mode. Fig. 7 depicts the comparison of packet delivery ratios for PPHQ and Multi-layer WSN over bit rate. The two buffer management schemes have different packet delivery ratios with the increasing amount of bit loads in the network. When the bit rate increases from 5000 to 10000 bits/s, the packet delivery ratio for PPHQ increases from 83.20 to 86.17 while packet delivery ratio for Multi-layer WSN increases from 82.68 to 84.57. However, it is clear from the figure that PPHQ has better performance in terms of packet delivery ratio compared to Multi-layer WSN. PPHQ has obtained 0.846% improvement compared to Multi-layer WSN. The reason is that PPHQ scheme gives priority to the important packets for fast delivery. Besides, when transmitter queue is not able to transmit important packets, multiple chances for retransmission is given. All these scenarios are not considered in Multi-layer WSN scheme.
Finally, average end-to-end delay experienced by both proposed PPHQ scheme and Multi-layer WSN is measured. As shown in Fig. 8, for all range of bit rate configured in the simulation, the average end-to-end delay for PPHQ scheme is less in comparison to the Multi-layer WSN. PPHQ has 4.2% better performance compared to Multi-layer WSN. The packet delay for Multi-layer WSN is caused by the queue congestion and higher load in the buffer since the output transmitter queue works in FIFO manner. In that case, all different types of packet have equal priority in terms of transmission schedule. On the contrary, in PPHQ scheme, when packets experience heavy queue congestion, the highest priority is always given to the important packets while other packets are kept waiting to avoid any possible dropping. Therefore, this way has resulted in delivering most important packets to the base station with minimum delay. In this paper, we proposed a PPHQ buffer management scheme to effectively utilize the storage space of the sensor node. Our study was based on packet classification and prioritizing different packets in the buffer. The proposed scheme gives higher priority to the important packet types since they contain valuable and sensed information. In comparison to M-LAYER WSN, our proposed scheme has less number of packet drop for important packet types as well as higher throughput and delivery rate. This is because, our transmitter queue is not based on FIFO method. Thus, highest priority is given to the important packets and they can be retransmitted multiple times compared to other type of packets. Our simulation results prove that the proposed scheme outperforms M-LAYER WSN in terms of packet delivery ratio, throughput and end to end delay. As part of our contribution, we proved that, significant packet delivery can be achieved by giving highest priority and the order in which the important packets are scheduled and forwarded.