Abstract
The exponential increase in Internet of Things devices on the Internet causes a deluge of traffic at the cloud. Most of the traffic data is redundant. However, fog computing solves the problems by processing data at the network's edge. Lately, the fog layer is a target of cyberattacks, due to its resource constraints. In this paper, we proposed a lightweight, human immune, and anomaly-based intrusion detection system (IDS) for the fog layer. The proposed system achieves low resource overhead by distributing the IDS functions among the fog nodes and the cloud. We obtained an accuracy of up to 98.8%. Also, we recorded a 10% reduction in the energy consumption of the fog node when compared with deploying a neural network on the fog node.