1. Introduction
Due to simplicity and low energy consumption, wireless sensor networks (WSN) are are being increasingly used for data acquisition and control of remote devices. In general, WSN can be considered as a low power and lossy network (LLN), presenting some constraints for use in critical and large-scale scenarios. The main limitations come from the nature of its components, such as lossy links, and devices with power supply limitations, poor processing power and limited memory. Other important limitations are the difficulty of building WSN management systems and the lack of flexibility regarding policy changes [
1]. The first prevents deployment in scenarios where the operation is subject to requirements that are more strict concerning reliability and performance, while the second stems from the rigidity of WSN with respect to policy changes, pointing to the difficulty to adapt it to factors external to communication and networking, such as business rules and accessibility.
A very important scenario with the aforementioned characteristics is the advanced metering infrastructure (AMI) of the smart grid. A relevant part of the AMI network is to handle communication in the neighborhood area, which usually involves many metering devices deployed in a large and complex geographical area. AMI requires that readings of thousands of metering devices be routed to a central collector and the execution of remote commands, such as cut-off and reconnection of consumers. Considering these requirements, the use of wireless communication is almost unanimous for the collection of information and operation of AMI devices.
The possibility of direct and bidirectional access to devices using IP technology considerably reduces the mentioned difficulties, but some issues emerge with respect to the complexity of interconnection. A basic premise of IP is end-to-end communication, which allows devices to be accessed without the need for gateways to adapt protocols. The 6LoWPAN standard (IPv6 over low power wireless personal area networks) has been developed to avoid adaptation [
2], making it possible to reach WSN devices with IPv6 addresses. Routing decisions in 6LoWPAN are made by distributed protocols, especially the routing protocol for low power networks and losses (RPL) [
3]. Each device routes the data using the information computed by RPL. Although 6LoWPAN (with RPL) has several positive aspects, some constraints have been pointed out: the computational complexity of the protocol executed on devices with low processing power and the lack of a unified vision of the network, which can contribute to high costs for building management systems [
4].
A software-defined network (SDN) is an architecture that aims to make networks agile and flexible. SDN’s goal is to improve network control by enabling network operators to respond quickly to changes in business requirements. Moreover, because it allows networking applications to reason about the network from a unified view of the topology, it can be considered as an alternative to overcome the above limitations. This main advantage adds to others, such as providing more flexibility in the introduction of new services, allowing for vendor independence and enabling faster innovation [
5]. SDN uses a central mechanism to make routing decisions instead of the decentralized protocols. Initially adopted in wired networks, the SDN approach has been expanded to wireless networks such as Wi-Fi mobile networks [
6] and software-defined wireless sensor networks (SDWSN) [
1].
This paper presents an architecture called SD6WSN (software-defined 6LoWPAN wireless sensor network), to control data plane forwarding in 6LoWPAN according to the SDN approach. SD6WSN defines a controller that communicates with data plane nodes through a control plane protocol (SD6WSNP), which uses IPv6 and RPL at layer 3, UDP at layer 4 and the constrained application protocol (CoAP) [
7] at the application layer. The controller uses SD6WSNP messages to send rules dictated by network applications to the nodes, which in turn define the forwarding of data plane packets. The maintenance of the RPL communication stack at the control plane allows the coexistence of SD6WSN nodes with conventional 6LoWPAN devices, allowing gradual migration, without discontinuity of the operating services.
SD6WSN allows network applications to implement routing algorithms in addition to RPL, overcoming the lack of flexibility in 6LoWPAN. A unified view enables network applications to solve complex problems. Traffic can be balanced through the routing nodes, allowing the optimized use of power and reducing interference and contention regions in the transmission medium. Algorithms can also control the radio interface, changing the transmission power to prioritize specific data streams, building routes that meet special quality requirements. Network applications can also build virtual networks to isolate traffic among private nodes, including mechanisms that enable them to meet application-specific security requirements. In addition, due to the unified view, centralized control enhances the planning and management capacity, facilitating the construction of management systems.
We evaluate SD6WSN in two experiments. The first was chosen due to the prominence of 6LoWPAN in the construction of AMI networks and neighbor area networks (NAN) of companies in the electric power sector [
8], supporting bidirectional communication for a more effective control of the electricity distribution network. Among others, this includes measurement, load control (of consumers) and distributed photovoltaic generation. The second experiment evaluates communication between peer devices, a scenario that becomes increasingly important in the so-called Internet of Things (IoT). Our experiments confirm that the proposed approach provides performance gains when compared to 6LoWPAN.
The remaining of this paper is organized as follows:
Section 2 discusses the related work, including the limitations pointed out in the literature to the 6LoWPAN-RPL approach and the differences of our approach with respect to others that adopt SDN techniques for sensor networks. In
Section 3, we describe the architecture, extending the presentation of the SD6WSN control plane presented in [
9]. In
Section 4, we provide a detailed description of how we have implemented SD6WSN in the Contiki operating system, including the software options to adapt a constrained device to act as an SD6WSN node, and the hardware options for real implementations.
Section 5 presents the two experiments that compare the performance of SD6WSN with respect to the 6LoWPAN-RPL approach.
Section 6 presents the findings and final remarks.
2. Related Work
The goal of SD6WSN is to bring the SDN approach to 6LoWPAN, supporting the implementation of complex networking applications not supported by RPL. The last is an IPv6 routing protocol that specifies how to construct a routing topology based on a destination oriented directed acyclic graph (DODAG), using an objective function that defines how a node in a DODAG selects its parents according to the routing metrics [
3]. The objective function computes a rank value, which represents the distance from the node up to the root with respect to a given metric. RPL uses the trickle algorithm [
10] to react to changes in topology that, at steady state, sends control messages at low speed, and speeding up to resolve inconsistencies [
11,
12,
13].
DODAG is best suited for converge-cast traffic, and when direct communication between sensors occurs, WSN would be subject to congestion in the links near the root. The authors in [
4] point out difficulties regarding the possible fragmentation of RPL control messages and issues regarding the hypothesis of bi-directionality assumed for the links since their quality is only evaluated in the routes towards the root. They also point out that RPL does not guarantee the absence of loops, and even if it can repair a loop when it is detected, this increases latency. The performance of RPL in AMI networks, with the emphasis on the reliability and stability, is evaluated in [
14]. The conclusion is that the protocol often chooses sub-optimized paths due to inefficient routing decisions, which is the main factor in decreasing the packet delivery rate. In a subsequent paper [
15], the same authors analyzed the role of the RPL protocol in a broader context of smart grid networks. Although the same restrictions were mentioned, the authors concluded that the application of RPL is viable.
RPL uses the expected transmission count (ETX) [
16] as one of the metrics to build the DODAG; however, it does not specify how to implement it. Several authors implemented measurement of ETX in the MAC layer [
17,
18], but this approach has a limitation. The calculation of ETX in the MAC layer can only be done when messages are sent in unicast mode. Because RPL constructs DODAG using control messages sent in multicast, the topology is built using pre-defined default values, which leads to the use of poor quality links. This difficulty was pointed out by Dawans et al. [
18], who studied the problem of neighborhood management in high-density RPL networks. Another known limitation of RPL is the size of the parent set of a node in the DODAG. If the size is small and the quality of the links is variable, the DODAG will be unstable. When the measurement engine identifies that the ETX has increased too much, the link is considered not usable, causing the use of an alternate parent. However, when there are no alternative parents, the node sends messages requesting a parent, which can cause the entire subtree to be rebuilt below it. A parent set with a size too large inhibits a child node from selecting the best parent, leading to poor routing. This is because the rank of a node must be greater than the rank of any member of its set of parents [
19].
RPL has also been compared to other alternatives. Kathuria et al. [
20] presented a comparative study between RPL and AODV (ad-hoc on-demand distance vector protocol) in intelligent energy metering networks. The simulations concluded that the AODV presents inferior performance in terms of latency and packet delivery rate (PDR) with respect to RPL in networks with a large number of nodes. Herberg and Clausen [
12] compared RPL with the LOAD (6LoWPAN ad-Hoc on-demand distance vector routing protocol), in large LLN networks with a predominance of bidirectional traffic. The authors argued that RPL is optimized for multipoint-to-point networks, with rare point-to-multipoint and point-to-point traffic. However, in AMI networks, there is a need for power meters or load controllers to receive commands frequently, and these types of traffic cannot be overlooked. The results showed that RPL provides less latency and that LOAD introduces less control traffic into the network. Yi et al. [
21] compared RPL with the LOADng (lightweight on-demand ad-hoc distance-vector routing protocol), which was developed by the 6LoWPAN working group. The authors pointed out a very large dependency of RPL on the root node of the network, which can become a critical point in the case of traffic bottlenecks. The results also show a high tendency of loops and packet fragmentation in RPL.
Karaagnac et al. [
22] presented a centralized control proposal for scheduling timeslots and channels for 6TiSCH networks using CoAP messages for the installation of schedule tables using the CoAP management standard interface (CoMI) and with messages encoded by concise binary object representation (CBOR) [
23] to optimize the control messages’ length, following the YANG data model. Similar to our research, the observed CoAP notifications are used to monitor changes in topology and link quality with neighboring nodes. The changes in the read parameters cause the nodes’s schedules’ recalculation, with subsequent sending of these new schedules to the nodes involved in the changes through the 6TiSCH CoMI interface. Their approach is similar to ours, but the SD6WSNP also uses CoAP messages for the installation of entries in the flow tables to program data plane forwarding, according to the SDN approach.
Other studies propose the implementation of SDWSN in open-source platforms, such as TinySDN [
24,
25] and CoAP-SDAN [
26]. TinySDN [
24] is an SDWSN tool for the TinyOS operating system, where the topology and link quality information collected from the CTPprotocol are informed to the central controller through the ActiveMessageC TinyOS component. From this information, layer 2 paths were computed and installed in the nodes’ flow tables using the same messaging component. In a subsequent paper [
25], the authors of TinySDN evaluated the change of the CTP protocol to RPL. The research on CoAP-SDAN [
26] proposed employing CoAP messages to acquire network quality information from the nodes and to install the centrally-computed routes in the nodes. The paper presented a packet delivery ratio comparison between the AODV, DSDVand their proposal, in a simulation environment. No details about the implementations on real constrained devices or protocol descriptions were presented. Unlike these preceding papers, ours provides a detailed specification of the architecture, which includes the control plane protocol, the flow table structure, the forwarding mechanisms in the data plane, the topology discovery and flow control. Moreover, a comprehensive description of the implementation of the SD6WSN in Contiki OS is provided, plus the description of our functional testbed based on real motes.
3. SD6WSN Architecture
SD6WSN is a typical SDN architecture, with a control layer composed of a set of controllers and a forwarding layer composed of a set of switching devices (in SD6WSN, we name switching devices as nodes). SD6WSN controllers include topology discovery and flow control functions, and the communication between controllers and nodes occurs through the southbound API. Networking applications connect to the controller to implement networking algorithms. Nodes are typical WSN devices extended with the following communication functions: border routing, data plane forwarding and control plane routing. The communication functions and sensing applications are coordinated by the SD6WSN agent, which interacts with the controller coordinator through the control plane protocol (SD6WSNP).
Figure 1 depicts the SD6WSN architecture.
The IETF has established the working group WPAN to standardize a solution for IoT, which includes IEEE 802.15.4 at the MAC layer, 6LoWPAN and RPL at the network layer, UDP at the transport layer and CoAP at the application layer.
SD6WSNP uses CoAP messages as the basis of communication, allowing the controller to perform the following operations: to manage entries in flow tables; to obtain local information from nodes including neighborhood, wireless link quality, geo-location and power transmission level; to modify node behavior, by setting power transmission level and transmission channel. Through SD6WSNP messages, the controller sends instructions to the agent (which has an internal CoAP server), which interprets the messages and performs actions, such as installing rules in the flow table. The agent also interacts with lower-level processes in the operating system (such as the TCP/IP stack) to drive packet forwarding according to the flow table. Some nodes can include the border router function, which is performed in 6LoWPAN-RPL by a special node called 6LBR (6LoWPAN Border Router). This node is responsible for topology management and for the conversion of the IPv6 to 6LoWPAN.
Figure 2 presents the SD6WSN communication architecture.
The security issue is essential for applications running in SDN. For example, in OpenFlow, the switch and controller communicate through a transport layer security (TLS) connection, which is initiated by the switch on startup to the controller. In SD6WSN, communication at layer 4 uses the UDP protocol; thus, the datagram transport layer security (DTLS) is more appropriate to securitize communication. DTLS is a communication protocol that provides security for datagram-based applications, designed to prevent eavesdropping, tampering or message forgery.
The SD6WSN architecture extends the 6LoWPAN wireless sensor network, which can alone provide message delivery. The last uses 6LoWPAN at layer 3 and UDP at layer 4, and the routing protocol is RPL. SD6WSN uses this delivery stack as the end-to-end transport protocol for supporting control plane communication, that is to transport the messages of SD6WSNP. This is the way that flow-based SDN architectures transport control plane packets. For example, OpenFlow control messages can be encapsulated in TCP packets transiting a TCP-IP network, routed by some of the standard protocols (e.g., OSPF).
In flow-based SDN, the controller is in charge of routing decisions. It sends the necessary information to switches so that they can forward packets in the data plane accordingly. In other words, the controller drives packet forwarding by storing rules in flow tables present in switches. Packets that do not match any installed flow table entry are forwarded to the controller, which computes a path for the new flow and install an entry instructing how to forward the packets of the new flow in every switch along the computed path. If the controller decides to not route a packet, it installs a new entry instructing to drop it in the origin node. SD6WSN does the same: it uses the control plane protocol (SD6WSNP) to store in the nodes the rules that the drive communication in the data plane.
In SD6WSN, networking applications are responsible for solving possible connectivity problems. Thus, it is very important that the controller maintains the unified view of the network as close to reality as possible. To do this, it needs to have a continuous connection with the nodes, to be able to receive the notifications and to send corrections to the entries in the flow tables. SD6WSNP messages are transported by a reliable protocol stack (6LoWPAN-RPL), assuring that the information of every node is continuously sent to the controller, which in turn can continuously update the contents of the flow tables, according to the decisions made by networking applications.
Flow tables are composed of two fields: match, where the characteristics of the incoming packet header that identifies the corresponding flow are defined, and action, where the forwarding behavior for a matching package is defined. A reduced set of attributes (with respect to standard SDN flow table entries) is included in the match field: IPv6 source address, IPv6 destination address, TCP source port, TCP destination port, UDP source port and UDP destination port. Each entry has a unique identifier, ranging from one to 255. Because the attributes can contain wild-cards, the header of an incoming packet can match multiple entries in the flow table. When this occurs, the more specific entry, that is the one that matches more non wild-card attributes, has the higher priority. When there are multiple entries with equivalent matching, the tiebreaker is the identification number of the flow entry (flowid), the lowest having the highest priority. IP address aggregation techniques can use the destination IP address mask (dstmask)to decrease the number of entries in the tables. If this field is not specified, mask/128 is assumed.
Table 1 describes possible attributes in SD6WSN flow table entries.
The action field has three attributes: type, nhipaddr and rfpwr. The first defines the kind of action to be taken, the second the is the next-hop address in data plane forwarding and the third is the transmission power to be adopted for specific flows. If not present, the default transmission power is assumed.
Table 2 describes the attributes of the action, field, and
Figure 3 shows the format of flow-table entries.
Messages of SD6WSNP are constructed over CoAP confirmed messages. The CoAP protocol was initially designed as a client-server protocol, with the communication initiatives taken by the client. It was later extended with the observe option [
27], activated by a flag in GET messages sent by the client, which instructs the server to register the request and send notifications back under certain conditions. The controller assumes the role of CoAP client, while the nodes assume the role of server The observe option is used whenever a relevant change state occurs or when a node receives a packet that does not match any existing flow. Three events are considered relevant changes: node failure, significant improvement of the quality of a link and deterioration of the quality of a link. The first is identified when a percentage of one node’s neighbors fail to report it on their neighborhood lists. The change in the quality of links is evaluated by the ETX metric. This kind of change should be carefully evaluated because it is common for transient changes in the quality of the transmission medium in wireless networks. Therefore, the ETX metric is calculated by an exponential moving average. In all three cases, the relevance of the change is defined by percentage thresholds that are configurable, all having default values. A node is considered inoperative when more than 50% (default parameterization) of its neighbors fail to report it in their neighborhood lists. In the default parameterization, the deterioration of link quality is considered relevant when a 100% increase in the ETX metric occurs in relation to the last notification sent, and the improvement is considered relevant when a 50% reduction of ETX is reported. The format adopted for response and notification messages is JSON (JavaScript Object Notation) [
28]. This format is largely used and has the advantage of a simple structure, with the delimitation of the fields formed by unique characters, like keys and brackets.
SD6WSNP defines four messages: node-mod, info-get, flow-mod and packet-in. Messages are classified according to the process to which they are associated. Node-mod and info-get are used for topology discovery and maintenance, while flow-mod and packet-in are used for flow control. Node-mod is the first message sent by SD6WSNP, from the controller to the border router (6LBR), requesting a notification every time a new node is identified by RPL. Just after receiving a notification, the controller sends info-get to obtain the neighbors of the discovered node and the quality of respective wireless links. A networking application can also ask the controller to send an info-get, whenever it needs information from a node. After registering the node information in its database, the controller sends a packet-in message instructing the node to send back a notification when it receives data plane packets that do not match any entry in its flow table. Flow-mod is used to insert and remove entries in flow tables, allowing the networking applications to install flows according to their traffic needs.
Table 3 summarizes SD6WSNP messages, and more details are provided in [
9].
3.1. SD6WSN Controller
The SD6WSN controller consists of three modules: coordinator; topology discovery and management; and flow control. The coordinator performs the integration with the networking applications. It uses the northbound interface to communicate with the applications the southbound interface for communication with the nodes. The topology discovery and management are triggered by flow-mod notifications and by info-get notifications received from nodes, informing significant changing in neighborhood wireless channels. The flow control module receives and process packet-in notifications. The coordinator sends and receives the SD6WSNP messages through the CoAP API of the Libcoap client library [
29] and interacts with other modules and networking applications through REST and JSON messages, as shown in
Figure 4. The state of the SD6WSN is stored in the networking database (DB).
3.1.1. Topology Discovery and Management
To maintain the unified view of the network, the controller needs to identify the active nodes, but also the neighbors that each node sees, including the quality of the wireless links that connect them, which is indicated by ETX. The SD6WSNP protocol uses the information sent in flow-mod notifications to include in and exclude nodes from the SD6WSN topology. In the case of inclusion, the controller checks if the registered node is part of a preloaded table of authorized IPv6 addresses, sending to the node the info-get/nbr-etx message to obtain its neighbors and the respective quality of links (ETX). This message is sent with the observe option enabled, so that whenever a significant change in the quality of the wireless communication channels occurs, this can be notified to the controller. Upon receiving the information, the controller informs the changes to networking applications, which perform the recalculation of the existing flows and inform the controller of the necessary modifications. When a node is excluded, 6LBR notifies the controller, which warns the applications about the topology change, allowing them to decide if there is a need to recalculate the paths of existing flows. In some situations, such as a reboot of a node, it is possible for a CoAP observe record to be lost. To work around, the controller starts a timer when an info-get/nbr-etx message is sent to a node, which is restarted whenever a response arrives at the controller. If the timer exceeds the defined limit, a new info-get message is sent to the node in question. The controller can use the info-get message to request other information from nodes (e.g., battery status), which may be sent with the observe option if it is necessary to follow the variation of these parameters.
3.1.2. Flow Control
The flow-mod SD6WSNP message includes or removes entries in flow tables. If an entry already exists, it is overwritten. The installation of a new flow results from the decision of networking applications, as a consequence of topology change or topology change notification. When a packet arrives in a node, SD6WSN checks the IP header fields according to the matching rules in the flow table, looking for an existing flow. If a matching occurs, the node performs the associated action, that is it forwards the packet in the data plane or discards it (see
Figure 5). Otherwise, the entering node sends a notification using the CoAP observe mechanism. Packet-in notification is formatted in a JSON message and contains the received packet header. When the controller receives the packet-in notification, it identifies networking applications, which calculate the corresponding route and the set of entries for the flow tables that will be inserted into/modified by nodes along to the path, to ensure the correct forwarding in the data plane.
3.2. SD6WSN Nodes
Each SD6WSN node has at least two components: agent and control plane routing. At least one node must include a third component named border router. A sensing component, which is application dependent, can be included in any node.
The agent is a CoAP server that communicates with the controller through SD6WSNP messages. It changes the local operating system packet transmission procedure (data plane forwarding) and interacts with the local operating system to read and modify specific mote information. The agent’s main functions are: (i) send information to the controller node; (ii) manage the entries in the flows table; (iii) inspect data plane packet headers; (iv) send or discard data plane packets according to matching entries in the flow table; (v) send packet-in notifications to the controller when there is no matching entry; and (v) interact with the operating system to change mote transmission parameters, such as transmission channel and RF power. SD6WSN modifies package forwarding at the operating system as follows. It inspects packets headers and checks if the incoming packet is an RPL message, and if so, it is routed through the control plane, that is it follows standard 6LoWPAN-RPL routing. Otherwise, if the packet contains an SD6WSNP message, it is handled by the agent. Otherwise, the packet is delivered to the local sensing application (see
Figure 6).
The border router extends standard 6LBR with three functions: (i) notify the controller when a node is detected or removed in 6LoWPAN; (ii) perform the routing between the IPv6 and 6LoWPAN network; (iii) identify the packets belonging to SD6WSN flows and handle them properly. Nodes with the border routing function perform data plane forwarding as described in
Figure 6.
5. Evaluation and Results
In this section, we present the validation tests of SD6WSN. Functional assessment was performed in a real testbed and the performance evaluation in the COOJA/Contiki simulation environment. The use of COOJA allows collection of data, either by the log of the UART of the emulated motes or by the capture of the packets transported between them in the same format of real networks.
We performed two experiments to evaluate the 6LoWPAN network, with SDN (SD6WSN) and traditional (RPL) routing approaches. As in the other proposals of the SDN approach, ours uses the 6LoWPAN protocol stack as the message delivery protocol (in the control plane), just as the OpenFlow approach uses the TCP-IP protocol stack to deliver its control messages. The first experiment simulates a typical AMI network scenario in residential areas, with nodes distributed along a straight path on both sides of the street. Here, the multi-hop characteristic prevailed, with a high number of jumps between the 6LBR and the most distant node. The main objective of this experiment is to evaluate the overhead introduced by SD6WSNP, with respect to RPL. The goal is to compare the competing approaches in the communication scenario most favorable to RPL, that is communication traffic occurs only from nodes to 6LBR and vice versa. To evaluate the performance of our approach in this condition, we measured the overhead incurred by SD6WSNP messages and the end-to-end delay. We expected that the overhead would not be much higher, not excessively increasing network charge with the additional control messages, thus providing similar average latency. In the second experiment, we evaluate a different traffic model. We select a classic grid topology to evaluate network performance between peer-nodes. The goal is to compare the competing approaches in a communication scenario that tends to appear more frequently in solutions aimed at the Internet of Things, where this type of communication is expected. To compare the performance of the two approaches, we compare the average (one-way) communication latency between pairs of randomly-chosen nodes.
5.1. Evaluation Tools
5.1.1. Validation Testbed
We used a simple test bed to validate SD6WSN in a real scenario based on motes of the CC25xx line (Texas Instruments). The environment features as a 6LBR a Raspberry Pi 3 model B minicomputer equipped with a USB mote that has the CC2531 chip and the Contiki firmware, compiled with the SD6WSN Border Router firmware.
Figure 13 shows some components of the test bed, including a minicomputer with two motes, one being the USB Border Router and the second identical mote loaded with the CC2531EMK sniffer firmware, used to capture packets IEEE 802.15.4 by radio frequency, used for the real-time analysis of the packets transmitted by the nearby devices. The motes use the SoC Model CC2538 because they have adequate amounts of RAM (32 kbytes) and flash memory (512 kbytes) for the installation of the S.O.Contiki 3.0 and the SD6WSN agent.
5.1.2. Simulation Environment
A sensor network using Contiki can be simulated using COOJA [
33]. One of COOJA’s most important features is to allow simulation of a network, emulation of the operating system, as well as of machine code instructions [
33]. This allows the configuration of networks with motes that emulate the operation of real hardware, including the firmware exclusively compiled for them. The Contiki-COOJA environment provides the image of a Linux virtual machine with the necessary software for compiling the firmware of several motes. The network topology can be defined and simulated with different options to capture the specificities of the wireless media. Data packets exchanged between motes can be captured and analyzed by the standard protocol analyzer (e.g., Wireshark) in the same way as in a real network.
We perform our experiments using “Wismote” motes, with 16 kbytes of RAM and 128 kbytes of flash memory, the MSP430 architecture and a 2.4-GHz CC2520 transceiver. We chose this mote type because its RAM is larger than others available in the COOJA simulator. The simulations were performed on a Linux Ubuntu 14.4 virtual machine on a computer with an Intel Core I7-6500U processor with 16 Gbytes of RAM. The environment contains the Contiki platform, including the compiler for the MSP430 and the COOJA simulator.
5.1.3. Traffic Generation
A packet generation module included in the firmware simulates the sensing application. Packets are sent to a server installed in 6LBR, which receives and sends them back. The purpose is to generate traffic in the data plane, enabling the performance evaluation. The application sends UDP packets every 30 s, with random variation (uniform) of up to 5 s, to reduce collision probability. Packets have a 20-byte payload to prevent the frame size from exceeding 127 bytes, avoiding packet fragmentation. The simulation time is 20 min, allowing the application to send at least 30 messages per node.
5.2. AMI Scenario
In this scenario, we evaluate the communication between nodes and the 6LBR, the most common communication in 6LoWPAN-RPL networks. We compare the operation of an SD6WSN shortest path application against the RPL DODAG. The location of nodes is chosen to simulate a neighborhood area network (NAN) commonly found in AMI networks [
34]. There are many real AMI scenarios that use 6LoWPAN for the communication between energy consumption meters and the meter data collector (MDC). The simulation scenario is a residential neighborhood formed by streets, with energy meters on both sides, using the grid-type topology shown in
Figure 14. One can observe one 6LBR for each street connected to a metering center containing MDC servers and SD6WSN controllers. In this scenario, we evaluate the impact of SD6WSNP messages by comparing the number of such messages with the number of RPL control messages. We also evaluate the average round-trip latency observed in the paths computed by RPL with that observed in the paths computed by the SD6WSN application.
The grid is formed by two parallel lines with a distance of 10 m between nodes, where Node 1 represents the 6LBR (see
Figure 15). This scenario allows variation of the number of hops in the paths by changing the transmission range of the nodes. In real scenarios, the range variation is due to several factors, among them the attenuation and reflections of the transmitted signal. The transmission range is varied using the Unit Disk Graph Medium (UDGM) model available on COOJA, setting transmission range to 25 m, 50 m, 100 m and 150 m and the interference range to twice the transmission range. The other wireless media settings in COOJA are transmission success rate to 75% and reception success rate to 100%.
As described in
Section 4.2, the communication between the Contiki firmware emulated in COOJA and the hosting machine occurs through an SLIP connection provided by the program “tunslip6.c”.
Figure 16 illustrates how COOJA integrates with the controller and the SD6WSN application. The firmware of 6LBR and motes also include the traffic generation application described in
Section 5.1 and a server program that receives the traffic and returns it back. Traffic generation timings have been adjusted so that traffic starts 180 seconds after the initialization of the firmware, allowing RPL and SD6WSN processes to stabilize, with the entire topology discovered.
The paths between nodes and the 6LBR are computed for each transmission range, which directly influences the number of neighbors of each node. The RPL and the SD6WSN application use the ETX metric as the weight of the corresponding links, choosing the path with the lowest accumulated ETX. RPL uses a distributed protocol, while SD6WSN uses a centralized algorithm.
Figure 17 illustrates the influence of the transmission range on the number of neighbors for each node and the consequent variation of the hop number between the 6LBR and the intermediate and the farthest nodes. In
Figure 17a, for the 25-m transmission range, each node has three to six neighbors, increasing to seven to 14 neighbors for the 50-m range (
Figure 17b), to 13 to 18 for the 100-m range (
Figure 17c) and to 19 neighbors for the 150-m range (
Figure 17d). In the latter case, all nodes have direct connectivity to the 6LBR.
In order to simulate different transmission ranges, four COOJA scripts were created in “nogui” mode (without the graphical interface). The produced logs contain transmission timestamps, allowing the calculation of the latency. Packets were captured by the COOJA plugin named radiologger-headless, the records of which are compatible with the Wireshark tool. For each range, the simulation is performed thirty times.
Table 5 compares the number of SD6WSNP messages with respect to RPL messages, the last being present in both cases. It can be observed that the increase caused by SD6WSNP messages is lower for larger transmission ranges. This is due to the smaller number of entries in the flow tables because of the reduction of hops in corresponding paths. In the worst case, the increase of SD6WSNP messages is 5.71%, which is acceptable considering the benefits that SDN can bring 6LoWPAN. Please note that the overhead incurred due to SD6WSNP messages (including all notifications) is reported in
Table 5.
End-to-end delay is also evaluated in the AMI scenario. The comparison between RPL and SD6WSN can be observed in
Figure 18,
Figure 19,
Figure 20 and
Figure 21. Because both protocols compute similar routes, they perform similarly. Latencies are statistically equivalent in the four transmission ranges.
5.3. Peer-to-Peer Scenario
The purpose of this experiment is to evaluate the performance of communication between peer nodes, with the paths between source and destination defined by the SD6WSN peer-to-peer application in comparison to the paths obtained by RPL. The latter optimizes the communication between the nodes and 6LBR, causing peer-to-peer paths to possibly involve a deviation to a common ancestor. The SD6WSN application has the unified view of the topology and uses a centralized shortest path algorithm to compute the paths, installing the corresponding flows along them. The simulation scenario consists of 25 nodes in a grid-type topology, plus the 6LBR, highlighted in gray in
Figure 22. All nodes have been compiled with a server and a client, so they can send and receive packets from any node in the grid, simulating the traffic between peer-nodes.
The number of possible source-destination pairs is 600 for the topology of
Figure 22. Among them, sixty pairs are randomly selected (offline) in three groups of 20. In each group, the origin is not repeated, but the destination is chosen without restrictions, except when the destination is the origin itself. An auxiliary CoAP resource is compiled to each node so that it can receive a configuration message informing its destination. Each source node sends 30 packets with a 20-byte payload, one every 10 s. The simulation scenario is shown in
Figure 23. Paths are computed ordinarily by RPL. The SD6WSN application computes the paths according to the unified topology, installing the corresponding flows on the nodes along them. In the case of topology changes, the SD6WSN application recomputes the affected paths and proceeds with the changes of the corresponding flow tables.
COOJA is executed in “nogui” mode, using the UDGM model, with transmission range set to 25 m and interference range to 50. The quality of wireless media is set to 75% of success in transmission and 100% in reception. We performed 10 simulations, each with three rounds of 20 origin-destination pairs. In each round, each origin node sends 30 UDP packets, with the random seed of the UDGM model changed.
Figure 24 shows the average latencies with the 95% confidence interval. It can be observed that average latency is 30.87% lower in SD6WSN when compared to RPL. This result was expected because RPL is optimized for traffic between nodes and the 6LBR; however, the gain is significant and indicates the potential of the proposed architecture.
6. Conclusions
This paper presented the SD6WSN architecture, developed to control data plane traffic in 6LoWPAN according to the SDN approach. The design of SD6WSN considers the specific characteristics of WSN devices, such as low data transfer rate, high latency, packet loss and low processing power. It also sought to take advantage of the flexibility provided by flow-based forwarding of the SDN approach, which allows the development of specific networking applications capable of routing packages in the most appropriate way depending on particular requirements.
The Contiki operating system served as the basis for implementing the proposed architecture in motes used in real-world implementations. We provide in this paper the detailed description of the SD6WSN implementation in Contiki motes. We also provide the results of two performance evaluation experiments in the COOJA emulator. The overhead introduced by SD6WSNP messages was evaluated in an AMI network scenario with four distinct propagation settings. The results indicate that the introduced overhead is not excessive, given the advantages that the SDN approach can bring. In the second experiment, a grid-topology was used to compare the average latency of peer-to-peer communication. In this scenario, the average communication latency of SD6WSNP was significantly lower than that obtained with RPL.
Due to the current memory limitation of the motes, some points have not yet been addressed in the SD6WSN implementation. We are working especially on two of them: buffering the incoming messages in situations that generate a packet-in notification and the securitization of SD6WSNP messages. In future works, with motes with greater memory capacity, we will include and evaluate both.
SD6WSN opens up many possibilities for research. Because future SD6WSN networking applications will have a comprehensive and reasonably accurate real-time view of the state of the wireless network, they could plan the flows taking into account this unified view. Moreover, because SD6WSN applications can act on the motes, for example by changing their transmission power or channel, it is possible to configure flows that would meet specific latency or packet loss requirements. Furthermore, because the routing behavior is fully determined by the controller, it is possible to configure flows to isolate the traffic among specific nodes, making it easier to improve security requirements.