First Out First Served Algorithm for Mobile Wireless Sensor Networks

Wireless Sensor Networks (WSNs) have recently gained tremendous attention as they cover a vast range of applications requiring an important number of sensor nodes deployed in the area of interest to measure physiological types of data and send it back to the base station for further analysis and treatment. Many routing protocols have been proposed to perform data routing towards the destination in accordance with energy consumption,end-to-end delay and throughput. In this paper,the First Out First Served algorithm for cluster based routing in Mobile Wireless Sensor Networks was presented. The algorithm aims to increase packet reception within the cluster in a highly constrained environment.The results prove the efficiency of the proposed algorithm in increasing the reception of data packets by the cluster head and enhancing the Radio CoefficientDiff parameter of the network. Keywords—MWSNs; WSN; Packet reception; energy consumption; convex area; Mobility Manager


I. INTRODUCTION
The recent evolution in electronic and robotics manufacturing has enabled the improvement of sensors architecture in order to work alongside additional devices such as actuators,which are capable of acting upon the physical environment.Such entities can be implemented to perform networking-related functionalities such as receiving ,transmitting, processing and relaying data towards the destination,they can also roam the network to some particular positions and proceed with data measurement in respect to the application requirements.A collection of these type of sensor networks constitutes a Mobile Wireless Sensor Networks (MWSNs).MWSNs [12][13] [ [17][18][19][20][21] present many advantages compared with static WSNs in terms of energy consumption;improved coverage and enhanced target tracking ,they can also include mobile sink nodes to reduce the network density to the maximum in addition to the overall network cost .Since the topology of MWSNs is constantly changing, performing data routing to the destination becomes a challenging task .WSN(Wireless Sensor Network)'s routing protocols are specifically designed for a static topology where paths establishment are performed in configuration phase or upon the occurrence of unpredictable events such as batteries depletion or sensor node location deviation.In general,the configuration phase consumes a considerable amount of energy,therefore, it is crucial to reduce the re-execution of this phase for a longer network lifetime,however when it comes to MWSNs ,the topology is changing rapidly leading to a constant network reconfiguration and a drastic energy completion in a short amount of time,another problem can be highlighted which refers to the important amount of packets being lost due to the frequent link dis-connectivity, hence it is plausible to propose a new routing paradigms to support the high mobility rate while mitigating the packet loss ration.In this article,the First Out First Served algorithm for cluster based routing in Mobile Wireless Sensor Networks was presented.FOFS algorithm aims to increase the network packet reception rate in a highly mobile environment.A detailed analysis of the forwarding connectivity condition is also presented in order to choose the forwarding sensor node that maintains the link connectivity between the sender and the receiver throughout the packet transmission time interval.

II. STATE OF THE ART
In recent research on wireless sensor networks, there has been an important focus on improving the communication between sensors by presenting new solutions related to QoS, MAC and routing protocols.Several solutions have been exploited from which the clustering approach were distinguished.M. Akbar et al. proposed in [1] a Mobile Balanced Energy-Efficient Network Integrated Super Heterogeneous (MBEEN-ISH), which is a hybrid protocol used in four-level heterogeneous WSN models.The protocol utilizes the benefits of both clustering and sinks mobility to maximize the network efficiency.It presents a new mathematical sink mobility model to maximize the network lifetime and guarantee a stabilized period.An improved version of LEACH named M-LEACH and LEACH-C have been proposed in order to take advantage of multi-hop routing and regulating cluster formation which have proven a better performance compared with LEACH.K. Thanigaivelu, and K. Murugan presented in [2] a novel clusterbased method.A Gridbased clustering (GBC) along with dual CHs are configured by a mobile sink node to achieve an enhanced energy balance in the network and prevent the energy hole problem for an extended network lifetime.D Seong et al. [3] proposed a novel mobile sink operation method in which the probe priority of the mobile sink is determined from data priority to increase the QoS.The authors used the mobile sink to reduce the routing hot spot.In [4],authors handled the mobility constraint by proposing an improved version of LEACH protocol named LEACH-Mobile, which consisted in adding the membership declaration to LEACH protocol so that to guarantee the addition of sensor nodes to a particular cluster during the steady state.The mean concept of LEACH Mobile protocol is to specify whether a sensor node is able to communicate with a cluster-head during its affected time slot, if no response has been received from the cluster-heard in a threshold interval, the sensor node is declared out of the cluster and will afterwards join a new cluster after receiving acknowledgment from its cluster head.The LEACH-Mobile protocol has being proven to outperform LEACH protocol in terms of packet reception rate but still has a high energy consumption due to the increased amount of control packets being sent.Jin Wang et al. [5] proposed an energy efficient routing algorithm to handle the sink mobility and increase the WSN lifetime for real time application.The mobile CHs collect data from the network before sending it to the sink node located in the center of the interest field.All moving CHs provide connection with the base station during the report.Three schemes are adapted to CHs movement to minimize communications and improve network lifetime.The requirement of resource-rich mobile CHs is the main limitation of this system.Another cluster based routing protocol named CBR Mobile-WSN was proposed in [6].It consisted in receiving data from cluster member and non-member sensor nodes.Cluster member send their data using TDMA mechanism whilst non-member sensor nodes can use a free time slot to communicate its data to the cluster head efficiently using the received signal strength parameter.CBR Mobile-WSN justified better flexibility when adapting to traffic rate and mobility changing characteristics.Moreover, it has been highlighted that packet loss reduction reaches a value equals to 25% compared to LEACH-Mobile routing protocol [7].Muhammad Ali Khan et al. [8] presented a fixed mobility based reactive protocol named Mobile Sink based Data Gathering Protocol (MSDGP), using a clustering based on the amount of sensed data and residual energy.MSDGP achieved less energy consumption and provided an extended network lifetime through implementing single message CH selection and introducing a mobile sink instead of static sink.By using greedy policy and dynamic programming, H. Zhao et al. [9] proposed a tree-based heuristic topology control algorithm, called MLS to maximize the network lifetime in large scale wireless sensor networks with mobile sinks.The algorithm introduces a predefined delay tolerance level in order for a sensor node to store data temporarily and transmit it to the mobile sink at the most suitable distance to achieve an extended network lifetime.F. Tashtarian et al. [10] studied how to determine a trajectory for a mobile sink without considering any predefined rendezvous points or virtual structures.The trajectory, which is named the Continuous and Optimal Trajectory (COT) makes a significant gain in terms of the network lifetime.M. Nabi et al. [11] proposed a MAC protocol (MCMAC) to support the cluster mobility for TDMA-based Medium Access Control (MAC) protocols in Wireless Sensor Networks (WSNs).MCMAC protocol exploits a hybrid contention free and contention-based communication approach to support cluster mobility.In [12],authors defined the Exploratory Coverage problem in Limited Mobility Sensor Networks that resolve the issue of the full exploration of the target area in respect to sensor range,coverage area, the number of sensors and the mobility.The problem has been designed and the simulation results demonstrated the impact of limited mobility on the overall area coverage,however,no insight has been given to insure successful packet delivery.Similary in [13],authors proposed a zone-based routing protocol (ZBRP) for WSNs based on the considered novel design space.ZBRP considers the features of unequal clustering and edge-based routing capabilities for optimal network resources usage.It aims to achieve a balanced energy consumption for both intracluster i.e inter-cluster communication and extends network lifetime by reducing the overall communication cost in the network.The proposed routing protocol distributes the load uniformly with proper cluster formation across the network and enhances the sensor network lifetime.However it remains unsuitable for MWSNs for no strategy has been taking place to tackle the problem of mobility.

III. THEORETICAL APPROACH OF CONNECTIVITY
A cluster has a radius β defined in terms of hops and it includes sensor nodes where the distance(in hops) is less than or equals to β,an example of such subdivision is presented in Fig. 1.As can be seen in Fig. 1,The cluster member size can be determined by changing the transmission power,in other words,when the transmission power of a sensor node is important,more sensor nodes tend to be included within the cluster and vice versa.The cluster members could maintain information of each other pro-actively using a limiteddepth,proactive link-state routing protocol.Correspondingly,the information about new routes discovery also routes maintenance can be made available via a family of reactive routing protocols.Therefore,the question to be asked is: how to find the itinerary towards the destination in a way that successful packet delivery is guaranteed to the cluster head node under the mobility constraint?In other words,what is the condition under which an intermediate node is selected in a way that packets can still be delivered when both sensor and cluster head nodes are mobile?In order to answer this question,three cases of the < source − destination > couple connectivity state are to be distinguished: the first case (Fig. 2) refers to the approximately null distance between the sensor and the receiver,in this case of study, the connectivity will be lost when the distance overcomes the communication range value dependently on the mobility model of sensors but most importantly the direction taken by both the sender and the receiver.The second case (Fig. 3) depicts the maximum distance at which both sensors remains connected,but once a value → 0 (where = 0) is added to the previous distance,the connectivity is completely lost which refers to the third case scenario where the distance gets bigger in respect to a particular sensor movement directions(Fig.4).In order to resolve the frequently interrupted connectivity,it is plausible to choose the most suitable forwarding sensor that will ensure packet delivery with respect to sensor mobility.For this,the area of coverage was redrawn in a way that all sensor nodes belonging to a convex full area where vertices refer to the sensor nodes in the extremist(see Fig. 5).For clarification purposes,Fig.6 presents a simplified version of a convex full area A where P i designates a vertex,S is the source node and D is the destination,it was proceeded to define a sub-area A j through which control packets are broadcasted in look for the destination D. The sub-area A j is defined as follows : where : • n refers to the number of sub-areas in the convex full, • S is a source node (the cluster head).
As previously mentioned,when sensor nodes are changing direction,either they get closer towards each other,or they head different directions but they stay within each other communication range, or they maintain different positions that lead to loss of connections after an x amount of time period being exceeded.A subdivision of the cluster into sub-areas was performed,so that to speed the convergence of data packet towards the destination by choosing a forwarding node that verifies the closest distance towards the furthest vertex of an area A j .The proposed method has the advantage that the search for the destination node is fast especially when it is located in the vicinity of areas vertices,moreover it reduces the number of packets roaming the network since only a small portion of sensor nodes are forwarding packets towards the destination,which will result in minimizing the number of packet been corrupted due to collision.The equation 4 refers to the condition that assures a successful delivery towards the destination,as previously mentioned,the destination can be a forwarding node or the destination itself.In order to choose the next node to forward packet to, the metric TPT was defined which refers to the round trip period located at the maximum distance.This main purpose is to guarantee a fast convergence to the destination by selecting the furthest sensor node from the source node but most likely the closest to destination.The definition of the round time packet transmission is relative to the path traveled to get to the end point.In fact,the destination location can be anywhere within the triangle SP i P j (see Fig. 8) or identical to the vertex P i i.e.P j .In this case of study,two definition of TPT were considered :the first definition consists in assuming that the length of the packet path is always below the maximum distance between the source node S and the vertex P i i.e.P j ,which can be represented as follows: (1) where : C R is the communication range,N i and N j are two sensor nodes and d thrj is the threshold above which the connection is lost between N i and N j .The transmission time of a packet can be estimated in accordance with the maximum distance towards the vertices of an area A j .The distance is then subdivided into small chunks of distances that equal to the maximum communication range.
The time needed to transmit data packet from one sensor node to another(T X T IM E) depends mainly on the physical data rate and the physical layer overhead while each sensor node will spend a duration equals to T IF S to switch from the transmission state to reception state upon transmitting a packet(see Fig. 7).The time of transmission is represented as follows: where : • T P T refers to round time packet transmission; • T X T IM E is the transmission time; • T IF S is the time needed to switch from RX to TR state The second definition of T P T m2 consists in : • Assuming that all sensor nodes are located within the triangle SP i P j .• Finding all non-cyclical paths between the two vertices P i and P j which include all sensor nodes.
In this case,the T P T m2 will then correspond to the average round time traveling of each path,which is supposed to be more than sufficient to represent the maximum T P T of a random sensor node in SP i P j .Therefore,the T P T definition is represented as follows : T P T = M ax(T P T m1 , T P T m2 ) Hence,in order for a communication to take place,this condition has to be verified: In this case of study,the border node can be identical to a previously defined border nodes as it can be referring to a recently defined border node which corresponds to the equation 4. The connectivity condition is repeated consecutively for each subarea A j ,and it is updated for each couple < N i , N j > of sensor nodes as follows : ( where i refers to the number of hops needed to reach the destination. The equation 5 highlights the dependency of the next destination node to be selected on the connectivity of the previously chosen border node,and this is maintained in ascendant way until the destination is found,in other words,the time required to look for the destination should be included within the time connectivity between the source node and the first border node to which packet is forwarded.The equation 5 can be reformulated with respect to T P T i (equation 6) so that at each stage of destination research,the determination of the border sensor node depends mainly on the connectivity between the sender and the receiver but also the previous round time packet transmission if it does exist.
The equation 6 proves the advantage presented by choosing a full convex area to proceed with the search for the destination (i.e. a cluster member).In fact,when the round transmission packet time was defined as being the maximum distance between the sender and the received,it is believed that this distance represents the maximum value that could separate two sensor nodes within the cluster It is also considered the case where the destination meets with a full convex area vertex.Once the maximum distance is extended to a certain extent, T P T i would never respect the condition of time connectivity.

A. Prerequisites :
• It is considered that all nodes are mobile and constantly changing directions with the same velocity .• It is also believe that the < S, D > path length is less than or equals to the maximum distance between the source node and the vertices of the area A i .• It is supposed that the time for packet processing is negligible compared to transmission time.

IV. FIRST OUT FIRST SERVED ALGORITHM FOR CLUSTER BASED ROUTING
In this section,much emphasis was put on regulating communication within a 1-hop cluster to handle the mobility constraint.As previously stated,when the sensors nodes are constantly changing location,the wireless link between the cluster head and the corresponding cluster members are frequently corrupted.Therefore,for a routing protocol that is based on TDMA mechanism,the overall performance is expected to degrade considerably,leading to a high packet loss.In order to resolve this issue,the First Out First Served algorithm is proposed,which purpose is to give priority of channel access to sensor nodes that are more likely to leave the communication range of the cluster head during data transmission.Hence,the first sensor to be out of the communication range is the first to be affected a time slot to transmit data to the CH.The algorithm is based on subdividing the timeline into equal superframes and the corresponding structure for the cluster head and the cluster member are presented in Fig. 9 and Fig. 10 respectively.The superframe is composed of three phases : the setup phase, the TDMA phase and the unslotted CSMA/CA phase.During the setup phase,the cluster head and its members are defined based on different parameters such as;the remained energy,the last round during which the sensor has been selected as a cluster head and the distance between the sensor and the base station.Several cluster head selection formulas have been presented in several research works described respectively in [14][15] [16],where the common goal is to choose the most suitable distribution of clusters that verifies an extended network lifetime and a high packet reception.The network lifetime refers to the time when the first or the %x of sensor nodes run out of energy.As can be seen in Fig. 9,the cluster head start by sending an advertisement packet to sensor nodes within its communication range.The setup phase duration can be adjusted by the user.Furthermore,the chosen duration aims to guarantee a vast reception of the advertisement packet by the sensors nodes in order to construct an x-hop cluster.During this phase(see Fig. 10),a cluster member receives one or multiple advertisement packets from which the closest cluster head is selected.The TDMA phase is composed of multiple slots where each slot is affected to a particular sensor node to transmit data or management packet.The last phase i.e.Unslotted CSMA/CA is used to transmit data packet from new sensor nodes joining the cluster during TDMA phase and to proceed with data transmission by the cluster members.The time needed by each cluster member during this phase depends on the length of data to be transmitted.The TDMA phase is preceded with a mini-slot where the collected data is aggregated to be forwarded to the base station.The unslotted CSMA/CA phase can be set to inactive,therefore all sensor nodes composing the cluster can put their transceiver off to lower the energy consumption for an extended period of time.A new round starts after completion of the first one and a new set of clusters is constructed.

A. First Out First Served functioning mechanism
As previously stated,in order for the communication between the cluster head and the cluster member to take place,the condition presented in equation 4 has to be verified.A number of real case scenarios consider that the sender and the receiver have different mobility models,therefore d thri .V elocity value will constantly change dependently on the pr-established path designated for each deployed sensor.In this case study,a random mobility model is considered where all possible mobility models have the same probability to occur.In order to tackle the issue of connectivity,a regular verification of sensor nodes locations is considered.As described in Algorithm 1,when a cluster head send an advertisement packet,a joint packet is received from sensor nodes in the vicinity.The packet contains the current location coordinates.Based on the received informations,the cluster head defines the set of distances Distance Set i away from the cluster members.The Distance Set i is sorted afterwards in descending order so that to give priority of time slot assignment to sensor nodes that are more likely to leave the communication range of the cluster head while being affected a time slot.During the  TDMA phase,the cluster members might loose their connectivity to the cluster head, or a new sensor node might join the cluster.Therefore,it is crucial to handle packet loss and allow incoming sensors to transmit their corresponding data packets.To this end,a Slot CH is dedicated to the CH during the TDMA phase so that to broadcast the current location coordinates.The ranking of the affected slot is determined with respect to the communication range C R of the cluster head and the average distance between the cluster member and the cluster head.The formulas is defined as follows : During Slot CH ,the cluster members set their transceivers to the reception mode to receive information related to the cluster head location coordinates and cluster size.If a cluster member doesn't receive the packet,then the connectivity is considered lost or a collision with sensors belonging to other clusters has been taken place.The third phase is automatically activated and the sensor will contend for the channel using the unslotted CSMA/CA mechanism [15] in order to transmit data packets.If a sensor node receives the packet from another cluster head then data packets are broad-casted to multiple cluster heads.This may cause packet redundancy but will guarantee a successful data packet reception in a highly critical environment.The unslotted CSMA/CA phase is also activated when sensor nodes have more data packets to be sent.After completion of data transmission,the transceiver is set to sleep mode until the next round so that to reduce the energy consumption.

V. SIMULATION SETUP
The simulations were performed in OMNET++ based simulation framework named Castalia 3.3 designed for WB-SNs and WSNs.Three metrics were used to evaluate the efficiency of the proposed approach: the average energy consumption,Radio Coef f icient Dif f and the average packet received by the cluster head (AP R CH).The Radio Coef f icient Dif f is defined as follows : Calculate the ranking of the cluster head slot during which the location coordinates and the cluster size are broadcasted.Slots away is defined according to Avg Dist i and the communication range of the cluster head.The packet generation rate is constant and equals to 5 pps (packets/sec).The initial energy level of each sensor node is assumed to be 18720J.The average temporal variation of the channel and the path loss map are defined in Castalia distribution (pathLossMap.txtand TemporalModel.txt).The radio reception mode is set to high which is equivalent to 1024 for data rate (kbps), DIFFQPSK modulation type, bandwidth (MHz), sensitivity (dBm) and power consumed (mW) equal respectively to: 20,-87 and 3.1.The size of the deployed sensors was varied to highlight their impact on the aforementioned metrics.
As can be seen in Fig. 11  As can be seen in Fig. 11, F OF S algorithm shows a better performance compared with the cluster based algorithm, as the Radio Coef f icient Dif f (which corresponds to FOFS algorithm)is greater than the Cluster based one with respect to the number of deployed sensors.
In Fig. 13, the average packets received by the cluster heads is highlighted with respect to the average number of deployed sensors.As can be seen in Fig. 13, there is no correlation between the number of deployed sensors and AP R CH,which is relevant to the random mobility model of the deployed sensors.F OF S algorithm increases the number of packets received by the cluster head compared with the Cluster Based algorithm.This behavior was expected as F OF S algorithm allows more data and management packets to be transmitted during the U nslotted CSM A/CA phase.Furthermore, the connectivity between the cluster heads and their cluster members is constantly verified to determine whether the cluster members need to activate their U nslotted CSM A/CA phase due to wireless link interruption.This enhances the successful packet reception and allows non-cluster members (i.e.sensors joining the cluster during the TDMA phase) to send their corresponding data to the new CH after reception of Slot CH .Fig. 12 presents the average energy consumption of F OF S and Cluster Based algorithms.F OF S algorithm consumes a slightly more energy compared to Cluster B ased algorithm in respect of the average number of deployed sensor nodes.The maximal energy consumed by F OF S algorithm is equal to 6.66 mw compared with 6.53 mw for Cluster B ased algorithm.Moreover,when the number of deployed sensors increases,the average energy consumption decreases,this behavior is related to the transceiver state.In fact, the radio model used in the simulation is CC2420 which consumes 62mw when the transceiver is in the reception state versus 57.42 mw in case of transmission state.The transceivers transmission power is correlated to energy of transmission and the frequent transmission from one state adds a considerable amount to the overall energy consumption.Based on the radio model characteristics, its deducted that a network where sensor nodes are in the reception state for a prolonged period of time will eventually consume more energy compared with a very active network.The high mobility of the sensor nodes obstructs maintaining the established clusters intact during the same round.Hence, at a time t i , a sensor node may be either an isolated node or a node that belongs to one or many clusters with a specific role.Therefore,when the number of deployed sensor nodes increases,more sensors are in the transmission state,which reduces the overall energy consumption in the network.The Cluster Based algorithm allows the cluster members to put their transceivers into the sleep state for the rest of the round period in order to save the energy of the storage battery, as opposed to the F OF S algorithm which activates the U nslotted CM SA/CA,hence more energy is consumed.

VI. CONCLUSION
Many routing protocols have been conceived to resolve the mobility issue in mobile wireless sensor networks.The clusterbased routing protocols is considered as a subtype category of routing protocols which represents a basic design to develop routing protocols destined to overcome WSN challenges with the existence of the mobility constraint.The ongoing study focuses on presenting a new cluster based algorithm to enhance the performance of MWSN in terms of packet reception in a very constrained environment.A detailed analysis of the forwarding connectivity condition is also presented in order to choose the forwarding sensor node that is most suitable to maintain connectivity between the sender and the receiver.The connectivity condition can be integrated in the routing process as a separate cross layer module.It can be generalized to include other types of routing protocols where the mobility is considered as a real issue to tackle.As a future work,the structure of the FOFS algorithm will be enhanced to include xhop clusters.A trade-off balance has to be found between the energy consumption and end-To-end latency in a very mobile environment.It is also believed that the proposed approach can also be extended to include Adhoc networks where nodes are highly mobile.

Fig. 1 .
Fig. 1.The routing zone of node S

Fig. 2 .Fig. 3 .
Fig. 2. The distance between the sender and the receiver is approximately null

Fig. 4 .
Fig. 4.Both sensor nodes are out of range

Fig. 6 .
Fig. 6.A simplified version of a convex full area

Fig. 7 .
Fig. 7. Abstract assumption of T P Tm 1 from S to the destination P i i.e.P j

Fig. 8 .
Fig. 8. Abstract assumption of T P Tm 2 from S to the destination P i i.e.P j
where : State ∈ {A, B, C, D} and; (A) RxReachedNoInterference: indicates the average number of successfully packet received without interference (B) RxReachedInterference: refers to the average number of packets received with possible interference.(C) RxFailedInterference: indicates the average number of packets failed because of interference.(D) RxFailedNoRxState: refers to the average packets received due to the non reception state of the transceiver.

Fig. 11 .
Fig. 11.Radio Coef f icient Dif f of F OF S and cluster based algorithms

Fig. 12 .
Fig. 12.The average energy consumption of F OF S and cluster based algorithms

Fig. 13 .
Fig. 13.The average number of received packet by the Cluster heads Algorithm 1 Definition CH i : designates a cluster head i.Cluster i : designates the cluster i .SN : corresponds to the number of sensor nodes in the network.CM i :indicates the set of cluster members with CH i as cluster head.N um CM i : designates the number of cluster members with CH i as cluster head.Distance Set i : indicates the set of distances between the cluster head CH i and the cluster member CM i for s = 1 to CM i do Defining the set of distances Distance Set i Compute the distance between CM i and the sensor node s.Insert dist(s,CH i) into Distance Set i end for Sort(Distance Set i ) Sort the computed set of distances in descending order.Define Avg Dist i ;the average distance with respect to cluster size.Define Slots away;