## 3 Discussion and Classification of IoT Attacks and Countermeasures
### Defenses and Countermeasures  
Given the importance and impact of the IoT domain on our day-to-day lives, it is crucial to explore the available defenses against the attack vectors described above. Similar to the attack classification, the available research literature classifies the defense mechanisms into one of the following categories. **Edge and fog computing** are terms commonly used to describe two additional computational layers in the context of the cloud computing paradigm as described in Figure 3. Edge computing refers to computations taking place at the edge of the network, i.e., at the data source or very close to it instead of executing them in the cloud [11]. The main idea of edge computing is to reduce the data transfer between the cloud and the end devices. Instead, since the edge layer is in a very close proximity to and could even include IoT devices, there are faster data transfer times, low transmission costs, and near-real-time communication. This is essential for the implementation of well-established security best practices [1; 15]. In addition, as pointed out by [PERSON] et al. [15], the edge layer has more computational resources than the IoT end devices, which allows the utilization of more computationally expensive security mechanisms. These include not only encryption mechanisms such as homomorphic encryption, but also the implementation of firewalls, intrusion detection, and intrusion prevention systems at the edge layer, which can analyze and block incoming malicious traffic [15]. Furthermore, as discussed by [PERSON] et al. [1], since there is less data transfer and more local data processing, edge computing reduces the opportunities for data breaches and theft during transit. As mentioned above, the reduced data transfer also results in lower latencies and faster response times, which is not only important for the utilization of countermeasures, but it is also crucial for life-threatening scenarios such as the ones encountered in the health sector, automated vehicles, critical infrastructure, etc. Within this context, the second important layer in the framework of the edge-cloud computing paradigm is fog computing. Fog computing describes computations taking place between the edge and the cloud layers (see Figure 3). The main idea of fog computing is to serve as an additional layer between the edge and the cloud, which allows intermediate data aggregation, analysis, processing, and storage [1; 16; 17]. In this way, only the most essential data are further propagated to the cloud, which reduces the transmission costs, saves cloud storage space, and helps with performing real-time and time-sensitive tasks [1; 16]. The devices most commonly used in the fog layer include switches, routers, and others [1; 16]. In the context of IoT security, fog computing can address some common security challenges. For instance, since the fog layer typically aims at analyzing and filtering out malicious data, it can prevent anomalous traffic to be passed forward to the cloud or the main backend system [1]. Additionally, fog computing reduces the need for data transmission across the whole network, which decreases the risks for eavesdropping and data theft [1]. Finally, the fog provides an environment with higher computational resources compared with the edge devices. Therefore, fog nodes can implement more advanced security best practices and attacks targeting the resource-constrained IoT end devices are therefore harder to perform against the fog layer. Figure 3: Cloud, fog, and edge computing hierarchy. Machine Learning and Deep Learning: In recent years, the machine learning (ML) and deep learning (DL) domains have experienced significant growth and advancement and have become integral parts of a wide variety of industries. The IoT domain is no exception and ML/DL-based approaches can be applied for preventing and mitigating attacks, as well as for improving the security and privacy of IoT-based networks [1; 10; 18; 19; 20; 21]. According to a comprehensive study presented by [PERSON] et al.