Flow-Based Analysis of Campus WiFi Traffic Anomalies Using Machine Learning
Abstract
Campus WiFi networks are exposed to attacks such as Distributed Denial of Service (DDoS), brute force, and port scanning, but flow-based machine learning models trained on public datasets may not recognize these attacks on a different network. This study evaluates, on campus WiFi traffic, two Random Forest models trained only on the corrected CNS2022 version of CICIDS2017. Model 1 used 55 flow features selected by variance and correlation filtering, while Model 2 used 34 flag, size, and contextual features computed over six-second windows, with the size features of DDoS training flows randomized. Both models were tested on 51 controlled attack recordings of DDoS, File Transfer Protocol (FTP) brute force, Secure Shell (SSH) brute force, and port scanning, and on 49,625 unlabeled operational flows. Both models achieved a macro F1 above 0.99 on the CICIDS2017 test set, but the mean recall across the four attack classes on the campus simulations fell to 0.383 for Model 1 and 0.691 for Model 2. FTP brute force remained recognizable because the server’s authentication reply had the same size in both datasets, whereas Model 1 failed on DDoS by relying on packet sizes specific to the training data. Model 2 recognized DDoS and port scanning mainly through contextual features. SSH brute force was hardly recognized because 99.3% of its flows came from connections rejected by the server before authentication. Fewer than 0.2% of operational flows were predicted as attacks. Flow-based detection on a different network must therefore be evaluated per attack class.
References
Abdelaziz, M. T., Radwan, A., Mamdouh, H., Saad, A. S., Abuzaid, A. S., AbdElhakeem, A. A., Zakzouk, S., Moussa, K., & Darweesh, M. S. (2025). Enhancing network threat detection with random forest-based NIDS and permutation feature importance. Journal of Network and Systems Management, 33(1). https://doi.org/10.1007/s10922-024-09874-0
Alduailij, M., Khan, Q. W., Tahir, M., Sardaraz, M., Alduailij, M., & Malik, F. (2022). Machine-learning-based DDoS attack detection using mutual information and random forest feature importance method. Symmetry, 14(6), 1095. https://doi.org/10.3390/sym14061095
Ardiansyah, Suradi, A. A. M., & Saputra, W. (2025). Strategi keamanan router MikroTik: Deteksi dan mitigasi serangan brute force berbasis scripting. JUKI: Jurnal Komputer dan Informatika, 7(1), 12–19.
Arp, D., Quiring, E., Pendlebury, F., Warnecke, A., Pierazzi, F., Wressnegger, C., Cavallaro, L., & Rieck, K. (2022). Dos and don’ts of machine learning in computer security. Proceedings of the 31st USENIX Security Symposium, 3971–3988.
Au, Q., Herbinger, J., Stachl, C., Bischl, B., & Casalicchio, G. (2022). Grouped feature importance and combined features effect plot. Data Mining and Knowledge Discovery, 36(4), 1401–1450. https://doi.org/10.1007/s10618-022-00840-5
Badan Siber dan Sandi Negara. (2025). Lanskap keamanan siber Indonesia 2024. Id-SIRTII/CC – BSSN.
Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5–32. https://doi.org/10.1023/A:1010933404324
Cantone, M., Marrocco, C., & Bria, A. (2024). Machine learning in network intrusion detection: A cross-dataset generalization study. IEEE Access, 12, 144489–144508. https://doi.org/10.1109/ACCESS.2024.3472907
Engelen, G. (n.d.). CICFlowMeter (fixed version). Retrieved November 1, 2026, from https://github.com/GintsEngelen/CICFlowMeter
Engelen, G., Rimmer, V., & Joosen, W. (2021). Troubleshooting an intrusion detection dataset: The CICIDS2017 case study. 2021 IEEE Security and Privacy Workshops (SPW), 7–12. https://doi.org/10.1109/SPW53761.2021.00009
Flood, R., Engelen, G., Aspinall, D., & Desmet, L. (2024). Bad design smells in benchmark NIDS datasets. 2024 IEEE 9th European Symposium on Security and Privacy (EuroS&P), 658–675. https://doi.org/10.1109/EuroSP60621.2024.00042
Graham, R. D. (n.d.). MASSCAN: Mass IP port scanner. Retrieved November 1, 2026, from https://github.com/robertdavidgraham/masscan
Grinsztajn, L., Oyallon, E., & Varoquaux, G. (2022). Why do tree-based models still outperform deep learning on typical tabular data? Advances in Neural Information Processing Systems, 35. https://doi.org/10.52202/068431-0037
Habibi Lashkari, A. (n.d.). CICFlowMeter. Retrieved November 1, 2026, from https://github.com/ahlashkari/CICFlowMeter
Intan Sabila, M., Tahir, M., Dwi Mardania, S., & Ilham Arifin, R. (2025). Implementasi Snort sebagai IDS dalam mendeteksi serangan port scanning Nmap pada simulasi jaringan virtual. JATI (Jurnal Mahasiswa Teknik Informatika), 9(4), 6944–6948. https://doi.org/10.36040/jati.v9i4.14340
Koumar, J., Hynek, K., Čejka, T., & Šiška, P. (2025). CESNET-TimeSeries24: Time series dataset for network traffic anomaly detection and forecasting. Scientific Data, 12, 338. https://doi.org/10.1038/s41597-025-04603-x
Kurose, J. F., & Ross, K. W. (2021). Computer networking: A top-down approach (8th ed.). Pearson.
Lee, W., & Stolfo, S. J. (2000). A framework for constructing features and models for intrusion detection systems. ACM Transactions on Information and System Security, 3(4), 227–261. https://doi.org/10.1145/382912.382914
Liu, L., Engelen, G., Lynar, T., Essam, D., & Joosen, W. (2022). Error prevalence in NIDS datasets: A case study on CIC-IDS-2017 and CSE-CIC-IDS-2018. 2022 IEEE Conference on Communications and Network Security (CNS), 254–263. https://doi.org/10.1109/CNS56114.2022.9947235
Meng, Y., Qin, T., Li, S., & Wang, P. (2022). Behavior pattern mining from traffic and its application to network anomaly detection. Security and Communication Networks, 2022. https://doi.org/10.1155/2022/9139321
OpenBSD. (n.d.). sshd_config(5): OpenSSH daemon configuration file. Retrieved October 31, 2026, from https://man.openbsd.org/sshd_config
Opitz, J. (2024). A closer look at classification evaluation metrics and a critical reflection of common evaluation practice. Transactions of the Association for Computational Linguistics, 12, 820–836. https://doi.org/10.1162/tacl_a_00675
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, É. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12, 2825–2830. https://jmlr.org/papers/v12/pedregosa11a.html
Postel, J., & Reynolds, J. (1985). File Transfer Protocol (RFC 959). https://doi.org/10.17487/RFC0959
Rodríguez, M., Alesanco, Á., Mehavilla, L., & García, J. (2022). Evaluation of machine learning techniques for traffic flow-based intrusion detection. Sensors, 22(23). https://doi.org/10.3390/s22239326
scikit-learn developers. (n.d.). Ensembles: Gradient boosting, random forests, bagging, voting, stacking. Retrieved November 2, 2026, from https://scikit-learn.org/stable/modules/ensemble.html
Sharafaldin, I., Lashkari, A. H., & Ghorbani, A. A. (2018). Toward generating a new intrusion detection dataset and intrusion traffic characterization. Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP 2018), 108–116. https://doi.org/10.5220/0006639801080116
Tobin, J., Fong, R., Ray, A., Schneider, J., Zaremba, W., & Abbeel, P. (2017). Domain randomization for transferring deep neural networks from simulation to the real world. 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 23–30.
Copyright (c) 2026 International Journal of Science and Society

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

.png)

.jpg)
.png)

.png)
.png)
.png)
1.png)

.jpg)



-modified.png)
-modified.png)


-modified.png)


