All posts
Note · November 2026

Same traffic, different recording: what a flow-extractor fix does to an intrusion detector

Fatema Ferdous Tamanna
Network securityIntrusion detectionDistribution shiftCICIDS2017

An intrusion detector does not see packets. It sees flow records produced by an extraction tool. If that tool is updated, the detector's inputs change even though the traffic does not. CICIDS2017 gives a rare chance to measure this, because the same packet captures exist in two versions: one produced by the original tool, and one regenerated with a corrected tool.

I used the two versions to ask two questions. Does a label-free drift test notice the tool fix, and how large is that shift next to real day-to-day change? And what happens to a detector that keeps running after the fix without being retrained?

The setup

CICIDS2017 [1] is one of the most widely used intrusion-detection benchmarks. Its flow features came from CICFlowMeter, which was later found to construct flows and compute several features incorrectly. Engelen et al. [2, 3] fixed the tool and regenerated the dataset from the original captures. The corrected tool splits traffic into flows differently, so it produces 26% fewer flows (2,099,976 against 2,830,743).

I aligned the two releases on 77 shared features and harmonized the labels into attack families. The corrected release marks some flows as "Attempted" attacks that never delivered a payload; following its authors, I count these as benign.

Is the tool fix a shift? Almost a perfect one

A classifier two-sample test [4] trains a classifier to tell two samples apart. An out-of-fold AUROC of 0.5 means the samples are indistinguishable; 1.0 means perfectly separable. I compared benign flows from the same day across the two releases (the tool change), and consecutive days within one release (real change in the traffic).

Comparison (benign flows)All 77 features50 features with unchanged definitions31 features without packet lengths
Tool change: same day, original vs corrected1.0000.9998–0.99990.86–0.89
Real change: consecutive days, original tool0.68–0.870.67–0.840.65–0.79
Real change: consecutive days, corrected tool0.63–0.700.62–0.690.60–0.66

With all features, one redefined counter separates the versions almost by itself, which is not surprising. The interesting column is the second one. Even after dropping every feature whose definition changed, the two recordings of the same traffic remain almost perfectly separable, far more than any two days of real traffic.

The third column shows where that comes from. Removing the 19 packet-length and payload-size features brings the tool change down to 0.86–0.89. That is still above every day-to-day comparison on the same features, so how the fixed tool builds flows matters too, but the near-perfect separation is carried by packet lengths.

Six bytes of padding

The packet-length difference has a simple cause. A TCP packet with no options and no data has 54 bytes of headers (Ethernet 14, IP 20, TCP 20). Ethernet pads every frame to a 60-byte minimum, which leaves exactly 6 bytes of padding. The original tool appears to count those bytes as payload.

The flow data show the signature. On Monday and Friday, 95.6% of the 263,555 original flows whose smallest backward packet carries 1–20 bytes carry exactly 6. In the corrected release, such small values almost disappear (416 flows), and none equal 6. The same artifact was noticed informally in a 2020 issue on the CICFlowMeter repository, where a re-extracted flow showed 0 bytes instead of 6, but I have not found it measured anywhere.

A detector that is not retrained

I trained an XGBoost detector on 70% of the original flows and tested it three ways: on the other 30% (as deployed), on the corrected release of the same traffic (tool fixed, model not retrained), and against a detector retrained on corrected data.

SettingAttack recallFalse positive rateAUROC
Deployed: original tool99.86%0.07%1.000
Tool fixed, not retrained (attack families it was trained on)75.5%0.46%0.997
Tool fixed, not retrained (all corrected attacks)67.8%0.46%0.991
Retrained on corrected data99.99%0.00%1.000

Means over 3 seeds. Random 70/30 splits are known to give high absolute scores on CICIDS2017 [5], so the number to read is the change between rows.

AUROC hides the failure. The detector still ranks attacks above benign flows almost perfectly, but at the threshold it was deployed with, it misses a quarter of the attacks. A monitoring dashboard that tracks AUROC would show nothing wrong.

The loss is almost all port scans. They were detected 100% of the time before the fix and 2.1% after. Port-scan labels barely differ between releases (158,930 against 159,066 flows), and port scans are a quarter of the attacks; had they still been detected, recall would be 99.8%. A port scan is a probe and a reply, and the original tool recorded a median of 6 bytes in that reply where the fixed tool records 0. Setting nine payload-length features of the corrected port-scan flows back to the original tool's values recovers detection from 2.4% to 51%, so the padding explains about half of the collapse.

The extra false positives are a labelling effect. Of 5,853 false positives, 5,813 are flows the corrected release labels "Attempted". On truly benign flows the false positive rate is 0.003%.

Limits

  • This is one dataset and one pair of tool versions. The fix also changes how traffic is split into flows, so the drift test mixes flow construction with feature computation; a test on matched flows would separate them.
  • The labels differ between releases too. Recall is reported on the attack families the deployed detector was trained on, and the loss is concentrated in a family whose labels did not change.
  • The day-to-day comparisons are a small reference for natural change, not a drift benchmark.

Takeaway

A fix to the measuring tool, with no change in the traffic, produced a larger shift than any real day-to-day change and silently broke a near-perfect detector, in a way its AUROC did not show. Before deciding whether to retrain, trust or roll back a model after a drift alarm, it is worth asking whether the world changed or only the way it was recorded. I wrote about the same question in ICU data in an earlier note.

Code, results and a README that maps every number to a script are at github.com/empresst/network-update-audit.

References

  1. I. Sharafaldin, A. Habibi Lashkari and A. A. Ghorbani. Toward generating a new intrusion detection dataset and intrusion traffic characterization. ICISSP, 2018.
  2. G. Engelen, V. Rimmer and W. Joosen. Troubleshooting an intrusion detection dataset: the CICIDS2017 case study. IEEE Security and Privacy Workshops, 2021.
  3. L. Liu, G. Engelen, T. Lynar, D. Essam and W. Joosen. Error prevalence in NIDS datasets: a case study on CIC-IDS-2017 and CSE-CIC-IDS-2018. IEEE CNS, 2022.
  4. D. Lopez-Paz and M. Oquab. Revisiting classifier two-sample tests. ICLR, 2017.
  5. D. Arp et al. Dos and don'ts of machine learning in computer security. USENIX Security, 2022.

More posts