Network traffic analysis in cloud and internet service provider (ISP) networks increasingly relies on machine learning (ML) models, as encryption and service consolidation make rule-based classification unreliable. At high flow-arrival rates, however, new flows can arrive faster than end-to-end analysis pipelines can process. Unlike typical cloud inference workloads, packets from the same flow arrive over time and require per-flow state. This streaming, stateful setting limits naive scale-out with stateless workers. This paper presents FlowWise, a serving system for streaming, stateful flow intelligence on commodity CPU/GPU servers that jointly selects (i) how many packets to collect and (ii) which model(s) to apply for each flow to balance latency, service rate, and accuracy. Across three representative tasks, inference time across candidate models differs by 1.8x-141.3x, while packet waiting time can exceed feature computation and inference by 6-8 orders of magnitude at the tail. FlowWise exploits these gaps with an uncertainty-driven fast-slow cascade: it issues early predictions from a one-packet model and escalates only uncertain flows to slower models that wait for additional packets and use richer features. A queue-centric runtime maintains per-flow state, performs asynchronous feature joining, and uses brokered, flow-ID-keyed streams to distribute workload across heterogeneous workers. FlowWise serves 76.3% of flows within 16 ms, improving median end-to-end serving latency by 40.5x while increasing service rate and maintaining similar accuracy to always running the slow model. With thousands of packet-header features per flow, our scale-up benchmark sustains over 48.5k new flows per second on a single 16-core commodity CPU server, comparable to reported flow-arrival rates in city-backbone traces. FlowWise is open sourced at https://github.com/noise-lab/FlowWise.
Figures & tables
Figure 1. Traffic analysis holds a tradeoff between latency and accuracy. FlowWise dynamically assigns predictions to either a slower, more accurate model (waiting for more packets or using a sophisticated design) or a faster, less accurate model (predicting on the first packet). The chart compares its request assignment efficacy against an oracle (using ground-truth classification correctness) and random assignment, based on the service recognition dataset.
Figure 2. Model serving for network traffic analysis.
Application
Model
F1 (1pkt)
F1(5pkts)
F1(10pkts)
Service Recognition
DT
0.845
0.907
0.909
LGBM
0.921
0.967
0.973
CNN
0.887
0.929
0.930
Device Identification
DT
0.812
0.824
0.827
LGBM
0.913
0.918
0.919
CNN
0.881
0.910
0.911
Table 1. Empirically, adding more packets increases the (weighted) F1 score. DT: Decision Tree, LGBM: LightGBM, CNN: Convolutional Neural Networks.
Figure 4
Serv. Rec.
Dev. Id.
QoE Inf.
Model
F1
Inf. Time
F1
Inf. Time
F1
Inf. Time
DT
0.845
0.052
0.812
0.053
0.715
0.053
RF
0.859
0.107
0.874
0.106
0.709
0.098
LGBM
0.921
0.139
0.913
0.210
0.723
0.162
XGBoost
0.672
0.117
0.507
0.152
0.646
0.127
CNN
0.887
0.481
0.881
0.491
0.710
0.385
Table 3. Different model performance for the 1st packet. Deeper green means higher F1 score, and deeper blue means lower model inference latency (in ms).
Figure 4. FlowWise , which supports the fast-slow model serving architecture, is tailored to the discrete arrival of network flow packets. The arrow width represents the proportion of flows processed at each stage.
Figure 5. The F1 score vs. end-to-end latency (in ms) across 5 models for the service recognition dataset. We use the Pareto Front to determine the placement of models in FlowWise .
Figure 6. FlowWise supports parallelism across heterogeneous hardware.
Method
Packet Depth
Feature
Model(s)
Queue
LEXNet ( Fauvel et al., 2023 )
N
Pkt Size & Direction
LEXNet (CNN)
No
FastTraffic ( Xu et al., 2023 )
N
N-gram of Raw Pkts
3-layer MLP
No
Best Effort
N
nPrint
LGBM
No
Queueing
N
nPrint
LGBM
Yes
FlowWise
1+N
nPrint
DT+LGBM+LGBM
Yes
Table 4. Comparison of evaluated traffic analysis frameworks. N is the best packet depth for an application (10 for service recognition, 3 for device identification, 20 for QoE inference.)
Figure 7. Performance of different approaches for the service recognition task (other tasks are in Appendix D ). We compare FlowWise against four baselines, all considering 10-packet inputs. The F1 score is computed on the non-missed flows.
Figure 8. End-to-end latency analysis of 4k flows per second on a single consumer ( i.e. , 1 CPU core) for service recognition : (a) The CDF of single-consumer latency demonstrates that FlowWise can accelerate 76% of flows to millisecond-level service. (b) A breakdown of latency at different stages illustrates the reduction of packet waiting time, showing the efficiency of FlowWise in minimizing overall latency.
Figure 9. Assigned portion of requests (#assigned flows / #all flows) vs. assigned incorrect portion (#assigned incorrect predictions / #all incorrect predictions) using different approaches on the fastest model. T: Uncertainty threshold for the Uncertainty and Per-class Uncertainty approaches.
Figure 10. Assigned portion of requests vs. F1 score for service recognition . Based on models, FlowWise is best configured to use Uncertainty for the first assignment, and Per-Class Uncertainty for the second.
Table 5. Comparison of Normalized AUC (assigned portion vs. improved F1 score normalized on the Oracle results) across different assignment methods. We vary models in a fastest-fast-slow (DT 1 pkt + LGBM 1 pkt + LGBM 10 pkts) architecture. Highlighted cells indicate the best performance in each. This is evaluated using service recognition dataset, but similar trends are observed with other datasets.
Figure 11. FlowWise service rate with the # of consumers.
Packet Number
2
4
6
8
10
Final F1 Score
0.945
0.956
0.960
0.962
0.963
Average Latency
132.7
188.5
323.0
358.8
372.2
Median Latency
11.2
11.1
11.3
11.2
11.2
Max Service Rate
4285
4210
4234
4226
4319
Table 6. FlowWise performance when varying the number of packets on the slow model, for the service recognition task. The unit of latency is ms, and the unit of service rate is classified flows per second.
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
function GetPerClassSlope( D,U )
Initialize Results R
for each Class Label L in D do
Partition D into Correct C and Incorrect I for L▹ Classify predictions
Get Thresholds T from U quantiles for L
Update R with assigned portions for C and I▹ Track portions
Compute Uncertainty u for DataPoint▹D is validation data
Append u to U
end for
Sort U in ascending order
Appendix
Algorithm 2 Universal Uncertainty Thresholds
#Cons.
All CPU
Half CPU+Half GPU
1
4.319k
-
2
8.805k
8.620k
4
16.692k
16.484k
8
31.114k
30.651k
12
40.238k
41.009k
16
48.505k
47.040k
Appendix
Table 7. Maximum service rate (new classified flows per second) when we increase the number of consumers.
Service
Application
# of Flows
Video Conferencing ( MacMillan et al., 2021 )
Zoom
1312
Google Meet
1313
MS Teams
3886
Video Streaming ( Bronzino et al., 2019 )
Twitch
1150
Amazon
1509
YouTube
2702
Appendix
Table 8. Service recognition dataset.
Device
# of Flows
Samsung Fridge
3770
Nvidia Jetson Nano
3770
Amazon Echo 3rd Gen
3770
Google Home
3770
Raspberry Pi 3
3770
SmartThings Dishwasher
3770
Appendix
Table 9. Device identification dataset.
VCA
Total # of Seconds
Meet
10189
Webex
12331
Teams
14408
Total
36928
Appendix
Table 10. Video conferencing application (VCA) QoE measurement dataset.
Figure 12. Performance of different approaches for the device identification task. We compare FlowWise against four baselines, all considering three-packet inputs. The F1 score is computed on the flows that are not missed.
Figure 13. Assigned portion of requests vs. F1 score at each stage for device identification task.
Figure 14. Assigned portion of requests vs. F1 score at each stage for QoE measurement task.