http://www.diva-portal.org

This is the published version of a paper presented at 11th Swedish National Computer Networking Workshop (SNCNW 2015) Karlstad, May 28-29, 2015.

Citation for the original published paper:

Jacobsson, M., Orfanidis, . (2015) Using -defined networking principles for wireless sensor networks. In: Proc. 11th Swedish National Computer Networking Workshop

N.B. When citing this work, cite the original published paper.

Permanent link to this version: http://urn.kb.se/resolve?urn=urn:nbn:se:uu:diva-254172 Using Software-defined Networking Principles for Wireless Sensor Networks

Martin Jacobsson and Charalampos Orfanidis Uppsala University Department of Information Technology Email:{martin.jacobsson, charalampos.orfanidis}@it.uu.se

Abstract—In this paper, we propose an architecture based on This extra functionality enables a much higher degree of software-defined networking (SDN) for wireless sensor networks. tailoring, but also more advanced in-network processing. The Ideas of how to design and make use of the flexibility that latter also provides shorter communication paths between SDN offers are presented. We discuss how SDN principles can lead to the use of commodity hardware in a wider range of sensors, actuators, and the data processing. This also leads WSN deployments and then tailor the software only to meet the to more robustness due to less dependence on far away nodes, requirements of the specific deployments and their applications. as well as lower delays and less energy consumption due to A few examples are introduced that demonstrate how the the minimized communication paths. architecture can be used for networking, in-network processing, In this paper, we discuss how SDN concepts can lead to the and performance predictions. use of commodity hardware in a wider range of IoT and WSN I.INTRODUCTION applications and then tailor-making using software to meet the More and more physical objects are becoming smart and requirements of the specific deployments. connected using ICT. A key concept for this is wireless sensor The remainder of this paper is organised as follows. Sec- networks (WSN), which connects smart objects with each tion II introduces the SDN-based architecture for WSNs. other in a local area using low power wireless communi- In Section III, we discuss the networking aspects of the cations. WSN is an important building block for the future architecture, while in Section IV, we give some example Internet of Things (IoT) vision. SDN applications. Section V contains the related work and WSNs may be used for many different types of applications Section VI concludes the paper. and in many different types of environments, such as in residential homes, apartment buildings, large office buildings, II.AN SDNARCHITECTUREFOR WSN industrial plants, outdoor in urban environments as well as SDN is a concept developed to meet the demands of rural areas. Applications may be delay-tolerant collection of more flexibility in the networking implementations on Internet sensor readings, responsive smart home applications, tracking routers. In SDN, there is a decoupling defined between the of mobile objects or persons, and time- and mission-critical control plane and the data plane with OpenFlow [3] being the operation of industrial plants, to name a few. currently most successful standard. New network control and For the IoT vision to become true, it is important to keep management solutions can easily be deployed by replacing the the costs low and this is mainly achieved through economy control plane functionality. of scale in both hardware and software. This means both OpenFlow is based on TCP, which means that the control standardized hardware and software. At the same time, appli- function could run locally on the router or somewhere else, cation requirements may force us to tailor every single WSN such as at a central server. Through the interface, the controller deployment individually and this can only be achieved by a application can configure the forwarding tables of the router high degree of reconfiguration capabilities, something that can (or network switch). The task of the controller is to provide be realised by using concepts and ideas from software-defined a coherent image of the entire network and provide it as networking (SDN) [1]. one single entity towards the SDN applications. Typical SDN The developments in hardware have made reconfiguration applications could be routing, but also other functions, such as possible. The TelosB WSN node platform [2], which is the access control and software-based traffic analysis, are possible. most commonly used experimention platform in the research The aim of this paper is to propose a flexible architecture for community, is now 10 years old. Today, for example, ARM WSN and IoT systems based on ideas from SDN and where and its partners have released new energy-efficient micro- in-network processing is a natural part. We have to mention controllers, such as the ARM Cortex M-series, which are suit- that an SDN architecture for WSNs includes challenges. The able for WSN nodes. Some of these have a 32-bit architecture WSNs have constrained resources and most of the times are and much more program and code memory as well as faster battery operated, which means that the available energy should processing capabilities than TelosB. Also the wireless chips be managed efficiently. One of the basic functions in a SDN have been updated. All this enables much more functions in architecture is the communication between the control and software. data plane and an increase in the communication will increase SDN Layers Back-End Server or Gateway SW Topology Application VM1 VM2 VM.. VM Optimization Simulation Control Specification Application Layer Application Central Execution Environment Controller r e l l

Control Layer l a o r c t

VM o n L o Routing & Forwarding C Local Local Local Controller Controller Controller Infrastructure Layer m

r VM o f

WSN Node WSN Node WSN Node t a l P

e HW d

Fig. 1. Overall SDN architecture for a WSN o MAC N

N Reconfigurable

S PHY W the energy consumption. Hence, the energy efficiency is one factor that should be considered during the design of a WSN Fig. 2. The architecture of the WSN node with SDN support architecture based on SDN. Figure 1 shows the overall architecture of our proposal with the SDN layers indicated. Each WSN node is equipped with a the WSN nodes, it also becomes possible to distribute the local controller, whose functionality can be as simple as just controller function. I.e., it is no longer required to run the receiving and executing the commands from the central con- controller on a central node. Furthermore, hybrid controller troller. The central controller communicates over the network versions can be defined. with either the used routing protocol if it is running or simple In homogenous networks, native binaries and dynamic link- networking principles, such as network-wide flooding [4]. On ing can be used, while massively heterogenous networks may top of this, message formats between the controller and the benefit from using code and VM technology designed WSN nodes must be defined. for embedded systems. OS has good support for On top of the central controller, there are one or more SDN dynamic loading as well as over the air programming, which applications. These applications can be related purely to the can be used if all run the same software and micro-controller networking of the WSN, such as topology control and routing. architecture. If various hardware and software systems exist In this architecture, some SDN applications may be directed in the same network, VMs may be a better choice. Some towards the network operator staff with a user interface, while researchers have proposed to put a virtual machine (VM) on others are completely automated. SDN applications may use WSN nodes. In this way, one single byte code binary can optimization solvers, simulators, specifically made algorithms, be distributed and executed on any node. Examples of VMs or a combination. developed for WSN nodes include EmbedVM, TakaTuka [6], Figure 2 shows the functionality on the WSN Nodes. Ev- and Darjeeling [7]. The latter two are Java VMs. A third erything, except potentially some parts of the local controller option is using something similar to the command chains of resides in the infrastructure layer. The main task of the local snapMac [8], i.e., a domain-specific VM-like engine with a controller is to setup, reconfigure, and monitor the parts of the small set of pre-defined commands that can be executed by software that can be reconfigured. It can do so in two ways. a very simple byte code interpreter. A fourth option is to use Either it changes parameters in the different functions, such as very simple scripting languages. Whatever choice is made, it the central frequency of the radio, the retransmission limit in is also important to have a good run-time monitoring system the MAC layer, modifying entries in the forwarding table, etc., that, for instance, can deal with application processes running or it installs new code in the different functions that changes out of hand or debugging. VMs and scripting languages may the behavior. The latter can be done by virtual machines (VM), be better in offering that functionality. but can also be done with native code and dynamically linked library functions. In this way, not only routing and MAC can III.RECONFIGURABLE NETWORKING be modified by the controller, but there is also flexibility for With SDN, we have the option to centralize all or some parts the neighbour and topology discovery functionality as well as of the networking at a more powerful node. For robustness other functions. reasons, we may not centralize everything. Instead, MAC, In-network processing of sensor data is important for the forwarding, and many routing decisions are still likely to be robustness of applications, energy-efficiency, and the reduction carried out by the individual nodes. However, long-term deci- of the delay. An application execution environment is defined sions can be taken by a centralized controller, such as which that allows application code to be updated over the air that protocol and what parameters to use. A central controller may can process sensor data as it is being forwarded by the nodes. also have good knowledge about application requirements, For instance, the ProFuN TaskGraph Tool [5] can be used. which can be taken into account as well. With a good code execution environment in place on The central controller needs to discover the actual topology and the quality of the links. This can be done either by has been shown by [8], [11]. In general, simulation or opti- packet trace information or simpler link quality estimation mization solvers may be used to find the right configuration. (LQE) for the links of the network. What is best depends The new thing here is that we can also take application needs on how it is supposed to be used. Hence, even this part into account in this process. should be reconfigurable. Only when data is needed by an SDN application, the collection of data should be started, since B. Optimal code deployment every extra data collection will reduce the network life-time. Depending on the topology, where a piece of code is A packet trace contains detailed information over how executed may have importance on the network life-time and packet losses over a link behaves. This information can be used robustness. If the processing of sensor data is done on one of in a simulator (e.g., [9]) with a technique known as trace-based the intermediate nodes, data does not need to make a detour simulation. The simulator can be used to answer questions, to be processed. Good data about the network can be used such as which protocol is best or which parameters should together with a solver to find the optimal assignment [5], [14]. be selected. The good thing is that the accuracy between the simulator and the deployment will be very good since the trace C. Predicting a WSN networks behavior and performance is collected from the network under study. Given the topology information, the used protocols, the While trace-based simulations can offer very good accuracy, application behavior, and everything else, it becomes possible trace data is expensive to collect. Hence, more light-weight to simulate the actual network at hand and predict its behavior alternatives are needed. LQE [10] is used to predict a link’s and performance. For instance, what is the actual network life- quality for various reasons, such as transmission power con- time likely to be and what protocol is best for this particular trol, rate adaptation, and routing. Many such techniques have network and application? Robustness analysis can also be done been proposed [10] and in general they are designed to be by simulating link or node outages. A system could also be light-weight. The collection of LQE for all links and thereby envisioned that goes one step longer and suggests the network also the network topology has been discussed by a handful of operator to make alterations to the node deployment, such as papers, such as [11]–[13]. move or add nodes, use of other antennas, etc. To gather LQE information from all links in the network and model this for use by the SDN applications is not a trivial D. Network life-time prediction problem. There are many aspects that need to be looked at and Using good energy consumption models [15] together with that have implications on the overall performance. Questions collected network data, such as radio propagation information to be answered includes: What data to collect and how? Packet and battery levels, better predictions of the network life-time reception ratio (PRR), received signal strength (RSS), signal- can be achieved. For the overhearing and collisions, it may also to-noise ratio (SNR), noise level, chip/bit error rate, etc. How be necessary to collect interference information. Interference often to sample and collect topology information? How much can be collected by the WSN nodes in a similar fashion to energy do we consume by doing these measurements? Do we JamLab [16]. gain by doing it? What happens to the energy efficiency by introducing all this extra overhead? V. RELATED WORK Many of the answers depend on how the data is being used. Early on in the WSN research, it has been noted that The LQE method may also have to take into account different some MAC protocols work better in some scenarios and packet sizes, transmission powers, and data rates, depending other protocols in other scenarios. Hence, reconfigurable or on the underlying wireless technology being used. We need adaptive MAC platform have been proposed. T-MAC [17] to define light-weight mechanisms for collecting topology is one such early protocol where the listening period is information that is still useful. Since this functionality also adaptive. C-MAC [18] is a much more recent protocol where has to evolve, we need this collection mechanism to also be many parameters can be reconfigured by the applications. replaceable. By updating the code, what is collected, how it In pTunes [11], the authors treat the parameters of a MAC is processed, and when it is communicated can be changed to protocol as an optimization problem. They collect data from meet future requirements. the network at the base station where a solver is used to find the optimal parameter configuration. The network is then IV. FURTHER SDNAPPLICATIONS reconfigured accordingly. With snapMac [8], it is possible When the topology and link information has been collected, to program the radio layer with a sequence (called chain) it can be used for various reasons. Here, we apply this of simple commands. The idea is similar to a VM with an information in four more ways. extensible set of very low-level instructions. IMPERIA [13] is a centralized architecture for WSNs with A. Centralized Networking data gathering applications. It defines MAC, routing, and If LQE or packet trace information is available at the con- management protocols. Its main idea is to move functionality troller, we can use it for routing or tuning routing parameters. from the simple WSN nodes to the sink (i.e., the controller In [13], one approach is attempted for centralized routing. The functionality) in a similar way to a SDN. However, the tuning of parameters based on information about the network flexibility of the SDN concept is not at all studied. Using SDN in WSNs has been proposed before. Mahmud [5] A. Elsts, F. H. Bijarbooneh, M. Jacobsson, and K. Sagonas, “Demo et al. [19] propose to deploy OpenFlow in WSNs, but the abstract: ProFuN TG: A tool using abstract task graphs to facilitate the development, deployment and maintenance of contributions are limited. The same holds for Luo et al. [20]. In applications,” in the 12th European Conference on Wireless Sensor [12], Costanzo et al. propose an architecture for a SDN-based Networks (EWSN’15), Porto, Portugal, Feb. 9-11, 2015. WSN where forwarding tables and in-network aggregation [6] F. Aslam, C. Schindelhauer, G. Ernst, D. Spyra, J. Meyer, and M. Zal- loom, “Introducing TakaTuka: a java virtualmachine for motes,” in the of sensor data can be configured. A method for collecting 6th ACM conference on Embedded network sensor systems (SenSys’08), topology information and configuration packets are proposed. Raleigh (NC), USA, Nov. 5-7, 2008. Software-defined radio (SDR) is another related area where [7] N. Brouwers, K. Langendoen, and P. Corke, “Darjeeling, a feature-rich VM for the resource poor,” in the 7th ACM Conference on Embedded radio hardware is replaced with software or reprogrammable Networked Sensor Systems (SenSys’09), Berkeley (CA), USA, Nov. 4-6, hardware (e.g., FPGA) for increased flexibility. The required 2009. intensive signal processing is very energy costly [21] and [8] P. D. Mil, B. Jooris, L. Tytgat, J. Hoebeke, I. Moerman, and P. De- meester, “snapMac: A generic MAC/PHY architecture enabling flexible might not be an option for WSN nodes in the foreseeable MAC design,” Ad Hoc Networking, vol. 17, pp. 37–59, Jun. 2014. future. [9] A. Marchiori, L. Guo, J. Thomas, and Q. Han, “Realistic performance analysis of wsn protocols through trace based simulation,” in the 7th ACM workshop on Performance evaluation of wireless ad hoc, sensor, VI.CONCLUSIONS and ubiquitous networks (PE-WASUN’10), Bodrum, Turkey, Oct. 17-21, Oct. 17-21, 2010. In this paper, we have proposed a SDN-based architec- [10] N. Baccour, A. Koubaa,ˆ L. Mottola, M. A. Zu´niga,˜ H. Youssef, C. A. ture for flexible reconfiguration of WSN networking and Boano, and M. Alves, “Radio link quality estimation in wireless sensor networks: A survey,” ACM Trans. Sen. Netw., vol. 8, no. 4, pp. 34:1– in-network processing functionality. SDN is an important 34:33, Sep. 2012. building block for being able to use standardised low-cost [11] M. Zimmerling, F. Ferrari, L. Mottola, T. Voigt, and L. Thiele, “pTunes: off-the-shelf hardware and yet achieve customization suitable Runtime parameter adaptation for low-power MAC protocols,” in the 11th International Conference on Information Processing in Sensor to the individual deployments. We have discussed how the Networks (IPSN’12), Beijing, China, Apr. 16-19, 2012. architecture can be used for different purposes, including [12] S. Costanzo, L. Galluccio, G. Morabito, and S. Palazzo, “Software networking, in-network processing, and WSN management defined wireless networks: Unbridling SDNs,” in the 2012 European Workshop on Software Defined Networking (EWSDN’12), Darmstadt, tasks. Germany, Oct. 2012. An important step in validating the architecture is to im- [13] U. Hunkeler, C. Lombriser, H. Truong, and B. Weiss, “A case for cen- plement a prototype version of it. In the future, we aim trally controlled wireless sensor networks,” Elsevier Computer Networks, vol. 57, no. 6, pp. 1425–1442, Apr. 2013. to make such a prototype and demonstrate its flexibility by [14] F. H. Bijarbooneh and M. Jacobsson, “Macroprogramming of wireless implementing multiple controllers and SDN applications on sensor networks using task graphs and constraint solving,” in the common WSN hardware for different types of applications, 8th Swedish National Computer Networking Workshop (SNCNW’12), Stockholm, Sweden, Jun. 7-8, 2012. such as data collection applications as well as sense-compute- [15] J. Vazifehdan, R. V. Prasad, M. Jacobsson, and I. G. Niemegeers, “An act type of applications. An interesting research question to be analytical energy consumption model for packet transfer over wireless addressed in the future is also the investigation of the trade-off links,” Communications Letters, IEEE, vol. 16, no. 1, pp. 30–33, Jan. 2012. between increased SDN functionality and energy efficiency. [16] C. Boano, T. Voigt, C. Noda, K. Romer,¨ and M. Zu´niga,˜ “JamLab: Augmenting sensornet testbeds with realistic and controlled interference ACKNOWLEDGMENTS generation,” in the 10th ACM/IEEE Intl. Conf. on Information Process- ing in Sensor Networks (IPSN’11), Chicago (IL), USA, Apr. 1214, 2011. This research is partly sponsored by the Swedish Foundation [17] K. L. T. Dam, “An adaptive energy-efficient mac protocol for wireless sensor networks,” in the 1st International Conference on Embedded for Strategic Research (SSF) under research grant RIT08-0065 Networked Sensor Systems (SenSys’03), Los Angeles (CA), USA, Nov. for the project ProFuN: A Programming Platform for Future 5-7, 2003. Wireless Sensor Networks. [18] A. F. R. Steiner, T. Muck,¨ “C-MAC: A configurable medium access control protocol for sensor networks,” in IEEE Sensors, Kona (HI), USA, Nov. 1-4, 2010. REFERENCES [19] A. Mahmud, R. Rahmani, and T. Kanter, “eployment of flow-sensors in internet of things virtualization via OpenFlow,” in the 3rd FTRA Inter- [1] B. Nunes, M. Mendonca, X.-N. Nguyen, K. Obraczka, and T. Turletti, national Conference on Mobile, Ubiquitous, and Intelligent Computing “A survey of software-defined networking: Past, present, and future (MUSIC’12), Vancouver, Canada, Jun. 26-18, 2012. of programmable networks,” Communications Surveys Tutorials, IEEE, [20] T. Luo, H.-P. Tan, and T. Quek, “Sensor OpenFlow: Enabling software- vol. 16, no. 3, pp. 1617–1634, Third 2014. defined wireless sensor networks,” IEEE Communications Letters, [2] J. Polastre, R. Szewczyk, and D. Culler, “Telos: Enabling ultra-low vol. 16, no. 11, 2012. ´ power wireless research,” in the Fourth International Symposium on [21] S. Szilvasi,´ B. Babjak,´ P. Volgyesi,¨ and A. Ledeczi,´ “Marmote SDR: Information Processing in Sensor Networks (IPSN’05), Los Angeles Experimental platform for low-power wireless protocol stack research,” (CA), USA, Apr. 15, 2005. Journal of Sensor and Actuator Networks, vol. 2, no. 3, pp. 631–652, [3] N. McKeown, T. Anderson, H. Balakrishnan, G. Parulkar, L. Peterson, 2013. J. Rexford, S. Shenker, and J. Turner, “Openflow: Enabling innovation in campus networks,” SIGCOMM Comput. Commun. Rev., vol. 38, no. 2, pp. 69–74, Mar. 2008. [4] M. Jacobsson, C. Guo, and I. G. Niemegeers, “A flooding protocol for manets with self-pruning and priorited retransmissions,” in the International Workshop on Localized Communication and Topology Protocols for Ad hoc Networks (LOCAN’05), Washington DC, USA,, Nov. 7-10, Nov. 7-10, 2005.