Network Intrusion Detection System Using Machine Learning and Ns2 in Smart City Networks

A. Parveen Akhther, Senthilnathan S, V. Ranjith, V. S. Prasanth · 2025

This research pioneers an NS2 (Network Simulator 2)-driven Network Intrusion Detection System (NIDS) for smart city cybersecurity, leveraging NS2's discrete-event simulation to model distributed urban infrastructures, including IoT-enabled grids, edge nodes, and multi-zone communication dynamics. The framework integrates a Zone-Adaptive Security Protocol (ZASP), where NS2 emulates polymorphic threats-such as cross-zone lateral movement, spoofed sensor data, and adaptive DDoS attacks-while validating real-time countermeasures through packet-level traffic analysis. Machine learning models, embedded within NS2's event scheduler, deploy Gradient Boosting classifiers trained on simulated smart grid and traffic management datasets, achieving 96.7 % detection accuracy with 1.7 % false positives under heterogeneous attack loads. NS2's trace analysis quantifies a 36 % reduction in threat response latency and 29 % improvement in attack attribution precision compared to centralized IDS architectures, alongside 93.1% legitimate throughput retention during city-scale emulated breaches across 12,000 -node topologies. Custom NS2 modules automate dynamic security policy adaptation, optimizing zonespecific encryption thresholds and QoS parameters for critical infrastructure. By rigorously validating resilience through NS2's scripting APIs and attack emulation tools, this work establishes a scalable, simulation-grounded NIDS framework that bridges theoretical intrusion detection with the operational constraints of IoT-dense urban networks, offering a deployment-ready solution for mitigating evolving cyberphysical threats in smart ecosystems.

Read the paper · More papers on PaperTik