A One-Pass Clustering Based Sketch Method for Network Monitoring

Yongquan Fu, Lun An, Siqi Shen, Kai Chen, Pere Barlet-Ros

Introduction

As network speeds continue to escalate, monitoring every individual packet has become computationally prohibitive. Network engineers traditionally rely on sketches—compact, probabilistic data structures like the Count-Min Sketch—to summarize traffic with minimal memory overhead. However, real-world network traffic typically follows a Zipfian distribution, where a small number of "heavy hitter" flows dominate the volume while millions of "mice" flows contribute very little. This skewness leads to significant estimation errors when large and small flows collide within the same hash buckets, often overwhelming the smaller signals.

Existing solutions attempt to mitigate this by separating heavy hitters or employing complex optimizations that struggle to maintain line-rate processing speeds. This paper introduces Jellyfish, a novel monitoring framework that reimagines sketching as a clustering problem, shifting the granularity from individual packets to "subflow" fragments to achieve unprecedented accuracy.

The Jellyfish Framework

Jellyfish departs from traditional packet-level hashing by introducing a multi-stage processing pipeline designed for high accuracy and scalability.

Subflow Ingestion and Clustering

Instead of processing every packet directly into a sketch, Jellyfish first aggregates packets from the same flow into subflows based on a predefined threshold (e.g., 128 packets). This aggregation reduces the total number of records the sketch must handle.

Crucially, Jellyfish treats the sketching process as a one-pass clustering task. Rather than using purely random hashing, it employs a $k$-means-inspired approach to map subflows with similar counters to the same bucket arrays. By ensuring that buckets contain values with low variance, the system mathematically minimizes reconstruction error.

The Jellyfish workflow: from packet ingestion to subflow clustering and query aggregation.

Decoupled Architecture and Membership

To maintain performance at scale, Jellyfish utilizes a decoupled architecture. A Pub/Sub framework (such as Apache Pulsar) separates traffic ingestion from the sketching logic, allowing the heavy lifting of clustering to occur on distributed, resource-rich nodes. To reconstruct full network flows from these subflow fragments, Jellyfish uses Cuckoo filters to track membership, enabling efficient and accurate queries.

Experimental Evaluation

The researchers evaluated Jellyfish using two massive, real-world traffic traces: CAIDA (Equinix-Chicago monitor, ~1.8 billion flows) and MAWI (transit link of WIDE, ~14 million flows). Jellyfish was compared against state-of-the-art methods including Count-Min (CM), Count-Sketch (CS), ElasticSketch (ES), and LSS.

Key Results

  • Unprecedented Accuracy: Jellyfish reduced average relative errors (RE) by three to five orders of magnitude compared to LSS and traditional sketches. For global entropy queries, the error reduction reached up to six orders of magnitude.
  • Heavy Hitter Detection: The framework improved F1 scores—a balanced measure of precision and recall—by up to 10× over traditional methods.
  • Real-Time Performance: Despite its decoupled nature, the system maintained low latency, with most monitoring messages delivered within 60ms, making it highly suitable for real-time anomaly detection.
Relative Error (RE) comparison on the CAIDA dataset across varying memory sizes, showing Jellyfish's significant accuracy advantage.

Conclusion

Jellyfish demonstrates that viewing sketching through the lens of clustering can solve the long-standing skewness problem in network monitoring. By "smoothing" traffic into subflows and applying smart mapping to buckets, it achieves near-perfect estimation accuracy. While the use of Cuckoo filters for membership tracking introduces a memory trade-off, the massive gains in precision offer a compelling new direction for high-speed network telemetry. Future work will explore further space-optimized data structures and integration with programmable hardware like P4 switches.

Summary updated

BibTeX
@article{fu2023one,
  author = {Yongquan Fu and Lun An and Siqi Shen and Kai Chen and Pere Barlet-Ros},
  title = {{A One-Pass Clustering Based Sketch Method for Network Monitoring}},
  journal = {IEEE/ACM Trans. Networking},
  year = {2023},
  doi = {10.1109/tnet.2023.3251981},
}
Figure