[Paper Review] "Flow Size Difference" Can Make a Difference: Detecting Malicious TCP Network Flows Based on Benford's Law
This paper proposes a novel unsupervised intrusion detection system (IDS) that applies Benford’s law to a new network flow metric—'flow size difference'—to detect malicious TCP flows. Normal flows exhibit Benford’s law compliance in this metric, while malicious flows deviate significantly, enabling effective anomaly detection with high AUC performance on real datasets without training data or complex configuration.
Statistical characteristics of network traffic have attracted a significant amount of research for automated network intrusion detection, some of which looked at applications of natural statistical laws such as Zipf's law, Benford's law and the Pareto distribution. In this paper, we present the application of Benford's law to a new network flow metric "flow size difference", which have not been studied before by other researchers, to build an unsupervised flow-based intrusion detection system (IDS). The method was inspired by our observation on a large number of TCP flow datasets where normal flows tend to follow Benford's law closely but malicious flows tend to deviate significantly from it. The proposed IDS is unsupervised, so it can be easily deployed without any training. It has two simple operational parameters with a clear semantic meaning, allowing the IDS operator to set and adapt their values intuitively to adjust the overall performance of the IDS. We tested the proposed IDS on two (one closed and one public) datasets, and proved its efficiency in terms of AUC (area under the ROC curve). Our work showed the "flow size difference" has a great potential to improve the performance of any flow-based network IDSs.
Motivation & Objective
- To investigate whether the newly proposed metric 'flow size difference' follows Benford’s law in normal TCP network traffic.
- To develop an unsupervised, threshold-based IDS using Benford’s law applied to flow size difference for detecting malicious flows.
- To evaluate the method’s performance on real-world and public network datasets with labeled malicious activity.
- To demonstrate that flow size difference is a more effective anomaly indicator than flow size alone.
- To provide a simple, interpretable IDS with two intuitive parameters for real-world deployment.
Proposed method
- The authors define 'flow size difference' as the absolute difference between the number of bytes sent and received in a bidirectional TCP flow.
- They apply Benford’s law to the leading digit distribution of flow size difference values across a sequence of network flows.
- The method uses two operational parameters: T (threshold for Benford’s law deviation) and W (sliding window size for flow aggregation).
- Anomalies are flagged when the Kolmogorov-Smirnov test p-value for Benford’s law fit falls below T over a window of W flows.
- The IDS operates in an unsupervised manner, requiring no labeled training data and allowing intuitive parameter tuning by operators.
- The approach is evaluated on two datasets: a closed TRT dataset and a public dataset, using AUC as the primary performance metric.
Experimental results
Research questions
- RQ1Does the flow size difference metric in normal TCP flows conform closely to Benford’s law?
- RQ2Do malicious TCP flows significantly deviate from Benford’s law in the flow size difference metric?
- RQ3Can an unsupervised IDS based on Benford’s law applied to flow size difference achieve high detection performance with minimal configuration?
- RQ4How do the parameters T and W affect the IDS’s detection accuracy and adaptability to evolving threats?
- RQ5Can this method be generalized to other flow types such as UDP or ICMP, or to generalized forms of Benford’s law?
Key findings
- Normal TCP flows exhibit strong conformity to Benford’s law in the flow size difference metric, while malicious flows show significant deviations.
- The proposed IDS achieved high AUC performance on both the closed TRT dataset and the public dataset, demonstrating strong detection capability.
- The method requires no training data, making it deployable in real-world environments without prior knowledge of attack signatures.
- The two parameters T and W have clear semantic meanings, enabling operators to intuitively tune the system for desired sensitivity and responsiveness.
- The approach is resilient to evasion attempts, as attackers would need to precisely mimic Benford’s law or drastically reduce attack volume, both of which are impractical or self-defeating.
- The method shows promise for improving existing flow-based IDSs by introducing a new, statistically robust feature derived from flow size difference.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.