30
sensors Article Interference Effects Redress over Power-Efficient Wireless-Friendly Mesh Networks for Ubiquitous Sensor Communications across Smart Cities Jose Santana 1,2, * ID , Domingo Marrero 1,3, *, Elsa Macías 1,3 , Vicente Mena 1,2 and Álvaro Suárez 1,3 ID 1 Grupo de Arquitectura y Concurrencia (GAC), Instituto Universitario de Ciencias y Tecnologías Cibernéticas (IUCTC), Universidad de Las Palmas de Gran Canaria, 35017 Las Palmas de Gran Canaria (ULPGC), Spain; [email protected] (E.M.); vicenteefi[email protected] (V.M.); [email protected] (Á.S.) 2 Departamento de Señales y Comunicaciones (DSC), Universidad de Las Palmas de Gran Canaria, 35017 Las Palmas de Gran Canaria (ULPGC), Spain 3 Departamento de Ingeniería Telemática (DIT), Universidad de Las Palmas de Gran Canaria, 35017 Las Palmas de Gran Canaria (ULPGC), Spain * Correspondence: [email protected] (J.S.); [email protected] (D.M.) Received: 10 May 2017; Accepted: 19 July 2017; Published: 21 July 2017 Abstract: Ubiquitous sensing allows smart cities to take control of many parameters (e.g., road traffic, air or noise pollution levels, etc.). An inexpensive Wireless Mesh Network can be used as an efficient way to transport sensed data. When that mesh is autonomously powered (e.g., solar powered), it constitutes an ideal portable network system which can be deployed when needed. Nevertheless, its power consumption must be restrained to extend its operational cycle and for preserving the environment. To this end, our strategy fosters wireless interface deactivation among nodes which do not participate in any route. As we show, this contributes to a significant power saving for the mesh. Furthermore, our strategy is wireless-friendly, meaning that it gives priority to deactivation of nodes receiving (and also causing) interferences from (to) the rest of the smart city. We also show that a routing protocol can adapt to this strategy in which certain nodes deactivate their own wireless interfaces. Keywords: ubiquitous sensing; wireless-friendly; interference; power saving; portable mesh network; smart city 1. Introduction In smart cities the availability of ubiquitous sensor communications is essential, but the use of a flexible and portable network for transporting the sensed data is also key. A Wireless Mesh Network (WMN) [1,2] is a key technology in current wireless communications which fulfils this aim. It is arranged into a set of devices (user terminals or linking interfaces) whose interconnections are wireless and organized in a lattice structure. The International Electrical and Electronic Engineering (IEEE) association has developed different standards, especially IEEE 802.11 for Wireless Fidelity (WiFi) or IEEE 802.15 for Wireless Sensor Networks (WSNs), among others. They are generally deployed in an ad-hoc mode, depending on the requirements, and can be used as a means of transport for data from end users and specially for interconnection of subnetworks whose distance or difficult access require wireless connectivity. Often communication sources can be directly linked to mesh nodes, e.g., user smartphones cooperating in a shared task. In some solutions for smart cities there already exist different proposals for facilitating both mobile collaborative sensing and sensed data access, so the collected information can be processed and shared by all the users. As stated above, Sensors 2017, 17, 1678; doi:10.3390/s17071678 www.mdpi.com/journal/sensors

Interference Effects Redress over Power-Efficient Wireless ... · An OLSRd plug-in allows the application level to inject user defined packets (type 200) in intermediate nodes using

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

  • sensors

    Article

    Interference Effects Redress over Power-EfficientWireless-Friendly Mesh Networks for UbiquitousSensor Communications across Smart Cities

    Jose Santana 1,2,* ID , Domingo Marrero 1,3,*, Elsa Macías 1,3, Vicente Mena 1,2 andÁlvaro Suárez 1,3 ID

    1 Grupo de Arquitectura y Concurrencia (GAC), Instituto Universitario de Ciencias y TecnologíasCibernéticas (IUCTC), Universidad de Las Palmas de Gran Canaria, 35017 Las Palmas de GranCanaria (ULPGC), Spain; [email protected] (E.M.); [email protected] (V.M.);[email protected] (Á.S.)

    2 Departamento de Señales y Comunicaciones (DSC), Universidad de Las Palmas de Gran Canaria,35017 Las Palmas de Gran Canaria (ULPGC), Spain

    3 Departamento de Ingeniería Telemática (DIT), Universidad de Las Palmas de Gran Canaria,35017 Las Palmas de Gran Canaria (ULPGC), Spain

    * Correspondence: [email protected] (J.S.); [email protected] (D.M.)

    Received: 10 May 2017; Accepted: 19 July 2017; Published: 21 July 2017

    Abstract: Ubiquitous sensing allows smart cities to take control of many parameters (e.g., road traffic,air or noise pollution levels, etc.). An inexpensive Wireless Mesh Network can be used as an efficientway to transport sensed data. When that mesh is autonomously powered (e.g., solar powered), itconstitutes an ideal portable network system which can be deployed when needed. Nevertheless,its power consumption must be restrained to extend its operational cycle and for preserving theenvironment. To this end, our strategy fosters wireless interface deactivation among nodes whichdo not participate in any route. As we show, this contributes to a significant power saving for themesh. Furthermore, our strategy is wireless-friendly, meaning that it gives priority to deactivationof nodes receiving (and also causing) interferences from (to) the rest of the smart city. We alsoshow that a routing protocol can adapt to this strategy in which certain nodes deactivate their ownwireless interfaces.

    Keywords: ubiquitous sensing; wireless-friendly; interference; power saving; portable mesh network;smart city

    1. Introduction

    In smart cities the availability of ubiquitous sensor communications is essential, but the useof a flexible and portable network for transporting the sensed data is also key. A Wireless MeshNetwork (WMN) [1,2] is a key technology in current wireless communications which fulfils this aim.It is arranged into a set of devices (user terminals or linking interfaces) whose interconnections arewireless and organized in a lattice structure. The International Electrical and Electronic Engineering(IEEE) association has developed different standards, especially IEEE 802.11 for Wireless Fidelity (WiFi)or IEEE 802.15 for Wireless Sensor Networks (WSNs), among others. They are generally deployedin an ad-hoc mode, depending on the requirements, and can be used as a means of transport fordata from end users and specially for interconnection of subnetworks whose distance or difficultaccess require wireless connectivity. Often communication sources can be directly linked to meshnodes, e.g., user smartphones cooperating in a shared task. In some solutions for smart cities therealready exist different proposals for facilitating both mobile collaborative sensing and sensed dataaccess, so the collected information can be processed and shared by all the users. As stated above,

    Sensors 2017, 17, 1678; doi:10.3390/s17071678 www.mdpi.com/journal/sensors

    http://www.mdpi.com/journal/sensorshttp://www.mdpi.comhttps://orcid.org/0000-0002-9215-7392https://orcid.org/0000-0002-9085-8398http://dx.doi.org/10.3390/s17071678http://www.mdpi.com/journal/sensors

  • Sensors 2017, 17, 1678 2 of 30

    typical sensed data are generated by smartphone sensors (such as Global Positioning System (GPS)receivers, accelerometers, cameras and several others) but also from different sources like presencesensors (those which usually activate lighting). Whatever mission a WMN has (a traditional transportnetwork, a network for sensing capable stations, or a sensor network), it entails multiple challengessuch as routing, throughput, range of operation, power saving, adaptability, stability, and robustness,among others.

    Some technologies at the link level have been proposed to implement WMNs [3] in differentenvironments. The IEEE 802.11s [4] standard is normally used in wide area WMNs deployed in citiesor places of similar area. WiFi routers and Access Points (APs) have been proposed to implement suchWMNs [5]. We will call them hereafter Mesh Access Points (MAPs).

    WMNs can be deployed in very large numbers in different domains [6], e.g., a smart city [7]in which the WMN is configured as a backbone that transports a variety of traffic including sensordata [8], and multimedia [9], among others, but there are still several challenges to convert them into asuitable infrastructure in some domain applications. Next we review some of them.

    An efficient channel assignment in WMN [10] improves its throughput considerably. The optimalassignment is not efficient or impossible when there will be uncontrolled external aspects presentaround the WMN, e.g., the interferences caused by external APs and other wireless devices ownedby a third party. Those devices can be commonly deployed statically or sometimes dynamically(e.g., massive usage of mobile telephones with tethering technology as in [11]).

    Channel interferences or collisions in current cities [12], where dense WiFi networks are deployed,could be a hard problem for IEEE 802.11s- or WiFi-based WMNs. WiFi interferences penalize greatlydata communication due to the fact wireless channels would be busy communicating signalling. Therouting is a key parameter to obtain the connectivity among MAPs [13]. Optimized Link State Routing(OLSR) [14] is a routing protocol used in Mobile Ad Hoc NETworks (MANETs), but it also can beused in WMNs, as well as Hierarchical OLSR (HOLSR) [15]. When a strong pattern of collisions orinterferences, signal or packet loss, connection drops, or even service disruptions [16] occur in a MAP,its suitability for relaying the packets of any route will be compromised. In that case, the routingprotocol must rapidly set up a new route in order to maintain the connectivity of the network.

    Energy saving in WMNs is another important challenge [17] as recognized in [18], but it is also adriving force behind sustainable solutions for smart cities [19–24]. We have presented various methodstargeting power saving in different areas [25,26], considering setting up and taking down the wirelessinterfaces of the MAPs whenever possible. We showed that a significant amount of power could besaved by this. In this sense we are aligned with one of the main challenges of smart cities [27].

    The challenges mentioned above are applicable to any WMN, but we will focus on WiFi-basedWMNs viewed as a ubiquitous, portable, and scalable solution for any deployment requirement;targeting to allow end users to access sensing data, which are directly delivered by MAPs. Unlikemajor WSNs (based on Zigbee or IEEE 802.15.4), our network model overcomes their restrictions byextending their range of operation, rate and compatibility. Thus we will call it Portable Wireless-friendlyMesh Network for Sensors (PWMNS), which is conceived as a communication backbone, as well as asource and sink, for sensor data traffic in a smart city.

    In [25,26] we reviewed power saving works from other authors that are complementary to ourmechanism. In this paper we extend our previous works [25,26] considering a new strategy to set upand take down down the WiFi interfaces of MAPs. The strategy includes taking these WiFi interfacesdown whenever a MAP detects a moderate level of interference from the other MAPs or external WiFidevices. We present new algorithms, protocol implementation and software architecture to accomplishthis strategy. We also performed a simulation on new parameters measuring the obtained interferenceredress and power saving. Finally we obtained experimental results on a testbed after applying ourstrategy. In addition to obtain a power saving (like in [25,26]), we also redress the adverse effects ofinterferences inside the PWMNS and in external surrounding WiFi devices.

  • Sensors 2017, 17, 1678 3 of 30

    The rest of the paper is organized as follows: in Section 2 we present the background on relatedand previous works. Section 3 presents our system architecture for supporting sensor data traffic in asmart city. Section 4 sketches the mechanism and protocol for a MAP to controllably set its wirelessinterface up and take it down. Section 5 formalizes the interference redress and the power savingdegrees achieved by the PWMNS; and simulation results shows that deactivation and activation ofMAPs wireless interfaces can allow both redressing the effects of interferences, as well as powersavings when they are not required in any route. Then, in Section 6, we present the experimentalresults over a test platform based on Raspberry Pi (RPi) [28]. Finally, conclusions are presented inSection 7.

    2. Background and Related Work

    Wireless networks are prone, by nature, to suffer from broken end to end communication service.This is due to the intrinsic nature of wireless communication channels that can randomly fade off (thereis no way to exactly know in advance when it will faded off), support a high number of active servicesdemanding a high bandwidth, or be subject to strong interferences from other channels or strongcollision patterns. All those characteristics could reduce significantly the end to end throughputto the extent that affected MAPs (hereinafter interfered MAPs) links could be broken. A verystrong interference of the above characteristics could produce an end to end communication serviceinterruption. This provokes a headache for users consuming multimedia information (streaming), butcould be also a big problem for traffic from critical sensors in a smart city (machine to machine ormachine to human types of communication).

    Solutions to the above problem are not simple to obtain, because it requires several levels of thenetwork architecture to cooperate in the solution. That is, it is impossible to solve this problem onlyat the physical and link level. In general, cross layer techniques have to be applied [29]. We haveworked in solutions to this problem for MANETs where over time the communication nodes candynamically enter and leave the coverage area [30]. Briefly, in the intermediate nodes of the MANETwe deployed the OLSR protocol. We configured the OLSR daemon (OLSRd) to calculate the optimalroutes defined as the number of attempts by a node on average to successfully transmit a packet to adestination, instead of the number of hops. Using OLSRd, a node can detect changes in the connectivityto its neighbours by injecting and receiving HELLO messages periodically. OLSR is able to quicklyreconfigure path breaks using an efficient flooding of control traffic. OLSR messages are not duplicatedthanks to its multipoint relays. Finally OLSRd diffuses the topological information necessary to obtainoptimal routes in terms of number of hops (this information is periodically renewed). An OLSRdplug-in allows the application level to inject user defined packets (type 200) in intermediate nodesusing a default forwarding algorithm [31]. Spreading those messages the application can control thepath breaks and interference by reconfiguration of the path. We call that application disruption controlrelay (dcr). In [32] it is shown that OLSR and HOLSR are efficient enough to reconfigure broken paths,in real time, for streaming services. In [33] it is shown that OLSR can be efficiently used to deployWMNs over long distances supporting traffic of emergency critical applications in case of naturaldisasters. In [34] a routing algorithm based on OLSR for finding the best routes according the qualityof WiFi links was presented. The simulation results are better than using the Expected TransmissionCount metric, but they do not show that this will be optimal for dense networks. For Voice over InternetProtocol (VoIP) [35] efficient policies to assure the low delay data delivery and balancing the trafficamong APs are required. We do not deal with these special requirements explicitly. An optimization ofOLSR for heterogeneous WMN (APs have multiple wireless interfaces) is the Unified Routing Protocol(URP) that eliminates the redundant diffusion broadcast messages of OLSR [36]. Simulation resultsin [37] showed that URP is better than OLSR. We do not explicitly consider heterogeneous WMNs, butin case URP allows the usage of dcr it could be easy to contemplate this.

    According to the above examples of application of OLSR to MANETs and WMNs for differenttypes of traffic, we argue that it is efficient to set up or take down the wireless interfaces of the MAPs

  • Sensors 2017, 17, 1678 4 of 30

    affected by external interferences, and rebuild broken routes efficiently. In the following sections wediscuss the main idea about how to apply OLSR and dcr to our wireless network.

    In any WiFi network, a MAP could degenerate into a bottleneck when it is affected by interferences,overlapped channels or collisions. To reduce this possibility, we propose to deactivate its wirelessinterface as long as the interference is present. Furthermore, we consider applying the mechanismpresented in [25,26] as part of this proposal, so that the power savings are increased as well at the sametime the negative effects of interferences are redressed.

    3. System Architecture

    Any MAP can be marked as (externally wireless) interfered by testing various measures likebeacon detection (in the same or overlapped channels) from external sources, increased channel accesstime, delays, loss of connectivity, service disruptions, or any other criterion. As stated in Section 1,when a MAP is strongly interfered by external factors, the routing protocol is responsible for redressingtheir effects. On the other hand, in our background of a backbone delivering a low-requirementsensor-data traffic, it is common for many nodes not to be linked to any active route (hereinafterunused nodes). Our proposed approach intends to take the wireless interfaces of both unused andinterfered nodes down. Thus we reach some power savings, as well as interference redress, whenmanaging the routing protocol to prioritize the MAPs not (or only moderately) interfered. This allowsfor redressing external moderated interference which may ballast the PWMNS traffic in the long term,or furthermore, the reverse interference of PWMNS over external devices of the smart city. This latterredress justifies the term wireless friendly [38] in our PWMNS acronym.

    We show, in Figure 1, a general system-architecture for implementing the communication in asmart city using a single ubiquitous, portable and easily deployable in different contexts mesh-network.We consider accesses from sensing sources linked to any MAP to Internet or any output device.

    Sensors 2017, 17, 1678 4 of 29

    affected by external interferences, and rebuild broken routes efficiently. In the following sections we discuss the main idea about how to apply OLSR and dcr to our wireless network.

    In any WiFi network, a MAP could degenerate into a bottleneck when it is affected by interferences, overlapped channels or collisions. To reduce this possibility, we propose to deactivate its wireless interface as long as the interference is present. Furthermore, we consider applying the mechanism presented in [25,26] as part of this proposal, so that the power savings are increased as well at the same time the negative effects of interferences are redressed.

    3. System Architecture

    Any MAP can be marked as (externally wireless) interfered by testing various measures like beacon detection (in the same or overlapped channels) from external sources, increased channel access time, delays, loss of connectivity, service disruptions, or any other criterion. As stated in Section 1, when a MAP is strongly interfered by external factors, the routing protocol is responsible for redressing their effects. On the other hand, in our background of a backbone delivering a low-requirement sensor-data traffic, it is common for many nodes not to be linked to any active route (hereinafter unused nodes). Our proposed approach intends to take the wireless interfaces of both unused and interfered nodes down. Thus we reach some power savings, as well as interference redress, when managing the routing protocol to prioritize the MAPs not (or only moderately) interfered. This allows for redressing external moderated interference which may ballast the PWMNS traffic in the long term, or furthermore, the reverse interference of PWMNS over external devices of the smart city. This latter redress justifies the term wireless friendly [38] in our PWMNS acronym.

    We show, in Figure 1, a general system-architecture for implementing the communication in a smart city using a single ubiquitous, portable and easily deployable in different contexts mesh-network. We consider accesses from sensing sources linked to any MAP to Internet or any output device.

    Figure 1. System architecture for sensor data traffic in a smart city.

    Our ubiquitous and portable network is composed of a set of MAPs with at least WiFi connectivity to the other MAPs. Although any routing algorithm could be used [39–41], OLSR is our candidate (as explained in Section 2) because it has been tested for heterogeneous traffic in MANETs and WMNs. One of the MAPs could have external connectivity, e.g., a wired connection or through a conventional radio access network like General Packet Radio Service (GPRS) or Long Term Evolution (LTE). These MAPs will be considered communication sinks.

    Figure 1. System architecture for sensor data traffic in a smart city.

    Our ubiquitous and portable network is composed of a set of MAPs with at least WiFi connectivityto the other MAPs. Although any routing algorithm could be used [39–41], OLSR is our candidate (asexplained in Section 2) because it has been tested for heterogeneous traffic in MANETs and WMNs.One of the MAPs could have external connectivity, e.g., a wired connection or through a conventionalradio access network like General Packet Radio Service (GPRS) or Long Term Evolution (LTE). TheseMAPs will be considered communication sinks.

  • Sensors 2017, 17, 1678 5 of 30

    It is a challenging task to develop a proposal for improving the behaviour of any wirelessnetwork towards external interferences. We focus our approach on wireless networks which onlysupport reduced or relatively low-rate sensor data traffic. This simplifies MAPs operation, especiallyin connectivity, packet routing, and managing their wireless interface activation and deactivation.Figure 2 illustrates the specific approach which we will follow. It shows various data sources fromdifferent sensors. Likewise, it can be observed that several external interferences are influencing MAP5and this could cause adverse effects on the traffic supported by the routes which use this node thatwe want to redress. Several measures made in real networks [42] and extended in Section 6 verify theinterfering effects among different networks sharing the same technology.

    Sensors 2017, 17, 1678 5 of 29

    It is a challenging task to develop a proposal for improving the behaviour of any wireless network towards external interferences. We focus our approach on wireless networks which only support reduced or relatively low-rate sensor data traffic. This simplifies MAPs operation, especially in connectivity, packet routing, and managing their wireless interface activation and deactivation. Figure 2 illustrates the specific approach which we will follow. It shows various data sources from different sensors. Likewise, it can be observed that several external interferences are influencing MAP5 and this could cause adverse effects on the traffic supported by the routes which use this node that we want to redress. Several measures made in real networks [42] and extended in Section 6 verify the interfering effects among different networks sharing the same technology.

    Figure 2. MAP5 is being interfered generating service disruptions due to traffic from building B.

    Figure 2 illustrates how these interferences can affect any MAP in a PWMNS. MAP5 is being interfered by the WiFi devices from building B while it is being used to transport packets between MAP6 and MAP4. Our mechanism will intend to redress these interferences by setting MAP5 wireless interface down. This mechanism will also be applied to any other MAP which are not being used in any route, in order to increase the PWMNS power saving. Although the interference problem can also be solved using other different techniques such as load balancing [43], or multipath routing [44]; we focus on it from a different point of view. Furthermore, unlike [43,44], we also adopt the objective of achieving a certain level of power saving.

    4. The Up/Down Mechanism of WiFi MAPs

    In this Section we describe a proposal for redressing the effects caused by external interferences on MAPs as well as simultaneously reducing power consumption. We consider that, under certain interfering conditions, a MAP could exclude itself from its PWMNS. Specifically, the affected MAP would request the PWMNS to take its wireless interface down. It is important to remark that we do not propose turning the MAP completely off, but only deactivating its wireless interface to the PWMNS. This action also involves power savings as well as a possible traffic rerouting.

    4.1. State Diagram

    In Table 1, we define the different states we will consider on any MAP from the power consumption point of view. Under the MAP_OFF_s state, the MAP does not have any consumption; but will also not be able to autonomously reactivate itself to participate in any PWMNS route again. In an IFACE_DOWN_s state, the MAP is saving the power required to communicate through its wireless interface; but will be able to set its wireless interface up at any time. Finally, under MAP_ON_s state, the MAP is consuming both the power required for its autonomous operation and its wireless interface to transmit and receive.

    Figure 2. MAP5 is being interfered generating service disruptions due to traffic from building B.

    Figure 2 illustrates how these interferences can affect any MAP in a PWMNS. MAP5 is beinginterfered by the WiFi devices from building B while it is being used to transport packets betweenMAP6 and MAP4. Our mechanism will intend to redress these interferences by setting MAP5 wirelessinterface down. This mechanism will also be applied to any other MAP which are not being used inany route, in order to increase the PWMNS power saving. Although the interference problem can alsobe solved using other different techniques such as load balancing [43], or multipath routing [44]; wefocus on it from a different point of view. Furthermore, unlike [43,44], we also adopt the objective ofachieving a certain level of power saving.

    4. The Up/Down Mechanism of WiFi MAPs

    In this Section we describe a proposal for redressing the effects caused by external interferenceson MAPs as well as simultaneously reducing power consumption. We consider that, under certaininterfering conditions, a MAP could exclude itself from its PWMNS. Specifically, the affected MAPwould request the PWMNS to take its wireless interface down. It is important to remark that we do notpropose turning the MAP completely off, but only deactivating its wireless interface to the PWMNS.This action also involves power savings as well as a possible traffic rerouting.

    4.1. State Diagram

    In Table 1, we define the different states we will consider on any MAP from the powerconsumption point of view. Under the MAP_OFF_s state, the MAP does not have any consumption;but will also not be able to autonomously reactivate itself to participate in any PWMNS route again.In an IFACE_DOWN_s state, the MAP is saving the power required to communicate through itswireless interface; but will be able to set its wireless interface up at any time. Finally, under MAP_ON_s

  • Sensors 2017, 17, 1678 6 of 30

    state, the MAP is consuming both the power required for its autonomous operation and its wirelessinterface to transmit and receive.

    Table 1. Different MAP states from the power consumption point of view.

    State Name MAP Wireless Interface Is Full MAP System Is

    MAP_OFF_s down off (it does consume no power)IFACE_DOWN_s down on and its wireless interface is down

    MAP_ON_s up on and its wireless interface is up

    In compliance with both our power saving and interference redressing targets, MAPs inMAP_ON_s state (under certain conditions) will change their state to IFACE_DOWN_s. However,MAPs cannot be in this state for a long time, because they can be necessary as alternative routes in thePWMNS and, furthermore, the interferences’ effects could have disappeared.

    We propose that there should be a compromise between node availability and consumption.Regarding the power savings involved in this process, they depend on that amount of time spentin IFACE_DOWN_s state. Hence, in addition to only considering the wireless interface deactivationwhen interferences appear, we also suggest applying our proposal in [25]; in order for the intermediatenodes (neither source nor sink) to repeatedly change from MAP_ON_s to IFACE_DOWN_s states. Thusthe power savings will be greater than if only applied when those nodes are interfered.

    After a node enters an IFACE_DOWN_s state it must return to the MAP_ON_s state, so that thenode can check if it is required in any route. Hereinafter, we will refer this node as an inactive node; incontrast to any other node maintaining MAP_ON_s state, which we will refer as active node. Thosemodes of operation are illustrated in the state diagram of Figure 3. It shows two states correspondingto the 2nd and 3rd entries in Table 1. It is also indicated the conditions and exit values for everytransition in the form condition/variable = exit_value. We must highlight the Boolean downabilityconditioning-variable D(t), which indicates whether the node will become inactive at instant to + tUPor not. Hence, it is possible to transition from IFACE_DOWN_s state to MAP_ON _s state when tDOWNseconds have elapsed since reference instant to; and then to will be updated to the current instant.From the MAP_ON _s state both possible transitions require tUP seconds to have elapsed since the toreference instant (and then to will be updated to the current instant), but if the node is downable, i.e.,D(t) = true, it must transition to the IFACE_DOWN_s state; and otherwise, i.e., D(t) = false, the node isto be used in any route and so it will remain in its MAP_ON_s state.

    Sensors 2017, 17, 1678 6 of 29

    In compliance with both our power saving and interference redressing targets, MAPs in MAP_ON_s state (under certain conditions) will change their state to IFACE_DOWN_s. However, MAPs cannot be in this state for a long time, because they can be necessary as alternative routes in the PWMNS and, furthermore, the interferences’ effects could have disappeared.

    Table 1. Different MAP states from the power consumption point of view.

    State Name MAP Wireless Interface Is Full MAP System Is MAP_OFF_s down off (it does consume no power)

    IFACE_DOWN_s down on and its wireless interface is down MAP_ON_s up on and its wireless interface is up

    We propose that there should be a compromise between node availability and consumption. Regarding the power savings involved in this process, they depend on that amount of time spent in IFACE_DOWN_s state. Hence, in addition to only considering the wireless interface deactivation when interferences appear, we also suggest applying our proposal in [25]; in order for the intermediate nodes (neither source nor sink) to repeatedly change from MAP_ON_s to IFACE_DOWN_s states. Thus the power savings will be greater than if only applied when those nodes are interfered.

    After a node enters an IFACE_DOWN_s state it must return to the MAP_ON_s state, so that the node can check if it is required in any route. Hereinafter, we will refer this node as an inactive node; in contrast to any other node maintaining MAP_ON_s state, which we will refer as active node. Those modes of operation are illustrated in the state diagram of Figure 3. It shows two states corresponding to the 2nd and 3rd entries in Table 1. It is also indicated the conditions and exit values for every transition in the form condition/variable = exit_value. We must highlight the Boolean downability conditioning-variable D(t), which indicates whether the node will become inactive at instant + or not. Hence, it is possible to transition from IFACE_DOWN_s state to MAP_ON _s state when seconds have elapsed since reference instant ; and then will be updated to the current instant. From the MAP_ON _s state both possible transitions require seconds to have elapsed since the reference instant (and then will be updated to the current instant), but if the node is downable, i.e., D(t) = true, it must transition to the IFACE_DOWN_s state; and otherwise, i.e., D(t) = false, the node is to be used in any route and so it will remain in its MAP_ON_s state.

    Figure 3. State diagram for our proposal.

    In Figure 4 we illustrate an example of the time evolution of the average power P(t) consumed by some node, related to the time evolution of the downability variable D(t) corresponding to the same node, according to the state diagram of Figure 3. Thus while D(t) remains true, its P(t) changes repeatedly between PMAP_ON Watts for seconds and PIFACE_DOWN Watts for seconds. When

    Figure 3. State diagram for our proposal.

  • Sensors 2017, 17, 1678 7 of 30

    In Figure 4 we illustrate an example of the time evolution of the average power P(t) consumedby some node, related to the time evolution of the downability variable D(t) corresponding to thesame node, according to the state diagram of Figure 3. Thus while D(t) remains true, its P(t) changesrepeatedly between PMAP_ON Watts for tUP seconds and PIFACE_DOWN Watts for tDOWN seconds. WhenD(t) changes to false (after t4 instant) P(t) will remain at PMAP_ON Watts level, and this value will berepeated while D(t) remains false.

    Sensors 2017, 17, 1678 7 of 29

    D(t) changes to false (after instant) P(t) will remain at PMAP_ON Watts level, and this value will be repeated while D(t) remains false.

    Let ∆ be the average power consumed by each MAP for an ∆ interval in the PWMNS, and ∆ be the power consumption per unit of time. The average power ∆ is calculated by Equation (1) assuming that, for a time interval ∆ = × + × , IFACE_DOWN_s state is reached m times and MAP_ON_s state n times:

    ∆ = _ × × + _ × ×∆ (1) while power consumption for the same time interval ∆ is calculated by Equation (2):

    ∆ = _ × × + _ × × (2)

    Figure 4. Power consumption variation related to D(t).

    We have measured the power consumption in one Linksys [45] MAP working with DD-WRT [46] firmware. Below we show the result, for a day (∆ = 24 h) assuming = 0 in case 1 and = 0 in case 2: 1. 9.4 Watts in MAP_ON_s (i.e., ∆ = 9.4 Watts × 24 h = 225.6 Watt − hour). 2. 7.6 Watts in IFACE_DOWN_s (i.e., ∆ = 7.6 Watts × 24 h = 182.4 Watt − hour).

    Usual mode for this MAP is case 1, where power saving does not exist. On the other hand, as can be noted in case 2, a maximum power saving of 44 Watts can be achieved for a day of operation. Thus, our mechanism can generate a power saving in the mid-point of both cases, whenever m > 0 and n > 0.

    Power consumption is a kind of human interference in the Environment. According to the Spanish Consumers and Users Organization (OCU) [47], 1 W of power for one year corresponds to 5.7 kg of carbon dioxide emitted to the atmosphere. Making calculations for carbon dioxide savings in the Linksys system, we obtain the following values, respectively:

    1. 53.58 kg of carbon dioxide in MAP_ON_s. 2. 43.32 kg of carbon dioxide in IFACE_DOWN_s.

    We compare these results with other recent MAPs, concretely the WRT160NL Router/AP Linksys/Cisco [48] equipped with the standard IEEE 802.11n (two wireless interfaces). Table 2 shows the average power consumed in the considered states.

    Figure 4. Power consumption variation related to D(t).

    Let P∆t be the average power consumed by each MAP for an ∆t interval in the PWMNS, andC∆t be the power consumption per unit of time. The average power P∆t is calculated by Equation (1)assuming that, for a time interval ∆t = m × tDOWN + n × tUP, IFACE_DOWN_s state is reachedm times and MAP_ON_s state n times:

    P∆t =PIFACE_DOWN × m × tDOWN + PMAP_ON × n × tUP

    ∆t(1)

    while power consumption for the same time interval ∆t is calculated by Equation (2):

    C∆t = PIFACE_DOWN × m × tDOWN + PMAP_ON × n × tUP (2)

    We have measured the power consumption in one Linksys [45] MAP working with DD-WRT [46]firmware. Below we show the result, for a day (∆t = 24 h) assuming m = 0 in case 1 and n = 0 incase 2:

    1. 9.4 Watts in MAP_ON_s (i.e., C∆t = 9.4 Watts × 24 h = 225.6 Watt − hour).2. 7.6 Watts in IFACE_DOWN_s (i.e., C∆t = 7.6 Watts × 24 h = 182.4 Watt − hour).

    Usual mode for this MAP is case 1, where power saving does not exist. On the other hand, as canbe noted in case 2, a maximum power saving of 44 Watts can be achieved for a day of operation. Thus,our mechanism can generate a power saving in the mid-point of both cases, whenever m > 0 and n > 0.

    Power consumption is a kind of human interference in the Environment. According to the SpanishConsumers and Users Organization (OCU) [47], 1 W of power for one year corresponds to 5.7 kg ofcarbon dioxide emitted to the atmosphere. Making calculations for carbon dioxide savings in theLinksys system, we obtain the following values, respectively:

    1. 53.58 kg of carbon dioxide in MAP_ON_s.2. 43.32 kg of carbon dioxide in IFACE_DOWN_s.

  • Sensors 2017, 17, 1678 8 of 30

    We compare these results with other recent MAPs, concretely the WRT160NL Router/APLinksys/Cisco [48] equipped with the standard IEEE 802.11n (two wireless interfaces). Table 2 showsthe average power consumed in the considered states.

    Table 2. Consumption measurements for the WRT160NL Router/AP.

    State Name Bandwidth Power (Watts)

    MAP_ON_s (b, g or n) 20 MHz 3.5MAP_ON_s (n version only) 40 MHz 4.4

    IFACE_DOWN_s any 2.8

    As can be noted, depending on the higher used-bandwidth, the average power consumed bythe MAP is increased by 0.7 or 1.6 Watts, respectively, from the IFACE_DOWN_s state. Attendingto previous results, they make clear that, when the time interval for the wireless interface to bedeactivated is maximized, power savings are also maximized. This deactivation time interval willbe increased whenever either m or tDOWN duration are increased. Factor m is determined by thenumber of times that the node returns to IFACE_DOWN_s state (the node is unused). On the otherhand, tDOWN duration impacts the availability of the node in the PWMNS when it is required for anyroute. We consider tDOWN duration a variable parameter which depends on power saving and trafficrequirements. Similarly, tUP duration must also be configurable, because it impacts the speed for thenode to be inactive in case it is interfered or just unused.

    4.2. Basic Ideas on Protocol

    As a complement to our idea in [25], in our current proposal we suggest extending it to situationswhere the node is being used in a route, but interfered. Obviously, measuring external interferences is aquite complex task, and more so to determine their tolerability threshold. Some measurable parameterscan be detection of sequence order loss in sensing messages, or excessive delay in their delivering, ornon-compliance in expected throughput in the route, among others. In this approach we will assume ageneric function κ(t) which models the cited interference parameters.

    We have to define carefully how our proposal operates in order to change the node state when itis unused or interfered. In this regard, for the first event, we defined in [42,49] a special mechanismof traffic control (we name it tc) implemented in infrastructure WiFi networks APs. In the presentproposal we have adapted it for PWMNS, including the ability of redressing interferences. We assumethat every MAP can measure its experienced interference level through the previously cited κ(t)function. Based on this function, the MAP has to send a request to change to IFACE_DOWN_s to thecorresponding neighbours. False alarms do not negatively interfere the routing because the MAPneighbours will or will not confirm and authorize the rerouting of the traffic. In Figure 5 we show howdcr and tc can work together in a MAP taking into account κ(t). Thus dcr is adapted to implement thisnew feature of redressing interferences and power saving. It must be clear that we do not propose anychange on OLSR, but influencing its decisions with our mechanism. Figure 5 also includes a set ofmessages in order to communicate dcr from different neighbours as well as standard OLSRd messages.These messages are described in Table 3.

  • Sensors 2017, 17, 1678 9 of 30Sensors 2017, 17, 1678 9 of 29

    Figure 5. Block diagram for our proposal.

    We consider that any MAP which fulfils the requirements for entering IFACE_DOWN_s state is a downable MAP (hereinafter dMAP). Let us explain how the communication with the dMAP neighbours is managed in a general case. The direct neighbours of the dMAP, using dcr, need to know the tDOWN set up by this latter. Thus, every dMAP must inform its neighbours about its tDOWN, just before it changes to IFACE_DOWN_s. This can be done by sending a control message (we name it GO_IFACE_DOWN) containing also its identification (id_MAP). Thus, all the neighbours are informed when the dMAP changes again to MAP_ON_s. Before the dMAP changes to IFACE_DOWN_s, it needs to be confirmed by all of its neighbours, in order for the former not to lose data coming from the latter ones. This is accomplished by forcing the dMAP to wait for acknowledgements (ACKs) from all its neighbours. The tDOWN negotiation information is included as part of the ACK message. Though tDOWN duration is initialized to a default value in the dMAP, it can be modified after ACK interchange, selecting the minimum returned value. It is also necessary for the dMAP to receive a negative acknowledgement (NACK), in case any neighbour needs the participation of the dMAP in any route. In both cases, the dMAP will wait until a programmable timeout will expire. In Table 3 we define the messages including the name of the messages, its arguments, the direction of communication and a brief description. In this table the initiator is any dMAP that requests to its neighbours confirmation and authorization for setting down its wireless interface.

    Table 3. List of messages the MAPs manage to set its wireless interface orderly down.

    Message Name Arguments Direction Description GO_IFACE_DOWN tDOWN, id_MAP dMAP → neighbours MAP is downable

    ACK tDOWN, id_MAP neighbours → dMAP Neighbour accept dMAP

    change to IFACE_DOWN_s

    NACK Motive (reason for refusal) neighbours → dMAP Neighbour refuse dMAP

    change to IFACE_DOWN_s DOWN dMAP → neighbours End of negotiation

    4.3. Algorithm Specification

    In Algorithms 1–4, we show the pseudocode of our proposal for tc and dcr, respectively, which concurrently run in every MAP. As regards tc, once an interference level threshold θ is defined (line #1), this algorithm will continuously sense the last interference level κ (line #3) and query for two conditions (line #4): if exceeds the defined threshold θ or the node is unused. According to these conditions, tc sends asynchronously the last MAP previous-downability value Dp to dcr (line #9). It

    Figure 5. Block diagram for our proposal.

    Table 3. List of messages the MAPs manage to set its wireless interface orderly down.

    Message Name Arguments Direction Description

    GO_IFACE_DOWN tDOWN, id_MAP dMAP→ neighbours MAP is downable

    ACK tDOWN, id_MAP neighbours→ dMAPNeighbour accept dMAP

    change to IFACE_DOWN_s

    NACK Motive (reason forrefusal) neighbours→ dMAPNeighbour refuse dMAP

    change to IFACE_DOWN_s

    DOWN dMAP→ neighbours End of negotiation

    We consider that any MAP which fulfils the requirements for entering IFACE_DOWN_s stateis a downable MAP (hereinafter dMAP). Let us explain how the communication with the dMAPneighbours is managed in a general case. The direct neighbours of the dMAP, using dcr, need to knowthe tDOWN set up by this latter. Thus, every dMAP must inform its neighbours about its tDOWN, justbefore it changes to IFACE_DOWN_s. This can be done by sending a control message (we name itGO_IFACE_DOWN) containing also its identification (id_MAP). Thus, all the neighbours are informedwhen the dMAP changes again to MAP_ON_s. Before the dMAP changes to IFACE_DOWN_s, itneeds to be confirmed by all of its neighbours, in order for the former not to lose data coming fromthe latter ones. This is accomplished by forcing the dMAP to wait for acknowledgements (ACKs)from all its neighbours. The tDOWN negotiation information is included as part of the ACK message.Though tDOWN duration is initialized to a default value in the dMAP, it can be modified after ACKinterchange, selecting the minimum returned value. It is also necessary for the dMAP to receive anegative acknowledgement (NACK), in case any neighbour needs the participation of the dMAP in anyroute. In both cases, the dMAP will wait until a programmable timeout will expire. In Table 3 we definethe messages including the name of the messages, its arguments, the direction of communication anda brief description. In this table the initiator is any dMAP that requests to its neighbours confirmationand authorization for setting down its wireless interface.

    4.3. Algorithm Specification

    In Algorithms 1–4, we show the pseudocode of our proposal for tc and dcr, respectively, whichconcurrently run in every MAP. As regards tc, once an interference level threshold θ is defined (line #1),this algorithm will continuously sense the last interference level κ (line #3) and query for two conditions

  • Sensors 2017, 17, 1678 10 of 30

    (line #4): if κ exceeds the defined threshold θ or the node is unused. According to these conditions, tcsends asynchronously the last MAP previous-downability value Dp to dcr (line #9). It is possible forDp to change while dcr processes it, but we mainly expect our algorithms to handle properly dMAPsinterfered or unused for a long time.

    Algorithm 1: Basic Pseudocode of tc

    1: Define θ2: Repeat3: Sense (κ)4: if (κ > θ or MAP is unused) then5: Dp = true6: else7: Dp = false8: endif9: Send (Dp) to dcr10: Forever

    Simultaneously, the dcr main process (Algorithm 2) will continuously update the reference startingtime to (lines #3–#4) and, in the case that MAP was in MAP_ON_s state (lines #5–#6), two timed threadswill be launched for to + tUP seconds (line #7). Both threads will be stopped after the selected time, anda definitive downability value D will be returned, according to the previous downability Dp (tc line #9).If MAP is definitively downable, its state will be changed to IFACE_DOWN_s and its wireless interfacewill be deactivated (lines #8–#12). Finally, in the case that MAP was in IFACE_DOWN_s state (line #12),it will wait for to + tDOWN seconds (line #13), will activate its wireless interface (line #14), and willchange its state to MAP_ON_s state (line #15).

    Algorithm 2: Basic Pseudocode of the dcr Main Process

    1: Define MAP_state = MAP_ON_s, tUP, tDOWN2: Repeat3: Read (t)4: to = t5: Switch (MAP_state)6: case MAP_ON_s:7: timedThread (to + tUP, dMAP_proc, neighbour_proc)8: if (D) then9: set Wireless Interface DOWN10: MAP_state = IFACE_DOWN_s11: endif12: case IFACE_DOWN_s:13: Wait (to + tDOWN)14: set Wireless Interface UP15: MAP_state = MAP_ON_s16: endSwitch17: Forever

    Algorithm 3 shows our proposed pseudocode for dcr dMAP_proc process launched from dcrmain process line #7. It always initializes MAP downability D to false which will be the default valuereturned to dcr main process when either the rest of dMAP_proc does not modify this value, or thethread is stopped by the programmed timer in dcr main process line #7. The former condition is testedafter receiving the last Dp from tc (lines #2–#3). If this previous-downability is met, the MAP will senda GO_IFACE_DOWN message to its neighbours (line #4) and will wait for receiving their confirmationor a timeout (line #5). Then, if an ACK is received from all neighbours (line #6), will send a DOWN

  • Sensors 2017, 17, 1678 11 of 30

    message to its neighbours (line #7), will update its tDOWN timer as the minimum it received from itsneighbours (line #8), and will return a true value for D (line #9).

    Algorithm 3: Basic Pseudocode of the dcr dMAP_Proc Process

    timedThread dMAP_proc1: D = false2: Receive (Dp) from tc3: if (Dp) then4: Send (GO_IFACE_DOWN) to neighbours’ dcr5: Receive (confirmation, tDOWN, timeout) from neighbours’ dcr6: if (confirmation = ACK and not timeout) then7: Send(DOWN) to neighbours’ dcr8: tDOWN = min(tDOWN received from neighbours’ dcr)9: D = true10: endif11: endifendtimedThread

    Algorithm 4 shows our proposed pseudocode for a dcr neighbour_proc process launched fromdcr main process line #7. We must remember it will stop once thread timer is elapsed (dcr main processline #7). Firstly, it will wait for receiving any GO_IFACE_DOWN message for any dMAP (line #1).Then, if the considered dMAP is irreplaceable (line #2), this neighbour_proc will send a NACK to it(line #3). Otherwise, a maximum tDOWN timer will be evaluated (line #5) in order to be sent, along withan ACK, to the considered dMAP (line #6). In either case (ACK or NACK) this neighbour_proc processwill wait for receiving a DOWN confirmation (or a timeout) from the dMAP (line #8). If a DOWNmessage is received (line #9) this neighbour_proc will then update its routing table by deleting dMAPfrom it (line #10).

    Algorithm 4: Basic Pseudocode of the dcr Neighbour_Proc Process

    timedThread neighbour_proc1: Receive (GO_IFACE_DOWN) from id_MAP2: if (id_MAP is used in a route for any sink and not alternative route for that sink) then3: Send (NACK) to id_MAP4: else5: Evaluate (tDOWN) for id_MAP6: Send (ACK, tDOWN) to id_MAP7: endif8: Receive (confirmation, timeout) from id_MAP9: if (confirmation = DOWN and not timeout) then10: UpdateDB (delete any route which includes id_MAP)11: endendtimedThread

    Continuing the example in Figure 2, we show in Figure 6 the sequence of actions to follow underour mechanism. Initially, there is a communication route among MAP4, MAP5 and MAP6 (marked asa blue wide arrow). The instant when the tc of MAP5 detects interferences is marked with (1). Then, atinstant marked with (2), MAP5 requests to change to IFACE_DOWN_s, by sending (black arrows) themessage named GO_IFACE_DOWN (MAP5 dcr will send it to its neighbours’ dcr) and it will wait fortheir answers.

  • Sensors 2017, 17, 1678 12 of 30Sensors 2017, 17, 1678 12 of 29

    Figure 6. Sequence of messages and state changes for MAP5.

    We show, in case 2, the situation in which one MAP replies NACK (red arrow). In this case MAP5 stays in MAP_ON_s state. Finally, in case 3 we show that if some answer is lost, MAP5 will also stay in MAP_ON_s state after a programmable timeout tmax.

    5. Interference Redress and Power Saving Factors

    It is important to have a measure for the interference redress and power savings achieved by our mechanism. This requires knowing how much the extra average power consumed by an active MAP is, related to when it is inactive.

    5.1. Mathematical Model

    Let , _ be the average power consumed by a MAP with its wireless interface is set up, and , _ when it is set down. Similarly, given an inactive MAP, let be the time interval during which it sets its wireless interface down, and the time interval during which it sets it up, in order to check for its requirement in any route. Equation (3) defines the extra average power , consumed by the MAP when it is active respect to , , which is what it consumes when is inactive for a cycle ∆ = + :

    , = , _ − , = , − , ∙ + , ∙ + = , _ − , _ ∙ + (3) At this point we are able to measure the average power consumed by any MAP. Thus, let , be a matrix representing the active MAPs of our PWMNS at instant t. Let Z be any of the

    possible source-sink pairs to be communicated through our PWMNS. If we define , as node matrix which must be active in order to establish the route able to communicate the given Z consuming the minimum average power possible, and Γ , that of maximum average power, Equation (4) determines which power saving will be the reached if the current set of active nodes at instant t is , :

    Figure 6. Sequence of messages and state changes for MAP5.

    All neighbours, before returning an answer, will analyze their routing tables or query the routingprotocol to find another route to the destination (actions performed by the OLSRd). All neighbourswhich are granted an alternative route will reply with an ACK message (green arrow). If any neighbourdid not obtain its replacement route, it should reply with a NACK message (red arrow). Then, onceMAP5 receives all ACKs, it broadcasts a last message, named DOWN (blue arrows), as notification forclosing the process. At that instant, marked with (3), MAP5 changes to IFACE_DOWN_s and MAP4will redirect its traffic through another MAP.

    We show, in case 2, the situation in which one MAP replies NACK (red arrow). In this case MAP5stays in MAP_ON_s state. Finally, in case 3 we show that if some answer is lost, MAP5 will also stay inMAP_ON_s state after a programmable timeout tmax.

    5. Interference Redress and Power Saving Factors

    It is important to have a measure for the interference redress and power savings achieved by ourmechanism. This requires knowing how much the extra average power consumed by an active MAPis, related to when it is inactive.

    5.1. Mathematical Model

    Let PMAP_ONm,n be the average power consumed by a MAP with its wireless interface is set up, andPIFACE_DOWNm,n when it is set down. Similarly, given an inactive MAP, let tDOWN be the time intervalduring which it sets its wireless interface down, and tUP the time interval during which it sets it up,in order to check for its requirement in any route. Equation (3) defines the extra average power Em,n

  • Sensors 2017, 17, 1678 13 of 30

    consumed by the MAP when it is active respect to Rm,n, which is what it consumes when is inactivefor a cycle ∆t = tDOWN + tUP:

    Em,n = PMAP_ONm,n − Rm,n = PMAPONm,n −

    PIFACEDOWNm,n · tDOWN + PMAPONm,n · tUPtDOWN + tUP

    =(PMAP_ONm,n − PIFACE_DOWNm,n

    )· tDOWN

    tDOWN + tUP

    (3)

    At this point we are able to measure the average power consumed by any MAP. Thus, let Am,n(t)be a matrix representing the active MAPs of our PWMNS at instant t. Let Z be any of the possiblesource-sink pairs to be communicated through our PWMNS. If we define γZm,n as node matrix whichmust be active in order to establish the route able to communicate the given Z consuming the minimumaverage power possible, and ΓZm,n that of maximum average power, Equation (4) determines whichpower saving SZ(t) will be the reached if the current set of active nodes at instant t is Am,n(t):

    Sz(t) =∑Mm=1 ∑

    Nn=1

    {Rm,n + Em,n × ΓZm,n

    }− ∑Mm=1 ∑Nn=1{Rm,n + Em,n × Am,n(t)}

    ∑Mm=1 ∑Nn=1

    {Rm,n + Em,n × ΓZm,n

    }− ∑Mm=1 ∑Nn=1

    {Rm,n + Em,n × γZm,n

    } =∑Mm=1 ∑

    Nn=1

    {Em,n × ΓZm,n

    }− ∑Mm=1 ∑Nn=1{Em,n × Am,n(t)}

    ∑Mm=1 ∑Nn=1

    {Em,n × ΓZm,n

    }− ∑Mm=1 ∑Nn=1

    {Em,n × γZm,n

    }(4)

    Now we will define a measure for evaluating the degree of interference redress of our mechanism.Let κm,n(t) be the interference experienced by every MAP at instant t. If we define ρZm,n as the matrix ofactive nodes configuring the route with maximum interference level able to communicate the givenZ, then Equation (5) determines its corresponding interference redress level RZ(t) reached when theset of current active nodes is Am,n(t). It should be noted that, unlike Equation (4), in this case theminimum level is always set to 0. Otherwise, if every node was equally interfered, the factor RZ(t)would return the maximum value (RZ(t) = 1) which would indicate an optimum interference redress,while we would actually like to alert about any interference, even if it is the minimum. This is adifferent criterion respect to power saving factor SZ(t) because, in this latter, there will always exist anextra average power consumed Em,n > 0; and our target, in this case, is that SZ(t) = 0 indicates theroute for Z which minimizes the overall extra average power consumed:

    RZ(t) =∑Mm=1 ∑

    Nn=1{

    κm,n(t) × ρZm,n}− ∑Mm=1 ∑Nn=1{κm,n(t) × Am,n(t)}

    ∑Mm=1 ∑Nn=1{

    κm,n(t) × ρZm,n} (5)

    Therefore, we consider that the desirable condition for our PWMNS is characterized by RZ(t) ≈ 1,but keeping SZ(t) ≈ 1; which implies a high degree of interference redress, but preserving a powersaving close to the optimum.

    5.2. Simulation Results for Power Saving and Interference Redress Factors

    In order to clarify the meaning of these measures we will use a straightforward example consistingof a regular 3 × 3 mesh which is illustrated in Figure 7. In this example we will assume as conditionthat the nodes are separated the maximum coverage distance. As we showed in our work in [26],this condition implies that the routes can only follow the city block geometry, i.e., every node canonly establish direct routes with its left, right, up or down neighbours. In Figure 7, every node islabelled with its identifier (a number from 1 to 9 inserted in a red box with yellow background), itsEm,n (a value on cyan background over the identifier) and its κm,n (a value on purple background downthe identifier). The routes established among the nodes are indicated by a red line, so that in Figure 7all the possible direct routes are established.

  • Sensors 2017, 17, 1678 14 of 30

    Sensors 2017, 17, 1678 13 of 29

    = ∑ ∑ , + , × Γ ,=1=1 − ∑ ∑ , + , × ,=1=1∑ ∑ , + , × Γ ,=1=1 − ∑ ∑ , + , × ,=1=1 = ∑ ∑ , × Γ ,=1=1 − ∑ ∑ , × ,=1=1∑ ∑ , × Γ ,=1=1 − ∑ ∑ , × ,=1=1 (4) Now we will define a measure for evaluating the degree of interference redress of our

    mechanism. Let , be the interference experienced by every MAP at instant t. If we define , as the matrix of active nodes configuring the route with maximum interference level able to communicate the given Z, then Equation (5) determines its corresponding interference redress level

    reached when the set of current active nodes is , . It should be noted that, unlike Equation (4), in this case the minimum level is always set to 0. Otherwise, if every node was equally interfered, the factor would return the maximum value ( = 1) which would indicate an optimum interference redress, while we would actually like to alert about any interference, even if it is the minimum. This is a different criterion respect to power saving factor because, in this latter, there will always exist an extra average power consumed , > 0; and our target, in this case, is that = 0 indicates the route for Z which minimizes the overall extra average power consumed:

    = ∑ ∑ , × ρ ,=1=1 − ∑ ∑ , × ,=1=1∑ ∑ , × ρ ,=1=1 (5) Therefore, we consider that the desirable condition for our PWMNS is characterized by ≈ 1 , but keeping ≈ 1 ; which implies a high degree of interference redress, but

    preserving a power saving close to the optimum.

    5.2. Simulation Results for Power Saving and Interference Redress Factors

    In order to clarify the meaning of these measures we will use a straightforward example consisting of a regular 3 × 3 mesh which is illustrated in Figure 7. In this example we will assume as condition that the nodes are separated the maximum coverage distance. As we showed in our work in [26], this condition implies that the routes can only follow the city block geometry, i.e., every node can only establish direct routes with its left, right, up or down neighbours. In Figure 7, every node is labelled with its identifier (a number from 1 to 9 inserted in a red box with yellow background), its , (a value on cyan background over the identifier) and its , (a value on purple background down the identifier). The routes established among the nodes are indicated by a red line, so that in Figure 7 all the possible direct routes are established.

    Figure 7. Regular 3 × 3 mesh with city block routes.

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    Figure 7. Regular 3 × 3 mesh with city block routes.

    Following we will study the power saving and interference redress possibilities which resultwhen we establish node 1 as source and node 9 as sink. Figure 8 shows some of the routes which give:(a) one of the maximum power saving cases, concretely S(t) = 1, ∑Mm=1 ∑

    Nn=1{Em,n × Am,n(t)} = 0.5,

    R(t) = 0.1, and ∑Mm=1 ∑Nn=1{κm,n × Am,n(t)} = 0.7; (b) one of the intermediate cases, corresponding

    to S(t) = 0.5, ∑Mm=1 ∑Nn=1{Em,n × Am,n(t)} = 1.3, R(t) = 0, and ∑Mm=1 ∑Nn=1{κm,n × Am,n(t)} =

    0.8; and (c) one of the routes with the minimum power saving, specifically S(t) = 0,∑Mm=1 ∑

    Nn=1{Em,n × Am,n(t)} = 2, R(t) = 0, and ∑Mm=1 ∑Nn=1{κm,n × Am,n(t)} = 0.8. In all cases

    more than one route gave the same level of S(t).

    Sensors 2017, 17, 1678 14 of 29

    Following we will study the power saving and interference redress possibilities which result when we establish node 1 as source and node 9 as sink. Figure 8 shows some of the routes which give: (a) one of the maximum power saving cases, concretely S(t) = 1, ∑ ∑ , × , = 0.5 , R(t) = 0.1, and ∑ ∑ , × , = 0.7 ; (b) one of the intermediate cases, corresponding to S(t) = 0.5, ∑ ∑ , × , = 1.3 , R(t) = 0, and ∑ ∑ , × , = 0.8; and (c) one of the routes with the minimum power saving, specifically S(t) = 0, ∑ ∑ , × , = 2, R(t) = 0, and ∑ ∑ , × , = 0.8. In all cases more than one route gave the same level of S(t).

    (a) (b) (c)

    Figure 8. (a) S(t) = 1, R(t) = 0.1; (b) S(t) = 0.5, R(t) = 0; (c) S(t) = 0, R(t) = 0.

    Figure 9 illustrates some of the results for the interference redress R(t) study: (a) one of the routes with the maximum redress, concretely R(t) = 1, ∑ ∑ , × , = 0, S(t) = 0.3, and ∑ ∑ , × , = 1.5; (b) one with an intermediate value, corresponding to R(t) = 0.4, ∑ ∑ , × , = 0.5, S(t) = 0.1, and ∑ ∑ , × , = 1.8; and (c) one of the routes with the minimum redress factor, specifically R(t) = 0, ∑ ∑ , × , = 0.8, S(t) = 0, and ∑ ∑ , × , = 2.

    Though routes shown in Figures 8 and 9 are different, there are other routes which share their same S(t) and R(t) level. Thus Figures 8c and 9c are both valid for S(t) = 0 (minimum power saving) and R(t) = 0 (minimum interference redress factor). On the other hand, we can also appreciate the usefulness of our factors in adjusting to a unitary range the highly-uneven original range of the corresponding measures ∑ ∑ , × , and ∑ ∑ , × , . This is better illustrated in Table 4, where we show the data generated by all possible routes.

    One of the issues facing our proposal is the simultaneous reachability of our both targets: power saving and interference redress. In Table 4 we can observe that those targets are not always incompatible, so that in the 3rd entry (route 1-2-5-8-9) a high value has been reached for both factors: S(t) = 0.7 and R(t) = 0.8.

    (a) (b) (c)

    Figure 9. (a) R(t) = 1, S(t) = 0.3; (b) R(t) = 0.4, S(t) = 0.1; (c) R(t) = 0, S(t) = 0.

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    Figure 8. (a) S(t) = 1, R(t) = 0.1; (b) S(t) = 0.5, R(t) = 0; (c) S(t) = 0, R(t) = 0.

    Figure 9 illustrates some of the results for the interference redress R(t) study: (a) one of the routeswith the maximum redress, concretely R(t) = 1, ∑Mm=1 ∑

    Nn=1{κm,n × Am,n(t)} = 0, S(t) = 0.3, and

    ∑Mm=1 ∑Nn=1{Em,n × Am,n(t)} = 1.5; (b) one with an intermediate value, corresponding to R(t) = 0.4,

    ∑Mm=1 ∑Nn=1{κm,n × Am,n(t)} = 0.5, S(t) = 0.1, and ∑Mm=1 ∑Nn=1{Em,n × Am,n(t)} = 1.8; and (c) one

    of the routes with the minimum redress factor, specifically R(t) = 0, ∑Mm=1 ∑Nn=1{κm,n × Am,n(t)} =

    0.8, S(t) = 0, and ∑Mm=1 ∑Nn=1{Em,n × Am,n(t)} = 2.

    Though routes shown in Figures 8 and 9 are different, there are other routes which share theirsame S(t) and R(t) level. Thus Figures 8c and 9c are both valid for S(t) = 0 (minimum power saving) andR(t) = 0 (minimum interference redress factor). On the other hand, we can also appreciate the usefulnessof our factors in adjusting to a unitary range the highly-uneven original range of the correspondingmeasures ∑Mm=1 ∑

    Nn=1{κm,n × Am,n(t)} and ∑Mm=1 ∑Nn=1{Em,n × Am,n(t)}. This is better illustrated in

    Table 4, where we show the data generated by all possible routes.

  • Sensors 2017, 17, 1678 15 of 30

    Sensors 2017, 17, 1678 14 of 29

    Following we will study the power saving and interference redress possibilities which result when we establish node 1 as source and node 9 as sink. Figure 8 shows some of the routes which give: (a) one of the maximum power saving cases, concretely S(t) = 1, ∑ ∑ , × , = 0.5 , R(t) = 0.1, and ∑ ∑ , × , = 0.7 ; (b) one of the intermediate cases, corresponding to S(t) = 0.5, ∑ ∑ , × , = 1.3 , R(t) = 0, and ∑ ∑ , × , = 0.8; and (c) one of the routes with the minimum power saving, specifically S(t) = 0, ∑ ∑ , × , = 2, R(t) = 0, and ∑ ∑ , × , = 0.8. In all cases more than one route gave the same level of S(t).

    (a) (b) (c)

    Figure 8. (a) S(t) = 1, R(t) = 0.1; (b) S(t) = 0.5, R(t) = 0; (c) S(t) = 0, R(t) = 0.

    Figure 9 illustrates some of the results for the interference redress R(t) study: (a) one of the routes with the maximum redress, concretely R(t) = 1, ∑ ∑ , × , = 0, S(t) = 0.3, and ∑ ∑ , × , = 1.5; (b) one with an intermediate value, corresponding to R(t) = 0.4, ∑ ∑ , × , = 0.5, S(t) = 0.1, and ∑ ∑ , × , = 1.8; and (c) one of the routes with the minimum redress factor, specifically R(t) = 0, ∑ ∑ , × , = 0.8, S(t) = 0, and ∑ ∑ , × , = 2.

    Though routes shown in Figures 8 and 9 are different, there are other routes which share their same S(t) and R(t) level. Thus Figures 8c and 9c are both valid for S(t) = 0 (minimum power saving) and R(t) = 0 (minimum interference redress factor). On the other hand, we can also appreciate the usefulness of our factors in adjusting to a unitary range the highly-uneven original range of the corresponding measures ∑ ∑ , × , and ∑ ∑ , × , . This is better illustrated in Table 4, where we show the data generated by all possible routes.

    One of the issues facing our proposal is the simultaneous reachability of our both targets: power saving and interference redress. In Table 4 we can observe that those targets are not always incompatible, so that in the 3rd entry (route 1-2-5-8-9) a high value has been reached for both factors: S(t) = 0.7 and R(t) = 0.8.

    (a) (b) (c)

    Figure 9. (a) R(t) = 1, S(t) = 0.3; (b) R(t) = 0.4, S(t) = 0.1; (c) R(t) = 0, S(t) = 0.

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    1 2 3

    4 5 6

    7 8 9

    0 0.2 0.1

    0 0 0.5

    0 0 0

    0.1 0.1 0.1

    0.7 0.1 0.1

    0.2 0.5 0.1

    Figure 9. (a) R(t) = 1, S(t) = 0.3; (b) R(t) = 0.4, S(t) = 0.1; (c) R(t) = 0, S(t) = 0.

    Table 4. Simulation results for a 3 × 3 PWMNS.

    Route R(t) ∑Mm=1 ∑Nn=1{Dm,n ·Am,n(t)} S(t) ∑

    Mm=1 ∑

    Nn=1{Em,n ·Am,n(t)}

    1-4-5-8-9 1 0 0.3 1.51-4-7-8-9 1 0 0.3 1.61-2-5-8-9 0.8 0.2 0.7 0.9

    1-2-5-4-7-8-9 0.8 0.2 0.1 1.81-4-5-6-9 0.4 0.5 0.6 1.1

    1-4-7-8-5-6-9 0.4 0.5 0.1 1.81-2-5-6-9 0.1 0.7 1 0.51-2-3-6-9 0 0.8 1 0.5

    1-2-3-6-5-8-9 0 0.8 0.6 1.11-4-5-2-3-6-9 0 0.8 0.5 1.3

    1-2-3-6-5-4-7-8-9 0 0.8 0 21-4-7-8-5-2-3-6-9 0 0.8 0 2

    One of the issues facing our proposal is the simultaneous reachability of our both targets:power saving and interference redress. In Table 4 we can observe that those targets are not alwaysincompatible, so that in the 3rd entry (route 1-2-5-8-9) a high value has been reached for both factors:S(t) = 0.7 and R(t) = 0.8.

    In order to verify how frequently we can reach both targets, we made a new simulation in a 3 × 3mesh where we set Em,n = 0.1 W for all nodes, and generated all the possible combinations of binaryinterferences κm,n. It must be clear that we have only considered binary levels of interference, i.e.,κm,n = {0|1}, where 0 means not interfered and 1 interfered.

    On the other hand, though Em,n is fixed to a constant value for every node, extra average powervaries according to the length of the considered route. Figure 10 shows the resulting histogram for R(t)vs. S(t) considering all the possible routes in the described conditions. As we can observe the highestpeak is placed at {R(t),S(t)} = {0,0}, which corresponds to the longest routes which in addition crossesthe most interfered nodes.

    We can also appreciate that the combination {R(t),S(t)} = {1,1} seldom occurs (but it does). Howeverwe can highlight a significant combination for 0.5 < R(t) < 1 and 0.5 < S(t) < 1, which representsfavourable cases for both power saving and interference redress, simultaneously. We should not forgetthat Em,n is fixed to a constant value for every node, so the S(t) values are inversely proportionalto routes length. In fact, Figure 10 shows three clearly visible groups (0, 0.5 and 1) for S(t), whichcorrespond to the three groups of route length showed in Table 4 (5, 7 and 9 nodes).

  • Sensors 2017, 17, 1678 16 of 30

    Sensors 2017, 17, 1678 15 of 29

    Table 4. Simulation results for a 3 × 3 PWMNS.

    Route R(t) Mm Nn nmnm tAD1 1 ,, S(t) Mm Nn nmnm tAE1 1 ,, 1-4-5-8-9 1 0 0.3 1.5 1-4-7-8-9 1 0 0.3 1.6 1-2-5-8-9 0.8 0.2 0.7 0.9

    1-2-5-4-7-8-9 0.8 0.2 0.1 1.8 1-4-5-6-9 0.4 0.5 0.6 1.1

    1-4-7-8-5-6-9 0.4 0.5 0.1 1.8 1-2-5-6-9 0.1 0.7 1 0.5 1-2-3-6-9 0 0.8 1 0.5

    1-2-3-6-5-8-9 0 0.8 0.6 1.1 1-4-5-2-3-6-9 0 0.8 0.5 1.3

    1-2-3-6-5-4-7-8-9 0 0.8 0 2 1-4-7-8-5-2-3-6-9 0 0.8 0 2

    In order to verify how frequently we can reach both targets, we made a new simulation in a 3 × 3 mesh where we set , = 0.1 W for all nodes, and generated all the possible combinations of binary interferences , . It must be clear that we have only considered binary levels of interference, i.e., , = 0|1 , where 0 means not interfered and 1 interfered.

    On the other hand, though , is fixed to a constant value for every node, extra average power varies according to the length of the considered route. Figure 10 shows the resulting histogram for R(t) vs. S(t) considering all the possible routes in the described conditions. As we can observe the highest peak is placed at {R(t),S(t)} = {0,0}, which corresponds to the longest routes which in addition crosses the most interfered nodes.

    Figure 10. Relationship between R(t) and S(t) in a 3 × 3 PWMNS.

    We can also appreciate that the combination {R(t),S(t)} = {1,1} seldom occurs (but it does). However we can highlight a significant combination for 0.5 < R(t) < 1 and 0.5 < S(t) < 1, which represents favourable cases for both power saving and interference redress, simultaneously. We should not forget that , is fixed to a constant value for every node, so the S(t) values are inversely proportional to routes length. In fact, Figure 10 shows three clearly visible groups (0, 0.5 and 1) for S(t), which correspond to the three groups of route length showed in Table 4 (5, 7 and 9 nodes).

    It seems obvious that interference impact is higher in central nodes of PWMNS. Anyway it is clearly illustrated in Figure 11 which shows (in the Z-axis) the number of routes crossing every node of the 3 × 3 mesh. Excepting the source (1,1) and sink (3,3), the next more visited node is the centre (2,2), being the less visited those of the remaining corners (1,3) and (3,1).

    Figure 10. Relationship between R(t) and S(t) in a 3 × 3 PWMNS.

    It seems obvious that interference impact is higher in central nodes of PWMNS. Anyway it isclearly illustrated in Figure 11 which shows (in the Z-axis) the number of routes crossing every nodeof the 3 × 3 mesh. Excepting the source (1,1) and sink (3,3), the next more visited node is the centre(2,2), being the less visited those of the remaining corners (1,3) and (3,1).

    Sensors 2017, 17, 1678 16 of 29

    We will analyze in more depth this relationship between interference influence and interfered node position into the mesh. For this purpose we defined the function dCr(t) which measures the proximity of the nodes belonging to the considered route r at instant t relative to the centre of the mesh. This function sums the mesh centre proximity of every route node and scales it between 0 (the route with less centred nodes) and 1 (the route with more centred nodes). The result is illustrated in Figure 12.

    Figure 11. Number of routes passing through each node in a 3 × 3 PWMNS.

    Figure 12. Relationship between R(t) and node proximity to the centre in a 3 × 3 PWMNS.

    Figure 12 shows that, for a centre proximity dCr(t) < 0.5, the interference redress returns values along all its definition range. However, when the interference appears in nodes very close to the mesh centre (dCr(t) > 0.5) the interference redress falls to R(t) = 0. The variability of centre proximity dCr(t) is very limited for the routes we are considering (Table 4). For this reason its values are distributed in only four groups.

    6. Experimental Results for a Test Platform Based on Raspberry Pi

    In this Section we will analyze the results of several experiments implemented on a PWMNS based on RPi.

    Figure 11. Number of routes passing through each node in a 3 × 3 PWMNS.

    We will analyze in more depth this relationship between interference influence and interferednode position into the mesh. For this purpose we defined the function dCr(t) which measures theproximity of the nodes belonging to the considered route r at instant t relative to the centre of themesh. This function sums the mesh centre proximity of every route node and scales it between 0 (theroute with less centred nodes) and 1 (the route with more centred nodes). The result is illustrated inFigure 12.

    Figure 12 shows that, for a centre proximity dCr(t) < 0.5, the interference redress returns valuesalong all its definition range. However, when the interference appears in nodes very close to the meshcentre (dCr(t) > 0.5) the interference redress falls to R(t) = 0. The variability of centre proximity dCr(t) is

  • Sensors 2017, 17, 1678 17 of 30

    very limited for the routes we are considering (Table 4). For this reason its values are distributed inonly four groups.

    Sensors 2017, 17, 1678 16 of 29

    We will analyze in more depth this relationship between interference influence and interfered node position into the mesh. For this purpose we defined the function dCr(t) which measures the proximity of the nodes belonging to the considered route r at instant t relative to the centre of the mesh. This function sums the mesh centre proximity of every route node and scales it between 0 (the route with less centred nodes) and 1 (the route with more centred nodes). The result is illustrated in Figure 12.

    Figure 11. Number of routes passing through each node in a 3 × 3 PWMNS.

    Figure 12. Relationship between R(t) and node proximity to the centre in a 3 × 3 PWMNS.

    Figure 12 shows that, for a centre proximity dCr(t) < 0.5, the interference redress returns values along all its definition range. However, when the interference appears in nodes very close to the mesh centre (dCr(t) > 0.5) the interference redress falls to R(t) = 0. The variability of centre proximity dCr(t) is very limited for the routes we are considering (Table 4). For this reason its values are distributed in only four groups.

    6. Experimental Results for a Test Platform Based on Raspberry Pi

    In this Section we will analyze the results of several experiments implemented on a PWMNS based on RPi.

    Figure 12. Relationship between R(t) and node proximity to the centre in a 3 × 3 PWMNS.

    6. Experimental Results for a Test Platform Based on Raspberry Pi

    In this Section we will analyze the results of several experiments implemented on a PWMNSbased on RPi.

    6.1. Interface Deactivation and External Traffic Effects

    In order to analyze the behaviour of a real PWMNS, we have assembled a test platform equippedwith four RPi MAPs (named node 1, 4, 6 and 7 in Table 5 and Figure 13). We have chosen these devicesdue to their powerful processing capability, multiple USB I/O and GPIO, and specially their versatileand complete Operative System (based on UNIX/Linux).

    Table 5. Configuration for the 4 RPi based PWMNS.

    node4 RPi2: WiFi Linksys Cisco WUSB600N interface, Debian RPi kernel ver. 4.1.17-v7+node1 RPi2: Alfa Chipset Realtek 8187L interface and 6 dBi antenna, Debian RPi kernel ver. 4.1.17-v7+node6 RPi2+: Display LCD with WiFi Linksys Cisco WUSB600N interface, Debian RPi kernel ver. 4.1.17-v7+node7 RPi3: internal WiFi interface Raspbian Jessie kernel ver. 4.4 (11 January 2017)

    Sensors 2017, 17, 1678 17 of 29

    6.1. Interface Deactivation and External Traffic Effects

    In order to analyze the behaviour of a real PWMNS, we have assembled a test platform equipped with four RPi MAPs (named node 1, 4, 6 and 7 in Table 5 and Figure 13). We have chosen these devices due to their powerful processing capability, multiple USB I/O and GPIO, and specially their versatile and complete Operative System (based on UNIX/Linux).

    Table 5. Configuration for the 4 RPi based PWMNS.

    node4 RPi2: WiFi Linksys Cisco WUSB600N interface, Debian RPi kernel ver. 4.1.17-v7+ node1 RPi2: Alfa Chipset Realtek 8187L interface and 6 dBi antenna, Debian RPi kernel ver. 4.1.17-v7+ node6 RPi2+: Display LCD with WiFi Linksys Cisco WUSB600N interface, Debian RPi kernel ver. 4.1.17-v7+ node7 RPi3: internal WiFi interface Raspbian Jessie kernel ver. 4.4 (11 January 2017)

    Figure 13. Image of our test platform.

    All nodes established their WiFi ad-hoc communication on channel 7 and OLSR to achieve a mesh configuration. We have deployed them in a static indoor placement, in order for them to establish a link structure similar to what is showed in Figure 14. This topology allows node6 (which was used as data source) to be able to communicate using any intermediate nodes (node7 or node4) to node1 (which was used as data sink). We used four RPis because we wanted to show that, with a reduced amount of redundant paths, our strategy worked properly. With greater number of redundant paths (more RPis) our strategy will continue to work; because a MAP will only set its WiFi interface down when its neighbours acknowledge it. Direct communication from node6 to node1 was seldom established, due to deployment conditions. The chosen route was decided by OLSR based on its operation mode, and interchanged configuration messages and metrics.

    Figure 14. Deployed static topology.

    node4

    node7

    node6 node1

    Figure 13. Image of our test platform.

  • Sensors 2017, 17, 1678 18 of 30

    All nodes established their WiFi ad-hoc communication on channel 7 and OLSR to achieve a meshconfiguration. We have deployed them in a static indoor placement, in order for them to establish a linkstructure similar to what is showed in Figure 14. This topology allows node6 (which was used as datasource) to be able to communicate using any intermediate nodes (node7 or node4) to node1 (whichwas used as data sink). We used four RPis because we wanted to show that, with a reduced amountof redundant paths, our strategy worked properly. With greater number of redundant paths (moreRPis) our strategy will continue to work; because a MAP will only set its WiFi interface down when itsneighbours acknowledge it. Direct communication from node6 to node1 was seldom established, dueto deployment conditions. The chosen route was decided by OLSR based on its operation mode, andinterchanged configuration messages and metrics.

    Sensors 2017, 17, 1678 17 of 29

    6.1. Interface Deactivation and External Traffic Effects

    In order to analyze the behaviour of a real PWMNS, we have assembled a test platform equipped with four RPi MAPs (named node 1, 4, 6 and 7 in Table 5 and Figure 13). We have chosen these devices due to their powerful processing capability, multiple USB I/O and GPIO, and specially their versatile and complete Operative System (based on UNIX/Linux).

    Table 5. Configuration for the 4 RPi based PWMNS.

    node4 RPi2: WiFi Linksys Cisco WUSB600N interface, Debian RPi kernel ver. 4.1.17-v7+ node1 RPi2: Alfa Chipset Realtek 8187L interface and 6 dBi antenna, Debian RPi kernel ver. 4.1.17-v7+ node6 RPi2+: Display LCD with WiFi Linksys Cisco WUSB600N interface, Debian RPi kernel ver. 4.1.17-v7+ node7 RPi3: internal WiFi interface Raspbian Jessie kernel ver. 4.4 (11 January 2017)

    Figure 13. Image of our test platform.

    All nodes established their WiFi ad-hoc communication on channel 7 and OLSR to achieve a mesh configuration. We have deployed them in a static indoor placement, in order for them to establish a link structure similar to what is showed in Figure 14. This topology allows node6 (which was used as data source) to be able to communicate using any intermediate nodes (node7 or node4) to node1 (which was used as data sink). We used four RPis because we wanted to show that, with a reduced amount of redundant paths, our strategy worked properly. With greater number of redundant paths (more RPis) our strategy will continue to work; because a MAP will only set its WiFi interface down when its neighbours acknowledge it. Direct communication from node6 to node1 was seldom established, due to deployment conditions. The chosen route was decided by OLSR based on its operation mode, and interchanged configuration messages and metrics.

    Figure 14. Deployed static topology.

    node4

    node7

    node6 node1

    Figure 14. Deployed static topology.

    The IP addresses assigned to the nodes were 192.168.200.6 (for node6), 192.168.200.4 (for node4),192.168.200.7 (for node7) and 192.168.200.1 (for node1). All these addresses were statically fixed inorder to make the addressing task easier and avoid their changes during the test. Focusing on whathappened in node6, we show in Table 6 the most habitual state for its routing table.

    Table 6. Most habitual kernel IP routing table for node6.

    Destination Gateway Genmask Flags Metric Ref Use IFace

    169.254.0.0 0.0.0.0 255.255.0.0 U 303 0 0 wlan0192.168.200.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0192.168.200.1 192.168.200.7 255.255.255.255 UGH 2 0 0 wlan0192.168.200.4 192.168.200.4 255.255.255.255 UGH 2 0 0 wlan0192.168.200.7 192.168.200.7 255.255.255.255 UGH 2 0 0 wlan0

    This routing table provides direct connectivity for node7 and node4. But, in order to reach node1,this table provides two possible routes: route1 (node6-node7-node1) and route2 (node6-node4-node1).As may be seen, the static topology guarantees that node6 will use one of the cited routes in order tocommunicate with node1 as well as there will always exist a direct connection between node6 andboth node4 and node7, so that any of the latter can be used as intermediate node for the former toreach node1. Obviously we also guarantee that node1 has a direct link to both node4 and node7.

    Figure 15 shows the time evolution of the chosen intermediate node for reaching node1 basedon successive readings of node6 routing table. Those readings were made during several sessions of300 s leaving a 1 s interval between every pair of readings. Data were obtained without varying anyconfiguration or traffic aspect. Vertical axis represents the following node (after node6) in the route; so

  • Sensors 2017, 17, 1678 19 of 30

    that possible values were node7, node4 and directly node1. In view of Figure 15 we must highlightthat the direct route from node6 to node1 was seldom chosen.

    Sensors 2017, 17, 1678 18 of 29

    The IP addresses assigned to the nodes were 192.168.200.6 (for node6), 192.168.200.4 (for node4), 192.168.200.7 (for node7) and 192.168.200.1 (for node1). All these addresses were statically fixed in order to make the addressing task easier and avoid their changes during the test. Focusing on what happened in node6, we show in Table 6 the most habitual state for its routing table.

    Table 6. Most habitual kernel IP routing table for node6.

    Destination Gateway Genmask Flags Metric Ref Use IFace 169.254.0.0 0.0.0.0 255.255.0.0 U 303 0 0 wlan0

    192.168.200.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0 192.168.200.1 192.168.200.7 255.255.255.255 UGH 2 0 0 wlan0 192.168.200.4 192.168.200.4 255.255.255.255 UGH 2 0 0 wlan0 192.168.200.7 192.168.200.7 255.255.255.255 UGH 2 0 0 wlan0

    This routing table provides direct connectivity for node7 and node4. But, in order to reach node1, this table provides two possible routes: route1 (node6-node7-node1) and route2 (node6-node4-node1). As may be seen, the static topology guarantees that node6 will use one of the cited routes in order to communicate with node1 as well as there will always exist a direct connection between node6 and both node4 and node7, so that any of the latter can be used as intermediate node for the former to reach node1. Obviously we also guarantee that node1 has a direct link to both node4 and node7.

    Figure 15 shows the time evolution of the chosen intermediate node for reaching node1 based on successive readings of node6 routing table. Those readings were made during several sessions of 300 s leaving a 1 s interval between every pair of readings. Data were obtained without varying any configuration or traffic aspect. Vertical axis represents the following node (after node6) in the route; so that possible values were node7, node4 and directly node1. In view of Figure 15 we must highlight that the direct route from node6 to node1 was seldom chosen.

    Figure 15. Chosen intermediate node for route from node6 to node1.

    We can detect that node6 uses as intermediate node mainly both the node7 and node4 to reach node1. Though both are valid, distance and other environmental conditions (radio channel instability and especially typical variation [50] of WiFi signal) cause OLSR to change dynamically the chosen route.

    As OLSR chose a single route among all the possibilities in order to establish connectivity between every pair of nodes, we considered that every node not participating in any route was susceptible for deactivating its wireless interface, so that it could contribute to power saving and avoid possible interferences. In order to check our test platform behaviour under interferences and the validity of this proposal, we have used several applications which generate some data traffic on the route node6-node1. We specifically used traffic which emulates the following two patterns:

    Figure 15. Chosen intermediate node for route from node6 to node1.

    We can detect that node6 uses as intermediate node mainly both the node7 and node4 to reachnode1. Though both are valid, distance and other environmental conditions (radio channel instabilityand especially typical variation [50] of WiFi signal) cause OLSR to change dynamically the chosen route.

    As OLSR chose a single route among all the possibilities in order to establish connectivity betweenevery pair of nodes, we considered that every node not participating in any route was susceptiblefor deactivating its wireless interface, so that it could contribute to power saving and avoid possibleinterferences. In order to check our test platform behaviour under interferences and the validityof this proposal, we have used several applications which generate some data traffic on the routenode6-node1. We specifically used traffic which emulates the following two patterns:

    • Connection-less Low Frequency Traffic (LFT) with Internet Control Message Protocol (ICMP).• Connection-oriented High volume and Frequency previously stored Traffic (HFT) with Secure

    Copy (scp).

    6.1.1. Effect of WiFi Interface Deactivation

    Figure 16 illustrates the result of one of the multiple tests performed in order to check whathappens in node6 routing table when node7 (one of the intermediate nodes) interface was deactivatedfor 2 s in a 60 s session. Specifically, initial chosen route was node6-node7-node1. At instant t = 10 wedeactivated node7 WiFi interface for 2 s and, after this time was elapsed, we reactivated node7 WiFiinterface again until t = 60. We repeated this experiment changing the interface deactivation interval.Similarly we checked our proposal of implementing a state “duty cycle”, i.e., cyclically repeatedchanges on the state of node from MAP_ON_s to IFACE_DOWN_s. The obtained results prompt usto state that, for this cyclical process, small tDOWN values were not optimal, especially for mediumor high data-rate traffic. This was due to OLSR definitively deletes that route from the table, becauseof its high variability. With an adequate selection of tDOWN, the right rerouting (through node4) laterundone (and recovered through node7) is evidenced in Figure 4. Obviously, our mechanism could beapplied on any unused node that, as node4, was not participating in any route (or is being interfered);because OLSR could find a right substitute and even could reuse the inactive node whenever possible.

  • Sensors 2017, 17, 1678 20 of 30

    Sensors 2017, 17, 1678 19 of 29

    Connection-less Low Frequency Traffic (LFT) with Internet Control Message Protocol (ICMP). Connection-oriented High vol