scieee AI-readable full text Open interactive document viewer

Integrating an intrusion detection system with heterogeneous IoT endpoint devices

Alves, André Filipe Pereira

Abstract

With the technological development, the world is witnessing a phenomenon that can be described as a flooding of gadgets and electronic devices in everyone’s daily life, both for work and personal usage. Due to this continuous increasing of development and deployment of gadgets, the IoT is continuously increasing its presence in city houses, companies and streets, with various devices that can work as sensors and/or actuators for many purposes. The quick growth of this industry is leading to the manufacturers the prioritizing production of devices with smaller dimensions, higher efficiency concerning energy consumption, greater processing capabilities and, ultimately, at a reduced cost. Meanwhile, it has been observed that these devices, and the networks in which they are integrated, still remain very vulnerable and require stronger protection mechanisms. Therefore, there is an obvious urgency in the development of appropriate solutions to protect businesses, consumers, and critical infrastructure as well as ensuring greater reliability on these devices. Hereupon, this dissertation consists in the development of the IDIoT, an IDS for the IoT, designed for heterogeneous endpoint devices. This system improves endpoint devices security with network layer control by being able to detect and correct to the most popular attacks targeting low-end devices, such as DoS and routing attacks. Since it targets low-end devices, this mechanism must require the smallest memory footprint possible, without sacrificing the energy consumption and the overall system performance. Throughout this dissertation, several IDS systems and possible attacks are studied in order to endow IDIoT with the best possible features. In order to test the solution over a network that can represent real world scenarios, the IDIoT was tested over the Cooja simuator, which is a network simulator that is able to emulate several IoT motes under a chosen network topology. Furthermore, some experimental results are presented in order to prove the efficiency of the proposed solution, through the simulation of attacks against an emulated network where devices are running the IDIoT. At last, the conclusion and future work perspectives are presented.

Full text

Universidade do Minho Escola de Engenharia André Filipe Pereira Alves Integrating an Intrusion Detection System with Heterogeneous IoT Endpoint Devices julho de 2020 Integrating an Intrusion Detection System with Heterogeneous IoT Endpoint Devices Adnré Filipe Pereira Alves UMinho | 2020                   !                   "#$%&%& DIREITOS DE AUTOR E CONDIÇÕES DE UTILIZAÇÃO DO TRABALHO POR TERCEIROS Este é um trabalho académico que pode ser utilizado por terceiros desde que respeitadas as regras e boas práticas internacionalmente aceites, no que concerne aos direitos de autor e direitos conexos. Assim, o presente trabalho pode ser utilizado nos termos previstos na licença abaixo indicada. Caso o utilizador necessite de permissão para poder fazer um uso do trabalho em condições não previstas no licenciamento indicado, deverá contactar o autor, através do RepositóriUM da Universidade do Minho. Licença concedida aos utilizadores deste trabalho https://creativecommons.org/licenses/by-nc-sa/4.0/ ii Acknowledgments Aos meus pais e à minha irmã, deixo o meu profundo agradecimento pelo apoio que me deram durante esta dissertação, mas também durante todo o meu percurso académico. Sem dúvida, nunca me faltou absolutamente nada para que eu pudesse tirar o maior proveito possível desta minha passagem pela Universidade do Minho. Ao meu orientador, o Professor Doutor Tiago Gomes, quero agradecer por ter assumido para comigo um papel altamente desafiante e exigente, mas sempre presente e amigo. O seu conhecimento, experiência e liderança marcaram bem a imagem do que deve ser um orientador exímio. Deixo também um forte agradecimento ao futuro PhD Miguel Silva por ter também mostrado sempre um papel ativo e enriquecedor na minha dissertação. A todos os meus amigos, um enorme abraço e agradecimento por todo o companheirismo e amizade demonstrados ao longo do meu percurso académico. Uma especial menção, não poderia faltar, ao grupo ”ESRG Top Students”. A todos os meus professores cabe um sincero agradecimento por tudo o que me ensinaram dentro e fora da sala de aula. À minha restante família do NEEEICUM e da AAUMinho, um honesto obrigado por terem também marcado o meu crescimento e aprendizagem durante estes 5 anos. iii STATEMENT OF INTEGRITY I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Code of Ethical Conduct of the University of Minho. iv Resumo Com o permanente desenvolvimento tecnológico, o mundo tem vindo a assistir a um crescimento exponencial no número de dispositivos eletrónicos presentes no quotidiano das pessoas, desde ferramentas de trabalho a dispositivos de uso pessoal. Devido a este contínuo desenvolvimento e utilização de aparelhos eletrónicos, a Internet das Coisas está cada vez mais presente nas casas, empresas, e ruas das cidades, com dispositivos munidos de desde sensores a atuadores, para demais propósitos. O crescimento desta indústria levou a que os fabricantes priorizassem a produção de dispositivos com menores dimensões, energeticamente mais eficientes, com maior processamento, a custo reduzido. Contudo, este crescimento e a necessidade de ligarmos tudo em rede, expõe estes dispositivos a ameaças vindas da Internet. Existe assim uma óbvia urgência no desenvolvimento de soluções adequadas para proteger empresas, consumidores e infraestruturas críticas, bem como garantir maior confiabilidade nesses dispositivos e na sua utilização. O objetivo desta dissertação consiste na exploração de soluções de segurança ao nível da rede, para dispositivos low-end ligados à Internet. Deste trabalho resultou o desenvolvimento de um sistema de detecção de intrusões, o IDIoT, capaz de detectar, corrigir, e eliminar, ataques provenientes de dispositivos maliciosos, tais como ataques de encanhamento e ataques de Denial of Service (DoS) . Dada a conhecida escassez de recursos nestes dispositivos, o mecanismo proposto deve apresentar requisitos de memória o menor possíveis, bem como aumento no consumo energético que não comprometa o desempenho do sistema. Nesta dissertação é apresentado um estudo teórico para o estado da arte referente a arquitecturas de sistemas de deteção de intrusões existentes referentes a estes dispositivos. É apresentado o desenvolvimento e implementação do Intrusion Detection on the Internet of Things (IDIoT), assim como a sua integração numa plataforma com as capacidades de simulação desses dispositivos. Seguidamente, são apresentados resultados experimentais com o objetivo de comprovar o funcionamento e eficácia da solução proposta. Por último, são apresentadas as conclusões e perspectivas futuras de trabalho. Palavras-Chave: Internet of Things (IoT), Intrusion Detection System (IDS), Ataques DoS, Ataques de Mapeamento, Operating System (OS), Segurança, Conectividade. v Abstract With the technological development, the world is witnessing a phenomenon that can be described as a flooding of gadgets and electronic devices in everyone’s daily life, both for work and personal usage. Due to this continuous increasing of development and deployment of gadgets, the IoT is continuously increasing its presence in city houses, companies and streets, with various devices that can work as sensors and/or actuators for many purposes. The quick growth of this industry is leading to the manufacturers the prioritizing production of devices with smaller dimensions, higher efficiency concerning energy consumption, greater processing capabilities and, ultimately, at a reduced cost. Meanwhile, it has been observed that these devices, and the networks in which they are integrated, still remain very vulnerable and require stronger protection mechanisms. Therefore, there is an obvious urgency in the development of appropriate solutions to protect businesses, consumers, and critical infrastructure as well as ensuring greater reliability on these devices. Hereupon, this dissertation consists in the development of the IDIoT, an IDS for the IoT, designed for heterogeneous endpoint devices. This system improves endpoint devices security with network layer control by being able to detect and correct to the most popular attacks targeting low-end devices, such as DoS and routing attacks. Since it targets low-end devices, this mechanism must require the smallest memory footprint possible, without sacrificing the energy consumption and the overall system performance. Throughout this dissertation, several IDS systems and possible attacks are studied in order to endow IDIoT with the best possible features. In order to test the solution over a network that can represent real world scenarios, the IDIoT was tested over the Cooja simuator, which is a network simulator that is able to emulate several IoT motes under a chosen network topology. Furthermore, some experimental results are presented in order to prove the efficiency of the proposed solution, through the simulation of attacks against an emulated network where devices are running the IDIoT. At last, the conclusion and future work perspectives are presented. Keywords: IoT, IDS, DoS Attacks, Routing Attacks, OSes, Security, Connectivity. vi Table of Contents Resumo v Abstract vi Acronyms List xiii 1 Introduction 1 1.1 ProblemStatement.................................. 1 1.2 Goals......................................... 2 1.3 ThesisStructure ................................... 3 2 State of the Art 4 2.1 Background...................................... 4 2.1.1 The Internet of Things . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.1.2 The IoT Network Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.3 6LoWPAN .................................. 9 2.1.4 RPL ..................................... 9 2.1.5 Operating Systems for the IoT . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.1.6 Security Threats Addressed to the IoT . . . . . . . . . . . . . . . . . . . . . 14 2.1.7 Intrusion Detection System . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.2 RelatedWork..................................... 20 2.2.1 High- and Middle-end IDS . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.2.2 Low-endIDS................................. 22 2.3 PlatformandTools .................................. 32 2.3.1 Cooja Network Simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 vii 3 System Model and Design 35 3.1 GAPAnalysis..................................... 35 3.1.1 ProposedSolution .............................. 37 3.1.2 SystemAssumptions............................. 38 3.2 SystemOverview ................................... 39 3.2.1 IDIoT-6Mapper................................ 43 3.2.2 IDIoT-Routing-Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 3.2.3 IDIoT Firewall System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.2.4 IDIoT DoS Detection Module . . . . . . . . . . . . . . . . . . . . . . . . . 46 4 Implementation 49 4.1 Implementation Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.2 IDIoTModules .................................... 53 4.2.1 IDIoT-6Mapper................................ 53 4.2.2 IDIoT-Routing-Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 4.2.3 IDIoT-Firewall................................. 60 4.2.4 DoS Detection Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 5 Evaluation 69 5.1 EvaluationOverview.................................. 69 5.2 IDIoTRoutingDetection................................ 70 5.3 DoSDetectionModule ................................ 75 5.4 Memoryfootprint................................... 79 5.5 EnergyConsumption ................................. 81 6 Conclusion 84 6.1 FutureWork ..................................... 85 References 93 viii OS Operating System. OSI Open System Interconnection. PAN Personal Area Network. RAM Random Access Memory. RCU Reconfigurable Computing Unit. RF Radio Frequency. RFID Radio Frequency Identification. ROM Read Only Memory. RPL Routing Protocol for low power and lossy networks. RTOS Real Time Operating System. SIEM Security Incident and Event Management System. SoC System on Chip. TCP Transmission Control Protocol. TI Texas Instruments. TSCH Time Slotted Channel Hopping. UDP User Data Protocol. WSN Wireless Sensor Networks. xv Chapter 1 Introduction This chapter starts by addressing the problem statement of this thesis as well as the expected goals intended to achieve. Finally, a brief description of the structure of this document is presented. 1.1 Problem Statement Connecting myriads of end-devices in the IoT can bring several challenges to the way such systems are designed and deployed in a wide-range of applications [1][2][3]. Such challenges not only comprise the connectivity and interoperability of heterogeneous wireless nodes, where a large volume of data is exchanged with the Internet, but also arise security- and privacy-related issues, even at the network edge. Such issues demand for a robust solution to tackle the ever-growing amounts of data transferred over the network, and also the security and performance requirements. Nowadays, hybrid hardware platforms, which combine a Microcontroller Unit (MCU) and a Field Programmable Gate Array (FPGA) on the same System on Chip (SoC), are becoming more cost-effective solutions that can be used even at the IoT network edge. Such platforms add extra processing capabilities to already existing systems by allowing the deployment of dedicated hardware accelerators [4][5][6] on the FPGA fabric. For instance, CUstomizable and Trustable End-device for the internet of things (CUTE mote), a mote specially designed for the edge network, is an in-house project that uses such platforms [7][8][9]. Nowadays the IoT industry is increasingly reaching more ecosystems, from infrastructures, such as transportation systems and power plants, services that reach out to entire cities and countries, and even household appliances such as electronic gadgets, smart home devices from light bulbs and wall plugs, to personal use machines. This vast presence of the IoT concept in the daily activities of our society is definitively a real concern in cybersecurity matters. Bringing connectivity to low-end devices significantly increases breaches for attacks through the network in which these devices are connected. With such 1 Chapter 1. Introduction 2 breaches and security issues, devices and networks are significantly more compromised ,which makes them less reliable. Therefore, efforts need to be made in regards to seeking for more cost-effective solutions and more processing capable devices , and in the security- and privacy-related issues [3][10][11]. Such issues demand greater and stronger mechanisms that enables more and more security at the IoT device and network paradigm. Mainly due to the quick growth of this industry, the rush for cheaper and faster devices has been the prior reason for the security and privacy concerns that have become a smaller priority for the manufacturers. However, adding additional capabilities to such resource-constrained devices is a compromise between integrating security mechanisms and reducing the device’s processing capabilities, increasing energy consumption and other concerns [12]. This pros and cons balancing situation is definitively a challenge researchers have in hands because the impact of such solutions. One solution for tackling this problem is fetching an IDS mechanism for the IoT networks and protocols, allowing for a greater possibility of detection and prevention of many kinds of malicious intrusions in IoT devices and networks. For instance, an implementation of an IDS towards the IoT constrained devices, can become a very useful tool for the manufacturing industry. For this reason, this thesis focuses on the study of IDS development capable of improving devices security againts two popular attacks: routing and DoS, with a possibility of integration in aforementioned hybrid hardware platforms such as the CUTE mote [7]. Due to the ferocity of such attacks and the liability of these resource constraint devices, the IDS must be able to standalone contribute with major safety capabilities. 1.2 Goals The main goal of this thesis is to integrate an IDS with heterogeneous IoT endpoint devices. This security mechanism must be able to: •Detect and prevent against routing attacks; •Detect and prevent against DoS attacks; •Improve safety in the data transferred through the network; •Induce little overhead regarding memory and Central Processing Unit (CPU) usage; •Be OS agnostic; Chapter 1. Introduction 3 The final goal is to integrate this solution with a heterogeneous architecture for an IoT endpoint device, such as CUTE mote [7]. 1.3 Thesis Structure This thesis will proceed to the Chapter 2, State of the Art, where structural topics used in this dissertation are covered, performing a theoretical context necessary for the discussion and conclusions taken down the line. Furthermore, the related work is presented, in which some state-of-the-art IDS solutions are studied. Information about the platform and tools used during and for the project are also shown. In Chapter 3, System Model and Design is covered, by showing the developed architecture of the solution, the decisions and trade-offs taken considering the best design. Moving on, is the Chapter 4 which covers the Implementation of the IDIoT solution. Some core-algorithms are presented aiming to deeply explain how the previous system model is implemented and integrated with the entire system. Evaluation takes place in Chapter 5 and here are presented the results for simulations and benchmarks performed on the system. Then, an analysis occurs, concerning the proposed solution and the obtained results. Limitations of the solution are also covered. At last, the conclusions for this project are presented in Chapter 6, referring to the solution beneficial features as well as limitations. A final section is reserved for future work discussion. Chapter 2 State of the Art Throughout the development of this work, several topics and domains must be covered. These include security and connectivity, applied to IoT end-devices and IDSs. These principles are the backbone of this study. The first section of this chapter will briefly describe what these topics are and where they stand in the current state-of-the-art. Firstly, IoT history, importance and architecture will be approached, in Sections 2.1.1 and 2.1.2. Moreover, OSes for the IoT are discussed in Section 2.1.5 as these are fundamental for our work, which will present a solution that runs as one or more OS applications. Furthermore, security threats addressed to the Wireless Sensor Networks (WSN) and the IoT are discussed in Section 2.1.6, an important topic for a security concerned project such as this one. At last, IDS as a defense mechanism is approached in 2.1.7, regarding possible architectures and common actuation methods. Next, the second section of this chapter addresses current state-of-the-art that is somehow closed to this work. Finally, last section covers the platform and tools required to the successful realization of this work. 2.1 Background 2.1.1 The Internet of Things The Internet of Things (IoT) as an idea has been around for a while now, the first example of an application more related to the IoT concept appears in the early 1980s where local programmers from the Carnegie Melon University used the internet connection to access a Coca Cola machine in the university facilities. They would use the connection to the refrigerated appliance to check if there was a drink available, and if it was cold, before making the trip to the cafeteria room. Despite some similar applications appearing as such, the IoT was not even officially named until 1999 [13]. This imminent technology is growing at a fast rate and it is already adding up large importance on various environments, on a daily basis. Whether we 4 Chapter 2. State of the Art 5 are improving the production of an industry, monitoring our health, or providing services for the community of a city such as live parking information, it is the common IoT platform that allows the communication between all its intervenients. The IoT, for this reasons, is resulting in regular day-to-day tasks to become more easy and automated [14] [15]. IoT can be described as a collection of billions of devices sharing and collecting data through the internet [16]. These devices are now able to communicate with each other, and with the user, in a network made of things, due to the emergence and integration of the IoT [17]. IoT devices can be used in a multitude of applications, in an endless amount of configurations and network topologies [1] [18] [2][3]. Each IoT device usually performs a specific set of tasks anf procedures such as data collection, like sensors, or performing services, like actuators. Communication with IoT devices through the Internet is only possible by integrating gateways to the network [19]. Some benefits of using IoT technology are: access to high-quality data; better tracking and management; more efficient resource utilization; automation and control; comfort and convenience; time and money savings [20]. Some fields of application are the human body, our homes, the environment, cities, and industries [16] [18] [21]. Mimo [22] is a new kind of infant monitor that provides parents with real-time information about their baby’s breathing, skin temperature, body position, and activity level on their smartphones. To help to prevent problems like sudden death syndrome, these devices improve health and life quality. SmartTrash [23] is a community service directed appliance. Products like cellular communication enabled Smart Trash to use real-time data collection and alerts to let municipal services know when a bin needs to be emptied. This information can drastically reduce the number of pick-ups required and translates into fuel and financial savings for community service departments. OnFarm [24] is a solution that combines realtime sensor data from soil moisture levels, weather forecasts, and pesticide usage from farming sites into a consolidated web dashboard. Farmers can use this data with advanced imaging and mapping information to spot crop issues and remotely monitor all of the farm’s assets and resource usage levels. Many more appliances can be developed and integrated using the IoT, for instance, [16] gathers some big amount of examples regarding this, concerning five major scenarios. These are: Transportation and Logistics, with examples of environment monitoring application; Healthcare, with examples of tracking application; Smart Environments, with examples of comfortable homes and offices; Personal and social, with examples of thefts and losses; Futuristic scenarios, at last, with examples of robot taxi’s. Statista, a business data platform, estimates that by the year of 2020, around 31 billion smartphones, wearables, smart watches, cars, and other devices will be connected to the IoT [25]. As previously discussed, there is a vast versatility of IoT appliances all around the tecnologic world. In Figure 2.1, adapted Chapter 2. State of the Art 6 from [26], is categorized a structure for the IoT architecture. Figure 2.1: Variants of things and networks in the Internet of Things. Similarly, to the Open System Interconnection (OSI) model, the most accepted architecture layout for the IoT in the current literature [27][18] is structured, from top to bottom, with application, network and perception layers. In Figure 2.1 it is possible to understand this categorization and organization. On the top of the architecture stands the application Layer that manages the data exchanged with the layers below, and uses this data to provide required services or operations. It is also known as the business layer and here various applications can exist, each having different requirements. Moving downwards, in the network Layer the processed information from the perception layer is received here. Then, the routes to transmit the data and information to the IoT hub are determined. This is the most important and dense layer of the architecture because the numerous amounts of devices and communication technologies that are integrated. The last one is the perception layer, or in other words the physical or the sensor layer and its the bottom layer in this example of IoT architecture. This layer has the capabilities of measuring Chapter 2. State of the Art 7 and collecting data which is then processed to the upper layers. Sometimes these network nodes can exchange data with each other and even perform operations without intervention from above. Concerning the perception layer, there can be many kinds of devices/things in IoT network. For instance, the IoT compliant devices can be described in three types of things, which are presented in Figure 2.1. All of these communicate with the IoT server via an Internet connection. Big Things are considered large devices, not specifically concerning the size of the device, but also as the complexity of the function it can perform and the vast expected resource availability. These devices are normally computers, big industrial machines, cars, etc... Small Things are devices with simpler function and complexity. Normally executing censoring or actuating operations, these devices are expected to be constrained in resources such as memory, power, and bandwidth. Non IP-Things are very much similar to the small things, described above. They establish a connection with a Gateway, using communication protocols such as Low Range (LoRa), bluetooth and Radio Frequency (RF). The Gateway performs the analysis of data which is later transmitted to the IoT Server via an Internet connection. 2.1.2 The IoT Network Stack The network layer of the IoT architecture is a layer concerning connection and connectivity. Protocols are specifically designed for the IoT and must tackle all of the communication challenges involved in this kind of network, which can be supporting and connecting to the Internet a large amount of heterogeneous smart devices [28] [18]. Such challenges are: addressing and identification, low power communication, low power routing protocols, high speed and nonlossy communication and, also, mobility of smart things [29]. In this section, we will briefly approach the IoT network stack and it’s most important protocols which will later be used during the development of the IDIoT solution. To develop a security mechanism for the IoT low-end devices, it’s important to understand what protocols are used within an IoT network, not only for communication between its devices but also for communication between the gateway of the network and the Internet. Additionally, it is also important to refer to which routing protocols are designed to IoT networks, most importantly the protocol we will be using, since routing is very important for the subject of preventing attacks, taking in consideration that these can take place by taking unauthorized actions against routing information. Generally, IoT devices connect to the Internet through the Internet Protocol (IP) stack, which most typically nowadays is used the IPv6, as an upgrade to the previous, but still in use, Internet Protocol version 4 (IPv4) [30]. However, some IoT devices are too resource-constrained to secure such complex and dense Chapter 2. State of the Art 8 network protocols. For this reason, these devices tend to connect locally through non-IP networks and, using a border router acting as a gateway, connecting the network to the wide Internet [31]. For instance, taking a glance at Figure 2.2 it is possible to further understand how all the above mentioned layers and protocols reside within a protocol stack such as the 6LoWPAN protocol stack. Figure 2.2: IoT Network Stack. There are many existing protocols for these non-IP networks, such as Bluetooth, Radio Frequency Identification (RFID), Near Field Communication (NFC), Institute of Electrical and Electronics Engineers (IEEE) 802.15.4, low power wifi, Sigfox, LoRa, Zigbee and some more [32][33] [34]. These are very popular however they are limited in range, making most of the above networks limited to small-medium Personal Area Network (PAN) [17]. In order to adapt an IP stack to better suit IoT networks, 6LoWPAN was developed by the Internet Engineering Task Force (IETF) and constituted one of the most important protocols of an IoT network stack. Moving upwards to the transport layer, IoT networks can use protocols such as UDP and Transmission Control Protocol (TCP), however, due to being a connection-oriented protocol and having a considerable bigger overhead, TCP is not a good option for communication in low power environments and UDP is the preferred option. Some networks also employ Internet Control Message Protocol (ICMP) at this layer, instead of UDP. Finally, at the top of a device’s communication architecture, the application layer also has many protocols specifically developed for the IoT networks and two of the most used are Message Queue Telemetry Transport (MQTT) and Constrained Application Protocol (CoAP). These will not be taken into details in this thesis. Chapter 2. State of the Art 9 2.1.3 6LoWPAN 6LoWPAN consists of the Low Power Wireless Personal Area Networks (LoWPAN) adaptation layer which defined encapsulation and header compression mechanisms enabling IPv6 over IEEE 802.15.4- based networks. IEEE 802.15.4 networks. It is an open standard regulated by the IETF, which defines other standards used in the internet, e.g., Hypertext Transfer Protocol (HTTP), UDP and TCP. The IETF regulated 6LoWPAN through RFC 4919 and RFC 4944 between 2007-2009 [33][32]. This open standard is expected to be used by resource constrained embedded devices in low power wireless networks. Internet protocol packets can be carried efficiently within small link-layer frames because 6LoWPAN has defined encapsulation and header compression mechanisms that allow IPv6 packets to be sent and received over IEEE 802.15.4-based networks [18]. This way, 6LoWPAN performs a crucial function at adapting the packet sizes of the two networks, since IPv6 requires the Maximum Transmission Unit (MTU) to be at least 1280 bytes while IEEE 802.15.4 standard’s packet size available for media access control layer is just 102 to 81 bytes [35]. On a 6LoWPAN network, there is a dedicated edge router, just like a sink node in a WSN. The 6BR acts as gateway communication with the internet. On a 6LoWPAN network each node can have an IPv6 address assigned to each interface, which enables them to be directly reached from anywhere on the Internet. This way, applications running on the nodes can exchange IP packets to a server on the Internet [36]. In Figure 2.2 a comparison is made between the IoT network stack, using the 6LoWPAN, and the traditional Internet network IP stack [36]. 2.1.4 RPL Routing Protocol for low power and lossy networks (RPL) is a routing protocol developed specifically for Low Power and Lossy Network (LLN)s which is a class of networks in which both the routers and their nodes are expected to be constrained concerning the fundamental resources such memory, power sources, and processing capabilities. This is a pro-active protocol based on a distance vector algorithm and provides support for multipoint-to-point traffic as well as point-to-multipoint traffic, from inside of the LLN network to the outside, and vice-versa. Support for point-to-point traffic is also available in RPL [37]. This protocol configuration works by creating a network topology map, which is called a Directed Acyclic Graph (DAG), and every node present has an assigned rank. The Destination-Oriented Directed Acyclic Graph (DODAG) root node has the smallest rank of the network, 0, and node’s rank increases as they get Chapter 2. State of the Art 16 information emitted by encrypting devices in order to detect the encryption key. It is performed by using information about the encryption operation, power and time required, faults frequency, etc. Many surveys have been published towards security threats in the IoT [48][46][27]. Such surveys mostly study threats which target the devices through the network and application layer. In accordance with the previously presented taxonomy in 2.4, these are: Routing, Man-in-the-middle, and Denial of Service attacks [46]. Routing attacks affect the routing information by spoofing, modifying or replacing this information. These attacks aim to create routing loops, to attract or repel network traffic, to increase or decrease source routes, etc... Some specific routing attacks are Sinkhole, Selective-forwarding, Wormhole and Sybil attacks. Man-in-the-middle attacks work by interfering with the communication between two entities. The attacker node modifies or obstructs the communication between entity A or B, without these noticing, or even just captures the traffic for unauthorized data analysis. Denial of Service are attacks launched into a specific network or a specific device within a network, intending to disable the normal operation of this device, or network, by an exhausting their resources. These attacks usually take place by flooding of communications or even jamming of the communication channels. There is a variety of DoS and Distributed Denial of Service (DDoS) attacks, such as IPv6 UDP Flooding Attack, Syn Flood, Land attack, ICMP flood, Smurf attack. Routing attacks and DoS attacks are considered the most frequent and more destructive mainly due to the current IoT device’s security breaches and constraint of resources [46][49][36]. Routing-wise, Sinkhole attack is the most important and takes place when an attacker introduces a fake node inside a network. This node will advertise, to all neighbor nodes, a minimum cost routing path in order to make all the adjacent nodes forwarding their packets through this malicious node. On the other hand, concerning the DoS attacks, one of the most destructive IPv6 UDP flood, a type of DoS attack in which the attackers overwhelms random ports on the target with IP packets containing UDP datagrams. As this happens, the receiving host will try to find the corresponding application associated with the received datagrams, but none will be found. Then, the host will try to send back a “Destination Unreachable” packet but having sent many and many UDP packets, the attacker will be able to overwhelm the system and make it unresponsive to other clients. 2.1.7 Intrusion Detection System An IDS is a type of security software designed to detect malicious actions performed by intruders with the aim of obtaining unauthorized access to a computer or a network. In order to protect systems Chapter 2. State of the Art 17 and networks, an IDS performs analysis on the network traffic, using an analysis engine, so it can detect ongoing intrusions and report a system alert to the network administrator. The network administrator, or other tools assisted by the IDS, can then take action against this attack by blocking such harmfull user or device, stopping the flow of that attacked network, and even saving the signature of the attack for later recognition and earlier prevention [27]. Intrusions can be external or internal to the network. An external intrusion happens when a user outside the target network tries to access one system without authorization. An internal intrusion happens when an inside device attempts to raise its access privileges in order to perform non-authorized actions [50]. The first research about this subject first appeared by 1980 by [51] where a preliminary concept of an IDS was delineated at the National Security Agency and consisted of a set of tools intended to help administrators review audit trails, normally composed by access logs, file access logs and system access logs [52]. Various kinds of networks co-exist in the Internet. For instance, some networks in the Internet enable peer-to-peer communication, where devices may communicate directly with each other and, for this reason, security mechanism based in the networks switch or router may not be preventive in case of a device becomes malicous. Therefore, in order to tackle these adverse difficulties, two kinds of IDS configuration also exist. Network-based Intrusion Detection System (NIDS) connects to one or more network segments and monitors network traffic for malicious activities. Host-based Intrusion Detection System (HIDS) is attached to a computer device and monitors malicious activities occurring within the system. The HIDS can also perform analysis to system calls, running processes, file-system changes, interprocess communication and application logs [48]. Figure 2.5 depicts the topology of a NIDS and a HIDS. Chapter 2. State of the Art 18 Figure 2.5: Network-based IDS (left) vs Host-based IDS (right). Even though IDSs are considered a matured technology for traditional networks, IDSs solutions are not so adequate for the IoT systems. Due to the lack of security concerns and resource constraints in the devices currently used in IoT networks, there are many development barriers for traditional IDS to operate within the IoT networks. These IoT devices are generally resource constrained due to reduced power, memory, processing capabilities and more. This way, the IDS as a concept of security mechanisms is also being imported for the WSNs as these devices become more connected with the Internet due to the IoT. Many solutions are already spread within the academic community and will later be studied in depth, in Section 2.2.2. For this purpose, some authors have published surveys [48] [27] to the current literature of IDS for the IoT and have categorized this solutions in a taxonomy that juggles with four approaches, being these: placement strategy, detection method, security threats which the IDS was designed to protect, and validation strategy. Chapter 2. State of the Art 19 Figure 2.6: IDS for the IoT Taxonomy. The IDS placement strategy concerns the strategy and location of IDS within the systems architecture. This strategy can be classified into three classes as seen in Figure 2.6. In a distributed strategy, IDS modules are placed in every physical object of the network. In this case, the drawbacks are that each physical object of the IoT network will be resource-constrained so the IDS module must be greatly optimized. Centralized strategy happens when the IDS is strategically placed in a centralized component of the network, e.g., a border router or a dedicated host, so all the traffic exchanged between the network and the Internet can be analyzed by the IDS. In a Hybrid placement, both strategies are combined in order to take each others strong points and to avoid each others drawbacks. The IDS detection method describes the functional mechanism used for the detection engine. In signature-based approach the behavior of usual and known attacks are stored in the IDS internal database so it can match certain network or node behavior to a stored attack signature. Signature-based are accurate and very effective when it comes to known threats, however, they are ineffective to detect new and unknown attacks because signature matching will never occur. Anomaly-based engine is composed by a set of rules defining how the network should behave. These rules define a normal behavior threshold and therefore if a deviation from these values occur, an alert is triggered. This approach is very efficient to detect attacks related to abuse of resources, however, they can consider an intrusion to anything that does not match a normal behavior and this can become a drawback. Specification-based is very alike with the anomalybased where a set of rules and thresholds are defined to represent the expected behavior but in this approach, a human expert should manually define the rules of each specification. This allows for rules to Chapter 2. State of the Art 20 be set for network specifications such as nodes, protocols and routing tables. Hybrid approach uses all the above-described strategies in order to maximize their advantages and minimize their drawbacks. An IDS is also categorized by the security threats it tries to prevent. There are many and the most relevant are, sinkhole and DoS [45] [36]. At last, the validation method is also an important metric for a classification on an existing IDS solution. Some validation examples are hypothetical, by simulation, theoretical, or even no validation at all. These last are self-explanatory. 2.2 Related Work Securing devices and networks with security measures like an IDS is an important topic that has been addressed for a long time. This method was so reliable and there was already established a mechanism for all networks, anti-virus, etc., that with the technological development and appearance of new technologies such as the IoT, the adoption of an IDS of IDS was kept within the goals of a secured network and/or device. However, developments in these technologies resulted in new security challenges to whom traditional IDSs were not suitable. This way, new solutions are demanded either from adapting the existing solutions to the new paradigm of the IoT, either from developing new solutions from the scratch. In this section we will present and discuss the most relevant related work concerning IDS based solutions. High- and Middleend IDSs are discussed in 2.2.1. Low-end IDSs for the IoT are discussed in 2.2.2. At last, a brief analysis of the platform and tools is presented in Section 2.3. 2.2.1 High- and Middle-end IDS IDS are usually one of the best tools for securing networks and devices. These security mechanisms were usually appointed as one of the best tools for securing traditional networks and devices. High- and middle-end IDS solutions are currently at its peak of development and well established in the Internet networks. For this class of devices, Snort and Suricata, depicted in 2.7, are two well-know solutions that have been widely used [53] [54]. 2.2.1.1 Snort Snort is a Network-based IDS developed in 1998 and spread for the web community like an opensource tool in 1999. It is a High-End IDS which only counted with 1200 lines of code back in 1999. The Chapter 2. State of the Art 21 user’s community has had a major role in developing and keeping this mechanism updated over the years through submitting bug alerts, bug fixes and more, as discussed in [55]. The Snort core engine is single-threaded, designed for the popular computers back in the day. It is a light-weight cross-platform network sniffing tool that works based on a bunch of defined rules and analyzing the packets exchanged over the network. This way, and having in mind the classification stated before in Figure 2.1.7, it is a signature-based IDS. A typical snort installation can process traffic at a rate of 100-200 megabits per second [56]. Snort works not only as intrusion detection but also as an intrusion protection system, by having the possibility of dropping and rejecting packets. In order to enable full sets of rules, Snort must be running in a 64-bit machine [53]. An architecture example [56] for Snort can be depicted in Figure 2.7. Figure 2.7: Architecture examples for Snort and Suricata, side by side. Snort sniffs and analyses all of the network traffic. Hence, Snort has a dedicated packet capture module and sent to the Decoder where their structure is analyzed for suspicious behaviors. These can be presented as wrong packet sizes, protocol settings, etc. If something suspicious takes place here, the Decoder is able to trigger an alert, otherwise the packets follow to the pre-processor which prepares this data for proper rules application by the detection engine. At last, output plug-ins define how to deal with the triggered alerts. Chapter 2. State of the Art 22 2.2.1.2 Suricata In 2009 a set of private companies, with the support and resources from the US Department of Homeland Security, founded the OISF. The biggest goal of this foundation was to develop an alternative to Snort tools called Suricata. Later in 2010, and inspired by Snort, Suricata is brought to the world as a Network-based IDS with a very similar to Snort’s structure [54]. Unlike Snort, which was 10 years old and was developed for the computers at that time, Suricata has a core engine working with a multi-thread architecture. This way, Suricata is expected to much better in multi-core systems, as evidenced in [55]. Just like Snort, Suricata also performs both as intrusion detection as intrusion protection and also needs to be running in a 64-bit machine in order to load the full set of rules. This is one major example of why we consider these mechanisms as middle- and high-end. In Figure 2.7, an example for the Suricata architecture is presented [56]. Network traffic, which can either come directly from the network interface or from pre-recorded traffic, is sent to the decode and the stream application layer where they suffer two operations. Firstly, packets are decoded just like in Snort, but then, instead of being sent in a queue to the following stage, here the packets are assembled into stream-queue which will later be fetched, for processing, by a certain thread. All threads compose the thread engine and this is how the multi-threading operations of Suricata takes place. 2.2.2 Low-end IDS Even though the IoT is still a recent and incipient paradigm in modern technology, it was already granted with some security and privacy challenges in keeping the information and collected data safe, trustable, and consistent. However, these systems face some challenges in authentication, confidentiality, access control, mobile security and many more. For these issues, protecting networks with heterogeneous IoT devices using IDSs as a security measure is a must. Nevertheless, an IDS designed for IoT devices will have different requirements than IDSs designed for traditional networks, thus, for this reason, adapting traditional IDS approaches to the IoT concept is still a topic of great interest. Several IDS systems for low-end devices can be found in the literature [49] [57] [58] [59], [60], [61] [62] [63]. Table 2.2, adapted from [48], summarizes the current state of the art of IDS regardign their placement strategy, detection method, security threats they can detect, and the validation strategy. Chapter 2. State of the Art 23 Table 2.2: Eighteen IDS solutions for the IoT. Key Placement Detection Security Validation Reference Strategy Method Threat Strategy Cho et al. (2009) Centralized Anomaly-based Man-in-the-middle Simulation Liu et al. (2011) - Signature-based - None Le et al. (2011) Hybrid Specification-based Routing attack None Misra et al. (2011) - Specification-based DoS Simulation DEMO (2013a) [57] Centralized Signature-based DoS Empirical Wallgren et al. (2013) Centralized - Routing attack Simulation Svelte (2013) [49] Hybrid Hybrid Routing attack Simulation Gupta et al. (2013) - Anomaly-based - None Kasinathan et al. (2013b) Centralized Signature-based - Hypothetical example Amaral et al. (2014) Hybrid Specification-based - Empirical Oh et al. (2014) Distributed Signature-based Multiple conventional attacks Empirical Lee et al. (2014) Distributed Anomaly-based DoS Simulation Krimmling and Peter (2014) - Hybrid Routing attack and Man-in-the-middle Simulation INTI (2015) [59] Distributed Hybrid Routing attack Simulation Summerville et al. (2015) - Anomaly-based Conventional Empirical Thanigaivelan et al. (2016) Hybrid Anomaly-based - None Le et al. (2016) Hybrid Specification-based Routing attack Simulation Pongle and Chavan (2015) Hybrid Anomaly-based Routing attack Simulation However, when handling a list of eighteen solutions, proper sampling must be used and, in this case, there are some vital concerns about the presented solutions which rule out many works. First and foremost, IoT network is continuously building and shaping itself and, for this reason, when studying the oldest works from these surveys, we found some of the older ones somewhat outdated. Secondly, many of these works are overlapping each other either in the problems they secure, either on the approaches they use in order to secure the communication or routing problems of such devices. Therefore, the ones who show overlapped approaches or targets, and show the weakest or even none results in evaluation or benchmarking concerns, must be dismissed. Thereafter, the result from a selective tapering of the previous table of solutions results in less than a handful of solutions which have the ability to represent all the relevant placement strategies, detection methods and different kind of security threats. These works are gathered in the Table 2.3 and represent the works we will be studying in the following sections. Chapter 2. State of the Art 24 Table 2.3: Key features of representative IDS solutions for each category. Key Placement Detection Security Validation Detected Reference Strategy Method Threat Strategy Attacks DEMO (2013a) [57] Centralized Signature-based DoS Empirical IPv6 UDP flooding attack Svelte (2013) [49] Hybrid Hybrid Routing attack Simulation Sinkhole and selectiveforwarding attacks INTI (2015) [59] Distributed Hybrid Routing attack Simulation Sinkhole attacks A Signature-based IDS of IoT Hybrid Signature-based DoS Empirical ”Hello Flooding” and (2018) [64] Version Number Modification 2.2.2.1 SVELTE: Real-time IDS in the IoT In 2013, Raza et al. [49] have proposed Svelte, an IDS developed to primarily target routing attacks such as spoofed or manipulated data, as well as sinkhole and selective-forwarding. Svelte is designed for 6LoWPAN networks and makes use of RPL. Following the taxonomy proposed and discussed in [48], this IDS has a hybrid placement strategy, because it has both centralized and distributed modules within the 6LoWPAN network. Centralized modules are found in the 6BR while the distributed modules can be found in the constrained nodes. The architecture proposed by [49] can be seen in Figure 2.8. It is possible to understand that this execution flow consists of many network nodes capable of sending information and traffic reports to the border router. This last is responsible for performing intrusion detection analysis to detect if any malicious activity is taking place. This is possible because of two main software modules located in the 6BR, which are the 6Mapper and the Mini-Firewall and their corresponding light-weight modules in the regular network nodes. The most important module of this architecture is the 6Mapper , which gathers information about RPL network and reconstructs the RPL DODAG in the 6BR. Having a secure and trustworthy mapping of the 6LoWPAN network is very efficient for the detection of many attacks. For example, sinkhole attacks, which take place when an attacker advertises a better routing path, can be prevented with the RPL DODAG information. To reconstruct the DODAG, 6Mapper sends mapping requests to the nodes in the 6LoWPAN network. These mapping requests are five bytes long and contain some information such as RPL instance ID, DODAG ID and DODAG version number. Nodes in the network will respond to the mapping request with packets with a size of 13 bytes, with four extra bytes per each neighbor of such node. The response packet contains the following information: node rank, parent ID and all neighbors IDs and ranks. As a Chapter 2. State of the Art 25 security measure, the authors state that packets used to map the network must be indistinguishable from other packets, otherwise attackers can perform a selective-forwarding attack exploiting this breach. Figure 2.8: An IoT setup where IDS modules are placed in 6BR and also in individual nodes. The other big contribution of [49] work is the Mini-Firewall , which has a module in the 6BR and also in the regular network nodes. Besides providing typical blocking functionalities against already known external attackers, specified by the network administrator, the firewall can block the external malicious hosts specified in real-time by the nodes inside the 6LoWPAN network. Nodes inside the 6LoWPAN can only choose to filter the traffic destined to itself. For an external to be blocked to all nodes, a minimum set of nodes need to have complained about such specific host. At last, Svelte has a few more Intrusion Detection Algorithms for network analysis, which support the 6Mapper and the Firewall. Such algorithms are Network graph inconsistency detection; Checking node availability; Routing graph validity; End-to-end packet loss adaptation. It is also convenient to refer that 6Mapper is capable of passively protect the network against Sybil and Clone ID attacks. All evaluations show high success rates for all the tested attacks. During the evaluation described by [49], with an example of such in Figure 2.9, it is possible to conclude that Svelte behaves the best when in a lossless network when compared to a lossy network. This is due to the time necessary for the 6Mapper to build a stable and secure network map. Chapter 2. State of the Art 32 evaluations nor results are presented for this IDS solution, concerning memory usage, power consumption or detection rates. 2.3 Platform and Tools In this section, we will briefly approach the platform and tools used throughout the implementation of this project. There is one very-known application from the Contiki OS that constitutes a vital tool for the development of this project, the Cooja Network Simulator. This tool will allow for all the network simulations of this project, and we will better approach this tool in the following Section 2.3.1. 2.3.1 Cooja Network Simulator Developing an IDS for the IoT is only feasible if reliable testing of the system is performed. Setting up a physical network of devices in a secured and controlled environment would be too much of a burden, if even financially possible, and for this reason, simulation is the wisest choice. Simulating an IoT network where an IDS would be integrated requires for a network simulator not only capable of simulating large networks of devices but also capable of simulating different devices running different firmware. Furthermore, the network simulator should be able to supply with a reliable computation of performance metrics of the IoT based smart devices. Contiki OS, previously analyzed in Section 2.1.5, offers Cooja Simulator, a network simulator specifically designed for WSN which allows for emulation of real hardware platforms. For this convenient reason, and also for the acknowledged performance of this tool [65][66], Cooja was used as the preferred, and only, network simulator throughout the development of this project. Cooja supports many sets of hardware motes and radio transceivers, such as TR 1100, Texas Instruments (TI) CC2420, and allows real simulation with message decoding of standard protocols such as RPL, IEEE 802.15.4, uIPv6 stack and uIPv4 stack. Cooja also provides a flexible and easy-to-use interface built up in different windows. There are five main windows, as seen in Figure 2.14, such as: the network window, which displays the physical arrangement of the runtime window, mote output, etc. Furthermore, this window can also display a 10-meter grid, different colors to different mote functionality in the network (sink, server, client, etc...) and radio environment of each node; The simulation window controls the operation of the simulation, through the speed parameter and the pause, start and reload button; The mote output window allows for a time-based visualization of all data printed and/or exchanged between each mote. Chapter 2. State of the Art 33 This window can allow filters to be added, in the bottom field, enabling a mote-specific view. The timeline window enables visualization of both power consumption and network traffic in the 6LoWPAN network. At last, the mote interface viewer allows for multiple types of configurations that can track multiple metrics of the node in runtime. For instance, in Figure 2.14 there are three different mote interface viewers displaying the status of three node-metrics. The far-left one allows us to press the node’s button during the simulation, the next is showing the status of the node’s LED’s, and the last is showing the node’s serial port. More metrics can be analyzed in this mote interface viewer. Figure 2.14: Contiki Cooja Network Simulator Environment. Figure 2.15: Contiki Cooja Network Simulator available motes for emulation. Chapter 2. State of the Art 34 Cooja network simulator has support for many devices, such as the MicaZ mote, MSP-EXP430F5438 mote from TI, Wismote, Z1 mote from Zolertia, Tmote Sky mote and some more. Hardware motes available to emulation by Cooja can be seen in Figure 2.15. Cooja can successfully emulate all these hardware platforms and build reliable simulations. For instance, Tmote sky is an ultra low power wireless module for use in sensor networks, monitoring applications, and rapid application prototyping. It consists of an 8 MHz TI MSP430 MCU with 10kB RAM and 49kB flash as well as a 250kbps 2.4GHz IEEE 802.15.4 chipcon wireless transceiver. This is the preferred device to simulate in a project, since its one of the most constraint devices supported by Cooja, allowing for the developers to always remember the resource constrained environment they are developing, and to test network applications before the real deployment. Chapter 3 System Model and Design This chapter will proceed on presenting the system model and design for the IDIoT IDS. Firstly, a GAP analysis is performed in Section 3.1 in order to understand which contributions are possible to add with this solution to the current literature. Then, the proposed solution is detailed in 3.1.1 followed by all system assumptions in Section 3.1.2. Then, for the rest of the chapter, the system model and design is presented in Section 3.2, where the entire system will be covered. For a more in-depth view, we will be analyzing the modules running in both border router and constraint nodes of the network, in Section 3.2. 3.1 GAP Analysis In previous Section 2.2.2 it was possible to understand that many solutions addressing the implementation of IDS for the IoT paradigm have been published. For instance, [27] published a survey studying twenty published solutions, with dates ranging from 2009 to 2017. Furthermore, Zarpelão et al. [48] is the author of the survey discussed before, in Section 2.2.2, which also analyses eighteen published solutions, which release dates range from 2009 to 2016. Both works have impressive content regarding the research of present literature for IDS for IoT and both present some concerns and considerations about the lack of conclusions and closures regarding many metrics of studied solutions. Concerns are drawn as the research in IDSs for the IoT are still in its infancy and incipient [27] [48]. Works reviewed do not cover or address a lot of IoT technologies and cannot detect a large variety of attacks [27][48], the most usual being routing attacks, DoS and man-in-the-middle. Furthermore, the proposed solutions do not investigate the strong and weak points of each possible detection method and placement strategy, as well as not reaching a consensus of which is the most proper one. Additionally, in most of the cases, security over the communication between IoT nodes is only an assumption. This is a real concern since many of the services provided by IoT networks and devices contain private data. This problem with 35 Chapter 3. System Model and Design 36 security in communication between network nodes also applies to the communication and traffic related to the IDS mechanism, as most of the solutions did not refer to any kind of security over the control data from the IDS itself. Last but not least, for all the studied, there is a clear lack of extendibility and configurability, meaning that a lack of clear instructions and details for adding more attacks to the detection engines is found, thus increasing a barrier in the use of already designed tools [48]. Concerning the configurability, most of these solutions also fail to present some kind of adjustment to the network needs during runtime of the devices and their tasks. In the previous Sections 2.2.2.1 to 2.2.2.4 the 4 most relevant low-end IDS solutions for the IoT were presented. These solutions suffer from some or even all of the problems previously pointed out and, at this moment, none of these seem really capable of effectively and stand-alone securing an IoT network with constraint nodes exposed to the malicious users which may arise from the connection to the Internet. Regarding Svelte, the main concern is the lack of clear strategies to prevent or protect against DoS attacks, which are as disruptive to a network as the sinkhole attack which is the main focus of Svelte. Also, Svelte makes use of the RPL protocol but fails in delivering protection against exploits of the RPL using control messages against itself. At last, Svelte assumes the communication between nodes to be secure and this can also be an issue with networks where nodes handle data with higher privacy concerns. In Section 2.2.2.2 DEMO was described, along with its particularity of using wired communications. DEMO deploys physical IDS probes to the network, more than one, depending on the size of the network, in order to send data to the centralized IDS engine. Although the authors introduce this particularity as a great solution in order to secure the communication of control data from the IDS, there are major concerns regarding the drawbacks of this approach, namely the increased cost of having to deploy physical devices to the network, running their specific firmware for the IDS. Additionally, the major difficulty for the network administrator to connect these wired devices, greatly limiting the possibility of having a network with mobile characteristics. Furthermore, DEMO presents no protection against routing attacks like Sinkhole and Selective-forwarding, protected in Svelte, and does not implement security measures against all RPL exploits. DEMO does not deliver any kind of evaluation of its metrics against the DoS attacks and cannot be considered an open-source solution since there is no access to the project or related algorithms and flow charts. INTI solution is an improvement to Svelte concerning the mobility features. In spite of having a good evaluation concerning detection rates and false positives, no evaluation is presented regarding energy or memory overhead which is a major concern for this solution since it empowers the constraint nodes Chapter 3. System Model and Design 37 with many more functionalities and responsibilities for the construction of the network map, for example, these nodes are constantly calculating neighbors trust and reputation levels using Beta Probability Density Function. Much like Svelte, INTI only covers routing attacks and fails to deliver protection against DoS attacks. At last, INTI also assumes communication between nodes to be secure and cannot be considered as an open-source solution since there is no trace of the project or any kind of algorithms and flow charts. Finally, the forth and last work covered, in 2.2.2.4, proposes a signature-based solution which, just like DEMO, is focused in protecting DoS attacks but has no protection strategy againts routing attacks. Furthermore, and having the same major concerns as DEMO does, this solution is based on the deployment of physical IDS probes to sniff the network which are wired-connected to the central IDS module. As discussed before, these strategy leaves major concerns with increased cost and reduced mobility of the networks. This signature-based solution makes use of RPL protocol nonetheless it does not prevent any kind of exploits of the RPL control messages. No evaluation or benchmarking is performed and this solution cannot be considered as an open-source solution since there is no trace of the project or any kind of algorithms and flow charts. 3.1.1 Proposed Solution In accordance with the survey of existing IDS solutions for the IoT, [50], we draw the conclusion that a hybrid IDS integrated into the 6LoWPAN protocol, would be the most promising IDS for the future of the IoT. Additionally, combining detection methods in order to make the best of anomaly-based and specification-based strategies would be most successful concerning detection rate and energy overhead. Furthermore, for solutions making use of the RPL protocol, it is essential for the solution to secure this protocol and the devices againts RPL exploits, namely the DIS and DAO attacks [67] [68] [69]. Regarding the attack protection, the IDS solution is expected to be capable of securing the network against both two most popular attacks, Routing and DoS attacks [70]. The GAP Analysis performed in previous Section 3.1 was the base for the development of the IDIoT solution and these metrics compose the IDIoT description which are presented in Table 3.1. On top of these introduced metrics for the IDIoT, it is also intended for the proposed solution to be able to accomplish a role of independence towards the OS of the platform it is deployed. Furthermore, it is envisioned a configurable and extensible point of view of the solution in order to both being able to deploy more protection rules at the moment of the integration with the network, and also of configuring the thresholds of such rules. At last, we pretend to deliver this project to the community making this an open-source solution. Chapter 3. System Model and Design 38 Table 3.1: IDIoT metrics side by side with studied IDS for the IoT solutions. Key Reference Placement Detection Security Validation Detected Name Strategy Method Threat Strategy Attacks DEMO (2013) [58] Centralized Signature-based DoS Empirical IPv6 UDP Flooding attack SVELTE (2013) [49] Hybrid Hybrid Routing attack Simulation Sinkhole and Selective- Forwarding Attacks INTI (2015) [59] Distributed Hybrid Routing attack Simulation Sinkhole attacks A Signature-based IDS of IoT Hybrid Signature-based DoS Empirical ”Hello Flooding” and (2018) [64] Version Number Modification IDIoT Hybrid Hybrid DoS + Routing Attack Simulation Sinkhole and Denial of Service 3.1.2 System Assumptions First, concerning the positioning of our proposal, it is assumed that the communication between the network nodes is secured and authenticated. Secure communications can be provided by upper layers, and for the sake of simplicity, the evaluation was performed with packets being transmitted in plain text, which did not affect the system deployment and its proper operation. We also assume that for the routing attacks, the malicious node is already inside the network. For the DoS attacks, they can be performed from anywhere inside the network or from the Internet. Regarding the IoT devices, this solution is intended to run in low-end IoT devices with tiny resources. They are expected to have below 10kB of RAM and less than 100kB of flash. Moreover, it is expected that networks where these low-end IoT devices are running, can perform some kind of critical service and therefore data availability is a priority. Regarding the network, it is assumed that a network will always be composed of more than 1 constraint nodes, and we assume that a network must always have a 6BR with higher resource availability, over 100kB of RAM or even the size of a Raspberry Pi or small laptop. Regarding mobility of the devices, we assume that these can change location once in a while, during their run time, for example, a smart light-bulb changing rooms within a house or sensors for a farm being changed from place to place in accordance with the needs of the farmer to track this or that plantation. This way, we assume the mobility will not be constant, for example as a smartphone being carried in a postman’s pocket. Chapter 3. System Model and Design 39 At last, motes will not run in networks under arsh and remote environments. These motes are expected to work within environments ranging from indoor houses with stable air flows and network connections, up to some outdoor applications where a little wind and dense air can be expected at some times. 3.2 System Overview The proposed solution shares some strategies with an already existing and previously studied solution of an IDS for the IoT. For instance, with a careful look at table 3.1, both IDIoT and Svelte are hybrid, concerning both placement strategy and detection method. Furthermore, both solutions intend to protect the devices and networks against routing attacks such as the sinkhole and the selective-forwarding. Svelte implementation makes use of 6LoWPAN and the RPL as is intended in our solution and Svelte’s successfully proved its truthfulness with simulations concerning memory overhead, energy overhead, and many more, whithin the constraint nodes, which we believe is crucial for a solution of this kind. We intend in doing the same extensive evaluation. For these reasons, and after an thorough study of the Svelte architecture and implementation, the conclusion was that not developing an IDS engine and architecture from scratch, but instead improving the Svelte IDS for all the intended requirements of our solution, would be the foremost choice in order to achieve the best results for our contribution. Many improvements and contributions to the existing architecture of Svelte will be performed. The refered solution was published in 2013 [49] and was designed over Contiki-2.6 at that time. Architecture was mostly constituted of modules in the application layer and some minor changes to the network layer. Contiki developers continued developing this OS during the years and in May-2018 a huge change was released, the Contiki-NG. At that moment, the Contiki-3.x version was the most recent and stable version of the Contiki OS. It was kept available for the community to work with, but developers shifted all work for the new and improved Contiki-NG. In the current Contiki-NG, the old RPL implementation was set aside for a brand new implementation called RPL-Lite. The old implementation even was considered to be deleted by some developers, but the community concluded that users and the community would benefit the most if it remained available as its last stable version. It is now called the RPL-Classic and its possible to use it in Contiki projects. Now ahead is the RPL-Lite which has many new features and seems much promising to the Contiki future and therefore promising for any application running in Contiki aswell. Chapter 3. System Model and Design 40 For this reason an upgrade and refurbish of Svelte for the Contiki-NG is mandatory. For instance, Svelte used the Contiki-RPL implementation from Contiki-2.6 to Contiki-3.x. The architecture will be accordingly upgraded in order to make use of Contiki-NG’s RPL-Lite implementation. Futhermore, enhancements to the Firewall will also be alongside with the efforts on the DoS attack protection, as each the rule-based model and the mini Firewall will be co-dependent. At last, enhancements to the 6Mapper module and the detection and correction modules, inherited from Svelte, will also be developed in order to provide for a more stable and reliable flow of data collection and attack detection. Figure 3.1 compiles an overview of the IDIoT architecture, showing an example of a network layout with three agents on sight: a border router which is the network root, some network nodes scattered randomly, and an internet connection, performed through the border router. On both the border router and the network nodes, a zoom-in table is displayed showing the network stack of the device in which is possible to locate the placement of the IDIoT. Figure 3.1: Overview of the IDIoT architecture. In Figure its possible to understand the hybrid nature of the IDIoT regarding the placement strategy, as there are both centralized and distributed modules present in the border router and the network nodes, respectively. On the the network nodes, the modules inherited from Svelte are the 6Mapper client and the Packet Loss, whereas the modules added in our project are the Firewall-Client , the firewall-Manager and the DoS detection. In the 6BR, the modules inherited by Svelte are the 6Mapper , Spoofing/Alteration Detection, Node Availability, Graph Validity, End-to-end Packet Loss and the Firewall-Server , whereas the modules now developed in our project are the DoS detection and the improved Firewall-Server and manager . The IDIoT architecture is present in the application layer and network layer, just like Svelte, which worked in the same grounds. However, Svelte was mainly present in the application layer and only few Chapter 3. System Model and Design 41 features run in the network layer. At this moment, IDIoT introduces more modules to the application layer, in both border router and network nodes, but also in the network layer, where features are more significant in both devices due to many new capabilities from the Firewall . Figure 3.2 depicts the border router, which is the central device with all centralized modules, detailing its dependencies between other software modules. Figure 3.2: Overview of the IDIoT Border-Router architecture. These communications concern the IDIoT flow between modules, so basically they represent control packets and these can be both periodically and occasional. On the left side of the Figure 3.2, it is possible to see that this device receives two kinds of control packets: filter requests and mapping responses. These packets are sent from the network nodes. On the right side of Figure 3.2 there are the control packets generated by this device, and sent to network nodes: the mapping requests and the filter commands. Furthermore, it is possible to see the communication between the TCP/IP and the Firewall-Server management for filter inquiry, as well as intra-modular communications, for example, between the DoS detection module and the Firewall management. In Figure 3.3, the network nodes architecture overview is shown. Chapter 3. System Model and Design 48 the state to high alert. This way, the low alert state is responsible for counting the total amount of packets received, on the device it is running, for a certain period of time. For this reason, a periodic timer is used. At each timer overflow, the packet counter is reset to 0. For each packet received, the counter is increased and its value is compared to the established threshold which sets the limits for the number of packets to be received for that time interval. If at any moment the number of received packets surpasses the referred threshold, the mechanism switch from low alert to high alert state. The high alert state is the one where the number of actions performed is much higher and thus where more latency is induced to the system, however, it is a state which was designed also not to be active for a great amount of time. Its main goal is to effectively detect which agent is causing this increased packet rate and to classify him as the cause, take actions in accordance, and return to the low alert state. This action is most likely to be a filtering order of the attacker and after such, the network traffic, at least the network traffic directed at this node should suffer a significant reduction and the IDIoT-DoS-Detection shall return naturally to the low alert state. This state workflow is very similar to the low alert state but now there are many increased actions. A finite number of detection agents are created, which are structures that store the IP address of a possible suspect as well as three packet counters assigned to this suspect. Each counter will be assigned to a protocol, such as the UDP, TCP and ICMP. In similarity to the low alert state, thresholds are configured which represent the maximum expected amount of packets to be received, in a certain amount of time, for a specific sender and protocol. If the received packets surpass any of these thresholds, the IDIoT-DoS-Detection is now detecting the attacker and the next step shall be to take actions in accordance. The IDIoT-DoS-Detection triggers a firewall procedure in order for this attacker to be locally filtered and reported to the border router running the IDIoT-Firewall-Server . As previously described, if any other network node’s IDIoT-DoS-Detection sends a report to the IDIoT-Firewall-Server concerning this same attacker, then it will be promoted to a global filter and will be filtered out of the entire network, after the IDIoT-Firewall-Server command. These referred thresholds have a great responsibility on the IDIoT-DoS-Detection and efforts are taken into making these the most representative of real network behavior, under penalty of having a detection module detecting false attacks and filtering innocent nodes, in a network where the traffic is just higher than previously expected, or under penalty of the IDIoT-DoS-Detection not being able to detect a possible attack being taken against the node where he is running, if the network actually is running with an inferior flow of traffic then previously expected. Chapter 4 Implementation This Chapter presents the implementation of the system discussed in Chapter 3. It starts with an overview given by Section 4.1, followed by a detailed implementation in Section 4.2, where all developed modules are explained and discussed. 4.1 Implementation Overview The first approach to implement of the IDIoT solution consisted in studying the Contiki-2.6, which was used by the first release of the Svelte, and comparing it with the latest Contiki-NG. Svelte was firstly ported from Contiki-2.6 to Contiki-3.x, where the main difference lies in the RPL implementation. At last, and the most difficult porting exercise, was upgrading Svelte from Contiki-3.x to Contiki-NG, where several changes were performed: changes in the Makefiles , the declaration of the DAG root and its initialization, the use of the UDP connections, the project-conf.h files, and some other minor changes. At last, and probably the hardest task was to port the Svelte integration with RPL to support both RPL-Classic and RPL-Lite implementations, present in Contiki-NG. Listing 4.1 shows an example of a Makefile suited for a UDP-server with the DAG-root, running the IDIoT modules. Some things remain from the old Contiki, for example, the need for inclusion of the top Makefile , the Makefile.include , and the definition of the root directory. However, this Makefile shows that for the inclusion of applications, formerly named as APPS in the previous Contiki versions, are now called MODULES . Also, in the previous Contiki versions, no routing protocol was specified because only the native version of RPL was available. By default, Contiki-NG uses the RPL-Lite, however, if the user intends in using the RPL-Classic, the MAKE_ROUTING define should be defined with MAKE_ROUTING_RPL_CLASSIC , as shown in line 12 in Listing , 4.1. Furthermore, the user can also define the desired Medium Access Control (MAC) protocol by defining the MAKE_MAC , e.g., MAKE_MAC_CSMA , as depicted in line 13 of Listing 4.2. 49 Chapter 4. Implementation 50 Listing 4.1: Contiki-NG Makefile for RPL-border-router running IDIoT modules. 1CONTIKI = ../../.. 2CONTIKI_PROJECT =udp−server 3 4include $(CONTIKI)/Makefile.dir−variables 5# Include IDIoT modules 6MODULES += $(CONTIKI_NG_SERVICES_DIR)/ids−server 7MODULES += $(CONTIKI_NG_SERVICES_DIR)/firewall−server 8MODULES += $(CONTIKI_NG_SERVICES_DIR)/dos−detector 9# Include in the project all flags defined in project −conf 10 CFLAGS += −DPROJECT_CONF_PATH=\”project−conf.h\” 11 12 #MAKE_ROUTING = MAKE_ROUTING_RPL_CLASSIC 13 MAKE_MAC = MAKE_MAC_CSMA 14 all : $(CONTIKI_PROJECT) 15 include $(CONTIKI)/ Makefile . include Listing 4.2: Contiki-NG Makefile for UDP-client running IDIoT modules. 1CONTIKI = ../../.. 2CONTIKI_PROJECT =udp−client 3 4# Include all needed modules for this firmware . 5include $(CONTIKI)/Makefile.dir−variables 6MODULES += $(CONTIKI_NG_SERVICES_DIR)/ids−client 7MODULES += $(CONTIKI_NG_SERVICES_DIR)/firewall−client 8MODULES += $(CONTIKI_NG_SERVICES_DIR)/dos−detector 9# Include in the project all flags defined in project −conf 10 CFLAGS += −DPROJECT_CONF_PATH=\”project−conf.h\” 11 12 #MAKE_ROUTING = MAKE_ROUTING_RPL_CLASSIC 13 MAKE_MAC = MAKE_MAC_CSMA 14 all : $(CONTIKI_PROJECT) 15 include $(CONTIKI)/ Makefile . include Chapter 4. Implementation 51 It is important to notice that all necessary modules, such as the IDIoT-6Mapper-Server , the IDIoT- Firewall-Server , and the IDIoT-DoS-Detection , must be included also in the Makefile . For instance, if considering the Makefile for a regular network node, such as an UDP-client, running the IDIoT as a client, a Makefile for the Contiki-NG using the RPL-Lite would look like the one presented in Listing 4.2. As seen in both Makefiles , a reference is given, in line 10, so that flags from the file project-conf header file would be included in the compiling flags for the project. This is a regular practice when building applications in Contiki as there are many possible configurations for the user regarding modules, variables size, and more. Listing 4.3 will show an example project-conf header file for a RPL-border-router running IDIoT modules. As presented before in Section 2.3, Tmote Sky was the preferred mote for the development of the project, mainly because Svelte’s implementation and evaluation was performed in this mote, for consistency and results comparison purposes. As this device is highly limited in resources, great efforts were taken during the implementation of saving ROM. For instance, as seen in Listing 4.3, in line 3, TCP stack was disabled in this project and therefore the support for such was turned of, allowing for a considerable amount of memory to be saved. Furthermore, in line 6, the amount of possible UDP connections is also limited to three due to an increasing amount of memory needed for each connection. Three connections were chosen as the maximum since this project only uses one for the UDP-server and UDP-clients packet exchanges, another for the IDIoT-6Mapper-Server and IDIoT-6Mapper-Clients exchanging the mapping requests and responses, and a last one for the IDIoT-Firewall-Server and IDIoT-Firewall-Client exchanges. Moving on to the project-conf.h , shown in Listing 4.3, there is a flag, assigned to zero at this moment, which allows for the entire project code to know whether it is supposed to use the RPL-Lite or the RPL- Classic implementation. If the user intends to switch from one RPL implementation to another, one must set both variables: this last referred one, and the variable seen in the Makefile , in Listing 4.1. By the end of the project configuration header file, three flags are used for module enabling or disabling management. In Listing 4.3 it is better detailed how these flags turn of or of the use of modules. Many other compiling flags can be set, enabled, or disabled in accordance with the user’s intended application. For instance, it is possible to check the configuration header files of a specific platform building system, like the T mote Sky or others, to check all the possibilities of configuration, such as the: uIP buffer size, RPL maximum instances, RPL maximum DAGs per instance, RPL DAG lifetime and more. Listing 4.3 shows an example of process definition for a specific application running the IDIoT modules. The two defined variables CONF_FIREWALL and CONF_DOS_DETECTION , in lines 21 and 22, are used to enable or disable the modules. Listing 5.1 shows how that is implemented. Chapter 4. Implementation 52 Listing 4.3: Contiki-NG application project configuration header file example. 1// Save some ROM by turning of the TCP stack. 2#undef UIP_CONF_TCP 3#define UIP_CONF_TCP 0 4 5/* Defines the maximum amount of UDP connections available*/ 6#define UIP_CONF_UDP_CONNS 3 7 8/* Define the max number of neighbors and routes allowed in each node's table */ 9#undef UIP_CONF_MAX_ROUTES 10 #define NBR_TABLE_CONF_MAX_NEIGHBORS 13 11 #define UIP_CONF_MAX_ROUTES 13 12 #define CSMA_CONF_MAX_NEIGHBOR_QUEUES 13 13 #define NETSTACK_MAX_ROUTE_ENTRIES 13 14 15 /* Turn of to use RPL-Classic. Turn off to 0 to use the default: RPL-Lite*/ 16 #define RPL_CONF_CLASSIC 0 17 18 // Auxiliar flags for improved code organization 19 #define CONF_DAG_ROOT 1 20 // Auxiliar flag for easy on/off states of addittional modules 21 #define CONF_FIREWALL 1 22 #define CONF_DOS_DETECTION 1 Listing 4.4: Contiki-NG application processes start example. 1#include "mapper-client.h" 2 3#if CONF_FIREWALL 4#include "firewall-client.h" 5#endif /* CONF_FIREWALL */ 6 7#if CONF_DOS_DETECTION 8#include "dos-detector.h" 9#endif /* CONF_DOS_DETECTION */ 10 /*--------------------------------------------------------*/ 11 PROCESS(mapper_client_process,"UDP client process"); 12 AUTOSTART_PROCESSES(&mapper_client_process, &mapper_client 13 #if CONF_FIREWALL 14 ,&firewall_client 15 #endif /* CONF_FIREWALL */ 16 #if CONF_DOS_DETECTION 17 ,&dos_detector 18 #endif /* CONF_DOS_DETECTION */ 19 ); Chapter 4. Implementation 53 4.2 IDIoT Modules For the implementation of the IDIoT, we have developed (based on the original Svelte), the following modules: (1) 6Mapper ; (2) routing attack detection; and (3) Firewall. To these modules there were added several missing features that were not yet developed. Moreover, and in order to enable DoS attack detection, it was also created the DoS detection module, which is able to detect and stop UDP flood attacks. 4.2.1 IDIoT-6Mapper Regarding the implementation of the IDIoT-6Mapper , the work of this project consisted mostly in upgrades and not so much in improvements. The upgrades refer to the changes performed to the Svelte original 6Mapper for this to be compliant with the Contiki-NG and its two RPL implementations. This was by far the most effort demanding task concerning the IDIoT-6Mapper . The IDIoT-6Mapper makes use of a simple UDP connection between server and client, using ports 4714 and 4713, respectively, for mapping requests and mapping response communications. These control packets have already been referred in Sections 3.2.1 and 2.2.2.1. Figure 4.1 presents the structure of both mapping request and mapping response exchanged variables and their size in bytes. Algorithm 5 shows the procedure which periodically sends these control packets to the network nodes. Figure 4.1: Svelte improved mapper. In this implementation, the IDIoT-6Mapper-Server makes use of two timers for the management of mapping request send interval. Both timers are from the etimer Contiki library and the first, map_timer , overflows at a larger amount of time than the other, the host_timer . Firstly, the map_timer is responsible for generating the event which will start the entire process of network mapping. This process is periodic and the mapping interval must be set accordingly with the network mobility, as said in the previous system Chapter 4. Implementation 54 Algorithm 5: IDIoT-6Mapper-Server Algorithm for network construction. Input: N - List of the Network Nodes Input: rpl_info - The RPL info of this node Input: Timestamp - Timestamp for this node at given moment Input: host_timer Input: map_timer Output: mapping_request if map_timer.expired then if host_timer.expired then for network_node in N do if network_node.timestamp == outdated then mapping_request.instance_ID = rpl_info.instance_ID ; mapping_request.dag_ID = rpl_info.dag_ID ; mapping_request.version_number = rpl_info.version_number ; mapping_request.timestamp = timestamp ; simple_udp_send( network_node.ipaddress , mapping_request ); end host_timer.restart ; return ; end map_timer.restart ; return ; end end Chapter 4. Implementation 55 design Section 3.2.1. When this timer expires, the IDIoT-6Mapper-Server proceeds on sending mapping requests to all network nodes and then restarts the map_timer and repeats the process. Sending mapping requests from one node to another is also a periodical procedure executed at the expiring event of the host_timer . A simple configuration is set: the amount of time of which host_timer runs before overflow is equal to the map_timer divided by the number of network nodes. For instance, if the network administrator sets the mapping interval, the map_timer value, of 120, and there are 6 UDP-clients in the network, the RPL-border-router will send mapping request to each node, one at a time, every 20 seconds. Algorithm 6: IDIoT-6Mapper-Client Algorithm for handling mapping requests and responses. Input: rpl_info - RPL info of this node Input: Nbr - List of neighbors to this node Input: mapping_request Output: mapping_response if mapping_request.instance_ID == rpl_info.instance_ID then if mapping_request.dag_ID == rpl_info.dag_ID then if mapping_request.version_number == rpl_info.version_number then mapping_response.node_ID = rpl_info.my_ID ; mapping_response.instance_ID = rpl_info.instance_ID ; mapping_response.dag_ID = rpl_info.dag_ID ; mapping_response.version_number = rpl_info.version_number ; mapping_response.timestamp = current_timestamp ; mapping_response.node_rank = rpl_info.my_rank ; mapping_response.parent_ID = rpl_info.myparent_ID ; for neighbor in Nbr do mapping_response.neighbors_IDs « neighbor.ID ; mapping_response.neighbors_ranks « neighbor.rank; end simple_udp_send(mappin_response.sender_ip, mapping_response); end end end Each timer from the etimer library is only present in the IDIoT-6Mapper-Server as the IDIoT-6Mapper- Client only sends mapping responses after the reception of a mapping request, thus, timers are not required. The client’s behavior when receiving a mapping request is described in Algorithm 6. At last, the algoritm 7 shows IDIoT-6Mapper-Server procedure in receiving a mapping response. The IDIoT-6Mapper-Server increasingly builds a topology of the network packet after packet, adding new nodes Chapter 4. Implementation 56 to the internally constructed network as the nodes refer to such node as a neighbor. With this information is then possible to perform the detection algorithms present in the following section. Notice that in Algorithms 6 and 5, the instance ID, DAG ID, and version number are always checked for safety concerns. This procedure happens for both RPL-Lite and RPL-Classic implementation even tough the RPL-Lite only has room for one instance and one dag. This procedure is mandatory since a node from another network, belonging to another DAG may intercept a mapping request and try to answer to such, which would create information mismatches in the IDIoT-6Mapper-Server . As expected, the RPL-Lite implementation induces little overhead when compared to RPL-Classic, mainly due to the existence of only one RPL instance and only one dag for such instance. This way, the RPL-Lite is the preferred RPL implementation when considering a solution that will be building a network topology of its own. Algorithm 7: IDIoT-6Mapper-Server Algorithm for managing the network mapping. Input: N - List of the Network Nodes Input: rpl_info - The RPL info of this node Input: mapping_response if mapping_response.instance_ID == rpl_info.instance_ID then if mapping_response.dag_ID == rpl_info.dag_ID then if mapping_response.version_number == rpl_info.version_number then N « mapping_response.node_ID ; N « mapping_response.parent_ID ; for network_node in N do if network_node.node_ID == mapping_response.node_ID then network_node.node.parent = mapping_response.parent_ID ; end end for neighbor in mapping_response.neighbors do N « neighbor_ID ; N « neighbor_rank ; end end end end Chapter 4. Implementation 57 4.2.2 IDIoT-Routing-Detection In the similarity of the previous module, the IDIoT-Routing-Detection has also suffered several upgrades and improvements. However, contrary to the previous module, upgrading the detection module was the smallest task. This is because almost all of the procedures performed by the IDIoT-Routing-Detection are performed over the collected data from the IDIoT-6Mapper and therefore do not handle directly with structured RPL data. For this reason, the effort performed in IDIoT-6Mapper to upgrade the module to work with both RPL versions resulted in only minor changes for upgrading this module. However, improving the module was the most effort demanding task. The Algorithms 9 and 10 will show some of the improvements performed in this solution, over the existing work presented by Svelte. For instance, Algorithm 8 is very much like the one presented by Svelte since the child and parent relation has not suffered changes. It was a relation specific to the RPL protocol as published in the standard [37]. Algorithm 8: IDIoT-Routing-Detection checking child-parent relation for rank inconsistencies. Input: N - List of the Network Nodes for Node in N do if Node.timestamp == outdated then continue ; else for Node in N do if Node.rank + 0.2*Node.rank < Node.parent.rank + MinHopRankIncrease then Node.fault = Node.fault + 1 ; Node.parent.fault = Node.parent.fault + 1 ; end end for Node in N do if Node.fault > FaultThreshold then Raise alarm ; end end end end The Algorithm 9 presents the detection and correction algorithm of possible attacks or information mismatches. Algorithm 9 shows one major improvement im comparison to the original Svelte algorithm Chapter 4. Implementation 64 Algorithm 13: Firewall client network filters management. Input: sender & attacker Input: GF - A list of Global Filters & GF_index Input: SF - A list of Small Filters & SF_index /*Got a new message of sender asking to filter packets from attacker*/; for Globalfilter in GF do if Globalfiler.state == active then if Globalfilter.ipaddress == attacker.ipaddress then return /*Already existing filter*/ end end end for Smallfilter in SF do if Smallfilter.state == active then if Smallfilter.ipaddress == attacker.ipaddress then if Smallfilter.dest == sender then return /* Already existing filter for this destination */ end /*New complaint of an existing filter. Promoting to global*/ ; GF[GF_index].ipaddress = attacker.ipaddress ; GF[GF_index].state = active ; GF_index = GF_index + 1 ; Smallfilter.state == unactive ; broadcast global filter ; return ; end end end for Smallfilter in SF do if Smallfilter.state == unactive then Smallfilter.ipaddress = attacker.ipaddress ; Smallfilter.state = active ; Smallfilter.dest = sender ; return ; end end /* All small filters are active, so replace with the oldest */ ; SF[SF_index].ipaddress = attacker.ipaddress ; SF[SF_index].dest = sender ; SF_index = SF_index + 1 ; Chapter 4. Implementation 65 4.2.4 DoS Detection Module Concerning the implementation of the IDIoT-DoS-Detection , two algorithms will be shown for a better understanding of what was performed. The first, Algorithm 14 shows the procedure that takes place every time a node, whose IDIoT-DoS-Detection is enabled, receives a valid packet that reaches the networking layer of the uIP stack. At this point, the TCP/IP performs a link to this procedure so it may be executed. If a node has the IDIoT-DoS-Detection disabled, this call will not take place and the following procedures will not take place as well. Algorithm 15 shows the procedure for each timer overflow. This module makes use of a timer, similarly to the ones used to by the IDIoT-6Mapper as previously explained, and the moment this timer expires, an event is triggered allowing for this procedure to execute. As explained in the previous system design of this module, Section 3.2.4, the IDIoT-DoS-Detection uses three states: OFF , LOW ALERT , HIGH ALERT . In OFF state no data structures are used, only an auxiliary variable cooldown used for asserting the state from off to low only after a configurable amount of time. In both the LOW ALERT and the HIGH ALERT state, a counter is used to keep track of the total amount of received packets for a specific amount of time and is represented in Algorithm 14 as for packet_counter . At last, the HIGH ALERT states makes use of a list of agents. These agents are called detecting agents and are implemented in a structure with the attacker uIP address, three counters, one for each protocol, respectively UDP, TCP and ICMP, and, at last, a state variable. There were two main concerns regarding the detecting agents: how detecting agents should be allocated, and how which selection process should be used when considering who will be assigned for the detecting agent to keep track. Firstly, the amount of allocated detecting agents will have an impact on memory allocation and an impact on latency as well since, at each packet received, if in the HIGH ALERT state, the comparison of the packet sender and the list of detecting agents takes place. The longer the list, the higher the latency for each received packet. Secondly, the selection process when considering which node will be assigned for such a detecting agent is also a concern, because the system relies on at least of the detecting agents being effectively allocated to an attacker. If all detecting agents are assigned to track regular network nodes, and the attacker is not being tracked, the system will never leave the HIGH ALERT state, causing even higher deniability of service for such node, the opposite of what is intended with this module. Chapter 4. Implementation 66 Algorithm 14: DoS Detection module at each packet reception. Input: packet.sender ip address Input: State_Threshold & udp_threshold Input: A - A list of Agents switch State do case Off do Do nothing ; end case Low Alert do packet_counter = packet_counter + 1; if packet_counter > State_Threshold then state = High_Alert_State; end end case High Alert do packet_counter = packet_counter + 1; for agent in A do if packet.sender == agent.ipaddress then agent.udp_counter = agent.udp_counter + 1; if agent.udp_counter > udp_threshold then report attacker; end return; end end /*If no agent is assigned for the sender of this packet, try to assign one*/; for agent in A do if agent.state == 0 then agent.ipaddress = packet.sender; agent.state = 1; agent.udp_counter = agent.udp_counter + 1; return; end end end end After some speculation and simulations, we found that the most reasonable amount of detecting agents for this system would be dynamic and with the value of a third of all network nodes. It is not expected that so many nodes can be compromised all at the same time and even if so, a third of the network nodes Chapter 4. Implementation 67 is a reliable value for allowing the system to detect attackers, even if only one at a time. Moreover, and regarding the selection process, the conclusions taken from simulations with a regular network where one node was receiving a DoS attack were that such node would always receive a packet from such attacker at a higher packet rate than any of node, making thus possible for a selection process to work by, after the IDIoT-DoS-Detection reaching the HIGH ALERT , and given, e.g., five as the amount of detecting agents, the first five nodes that would send a packet to this node, would be the ones selected to be tracked with a detecting agent. Empirically, this was the number found to be ideal. In Algorithm 14, and in case of HIGH ALERT active, it is shown only one counter and one logic comparison using the UDP counter for such detecting agent. This procedure is implemented this way since, at this moment, only support for UDP packet counting is enabled. Support for other protocols is left for future work. Regardless of the protocol implementation, an attacker will be detected when the number of packets counted exceeds a previously defined threshold. This threshold can be configured by the network administrator and in this implementation, we used a threshold in accordance with the maximum expected traffic flow for one node within a regular network of thirteen nodes, in which one is an UDP-server and the remaining are UDP-clients. The threshold values were, for this reason, obtained through simulation of this network delimiting what could be considered normal traffic and from what point it could no longer be considered normal. At last, and concerning the timer referred in Algorithm 15, the implementation of the IDIoT-DoS- Detection makes use of a timer to generate expiring events in order to trigger the procedure shown in Algorithm 14. This timer value is configurable by the network administrator at the moment of deployment, such as the mapping interval used by the IDIoT-6Mapper . If deploying this solution in a greatly resource-limited node, one of the possibilities in the IDIoT is to set this timer value to be the same as the IDIoT-6Mapper mapping interval timer and the system will make use of the IDIoT-6Mapper timer to generate these events as well. Chapter 4. Implementation 68 Algorithm 15: DoS Detection module at timer overflow. Input: etimer expired event Input: State_Threshold Input: A - A list of Agents switch State do case Off do if cooldown == 0 then state = Low_Alert_State; else etimer_restart; end end case Low Alert do packet_counter = 0; etimer_restart; end case High Alert do if packet.sender < State_Threshold then state = Low_Alert_State; end packet_counter = 0; memset(agents,0); etimer_restart; end end Chapter 5 Evaluation This chapter will focus on evaluating our solution regarding its ability to accomplish what was proposed in previous chapters. It presents functional tests, performance evaluations and system characterizations, e.g., memory footprint and energy consumption. 5.1 Evaluation Overview Adding new features to a stable version of firmware aiming to improve certain capabilities of the targeted device is a bold intention in the research community. For this reason, one cannot simply expect community interest or even approval for its work if detailed evaluations are not presented. Therefore, it’s widely established that some evaluations and benchmarks shall be performed and presented for any kind of feature developed with the aim of deployment in stable devices. Our solution slightly changes the behavior or a device within a network, regarding its routing behavior and its communications activity. For this reason, metrics for this evaluation should be: the device’s capability of detecting, reporting and filtering an attack, the device’s overhead when exchanging communications, and the device’s increased footprint in memory. The device’s capability of detecting, reporting, and filtering an attack is not a quantifiable metric in contrary with, for example, the devices increased memory footprint, measured in kB. For this reason, to evaluate this metric, then, a finite number of simulation samples will be used, where in each sample a different simulation test scenario is used. Simulations performed will be available to the research community in an open-source repository and the structure is as follows: For the device’s capability of detecting, reporting, and filtering an attack, we have three test scenarios of networks, and we will run each test scenario twice. First time without the IDS modules and secondly with the IDS modules. These three test scenarios will be (1) network without 69 Chapter 5. Evaluation 70 attacks, (2) network under a sinkhole attack from inside the network, (3) under a DoS attack from inside the network. All test scenarios run the same base structure which is one UDP-server acting as DAG-root, running IDS-server modules when IDS is active, and many UDP-clients, also running IDS modules if such is active. Regarding the device’s overhead when exchanging communications, which is a quantifiable metric, many factors can be measured and for this reason, we will be using an excellent tool which has proven to be suited or these types of works. The Thread-Metrics Benchmark Suite allows researchers and developers to access the amount of overhead introduced by an RTOS to determine if its services are worth the additional performance cost [71]. It consists of creating eight OS processes that output a score value denoting the system’s availability. A higher score represents more system availability to execute the application rather than OS services. On the other hand, a lower score denotes less availability as the OS is busy processing other services/events. From the Thread Metrics Benchmark Suite, we will be benchmarking our system with the following tests: (1) Basic Processing Test, (2) Cooperative Scheduling Test, (3) Preemptive Scheduling Test, (6) Message Processing Test, (7) Synchronization Processing Test, and the (8) RTOS Memory Allocation test. All tests will output a score that will be presented in following sections. Both Interrupt Processing Test and Interrupt Preemption Processing Test require for some processor-specific instructions which are not available for the processor being used in Tmote Sky, the MSP430, and for this reason, these will not be performed. We will be running four additional test scenarios to measure the overhead induced by our solution. This test scenario is just like the aforementioned, with the difference that, in all four of these tests, the UDP-server will be running the Thread Metrics tests, each at a time. The score from these tests will be shown for comparison. Cooja Network Simulator will be used for all simulations, as discussed in Section 2.3. 5.2 IDIoT Routing Detection In order to evaluate the IDIoT Routing Detection functionality, a sinkhole attack is launched within the network. In Figure 5.1 it is possible to see the printed route links from RPL-Lite after one hour of simulation. The network topology used for this simulation is shown in Figure 5.2 as well as the routing information collected after 1 hour of runtime, represented in arrows, from a parent to child direction. This information shows which are the current routes for each node to the network root. This routing table is obtained from Chapter 5. Evaluation 71 this network while using the RPL-Lite protocol, however using the RPL-Classic the results are very similar, due to the fact that the attack is not active, so no interference is present to affect routes from the typical flow. Figure 5.1: Clean routes in network under no attacks. Figure 5.2: Topology used for the evaluation of the sinkhole attack detection. Regarding the attack implementation, one of the deployed UDP-clients will be modified in order to run a sinkhole attack. This node, represented in simulations by number 13, behaves as a regular UDP-client, just like the remaining, however with a slightly modified behavior regarding RPL specifications. These modifications are the rank it is advertising in all of his DIO messages sent to neighbors, as well as the frequency at which RPL trickle timer is operating. In order to perform the sinkhole attack, we have modified his rank advertisement to be as high as the root rank and the frequency of the trickle timer to be as high Chapter 5. Evaluation 72 as possible, resulting in a higher frequency of DIO being sent to neighbors so these always have this node in high stakes in their routing tables. The same topology from Figure 5.2 was repeated, however, this time, the attacker was enabled. Once again, Figure 5.3 shows the printed route links, stored in the DAG-root, node 1, after 1 hour of simulation. It is now possible to notice that are many links headed by node 13, whereas in previous Figure 5.1 there was none. In Figure 5.4 it is possible to see to what extent the sinkhole can effect the routing tables of the network. Routes are shown in Figure 5.4 were collected after 1 hour of simulation. Most neighbors of node 13 have redirected their routing tables through him since he his advertising a much more pleasant rank. Figure 5.3: Modified Routes in network under sinkhole attack. Figure 5.4: Modified topology caused by a sinkhole attack. Chapter 5. Evaluation 73 After the first data collection from the IDIoT-6Mapper , the detection and correction module starts running and analyzing the collected data. At this configuration, the minimum hop rank increase is 128, which is also the rank of the DAG-root. For this reason, node 13 should be reporting at least a rank of 256 in order to be in accordance with the parent-child relationship. Furthermore, in simulations where the maximum transmission distance is fewer than 70 meters, node 13 is not a neighbor of node 1, making it mandatory for him to be a child of either node 2 or 3. This should result in a rank of at least 3 times the minimum hop rank increase: 384. However, node 13 his being said, by all of its neighbors, to have a rank value of only 130. The attacker is detected and since the light rank correction is not possible because all neighbors are contaminated with false rank information, the attacker is marked as severe. For this reason, the detection and correction module triggers the firewall server to globally filter with the attacker by sending filter commands to all network nodes. Furthermore, the RPL-global-repair procedure is triggered, which re-starts the entire RPL formation, and, at last, IDIoT-6Mapper performs a global repair of his own collected data. Figure 5.5 shows part of the Cooja mote output window from IDIoT-6Mapper-Server information where it is possible to see the attacker marked as a global filter and aside from the remaining network. It also shows the re-constructed IDIoT-6Mapper network graph after the global repair process. It is possible to check, for all network nodes present, none is claiming to have node 13 as neighbor, as this is completely filtered out from the network. Moreover, and for a better visualization, Figure 5.6 shows a final instance where all routing information shows how the attacker was successfully globally filtered from the network. At last, it is possible to see in Figure 5.7 the same procedure of route links being printed, as seen before, after one hour of simulation and, ultimately, node 13 has vanished. Figure 5.5: IDIoT-6Mapper network graph recovered after global repair. Chapter 5. Evaluation 80 Figure 5.11: RAM usage overhead evaluation for devices running IDIoT modules. Figure 5.12: ROM usage overhead evaluation for devices running IDIoT modules. Memory footprint evaluation fulfills the all expectations. It is possible to confirm what was expected concerning which device had a higher overhead with the inclusion of the IDIoT modules: the centralized node. An increased 6kB of ROM is necessary for all modules of the IDIoT-server and 3.3kB for the IDIoT- client. Regarding the RAM usage overhead, an increased usage of 1.5kB is seen for the IDIoT-server whereas the IDIoT-client modules induce an overhead of 0.5kB of RAM. These results are very positive concerning the possibility of deploying both IDIoT-server and -client versions on such a resource-constrained device as the Tmote Sky, with only 48kB of ROM and 10kB of RAM available. Chapter 5. Evaluation 81 5.5 Energy Consumption The following Table 5.4 presents the evaluation performed on energy usage of the IDIoT modules. Usually, nodes in the IoT, such as the Tmote Sky, for instance, are battery powered and hence energy is a scarce resource. For this reason, Contiki offers a tool named PowerTrace [72] which allows for developers to access the total time different parts of the system were active. With this data, it is possible to estimate with high accuracy the power consumption of a node, when one knows the nominal values from the device in use. In Table 5.3 data is retrieved for the Tmote Sky datasheet [73], which is used for the aforementioned calculations. Table 5.3: Tmote Sky nominal operation values. Typical conditions Minimum Nominal Maximum Unit Supply Voltage 2.1 3.6 V Operating free air temperature -40 85 C MCU on, Radio receiving (RX) 21.8 23 mA MCU on, Radio transmitting (TX) 19.5 21 mA MCU on, Radio off 1800 2400 µA MCU idle, Radio off 54.5 1200 µA MCU standby 5.1 21.0 µA Given the nominal operation conditions from Table 5.3 and the on and off time for each part of the system, provided from the PowerTrace application, it is possible to determine the energy, in mJ , for each device, with the following calculations. For transmit we understand the amount of time when the MCU was on and the radio was transmitting. For listen we understand the amount of time when the MCU was on and the radio was receiving. For CPU we understand the amount of time when the MCU was on and the radio was off, and for Low Power Mode (LPM) we understand as the amount of time when the MCU was in idle mode and the radio was off. Energy(mJ) = ((transmit ∗19.5mA)+(listen ∗21.8mA) +(CPU ∗1.8mA)+(LPM ∗0.0545mA)) ∗(3V/4096) Evaluation of resource consumption was performed with the same topology as described in Section 5.2 and 5.3. Simulations were performed with and without the attack, as well as with and without the IDIoT modules. The obtained results can be seen in Table 5.4. Chapter 5. Evaluation 82 Table 5.4: Energy Consumption for devices running IDIoT modules for 15 minutes, in 4 topologies. IDIoT-Server IDIoT-Client Resource Clean Clean+IDS Under DoS Under DoS + IDS Clean Clean+IDS Under DoS Under DoS + IDS CPU (s) 2 2 2 2 0 0 18 2 LPM (s) 898 898 898 898 900 900 882 898 listen (s) 25 28 136 30 16 18 20 20 transmit (s) 875 872 765 870 884 882 880 880 Energy (mJ) 14.43 14.43 14.72 14.44 14.43 14.43 14.9 14.43 It is possible to notice, in Table 5.4, an increased energy consumption for a network under DoS attack and where the IDIoT is not enabled. However, this is only an increase of two percent in energy consumption. This is immensely negligible having in consideration that the network was set to run for 15 minutes. This negligible increase can be explained by the limitations presented by Cooja concerning energy consumption estimations of the emulated radio module. It is possible to see in Table 5.4 the radio was either on listen or transmit mode for the entire duration of the simulation, 15 minutes, 900 seconds. For this reason, it is not feasible to estimate the energy consumption of the emulated radio device on different network topologies. However, the results obtained for the MCU energy consumption, alone, are trustworthy and relevant for the metric in study. For this reason, Figure 5.13 delivers the obtained results for energy consumption concerning the MCU operation of the devices under the same circumstances as seen in Table 5.4. The topology used for this evaluation was the same seen in Figure 5.2, where the IDIoT-server is running in node 1. The DoS attack used for this simulation was the same as the one described in Section 5.3 which is launching an UDP flood towards the DAG-root. Furthermore, and in accordance with the memory evaluation performed in 5.4, it is possible for an evaluation to be presented regarding the energy consumption of each module in the IDIoT solution, a relevant evaluation as different IDIoT modules can be enabled or disabled in accordance with the network administrator intentions. Chapter 5. Evaluation 83 Figure 5.13: Energy consumption overhead for the DAG-root under DoS attack over 15 minutes. Figure 5.14: Energy consumption overhead related to each IDIoT module enabled, for a 10 minute simulation. Energy consumption evaluations presented in Figure 5.13 shows how the target of a DoS attack can rapidly have is battery drained out. It is also possible to verify how a IDS solution like the IDIoT can be used to prevent such a simple implementation of a DoS attack to have unbearable results of a device’s battery life. Moreover, in Figure 5.14, evaluation of the energy overhead in a topology with no attacks is possible to re-assure how little energy consumption these IDIoT modules induce of a device. Chapter 6 Conclusion The IoT has continuously advanced throughout the years since it first appeared. The deployment and utilization of IoT devices in a wide range of applications is increasing like never before. However, connecting all these devices to the Internet, enables for a vast surface of attacks to such devices and the networks these are integrated in. Security mechanisms for IoT low-end endpoint devices are demanded in order to address this issue and to establish reliability in these devices and networks. For this reason, solutions like the IDS are developed for the IoT paradigm and the current state-of-the-art presents a great amount of literature, published over the years, concerning integration of an IDS with the IoT network architecture. However, much work can still be done concerning low-end IDS solutions, since these are still in its infancy and incipient. Works do not cover or address many IoT technologies and can not detect a large variety of attacks. Moreover, one of the best solutions found, Svelte, is, nonetheless, an outdated solution running an older version of Contiki OS as well as its previous RPL implementation. This thesis was based on the development of the IDIoT, a low-end IDS solution which is capable of detecting routing and DoS attacks, such as the sinkhole and the UDP flood. The development of the IDIoT was based on Svelte, a low-end IDS developed in Contiki-2.6. A refactoring was performed to some modules and after developing others from scratch, the resulted IDIoT solution is, to the best of our knowledge, the first of its kind to integrate both routing and DoS security mechanisms in order to prevent malicious actions towards IoT constrained devices. IDIoT is capable of detecting sinkhole attacks as well as UDP flood attacks, thanks to its detection modules running in both centralized and distributed devices of the network. Furthermore, the IDIoT also integrates into its design a Firewall which allows for centralized and distributed network nodes to perform basic filtering actions toward detected attacks, preventing this way issues such as the denial of services, increased energy consumptions, and more. The IDIoT modules are deployed on the Contiki-NG, a promising OS for the IoT devices, as well as its most recent RPL implementation, the RPL-Lite, which enables new features concerning the routing in 84 Chapter 6. Conclusion 85 low-end IoT networks. Moreover, the IDIoT is a highly configurable and extensible solution where one can choose which modules should be enabled in the network and has support for the previous RPL-Classic implementation. The evaluation performed to the IDIoT modules show great results concerning the detection of sinkhole attacks launched from inside the network as well as UDP flood attacks which can be launched from inside the network as well as from the Internet. Thread-metrics benchmarks show, that for a UDP flood attack, in a network with IDIoT enabled, such attack will not succeed in affecting the network. However, if a network is not protected with IDIoT modules, the DoS attack will be able to degrade up to 40% of network’s performance. Moreover, energy consumption evaluations also assure the detection and prevention enabled by the IDIoT modules during these attacks, which would result in much rapidly drained batteries for unprotected devices. At last, memory footprint evaluations show that the overhead of all IDIoT modules are suitable for low-end devices with resource-constrained hardware, e.g., the TMote Sky. 6.1 Future Work Despite the IDIoT being a good solution as an IDS for the low-end IoT endpoint devices, there are still some improvements and features that can be added in future developments: •Integration the IDIoT with CUTE mote - Hybrid hardware platforms, which combine a MCU and a FPGA on the same SoC are popular even at the network edge. These platforms add extra processing capabilities to already existing systems by allowing the deployment of dedicated hardware accelerators on the FPGA fabric [7] [74]. CUTE mote [7] is a in-house project specially designed for the edge network that proposes a heterogeneous architecture which combines a MCU and a Reconfigurable Computing Unit (RCU) with an IEEE 802.15.4 radio transceiver. CUTE mote supports a series of hardware accelerators concerning the IoT e related with the network stack. By having available FPGA fabric, it is possible to integrate the IDIoT IDS along with the existing network filters, allowing for the IDIoT blacklist to be directly offloaded in hardware, relieving MCU usage. •Integrating the IDIoT with IPv6 over the TSCH (6TISCH) based model - The 6TISCH proposes a protocol stack rooted in the TSCH mode of the IEEE 802.15.4 standard, supports multihop topologies with the RPL and is IPv6-ready through the 6LoWPAN [75]. Having in mind the best feature of the IDIoT, the detection of an attacker, would be a great topic in research to integrate such Chapter 6. Conclusion 86 a solution with the 6TISCH protocol. This way, instead of limiting the IDIoT actions when detecting an attacker to filtering such attacker with the resource to the IDIoT-Firewall , action techniques using channel hopping provided by the TSCH could be investigated; •Developing an OS agnostic framework - IoT motes are expected to have a certain degree of interchangeability concerning its functions and communications in regards to the OS being used. This is possible through compatibility provided by using the same standards and protocols. For this reason, and since the IDIoT modules are currently only running in the application and networking layer of these devices, a great improvement shall be to develop an OS agnostic framework of IDIoT so it can run in devices with, e.g., RIOT OS or TinyOS; •Extending the architecture to prevent more attacks - Existing IDIoT modules are easily extensible for more attack prevention which would enrich the security mechanism. For instance, a wormhole attack is also a popular attack in wireless networks [76]. If the IDIoT-6Mapper is extended, in the mapping responses the clients send to the server, with the signal strength of each node’s neighbor it is also possible to detect a wormhole attacks; •Extend the DoS detection module - Many improvements can performed to the IDIoT-DoS- Detection over the basis we have created. For instance, the module can be improved to secure more flooding attacks, in similarity with the implemented UDP-flood, but this time, with other protocols such as TCP or ICMP; Moreover, the IDIoT-DoS-Detection can be extended for other DoS attacks which exploit well known and used protocols. For instance, concerning the TCP, it is possible to improve this module to prevent the syn-flood . References [1] T. Gomes, D. Fernandes, M. Ekpanyapong, and J. Cabral, “An IoT-based system for collision detection on guardrails,” in 2016 IEEE International Conference on Industrial Technology (ICIT) , March 2016, pp. 1926–1931. [2] S. Pinto, J. Cabral, and T. Gomes, “We-care: An IoT-based health care system for elderly people,” in 2017 IEEE International Conference on Industrial Technology (ICIT) , March 2017, pp. 1378–1383. [3] S. Pinto, T. Gomes, J. Pereira, J. Cabral, and A. Tavares, “IIoTEED: An Enhanced, Trusted Execution Environment for Industrial IoT Edge Devices,” IEEE Internet Computing , vol. 21, no. 1, pp. 40–47, Jan 2017. [4] T. Gomes, S. Pinto, F. Salgado, A. Tavares, and J. Cabral, “Building IEEE 802.15.4 Accelerators for Heterogeneous Wireless Sensor Nodes,” IEEE Sensors Letters , vol. 1, no. 1, pp. 1–4, Feb 2017. [5] T. Gomes, F. Salgado, S. Pinto, J. Cabral, and A. Tavares, “Towards an FPGA-based network layer filter for the Internet of Things edge devices,” in 2016 IEEE 21st International Conference on Emerging Technologies and Factory Automation (ETFA) , Sep. 2016, pp. 1–4. [6] T. Gomes, F. Salgado, S. Pinto, J. Cabral, and A. Tavares, “A 6LoWPAN Accelerator for Internet of Things Endpoint Devices,” IEEE Internet of Things Journal , vol. 5, no. 1, pp. 371–377, Feb 2018. [7] T. Gomes, F. Salgado, A. Tavares, and J. Cabral, “CUTE Mote, A Customizable and Trustable End- Device for the Internet of Things,” IEEE Sensors Journal , vol. 17, no. 20, pp. 6816–6824, Oct 2017. [8] T. Gomes, S. Pinto, T. Gomes, A. Tavares, and J. Cabral, “Towards an FPGA-based edge device for the Internet of Things,” in 2015 IEEE 20th Conference on Emerging Technologies Factory Automation (ETFA) , Sep. 2015, pp. 1–4. [9] A. Ribeiro, C. Rodrigues, I. Marques, J. Monteiro, J. Cabral, and T. Gomes, “Deploying a Real-Time Operating System on a Reconfigurable Internet of Things End-device,” in IECON 2019 - 45th Annual Conference of the IEEE Industrial Electronics Society , vol. 1, Oct 2019, pp. 2946–2951. 87 REFERENCES 88 [10] S. Pinto, D. Oliveira, J. Pereira, N. Cardoso, M. Ekpanyapong, J. Cabral, and A. Tavares, “Towards a lightweight embedded virtualization architecture exploiting ARM TrustZone,” in Proceedings of the 2014 IEEE Emerging Technology and Factory Automation (ETFA) , Sep. 2014, pp. 1–4. [11] S. Pinto and N. Santos, “Demystifying Arm TrustZone: A Comprehensive Survey,” ACM Comput. Surv. , vol. 51, no. 6, Jan. 2019. [Online]. Available: https://doi.org/10.1145/3291047 [12] S. Raza and R. Magnusson, “TinyIKE: Lightweight IKEv2 for Internet of Things,” IEEE Internet of Things Journal , vol. PP, pp. 1–1, 08 2018. [13] K. Ashton. (2009) That ‘Internet of Things’ Thing. [Online]. Available: https://www.rfidjournal.com/ that-internet-of-things-thing [14] A. Al-Fuqaha, M. Guizani, M. Mohammadi, M. Aledhari, and M. Ayyash, “Internet of Things: A Survey on Enabling Technologies, Protocols, and Applications,” IEEE Communications Surveys Tutorials , vol. 17, no. 4, pp. 2347–2376, 2015. [15] J. Lin, W. Yu, N. Zhang, X. Yang, H. Zhang, and W. Zhao, “A Survey on Internet of Things: Architecture, Enabling Technologies, Security and Privacy, and Applications,” IEEE Internet of Things Journal , vol. 4, no. 5, pp. 1125–1142, 2017. [16] L. Atzori, A. Iera, and G. Morabito, “The Internet of Things: A Survey,” Computer Networks , pp. 2787–2805, 10 2010. [17] L. Mainetti, L. Patrono, and A. Vilei, “Evolution of wireless sensor networks towards the Internet of Things: A survey,” in SoftCOM 2011, 19th International Conference on Software, Telecommunications and Computer Networks , Sep. 2011, pp. 1–6. [18] P. Sethi and S. R. Sarangi, “Internet of Things: Architectures, Protocols, and Applications,” Journal of Electrical and Computer Engineering , vol. 2017, pp. 1–25, 01 2017. [19] M. R. Palattella, N. Accettura, X. Vilajosana, T. Watteyne, L. A. Grieco, G. Boggia, and M. Dohler, “Standardized Protocol Stack for the Internet of (Important) Things,” IEEE Communications Surveys Tutorials , vol. 15, no. 3, pp. 1389–1406, Third 2013. [20] C. Perera, C. H. Liu, S. Jayawardena, and M. Chen, “A Survey on Internet of Things From Industrial Market Perspective,” IEEE ACCESS , vol. 2, pp. 1660–1679, 01 2015. REFERENCES 89 [21] A. Zanella, N. Bui, A. Castellani, L. Vangelista, and M. Zorzi, “Internet of Things for Smart Cities,” IEEE Internet of Things Journal , vol. 1, no. 1, pp. 22–32, 2014. [22] M. Baby. (2018) Sleep Trackers for little ones. [Online]. Available: https://www.mimobaby.com/ [23] S. Trash. (2019) An overview of Smart City waste management market. View wireless solution providers, case studies and data platform offerings. [Online]. Available: https: //www.postscapes.com/smart-trash/ [24] S. Agriculture. (2019) Filter and discover IoT Agriculture Resources. View smart farm case studies, sensor applications and potential resource and labor saving dashboards, tools and apps. [Online]. Available: https://www.postscapes.com/smart-agriculture/ [25] S. R. Department. (2016) Internet of Things connected devices installed base worldwide from 2015 to 2025 (in billions). [Online]. Available: https://www.statista.com/statistics/471264/ iot-number-of-connected-devices-worldwide/ [26] O. Oman. What is IoT? Understanding IoT Device Management and Standards. [27] L. Santos, C. Rabadao, and R. Gonçalves, “Intrusion detection systems in Internet of Things: A literature review,” in 2018 13th Iberian Conference on Information Systems and Technologies (CISTI) , June 2018, pp. 1–7. [28] A. Dunkels, “Design and implementation of the lwIP TCP/IP stack,” Swedish Institute of Computer Science , vol. 2, 03 2001. [29] O. Hahm, E. Baccelli, H. Petersen, and N. Tsiftes, “Operating Systems for Low-End Devices in the Internet of Things: A Survey,” IEEE Internet of Things Journal , vol. 3, no. 5, pp. 720–734, Oct 2016. [30] R. Navas, “State of the art of IETF security related protocols for IoT,” 11 2016. [31] J. Granjal, E. Monteiro, and J. Sá Silva, “Security for the Internet of Things: A Survey of Existing Protocols and Open Research Issues,” IEEE Communications Surveys & Tutorials , pp. 1–1, 07 2015. [32] G. Montenegro, J. Hui, D. Culler, and N. Kushalnagar, “Transmission of IPv6 Packets over IEEE 802.15.4 Networks,” RFC 4944, Sep. 2007. [Online]. Available: https://rfc-editor.org/rfc/rfc4944. txt