Real-Time Network Traffic Analyzer with Multi-Model Machine Learning for Intrusion Detection and Prevention

Authors

  • Bindu Hathwar
  • Reshma H. M.
  • R. Ashok Kumar

Keywords:

Exponential moving average, Geo-IP mapping, Isolation forest, K-means clustering, Threat intelligence

Abstract

Real-Time Network Traffic Analyzer (NTA) is an Intrusion Detection and Prevention System (IDPS) developed using the Python programming language. Unlike a traditional intrusion detection system (IDS), which relies on a fixed set of predefined rules, the proposed system uses machine learning techniques and can detect previously unseen attacks. The system collects real-time network data and processes Open Systems Interconnection (OSI) Layers 2–7. It performs Geo-IP and threat intelligence analysis. Three machine learning models have been applied: Isolation Forest, used for anomaly detection; an Exponential Moving Average (EMA)-based temporal predictor, used for time-series anomaly detection; and K-Means clustering, used for traffic classification. Every five seconds, the system generates a feature vector of length 25. As a result of experiments performed on a university Local Area Network (LAN), it was possible to detect attacks with a detection rate of 95.7%, a false alarm rate of 3.1%, and a mean time to detect (MTTD) of less than ten seconds for Internet Control Message Protocol (ICMP) flood, Transmission Control Protocol (TCP), Synchronize (SYN) flood, User Datagram Protocol (UDP) flood, and port scan attacks.

References

IBM Security, Cost of a Data Breach Report 2023. Armonk, NY, USA: IBM Corp., 2023.

Indian Computer Emergency Response Team (CERT-In), India Ransomware Report 2022. New Delhi, India: Ministry of Electronics and Information Technology, Government of India, 2022.

Wireshark Foundation, Wireshark Network Protocol Analyzer, version 4.2.0, Nov. 2023.

M. Roesch, “Snort: Lightweight intrusion detection for networks,” in Proceedings of the 13th Systems Administration Conf. (LISA ’99), Seattle, WA, USA, Nov. 1999, pp. 229–238.

H.-J. Liao, C.-H. R. Lin, Y.-C. Lin, and K.-Y. Tung, “Intrusion detection system: A comprehensive review,” Journal of Network and Computer Applications,” vol. 36, no. 1, pp. 16–24, Jan. 2013.

A. L. Buczak and E. Guven, “A survey of data mining and machine learning methods for cyber security intrusion detection,” in IEEE Communications Surveys & Tutorials, vol. 18, no. 2, pp. 1153–1176, 2016.

F. T. Liu, K. M. Ting and Z. -H. Zhou, “Isolation Forest,” 2008 Eighth IEEE International Conference on Data Mining, Pisa, Italy, 2008, pp. 413-422.

R. C. Ripan et al., “An isolation forest learning based outlier detection approach for effectively classifying cyber anomalies,” in International Conference on Hybrid Intelligent Systems, 2020, pp. 270–279.

S. Hochreiter and J. Schmidhuber, “Long Short-Term Memory,” in Neural Computation, vol. 9, no. 8, pp. 1735–1780, Nov. 1997.

S. A. Althubiti, E. M. Jones and K. Roy, “LSTM for anomaly-based network intrusion detection,” 2018 28th International Telecommunication Networks and Applications Conference (ITNAC), Sydney, NSW, Australia, 2018, pp. 1–3.

N. Shone, T. N. Ngoc, V. D. Phai and Q. Shi, “A deep learning approach to network intrusion detection,” in IEEE Transactions on Emerging Topics in Computational Intelligence, vol. 2, no. 1, pp. 41–50, Feb. 2018.

J. Erman, A. Mahanti, M. Arlitt, I. Cohen, and C. Williamson, “Offline/realtime traffic classification using semi-supervised learning,” Performance Evaluation, vol. 64, no. 9–12, pp. 1194–213, Oct. 2007.

D. M. Divakaran, L. Su, Y. S. Liau, and V. L. Thing, “SLIC: Self-learning intelligent classifier for network traffic,” Computer Networks, vol. 91, pp. 283–297, Nov. 2015.

A. Khraisat, I. Gondal, P. Vamplew, and J. Kamruzzaman, “Survey of intrusion detection systems: techniques, datasets and challenges,” Cybersecurity, vol. 2, 2019.

Y. Zhong et al., “HELAD: A novel network anomaly detection model based on heterogeneous ensemble learning,” Computer Networks, vol. 169, Mar. 2020.

J. B. MacQueen, “Some methods for classification and analysis of multivariate observations,” in Proceedings of the 5th Berkeley Symposium on Mathematical Statistics and Probability, vol. 1, Berkeley, CA, USA, 1967, pp. 281–297.

Published

2026-11-16