Memoria
Memoria
1
Overview
Another challenge of IoT in smart cities arises from the efficient transport of the
gathered information from the source nodes up to the processing and storage
centres. Namely, the future IoT will connect to the Internet billions of
heterogeneous smart devices with the capacity of interacting with the
environment.
In this master thesis, Improving IoT with Software Defined Networking (SDN),
SDN is the key enabler to address security challenges posed by IoT in the
context networking. SDN is a new networking paradigm aiming to overcome
the limitations of traditional IP networks, which are complex and hard to
manage in terms of network configuration and reconfiguration due to faults and
changes.
The idea is to separate the control plane from the data plane, thereby the
control logic in routers and switches will be moved to a centralized network
controller. That is SDN, can be viewed as a network operating system which
interacts with the data plane and the network applications by means of APIs.
Therefore, SDN addresses properly the IoT challenges. SDN allows the
enforcement of network security at the edge, and this project will benefit from
this approach.
3
Resumen
Por lo tanto, las soluciones propuestas desde una perspectiva de red IoT
deben tener en cuenta la escalabilidad de los nodos, así como el coste
operacional de la implementación de la infraestructura de red. Esto generará
un enorme volumen de datos, lo que plantea un enorme desafío tanto para su
transporte como para su procesado. Por otra parte, aparecen problemas de
seguridad, debido al hecho de que los dispositivos maliciosos de IoT estarán
interconectados hacia las redes de agregación.
4
Acknowedlegements
In these first lines of the Thesis, I take the opportunity to especially thank my
tutors Ricard Vilalta and David Pubill, for having guided the selection of my
Project Master Thesis and for their valuable assistance in the development
thereof.
I also want to thank Ricard and David for always being available when needed
and for sharing their research projects and extensive bibliographic information
that have served as basis and guided me in this project.
5
Table of Contents
INTRODUCTION ................................................................................................. 9
6
4.1
Conclusions and results ................................................................................................. 52
BIBLIOGRAPHY ............................................................................................... 56
7
Improving IoT Security with SDN
INTRODUCTION
Billions of objects will be connected to the internet in the coming years.
Therefore it is expected a real revolution on the amount of data gathered and
shared. This is known as the Internet of Things (IoT). Objects such as home
appliances, lampposts, traffic lights or irrigation outlets are some examples of
smart things. They are equipped with several sensors generating data, which
then should be gathered and analysed
Cloud computing means the ability to store and access data and programs over
the Internet. It is a service offered by centralized data centers, which might be
geographically distributed. Instead, fog computing is a decentralised and
distributed computing infrastructure in which application services are handled at
the network edge. Its goal is to improve efficiency and reduce the amount of
data that needs to be transported to the cloud for data processing, analysis and
storage [1].
The integration of IoT with fog and cloud computing is a valuable solution due to
the functionality of computing, storage and networking resources at the edge of
the network, thus allowing fast interaction with the data and low latency. Fog
and cloud computing are expected to allow the data storage and processing
from billions of smart things and IoT gateways, while delivering these
functionalities at the edge of the network. IoT gateways are key enablers for IoT
and typically consists of small gateways which are able to interconnect
distributed wireless sensors, interconnected through wireless sensor networks
(WSN), and acting as an internet gateway for the interconnected devices.
Software Defined Networking (SDN) [11] is expected to be a key enabler for the
next generation networks, the so-called 5G (5th generation of wireless systems),
which will need to integrate both IoT services together with traditional human-
based services. In this context, SDN enables a global orchestration of
distributed cloud, heterogeneous network and IoT resources required in order
to:
a) Transport the huge amount of data generated at the terminals, sensors,
machines, nodes, etc., to any distributed computing node, edge, or core
data center;
b) Allocate computing and storage resources in distributed data centers,
and;
c) Process the collected data (Big Data) and make the proper decisions
(cognition).
SDN automatically configures network devices, gathering the data needed for
the analysis, while keeping private the details of the underlying infrastructure of
devices. It is designed to authenticate users and devices and follow the
prescribed rules of access.
One of the biggest challenges IoT network administrators face, is the ability to
collect data and conduct analyses to produce a positive user experience on the
go. SDN makes it much faster and better than legacy network hardware. SDN is
able to redirect traffic automatically when needed, which significantly improves
9
Improving IoT Security with SDN
IoT applications. SDN can also provision the environment where is carried out
and instantly delivered the analysis of data.
Moreover, security issues appear, due to the fact that untrusted IoT devices are
interconnected towards the aggregation networks or external malware are
applied to the network [7]. It is in this context, where SDN can provide a huge
advantage with regard to security.
The technical solution proposed in this Master Thesis is intended to provide an
agile answer on how to overcome and improve the IoT security with software-
defined networks. The proposed work will consists in the programming of an
intrusion detection algorithm as an SDN application and the validation of this
intrusion detection algorithm in an experimental platform (network/environment).
SDN is a method for centralized control of the network and devices, while it is
allowing the network to be extremely flexible. The use of automated policy-
based control allows transparent access across any device or platform
(accepting Bring Your Own Device – BYOD policy). The permanent monitoring
of own devices behaviour allows the scanning for potential threats.
This Master Thesis has been performed in the premises of CTTC (Centre
Tecnològic Telecomunicacions Catalunya), a research center located in
Castelldefels (Spain). More exactly, the master thesis has been performed at
the cloud/fog computing platforms and transport network of the ADRENALINE
Testbed ®. In the context of evolving the capabilities of this testbed, my work
has consisted in:
- The debugging of the Fog node and its SDN controller, which was quite
unstable.
- The design of an overall architecture for the security application, which
takes into account the several needed modules in order to properly
analyse possible security threads.
- Design and validation of a simple algorithm (several have been studied)
in order to validate the proposed application. The algorithm has been
studied against a simulated security thread and its performance has
been evaluated.
- Develop a security application which interacts with the Fog node SDN
controller. Using a REST API, the flow statistics are read and analysed,
using the previously validated algorithm.
10
Improving IoT Security with SDN
1.1. IoT
The International Telecommunications Union defines the Internet of Things
(IoT) as the “global infrastructure for the information society, enabling advanced
services by interconnecting (physical and virtual) things based on existing and
evolving interoperable information and communication technologies” [22].
Currently, the IoT is composed by a large number of networks designed for a
wide range of applications. For example, the cars of today have different
networks for controlling engine operation, the safety functions, communication
systems, etc. Commercial and residential buildings have also various control
systems for heating, ventilation and air conditioning; telephone service; security
and lighting. As IoT progresses, these networks and many others, will be
connected and will have more security features, analysis and management (see
Fig.1.1) and will offer better services by breaking the silos built in through
different IoT Networks. As Mario Campolargo, DG CONNECT European
Commission states in [11] “IoT will boost the economy while improving our
citizens’ lives.”
11
Improving IoT Security with SDN
At a wider level, cities are starting to adopt in different ways the IoT technology
by deploying sensors around the cities with the purpose of providing new
services for citizen (sensors parking, transport sensors, air quality sensors etc.),
municipality (smart building, energy efficiency, resilient city) and third parties.
This new services are grouped in the term smart cities. Thus, IoT is not only a
new paradigm in which respect the technology delivered but also is a business
ecosystem engine for the cities economic development.
12
Improving IoT Security with SDN
A gateway acts as a bridge, thus is able to route different types of traffic and
convert these streams to a common protocol for access across the WAN. Some
devices might use IP natively while others might use PAN-based protocols like
Bluetooth, ZigBee or 6LoWPAN. Nodes that are simple sensors may need to be
connected to an ADC (Analog to digital converter) to convert their raw analog
voltage to a digital value before transport.
Along with the increase in maturity of the IoT, the technology market is starting
to develop services that are key solutions for the society challenges. Below are
presented some of the market applications that are build based upon IoT
concepts [13]:
13
Improving IoT Security with SDN
Smart Environment
10 Forest Fire Detection
Monitoring of combustion gases and pre-emptive fire conditions alert zones.
11 Air Pollution
Control of CO2 emissions of factories, pollution emitted by cars and toxic gases
generated in farms.
12 Snow Level Monitoring
Snow level measurement to know in real time the quality of ski tracks and allow
security corps avalanche prevention.
13 Landslide and avalanche prevention
Monitoring of soil moisture, vibrations and earth density to detect dangerous patterns in
land conditions.
14 Earthquake Early Detection
Distributed controls in specific places of tremors.
Smart Water
15 Potable water monitoring
Monitor the quality of tap water in cities.
16 Chemical leakage detection in rivers
Detect Leakages and wastes of factories in rivers.
17 Swimming pool remote measurement
Control remotely the swimming pool conditions.
18 Pollution levels in the sea
Control real-time leakages and wastes in the sea.
19 Water Leakages
Detection of liquid presence outside tanks and pressure variation along pipes.
20 River Floods
Monitoring the water level variations in rivers, dams and reservoirs.
The IoT technology takes shape and many applications of the sensors are
starting to be deployed through the cities. Nevertheless these applications need
to have a layer of security due to the fact that malware attacks are at the
moment a menace for the data owners.
14
Improving IoT Security with SDN
1.2. SDN
Software-Defined Networking (SDN) is a network architecture that allows the
programming of the network through clearly defined interfaces. SDN allows the
possibility of creating new services and more efficient applications based on the
interaction with networks traffic, network security implementation, or quality of
service.
Figure 1.2 shows the SDN architecture, which is being defined by the Open
Networking Foundation (ONF) [2]. It basically consists of three layers:
15
Improving IoT Security with SDN
Each flow table in the switch contains a set of flow entries; each flow entry
consists of match fields, counters, and a set of instructions to apply to matching
packets.
16
Improving IoT Security with SDN
1) A Flow Table, with an action associated with each flow entry, to tell the
switch how to process the flow;
3) The OpenFlow Protocol, which provides an open and standard way for a
controller to communicate with a switch. By specifying a standard
interface (the OpenFlow Protocol) through which entries in the Flow
Table can be defined externally, the OpenFlow Switch avoids the need
for researchers to program the switch.
A basic match table for flow definition, included in OF 1.3 includes the following
parameters [17]:
17
Improving IoT Security with SDN
18
Improving IoT Security with SDN
Moreover, the available flow counters per flow entry are the following:
• Received Packets
• Received Bytes
• Duration (seconds)
• Duration (nanoseconds)
Finally, OF v1.3 introduces a new message (i.e. OFPT_METER_MOD) which
enables the specification of traffic meters into the OF-switches, with an
associated Band-rate and a QoS-enabling strategy, such dropping packets at a
determined Drop-rate or Differentiated Services Code Point (DSCP) packet
tagging to allow DiffServ. Flows can be attached to these predefined meters,
associating a maximum rate to each flow. A Meter instruction has to be included
inside the OFPT_FLOW_MOD message indicating the Meter-Id desired to be
attached to.
19
Improving IoT Security with SDN
A source code repository includes contributed source code from Big Switch
Networks, Cisco and NEC. Open Daylight project is sponsored by the LINUX
foundation, and it has its own website, wiki, and a mailing list available. These
resources appear to currently be aimed at developers wishing to contribute to
the project. The software is written in Java.
ONOS [15] is the SDN network operating system for service providers
architected for performance, high availability, scale-out and well-defined
northbound and southbound abstractions and interfaces. ONOS was open-
sourced on December 5th, 2014. The first open source release of ONOS was
called Avocet and the next is Blackbird. Blackbird, which was released recently
focuses on performance optimizations, defining metrics for measuring the
"carrier-grade quotient" of SDN control planes/controllers and publicly providing
the measurements for ONOS using these metrics.
20
Improving IoT Security with SDN
HP Network protector
HP Network protector is a SDN application on top of HP VAN SDN controller,
which programs the Openflow switches. It’s mainly targeted for BYOD (Bring
your own device) scenarios in Enterprises. Some of the important features of
HP Network protector are:
• Creating custom white and black filter lists
• Monitoring suspicious DNS requests
• Malicious identity detection
21
Improving IoT Security with SDN
1.3. Security
The integration of Internet of Things (IoT) has provided the control of different
connected devices into a single network or smart device, such as different types
of wireless sensors networks, smartphones, tablets and at the same time gave
born to a new paradigm related with security in IoT networks due to the fact that
hacked devices can be easily introduced in the networks. Thus, IoT security has
become essential for citizens’, organizations, governments and utilities for
protection of data and infrastructures and is gaining power in day to day
deployment.
Since the beginning of the Internet era and development of networks, security
has always been a primary concern for everyone, be it enterprises, small and
medium businesses (SMBs), individuals or governments. Due to the increase of
the networking applications and technological advancement security has
converted in a big concern both in public a private environments. Prior to the
emergence of IoT, the adverse effect of threats was limited to theft of money
and intellectual properties. Now, the effect can lead to loss of human life,
hacking of critical infrastructures like electricity and nuclear power grids,
organizational productivity, and even national intelligence.
22
Improving IoT Security with SDN
The main components of the generic model of the ANIDS are discussed below.
23
Improving IoT Security with SDN
Another architecture that has been studied for the security detection intrusion is
based on a simplified model composed by 3 modules:
24
Improving IoT Security with SDN
a) Collector,
b) Anomaly Detection,
c) Anomaly Mitigation
Fig. 1.6 [3] shows each module named accordingly with the functionality that
represents:
Finally the third type of architecture, called Malware Monitor [4], was studied
(Fig.1.7).
25
Improving IoT Security with SDN
b) Detector Nodes: Detector nodes first state fully inspect each received
packet for malicious content to detect events associated with malware infections
(e.g. DoS attacks or communication with malicious servers). Secondly, they
compute flow statistics for each flow they receive, such as byte and packet
counts or burst sizes. The second job can be accomplished by leveraging a
feature of OpenFlow where switches maintain flow statistics for each flow that
passes through them; thus the detector node can run an OF controller and
simply pull flow statistics from the upstream edge switch. More advanced
statistics can be calculated using simple utilities (tshark, capinfos, tcpdump)
available for Unix-based operating systems. The detector node then
26
Improving IoT Security with SDN
c) Decision Module: The decision module examines the flow meta-data sent
by the detector nodes to compute a maliciousness score for each individual
flow. However unlike the detector nodes, which looked at only one flow at a
time, the decision module performs correlation across flows to discover
suspicious patterns or combinations of events – for example, a distributed DoS
attack, or a number of flows from different hosts connecting to a common
blacklisted IP (indicating members of a botnet). Thus it assigns a maliciousness
score to a flow based not only on the events that have been detected as part of
it but also on its similarity with other malicious flows this similarity can be seen
in common events occurring in a flow or similar statistical characteristics. We
believe that some stealthy flows that are able to disguise themselves
individually can be discovered in this manner.
These methods were studied in order to have a better approach on the suitable
method to be used for the security algorithm development.
In the figure below, Fig.1.8. is presented the classification of methods that were
studied for the development of the security algorithm.
27
Improving IoT Security with SDN
Usually, statistical methods fit a statistical model to the given data and then
apply a statistical inference test to determine if an unseen instance belongs to
this model. Instances that have a low probability to be generated from the learnt
model based on the applied test statistic are declared anomalies.
Classification based methods and systems is the method that identifies the
belonging of an observation to a set of categories, where the set of categories is
a training set of data containing observations whose category membership is
known.
The objective of this method is to represent the attacks in a generic way to allow
for an easy detection of the malware. This method search for instances of
known attacks, by attempting to match with pre-determined attack
representations.
In the first instance the search of malware begins with a complete lack of
knowledge and subsequent, matching of activities against a known attack helps
acquire knowledge and enter into a zone with higher confidence.
28
Improving IoT Security with SDN
Rate Limiting
In computer networks, rate limiting is used to control the rate of traffic sent or
received by a network interface controller. It can be induced by the network
protocol stack of the sender and also by the network scheduler of any router
along the way.
The rate limiting (or traffic shaping) is the regulation of the rate at which flows
are allowed to inject packets into the network and is therefore one of the
cornerstones of any QoS architecture.
OpenFlow 1.3 allows different rate limiting policies once a certain rate has been
reached:
– Drop: Drop (discard) the packet. Can be used to define a rate limiter
band.
– Dscp: decreases the drop precedence of the DSCP field in the IP header
of the packet. Can be used to define a simple DiffServ police.
Flow interruption
In order to do not allow any traffic of a suspicious flow, the flow rule can be
directly removed from the SDN controller.
29
Improving IoT Security with SDN
The End-to-end security application will be responsible for the monitoring of the
current flows, and through different anomaly detection mechanism it will be able
to identify malicious flows. Finally, this application will apply the desired security
policies with regard to the detected anomalies in order to mitigate them. It will
consists of three main modules shown in Fig. 2.1: (a) the Collector, (b) the
Anomaly Detection and (c) the Anomaly Mitigation.
30
Improving IoT Security with SDN
Collector Module
If we focus on the available information from the SDN controller, the different
per flow counters might be obtained. From this information we can estimate the
following data per flow:
These data will allow us to detect anomalies in the flows, such as for example
intrusion detection, or WSN malfunction.
Anomaly Detection Module
Data produced by the previous module are subsequently fed to the Anomaly
Detection module at periodic time intervals, thus creating discrete time
windows. For every time window this module inspects all flow entries, exposing
any flow-related network anomaly and identifying a potential attacker or the
31
Improving IoT Security with SDN
victim of the attack. Moreover, it performs successfully not only in identifying the
attack pattern, but also the attacker or the victim (i.e. host under attack). As
soon as an anomaly is detected in the network, our algorithm inspects and
correlates specific network metrics identifying the attack and exposing all
related information to the Anomaly Mitigation module.
In later sections of this chapter, we will describe an anomaly detection
mechanism and we will evaluate its behaviour against this kind of attack.
Anomaly Mitigation Module
The Anomaly Mitigation module aims to neutralize identified attacks, inserting
flow meters in the flow table of the Open Flow switch (or removing existing
flows) in order to block/mitigate the desired malicious traffic. These flow entries
have higher priority than any other in the flow table.
This module is presented in Chapter 3, in the experimental results.
For the detection of the anomalies it has been envisaged an algorithm based on
the data variance gathered from a sensors network. The formula presented
below is the deviation calculated for the data provided by the sensors:
! !
Standard deviation: 𝜎 = ! !!!(𝑥! − 𝑥)! (2.1)
Where,
32
Improving IoT Security with SDN
𝜎 = 𝑠𝑡𝑎𝑛𝑑𝑎𝑟𝑑 𝑑𝑒𝑣𝑖𝑎𝑡𝑖𝑜𝑛
𝑥! = 𝑠𝑒𝑛𝑠𝑜𝑟 𝑑𝑎𝑡𝑎
(𝑥) = 𝑚𝑒𝑎𝑛 𝑣𝑎𝑢𝑒 𝑐𝑎𝑙𝑐𝑢𝑙𝑎𝑡𝑒𝑑 𝑓𝑜𝑟 𝑡ℎ𝑒 𝑑𝑎𝑡𝑎
The malware detection is sensed for the data processed by the sensors and is
conditioned by the following formula:
b) A bad flow is created with a probability of 10%. A bad flow has different
properties:
a. The number of packets per second are duplicated (in comparison
with a conformant flow).
b. Packet size is also 50% increased.
33
Improving IoT Security with SDN
In the following figure are presented the modules of: mean function definition,
standard deviation definition and flows checking algorithm.
The following module presents the evaluation of the algorithm. First the
algorithm is checking for bad flows through the flows created in the module
presented in Fig.2.2 then the algorithm it calculates the percentage bad flows
error by applying the condition presented through the formula 2.2 that is
comprised between, (N_SIGMA) threshold_up and (N_SIGMA)
threshold_down.
34
Improving IoT Security with SDN
In the previous section were presented the main modules of the security
algorithm, thus, during the simulation process, the main purpose was to
simulate the algorithm and to detect the ideal length of window and standard
deviation for which the error to detect the traffic malware is the smallest.
Also, is important to mention that the simulation was realized for 5 simulated
parameters N_SIGMA and 3 simulated parameters of WINDOW (see below
scenarios results a, b, c, d) for both types of traffic simulated, packets/s and
bytes/s, therefore the conclusions and explanations made for each scenario are
based strictly on these results.
For the simulation of the algorithm were modelled the following simulation
scenarios:
35
Improving IoT Security with SDN
N_SIGMA
2
4
8
10
12
Error
(%)
vs
N_SIGMA
73,3
26,9
17,2
13,8
18,3
By variations of the traffic standard deviation (sigma) it was noticed that when
incrementing sigma the error was decrementing reaching the best result for
N_SIGMA =10 and error = 13,8% (see values in Table 2.1).
As can be visualized in the Fig. 2.2 the best result has been obtained for
N_SIGMA = 10, error= 13,8%. If we take a deeper look, we can observe that is
an optimal value, due to the fact that for lower and higher values, the
performance of the algorithm decreases in terms of errors in detected security
threats. This optimal value for N_SIGMA is related somehow to the dangerous
flows properties, in terms of both the number of times that packets per second
are multiplied and the small standard deviation produced due to the fact that
only values from 20 to 23 packets/sec are generated.
If the selected N_SIGMA is lower that the optimal, the algorithm might detect
false positives, due to the proximity to standard flows. On the other hand, if the
selected N_SIGMA is higher than the optimal, the algorithm doesn’t detect
many possible threats due to the fact that only a small portion of dangerous
flows might have such a higher number of packets/sec.
36
Improving IoT Security with SDN
70,0
60,0
50,0
40,0
30,0
20,0
10,0
0,0
2
4
8
10
12
WINDOW
5
10
20
Error
(%)
vs
WINDOW
13,8
3,9
5,2
As can be visualized in the Fig. 2.3 the best result has been obtained for
WINDOW = 10, error= 3,9%.
37
Improving IoT Security with SDN
14,0
12,0
10,0
8,0
6,0
4,0
2,0
0,0
5
10
20
N_SIGMA
2
4
8
10
12
Error
(%)
vs
N_SIGMA
73,3
30,7
14,6
6,5
20,0
By variation of the traffic standard deviation (N_SIGMA) it has been noticed that
when incrementing sigma the error was decrementing. As can be visualized in
the Fig. 2.4 the best result has been obtained for N_SIGMA = 10, error= 6,5%.
This systems has the same behaviour as the scenario from section 2.5.1 as
somehow is similar with the one presented in this section, the change is that
analysis is realized for the traffic-bytes/s.
38
Improving IoT Security with SDN
70,0
60,0
50,0
40,0
30,0
20,0
10,0
0,0
2
4
8
10
12
The simulation has been realized for N_SIGMA= 10 and 1000 samples.
For each WINDOW length it was simulated the algorithm 3 times and each time
the error was tracked, afterwards it has been calculated the mean value of the
Error (%). The calculated mean value of Error (%) is presented in the table
below:
WINDOW
5
10
20
Error
(%)
vs
WINDOW
6,53
0,03
0,56
As can be visualized in the Fig. 2.5 the best result has been obtained for
WINDOW = 10, error= 0,03%.
39
Improving IoT Security with SDN
6,00
5,00
4,00
3,00
2,00
1,00
0,00
5
10
20
Overall, it has been observed that for both type of simulated traffic (packets/s
and bytes/s) the best behaviour of the algorithm is attained for window length
=10 and N_SIGMA=10. It results that the behaviour of the algorithm is stable for
the values mentioned before.
40
Improving IoT Security with SDN
In order to carry out the experimental part of this work an IoT platform has been
connected to the ADRENALINE Testbed®, developed by the researchers form
CTTC (Fig 3.1). The cloud/fog computing platforms and transport network offer
an integrated cloud and network orchestration which is capable of creating VMs
and establishing End-to-End (E2E) paths through heterogeneous networks
considering multi-domain SDN orchestration. The deployed architecture allows
providing E2E connectivity services of VMs located in different network
locations, interconnected though multi-layer multi-domain networks considering
heterogeneous SDN/OpenFlow (OF) and General Multiprotocol Label Switches
(MPLS)/Path Computation Element control planes [8].
The IoT platform (Fig 3.2) consists of a temperature and a dioxide carbon (CO2)
sensors, 2 Wireless Sensor Network (WSN) nodes and 2 gateways that gather
the data generated by the sensors, one SDN NFV Edge Node to control the
flows of data coming from the sensors and a database where the data is stored.
The SDN NFV Edge Node network element is able to provide computing,
storage and networking services, acting as a cloud edge node (fog node) and
has been introduced in [8].
41
Improving IoT Security with SDN
The proposed E2E security application (Fig.3.2) runs on top of the SDN/NFV-
enabled edge node and it has been implemented as described in previous
chapter and the implementation has been done in python.
The proposed SDN/NFV edge node has been developed using an Intel NUC
NUC5i5RYH, with 16Gb RAM and 120 Gb SSD. Several USB to Ethernet port
converters have been included in order to extent the node switching
capabilities. RYU SDN controller and OpenStack nova services are run in the
node as well.
The WSN nodes are Z1 motes by Zolertia (Fig 3.3), which feature a 16-bit RISC
CPU @16MHz, an 8KB RAM and a 92 KB flash memory. They also include the
CC2420 transceiver, which is IEEE 802.15.4 compliant. These nodes support
ContikiOS, an open-source operating system for the IoT, which connects tiny,
low-cost, low-power microcontrollers to the Internet and supports Ipv6 through
6LowPAN. It is worth noting that each mote can operate as either a source or a
sink node.
42
Improving IoT Security with SDN
Finally, the IoT gateways are connected to 2 WSN sink nodes via USB. IoT
gateways have been implemented using a Raspberry Pi 2, using Raspbian,
based on Debian. The IoT gateway reads the measurements in the USB port
and it retransmits them to a processing software, which is run in a VM running
at the edge node.
Fig. 3.4 shows the network topology as seen by the SDN orchestrator. It can be
observed that the SDN/NFV- enabled edge node is depicted in red, and
interconnected towards the metro network.
43
Improving IoT Security with SDN
44
Improving IoT Security with SDN
45
Improving IoT Security with SDN
In the table below, are described the technical details of the flow, MAC
addresses and IP addresses that are configured in the IoT Security Testbed, for
the gateways and the SDN/NFV Edge Node. The details, in terms of flow traffic
were described in the Section 3.1 Testbed description. While iot-gw1 and iot-
gw2 are the external IoT gateways, test_iot is the virtual machine running in the
edge node, which is responsible for running the storage services (implemented
as a MySQL database).
Fig 3.5 shows the SQL Database, which is composed by the following data
columns: date and hour when the data has been recorded, id of the mote (in
this case id of the sensor), value recorder, description of the recorded value and
the id of the value.
46
Improving IoT Security with SDN
Flow Description
The traffic is routed from IoT Gateway 1 with MAC address b8:27:eb:4f:67:5b
and IP address 10.1.14.7 through the source: OpenFlow switch with the
following MAC address 00:00:80:3f:5d:08:2b:72 and interface connected to port
1, with the following IP address 10.1.7.48 and the destination: a switch with the
following MAC address 00:00:6a:5a:fb:3b:66:41, this switch is in charge of
managing the traffic of the IoT SQL Database through an interface of the
controller, number 41, with the following IP address 192.168.30.30. Below is
presented the script of the flow.
47
Improving IoT Security with SDN
Source: {“routerId”:”00:00:80:3f:5d:08:2b:72”,”interfaceId”:”1”,”endpointId”:”iot-gw1”}
Dst:{“routerId”:”00:00:6a:5a:fb:3b:66:41”,”interfaceId”:”41”,”endpointId”:”test_iot”}
Traffic Params: {“reservedBandwidth”:”100000000”}
ConnectionType: {“direction”:”bidir”,”layer”:”48thernet”,”layerId”:”48thernet”}
Match: {“ethDst”:”fa:16:3e:ef:ef:15”,”ethSrc”:”b8:27:eb:4f:67:5b”}
The traffic is routed from Gateway 2 with MAC address b8:27:eb:8a:c5:ff and IP
address 10.1.14.8 through the source, OpenFlow switch with the following MAC
address 00:00:80:3f:5d:08:2b:72 and interface connected to port 3, with the
following IP address 10.1.7.49 and the destination: a switch with the following
MAC address 00:00:6a:5a:fb:3b:66:41 , this switch is in charged to manage the
traffic of the IoT SQL Data Base through an interface of the controller, number
41, with the following IP address 192.168.30.30. Below is presented the script
of the flow.
Src: {“routerId”:”00:00:80:3f:5d:08:2b:72”,”interfaceId”:”3”,”endpointId”:”iot-gw2”}
Dst: {“routerId”:”00:00:6a:5a:fb:3b:66:41”,”interfaceId”:”41”,”endpointId”:”test_iot”}
Traffic Params: {“reservedBandwidth”:”100000000”}
ConnectionType: {“direction”:”bidir”,”layer”:”48thernet”,”layerId”:”48thernet”}
Match: {“ethDst”:”fa:16:3e:ef:ef:15”,”ethSrc”:”b8:27:eb:8a:c5:ff”}
Below are presented the scripts that are collecting the traffic from the switch
OF_1 (Fig.3.5) and send them to the algorithm presented in the section 2.4:
48
Improving IoT Security with SDN
The flows are recorded as per packets per second and bytes per second as
presented in the traffic frame presented below.
Flow 1:
Flow 2:
49
Improving IoT Security with SDN
Flow 3:
Flow 4:
The fist part of the algorithm, collector module, is devoted to generate the flows
in packets per second and bits per second. In the first step is depicted, through
def create bad_flows function, the percent of error (bad_flow) that will be
generated.
In the second approach are depicted the flows comprised between a range of 0
and N_Flows, where N_Flows is 5. The depiction of the dangerous flows starts
when the condition if not create bad_flow () is not accomplished.
50
Improving IoT Security with SDN
A widely used and easy to be implemented method for the flow mitigation is the
flow limiting in the OF Switch. In the picture depicted below can be visualized
through Wireshark the flow traffic eliminated from the switch OF_1, IP address
10.1.7.45.
51
Improving IoT Security with SDN
52
Improving IoT Security with SDN
- Develop a security application which interacts with the Fog node SDN
controller. Using a REST API, the flow statistics are read and analysed,
using the previously validated algorithm.
The results obtained during the experimental process are valuable insights in
which regards the election of the most proficient parameters (standard deviation
and window supervision length) that ensure the efficiency of the algorithm. By
knowing and implementing the most efficient parameters, it ensures the best
effort of the algorithm and therefore is created a secure environment for the
proposed testbed.
53
Improving IoT Security with SDN
the IoT database. Along with the fast testbed repose it is improved the energy
use of the networks due to the fact that the fast network response is translated
by a decrement of the energy used to obtain the query data.
54
Improving IoT Security with SDN
Acronym Description
ADC Analog to digital converter
ANIDS Architecture Network Intrusion Detection System
ARP Address Resolution Protocol
BOS bit Bit Oriented Signalling
BYOD Bring your own device
CTTC Centre Tecnològic Telecomunicacions Catalunya
DDos Distributed denial attack of service
DNS Domain Name System
ECP Explicit Congestion Notification
ICMP Internet Control Message Protocol
ISP Internet Service Provider
OF Open Flow
OVS Open Vswitch
ONOS Open Network Operating System
PAN Personal Area Network
PBB Provider Backbone Bridge
I-SID Backbone Service Identifier
MPLS Multiprotocol Label Switching
NIDS Network intrusion detection system
RSPAN Remote Switch Port Analyser
WSN Wireless Sensors Networks
WAN Wide Area Network
SCTP Stream Control Transmission Protocol
SDN Software Defined Networking
SPAN Switched Port Analyser
TLS Transport Layer Security
VAN Virtualized application networks
55
Improving IoT Security with SDN
Bibliography
[1] Bonomi, Flavio, et al. "Fog computing and its role in the internet of things."
Proceedings of the first edition of the MCC workshop on Mobile cloud
computing. ACM, 2012.
[1] Nadeau, Thomas D., and Ken Gray. SDN: software defined networks.
O'Reilly Media, Inc., (2013).
[2] Bhuyan, Monowar H., Dhruba Kumar Bhattacharyya, and Jugal Kumar
Kalita. Network anomaly detection: methods, systems and tools. pp. 303-336
Communications Surveys & Tutorials, January 2014
[3] Li, Bingdong, et al. "A survey of network flow applications." Pp 567-581,
Journal of Network and Computer Applications 36.2 (2013)
[4] Abaid, Zainab, Mohsen Rezvani, and Sanjay Jha. "MalwareMonitor: An sdn-
based framework for securing large networks." Proceedings of the 2014
CoNEXT on Student Workshop. ACM, (2014)
[5] Giotis, K., et al. "Combining OpenFlow and sFlow for an effective and
scalable anomaly detection and mitigation mechanism on SDN environments."
Pp 122-136, Computer Networks 62 (2014)
[10] Seugwon Shin, Philip Porras, Vinod Yegneswaran, Martin Fong, “FRESCO:
Modular Composable Security Services for Software Defined Networks”, ISOC
Network and Distributed Security Symposium (2013)
[11] Dr. Ovidiu Vermesan, Dr. Peter Friess, Internet of Things: Converging
Technologies for Smart Environments and Integrated Ecosystems, River
Publishess Alborg, 2013
56
Improving IoT Security with SDN
[20] Aparicio Carraza, Julio Tax, Jose Reyes Alamo, “Building a Future in SDN
with one Controller”, The City University of New York,
https://openlab.citytech.cuny.edu/jreyesalamo/files/2012/08/Building-a-Future-
in-SDN-with-one-Controller.pdf
57
Improving IoT Security with SDN
#!/usr/bin/python
import
time
import
random
import
math
TIME_WINDOW
=
1
N_FLOWS
=
5
T_MAX
=
1000
*
TIME_WINDOW
flow_results_db
=
{}
values_db
=
{}
N_SIGMA
=10
WINDOW
=
10
#CHECK_PARAM='packets_per_second'
CHECK_PARAM='bytes_per_second'
ALGOERRORS
=
0
ALGODECISIONS
=
0
FLOWS
=
0
BADFLOWS
=
0
BADFLOWS_ERROR
=
0
def
create_bad_flow
(percent=10)
:
return
random.randrange(100)
<
percent
def
read_flows(T)
:
#print
"reading
flows"
for
i
in
range(0,
N_FLOWS):
#select
if
flow
is
ok
or
not
base_pkts_sec
=
20
if
not
create_bad_flow():
flow_results_db[i]['timestamp'].append(
time.time()
)
flow_results_db[i]['packets_per_second'].append(
base_pkts_sec
+
random.randint(
0,
i+4)
)
flow_results_db[i]['bytes_per_second'].append(
100
*
flow_results_db[i]['packets_per_second'][-‐1]
)
flow_results_db[i]['bad_flow']
=
False
else:
#print
"Creating
dangerous
flows"
58
Improving IoT Security with SDN
flow_results_db[i]['timestamp'].append(
time.time()
)
flow_results_db[i]['packets_per_second'].append(
2*(
base_pkts_s
ec
+
random.randint(
0,
i+4)
)
)
flow_results_db[i]['bytes_per_second'].append(
150*flow_results_
db[i]['packets_per_second'][-‐1]
)
flow_results_db[i]['bad_flow']
=
True
#print
"Flow:
"
+
str(i)
+
"
packets_per_second
"
+
str(flow_results_db[i]['packets_per_second'][-‐1])
+
"
bytes_per_second:
"
+
str(flow_results_db[i]['bytes_per_second'][-‐1])
#def
mean
function
def
mean(values):
return
sum(values)*1.0/len(values)
#def
standard
deviation
mean
def
stanDev(values):
length=len(values)
m=mean(values)
total_sum=0
for
i
in
range
(0,length):
total_sum+=
(values[i]-‐m)**2
under_root=total_sum*1.0/length
return
math.sqrt(under_root)
def
check_flow(flow_id):
global
ALGODECISIONS,
ALGOERRORS,
FLOWS,
BADFLOWS,
BADFLOWS_ERROR
ALGODECISIONS
=
ALGODECISIONS
+
1
FLOWS+=1
result
=
False
if
CHECK_PARAM=='packets_per_second':
#check
pkts_per_sec
result
=
check_flow_param(flow_id,
'packets_per_second'
)
else:
#check
bytes_per_sec
result
=
check_flow_param(flow_id,
'bytes_per_second'
)
#evaluating
algorithm
if
ALGODECISIONS
>=
WINDOW
*
N_FLOWS
:
if
flow_results_db[flow_id]['bad_flow']:
BADFLOWS
+=
1
print
"Checking
a
bad
flow"
if
(result
!=
flow_results_db[flow_id]['bad_flow']
):
59
Improving IoT Security with SDN
60
Improving IoT Security with SDN
values_db[flow_id].append(flow_results_db[flow_id][param][-‐
1])
return
True
def
process_flows():
for
i
in
range(0,
N_FLOWS):
check_flow(i)
if
__name__
==
'__main__':
#print
"SECURITY
APP"
T
=
0
#INIT
for
i
in
range(0,
N_FLOWS):
flow_results_db[i]
=
{
'timestamp'
:
[],
'packets_per_second'
:
[],
'bytes_per_second'
:
[],
'bad_flow'
:
False
}
values_db[i]
=
[]
#START
FLOW
LOOP
while(T<=T_MAX):
print
"HI.
Current
time:
"
+
str(T)
read_flows(T)
process_flows()
#time.sleep(TIME_WINDOW)
T
+=
TIME_WINDOW
61