Abstract
Keywords
Introduction
The Internet of Things (IoT) enables physical devices not only to be connected to the virtual world but they can also remotely receive their order from the Internet and act as access points to various Internet services.
1
In that context,
Wireless sensor networks (WSNs) are important building blocks of IoT. The general topology of the network consists of several sensor nodes scattered in a target area where they monitor various physical phenomena. A particular node also known as
The aforementioned usages require a deployment of several WSNs, each with specific application goals. Moreover, WSN requirements can evolve (more sensors) and new needs that have not yet been identified may also emerge. To provide Internet connectivity for deployed WSNs, we envisased to set up several gateways acting as a backbone framework. They bridge the Internet connection to several WSNs. A wireless network interface (IEEE 802.15.4 for example) connects the WSN while the Internet side uses a typical Ethernet network adapter or any other access technology interface such as long-term evolution (LTE, also widely known as 4G, is a standard for high-speed wireless communication for mobile devices and data terminals, based on the GSM/EDGE and UMTS technologies) or IEEE 802.11. So, they will not only enable the linking (through Internet access) of some unconnected parts of the same WSN but also provide a remote access to all sensor networks through the Internet. Due to their limited capacity (in terms of bandwidth), gateway acts as a single point of failure for Internet connection and could hinder traffic coming from the WSN side (bottleneck). Since several WSNs are set up at the same time and given the unreliability of wireless links, each connected part of the WSN should access Internet through several possible gateways. Network should adapt and change the Internet entry point depending on the availability of gateways and the amount of traffic and other network conditions (QoS requirement and application constraints).
The contribution of this article is twofold. First, given the network conditions and other constraints, it determines the most appropriate gateways from existing ones that would provide an efficient Internet connection of deployed WSNs at lower costs. Second, a three-layer architecture that dynamically adapts to network conditions is designed and the end-to-end connection between WSNs and Internet ensured.
There are two somewhat conflicting objectives which should be met:
WSNs will seek to use the maximum available gateways to meet QoS, bandwidth, and fault tolerance. Indeed, the more the available and open gateways, the higher the bandwidth to convey data.
Only an appropriate number of gateways should be used. These are those that match actual application requirements given current network conditions.
The main idea is to install the maximum number of gateways in the network, but to select and use a limited number of these devices. The remaining capacity (unused gateways) will overcome any future failure (gateway, and node and link breakdown) or serve for scaling purposes (addition of new nodes to the network or deploying new WSNs and services). At the same time, we aim to balance traffic load among all selected gateways, thus, the use of active resources is optimized.
The rest of this article is organized as follows. In section “Related works,” related works are reviewed, followed by a description of the network model and problem statement. A formal definition of the algorithm and resolution approach is done with illustrative examples. The “System architecture” and “Routing scheme” sections highlight the system and protocol design. Then, implementation considerations and some use cases are provided. The article ends with the “Conclusion” section.
Related works
The problem of using gateways to connect WSN to the Internet to achieve the vision on IoT has already been investigated in the literature. Zachariah et al. 2 put the emphasis on the use of Bluetooth Low Energy (BLE) to establish the connection between various sensor nodes and the Internet. They advocate the use of smartphones for this purpose. Our work aims to connect WSNs to Internet or establishing communication between several unconnected WSNs. In this case, network access technologies around IEEE 802.15.4 standards and the IPv6 routing protocol for low-power and lossy network (RPL) are more appropriate. However, providing gateways with more interfaces, including BLE, allows the support of a large variety of devices and new IoT appliances.
To design an access scheme for sensors through IoT gateways, Wang et al.
3
proposed a three-layer approach: sensor networks (
Number and locations of gateways within WSN are crucial as they impact the network performance and lifetime. Some heuristics used for node placement or load balancing can be found in the literature. 5 Among others, we can mention recursive and iterative dominating set, augmenting and greedy placement. But these algorithms relate to wireless mesh networks (WMNs) and are not directly applicable to WSNs, especially when network topology is built as a directed acyclic graph (DAG) such as in the case of RPL.
The use of linear programming (LP) for solving gateway deployment problem is discussed by Wu and colleagues.6,7 Once again, the proposed solutions relate to WMN and primarily aim at maximizing throughput of gateways while balancing the load between them. Boubrima et al. 8 also suggested the use of LP for gateway deployment in order to monitor air quality. Their integer programming model expresses constraints in a way that pollutant concentrations are accounted when placing sensors with the aim of achieving a bounded error at locations where no sensor is deployed while minimizing the financial cost. Our model also uses LP to express desired network characteristics as constraints, particularly in an RPL-like tree-based topology. Moreover, commands issued to open or close gateways are evaluated dynamically depending on network conditions, rather than estimated in advance for a fixed topology.
Our work is a preliminary step from those carried out by Petrolo et al. 9 Here, gateways are designed to couple semantic web technologies and cloud computing to enable various IoT applications and platform integration. Their main goal is to achieve the Cloud of Things (CoT) vision. As a result, used gateways handle semantic-like things and act as an end-point for the dynamic presentation of real-world data to consumer applications and users. They are thus used to enable a lightweight and dense deployment of services, thanks to virtualized software and technologies. This article aims to provide an architecture that ensures a flexible and robust communication between WSN and backbone Internet with low-cost hardware. In this way, our scheme takes place at routing level (network layer), whereas the above work relies on an application layer by enabling service integration and data presentation through container-based virtualization in gateways.
Design considerations
This section describes the network architecture and presents some major design considerations. The gateway selection procedure is formulated as an integer linear program (ILP) problem under several constraints. Figure 1 shows the envisioned network architecture. Gateways depicted as routers are more robust nodes than those scattered in the target area. They are constantly powered and have sufficient memory and processing resources. In the proposed model, the third version of Raspberry Pi platform 10 is used, thanks to its good hardware features and low acquisition cost. So, it is easier (in terms of investment cost) to deploy a large number of such devices in a given area of interest. Sensor nodes acquire and relay data through multi-hops wireless links to the border router performed by the gateway. These sensor nodes belong to separate networks depicted in Figure 1 by color codes (red, blue, or gray) depending on their application or network goal.

Backbone architecture for WSN interconnection.
Network model
The target framework which is illustrated in Figure 1 network can be modeled as directed graph
For illustration, consider the network depicted by Figure 1. Values are
All network nodes (gateways and sensors) are assumed to be stationary once deployed. Every gateway
Problem formulation
To set up the network, the more the gateways, the better the overall system capacity. It is desirable to minimize their setup cost and usage. However, distributing traffic load among all open gateways is sought, as well as ensuring sufficient network resources (i.e. bandwidth capacity) to allow a
Given a network modeled by the directed graph
When looking for solutions to the above problem, several constraints are taken into consideration:
Under the aforementioned constraints, two optimization objectives are targeted:
Gateway selection procedure
Computational complexity
Proposition 1: NP-hardness of gateway selection problem
The gateway selection problem as stated in “Problem formulation” section is NP-hard.
Proof
The NP-hardness of gateway selection problem is established through the reduction of the well-known capacitated facility location problem (CFLP) to it. 11
Indeed, there is a set
Reducing CFLP to gateway selection problem is quite simple. One can see the CFLP as an instance of this problem, where facilities match the gateways and they have the same operational cost
Solving method
The problem is formulated as an integer linear problem (ILP). All notations are those introduced in the “Network model” section. Gateways, indexed by
Gateway selection problem can be rewritten as in the above ILP
The objective function (OF) given by equation (2) seeks to minimize the number of gateways to open
The first constraint, also known as WSN coverage constraint, is described by relation (3). It ensures that each node can reach at least one gateway. Moreover, as the sum value is set to 1, this requires that every node accesses the Internet through one and only one gateway. Thereafter, separate routing trees can be built. The inequality (4) is the capacity constraint. It ensures that clients’ demands do not exceed the selected gateway capacity. Relation (5) denotes that only opened gateways can be used as sinks for the routing. The following relation, inequality (6), restricts the coverage area of gateways through multi-hops wireless links to
There are several heuristics11,12 to solve the proposed ILP. We opted to use the IBM ILOG CPLEX v 12.6.3 libraries.
13
In the latter, the CPLEX optimizer looks for exact solutions for the ILP and restricts the search space using the
Illustrative scenarios
Three variables are given as inputs,
The network topology depicted by Figure 1 is used to illustrate how the model operates. The two-dimensional array C (5 rows × 37 columns) associated with value
First scenario
First, all gateway capacities are set to the same initial value
Hence, based on the inputs provided, the system advocates the opening of gateways

Routing tree associated with various input data: (a)
It is worth noting that load distribution (note
Second scenario
Let us consider the same inputs as the previous scenario, except gateway capacities that are now set on the same value 10, that is,
Note that by setting gateway capacities to a lower value, the system behaves as expected. It suggests the opening of more entry points toward the Internet backbone (four instead of three as previously mentioned). In addition, the new distributions of gateway loads are
Summary of scenario parameters.
System architecture
To instantiate the described model, it is necessary to gather information about the network topology. In particular, those related to various deployed WSNs and their interconnection graph from which the optimal paths to reach gateways and the associated costs are inferred. Hence, this network map also allows the building of the two-dimensional array
Figure 3 shows the overall functional architecture of the system. As illustrated, three main entities are required for system implementation: sensor nodes, gateways, and the centralized management station. The sequence diagram at the bottom part of the figure outlines the interactions between these entities:

System architecture.
To account for the dynamic nature of the network, sensors keep monitoring their vicinity on a regular basis. Vicinity information is sent back to the base station only when topology changes (newly discovered node or when a neighboring node stops functioning) to reduce consumption of resources.
Routing scheme
Nodes in the WSN build the network topology according to RPL, 14 a distance vector routing protocol standardized for low-power and lossy network where multipoint-to-point is the dominant traffic pattern. Topology is organized as one or more DAG with each rooted at a single point that acts as a sink for other nodes. The setting up step starts at the sink that spreads special configuration messages in its vicinity. Those which are also called DIOs convey all configuration parameters. Later, they are forwarded hop-by-hop to flood the whole network.
Disseminated parameters include (but not limited to) instance ID, root ID, Objective Code Point (OCP), metric, and timers value. RPL instance is used to define the optimization criteria when forming a routing path according to the application goal. So, it is possible to concurrently run several RPL instances in the network that operate independently with one another. While an instance may include several DAGs, the latter belongs to one and only one instance. The optimization goal is achieved through the OF identified by an OCP value which is the same for a given instance. OF defines a framework where routing metrics are converted to a scalar value: the
As illustrated, a WSN can include a two-instance RPL network where the first builds a DAG optimized to minimize latency to reach a single centralized lighting controller in a home automation application, while another network builds a DAG to maximize reliability when sending environmental data to a central server.
Up to now, Internet Engineering Task Force (IETF is a open standards organization that develops and promotes Internet standards) has standardized two OFs. The first, namely, OF0, 15 uses the hop-count as the unique parent section criterion. The second 16 is tailored for Expected Transmission Count (ETX is a link quality metric that estimates the expected number of MAC transmission (including retransmission) required to send packet over a wireless link), a metric that accounts for packet reliability. Many other OFs have been proposed by the research community. Among others, Kamgueu et al. 17 used node’s residual energy as the unique routing metric and proposed a method to combine several criteria to take QoS into consideration. 18
Implementation and deployment
System hardware
As stated earlier, the system consists of two main parts: The WSN and the Internet (through backbone infrastructure). In the proposed implementation, nodes deployed in the WSN side are TelosB type CM5000 equipped with a MSP430 microcontroller (as the CPU) and a CC2420 radio-frequency chip that uses IEEE802.15.4 wireless communication standard. Various sensor interfaces are integrated to acquire environmental measurements (i.e. temperature, humidity, and light). The TelosB was chosen, although it costs higher (about twice) than the Raspberry Pi. This is justified by many available sensors and device robustness, and besides, it is a prototype designed for the purpose of research. Depending on application requirements, cheaper nodes can be used. It is worth noting that we aim to reduce the intermediate layer hardware and setup costs, and that the WSN layer is assumed to be already deployed.
In the backbone side, the Raspberry Pi 3 is used and acts as both, the gateway and the RPL DODAG root. Indeed, the third version of this platform is a real computer that includes a quad-core ARM Cortex-A53 CPU clocked at 1.2 GHz with 64-bit data path, 1 GB memory, 1 Ethernet, and IEEE802.11n wireless local area network (LAN) interfaces. Moreover, it incorporates Bluetooth 4.1 and the new BLE convenient for IoT usages, in addition to 4 USB, HDMI ports, and more than 40 general-purpose input/output (GPIO) pins. The main reason of this choice is the small size of the device (the scale of a credit card), its powerfulness compared to its low cost and the ability to fully run the gateway interface program without size and other resource restrictions. Figure 4 highlights the gateway structure carried out by the association of Raspberry Pi 3 (left side) and TelosB mote (right side). The latter acts as IEEE802.15.4 interface for connecting the WSN.

Internet gateway: Raspberry Pi 3 and TelosB association.
Network operations
WSN operations
On the WSN field, every node runs a specific client application written in the node’s flash memory prior to its deployment. A given application is recorded through a
As soon as the node obtains a
Gateway operations
The gateway is set up by the hardware combination, Raspberry Pi 3 and TelosB illustrated in Figure 4. In this coupling, the Raspberry ensures both the RPL root for all dispatched instances and the bridging between the WSN and Internet. It also communicates with the management PC which does not only forward model parameters but also receives open/closed gateway orders from it.
To interface with the WSN side, the TelosB mote runs a basic SLIP application 19 that reads raw bits of information from the IEEE802.15.4 radio interface and forwards them to the device’s USB port and vice versa.
Once started, the gateway disseminates configuration parameters of all existing
It is worth pointing out that when a new instance is created, the gateway advertises this one with the dedicated instance, thanks to the multicast group. Any newly deployed node (not yet configured instance) can get one and starts normal operation (application running and vicinity information gathering/feedback).
Use case
To begin, the evaluation of the network formation and scaling were done through simulations. Given that the simulated prototype we have developed currently supports only one gateway, a network, as large as the host computer’s performance allows, has been setup. So, support for multiple instances on the gateway and end-to-end communication between WSN nodes and Internet are also evaluated.
Besides, a real scenario was deployed to evaluate the operation of the proposed model on multiple gateways. The use case has been applied to home automation for gathering environmental data.
Large-scale simulation
Using COOJA,
20
the simulator integrated to Contiki, a
Simulation parameters.
Figure 5 shows the described network, where nodes are colored yellow, purple, and blue according to their instance ID, respectively, 50, 30, and 20. The green node at the center of topology is the one that connects the simulator with the gateway on the host computer and interfaces the border router. Arrows depict the next hop selected by sensor nodes according to the RPL OF. As desired, nodes build three separate routing trees depending on their respective color.

COOJA simulation of a large-scale scenario.
Browsing through gateway IPv6 address on the host computer enables to display sensors of any group as well as the statistics of upward and downward streams for every sensor. For example, Figure 6 shows that almost all instances, 20 sensors, are discovered and can be

Discovered sensor nodes at gateway (instance 20).
Real-world scenario
A prototype of the proposed model has been deployed using home automation application scenario. By way of demonstration, two applications were developed. The first collects temperature data and the second the brightness. The first application is registered with RPL instance 10 and the second with 20. Nodes run Contiki v 2.7 operating system 21 and the gateway used the Raspbian 4.4 kernel version. The 6-LBR gateway application 22 has been modified and extended to handle several RPL instances, as well as open/closed gateways according to network conditions and management PC commands. Two gateway devices (each consisting of the association of Raspberry and TelosB) and 10 sensors are placed at various locations in a five-room house. Gateways are connected to the Internet through a wired Ethernet backbone as shown in Figure 4.
Model parameters are set so that both gateways can capture half of the sensor nodes each, that is,
First of all, five sensor nodes running instance 10 related to the first application were deployed. Instances were previously created at gateway level. After the initialization step and given the above parameters, the proposed model advocates the opening of only one device, denoted as gateway 1. Figure 7 shows the network topology graph obtained from web interface used to interact with the first Raspberry Pi. As shown, all five sensor nodes materialized by their 16-bit MAC-ID use this device as the only exit point to Internet. Indeed, the corresponding outputs computed by the proposed model are

Home automation scenario: first gateway—stage 1.
As a next step, the second instance 20 was created on gateways and the remaining five nodes were deployed, so that two execute the first instance application and others, the second. Then, gateway 2 (previously closed) starts to act as RPL root for both instances. As shown, when instance tabs are browsed, two nodes operate for 10 (Figure 8(a)) and three for 20 (Figure 8(b)). Note that the first gateway continues to capture the previously deployed nodes as highlighted above (Figure 7).

Home automation scenario: second gateway—stage 2: (a) instance 10 app and (b) instance 20 app.
Conclusion
This article investigates how to select gateways for efficient integration of WSNs to Internet with the aim of achieving the IoT vision. A backbone architecture that connects several multi-instance applications has also been designed. The central point on the targeted framework is the
A prototype of the proposed model was implemented as proof of a concept using low-cost Raspberry Pi as the gateway. A real-world application scenario for home automation was deployed to demonstrate the effectiveness of the proposed scheme. The COOJA simulator also showed that the architecture can scale up to 100 sensors managed by the same gateway. We argue that a possible limitation (i.e. simulation size) can only relate to memory resources, since the sensor firmwares are fully emulated.
