## 2 State of the Art
### SDN and NFV in IoT Environments  
SDN has demonstrated its benefits widely in managing complex networks. The separation of the data plane and data control has brought about highly dynamic and scalable network operations [12]. The SDN controller centralizes the data control and maintains global visibility of the network state [13]. The SDN controller can monitor, prioritize, and de-prioritize network traffic through APIs [14].  
The generic SDN architecture is composed of three layers: (i) the application layer, (ii) the control layer, and (iii) the infrastructure layer, as is shown in Figure 1. The SDN controller is part of the control layer and keeps communication with the entities of the application layer and infrastructure layer through APIs [15]. Furthermore, the SDN controller is responsible for providing security, routing, and network management [16]. The infrastructure layer comprises virtual (e.g., OpenVswitch or OpenFlow) and physical network devices. The SDN controller communicates with the infrastructure layer through southbound APIs and the application layer through northbound APIs.  
The southbound APIs facilitate the SDN controller's ability to control heterogeneous networks. By doing so, the SDN controller can dynamically change forwarding rules installed in switches and routers, among others [17]. OpenFlow is the most used southbound API [18], but it is not the only one available. For instance, the following are implemented southbound APIs: NETCONF, OF-Config, Opflex, as well as some routing protocols such as IS-IS, OSPF, and BGP [17]. OpenFlow controls network devices' routing tables and other hardware using an SDN controller. The SDN controller can remotely configure the flow tables of OpenFlow switches. Each open-flow table consists of the packet header, action, and statistics [13]. In this way, the user can program the behavior of the network.  
On the other hand, the northbound interfaces support and enable innovative applications. Currently, most controllers implement the northbound API through the Representa  
Figure 1: Generic SDN architecture in IoT environments.  
tional State Transfer (REST) web architecture, but it can offer other more specialized APIs such as NVP NBAPI and SDMN API [19]. There are other northbound interfaces to abstract the controller functionalities and facilitate the data plane behavior from the application developers [19], but these are more related to programming and query-based languages, such as Frenetic, Procera, and Netcore, among others [13].  
Several controller implementations have been proposed to manage, mainly, OpenFlow-based switches. The NOX and the Python-based open source (POX) were the first open-source controller implementation of the OpenFlow protocol based on the C++ and Python programming languages [17]. Other controller implementations have since been proposed for providing a centralized and distributed control based on the C, Java, JavaScript, or Ruby programming languages. These controller implementations include Beacon, Helios, ONIX, ONOX, OpenDaylight, and the Ryu framework [13]. Furthermore, some implementations aim to manage wireless networks and provide programmable and flexible stack layers for wireless networks, such as openRadio and MobileFlow [19]. This wireless network controller implementation focuses on solving mobility routing issues.  
The SDN approach has been used in the design of IoT architectures [20]. SDN demonstrates that it can reconfigure the IoT network according to the environment changes [14]. In addition, SDN technologies can handle IoT requirements in terms of Quality of Service (QoS) guarantee, traffic engineering, and security services. Furthermore, the virtualization of the network functions has demonstrated an enhancement of IoT networks' scalability and flexibility [21].