IoT devices generate enormous amounts of data, which deep learning algorithms can learn from more effectively than shallow learning algorithms. The approach for threat detection may ultimately benefit fog computing or fog networking (fogging). The authors present a cutting-edge distributed DL method for detecting cyberattacks and vulnerability injection (CAVID) in this paper. In terms of the evaluation metrics tested in the tests, the DL model performs better than the SL models. They demonstrated a distributed DL-driven fog computing CAVID approach using the open-source NSL-KDD dataset. A pre-trained SAE was utilised for feature engineering, whereas Softmax was employed for categorization. They used parametric evaluation for system assessment to evaluate the model in comparison to SL techniques. For scalability, accuracy across several worker nodes was taken into consideration. In addition to the robustness, effectiveness, and optimization of distributed parallel learning among fog nodes for enhancing accuracy, the findings demonstrate DL models exceeding classic ML architectures.