ChameleMon: Shifting Measurement Attention as Network State Changes

Kaicheng Yang, Yuhan Wu, Ruijie Miao, Tong Yang, Zirui Liu, Zicang Xu, Rui Qiu, Yikai Zhao, Hanglong Lv, Zhigang Ji, Gaogang Xie · DOI

Abstract

Flow-level network measurement is critical to many network applications. Among various measurement tasks, packet loss detection and heavy-hitter detection are two most important measurement tasks, which we call the two key tasks. In practice, the two key tasks are often required at the same time, but existing works seldom handle both tasks. In this paper, we design ChameleMon to support the two key tasks simultaneously. One key design/novelty of ChameleMon is to shift measurement attention as network state changes, through two dimensions of dynamics: 1) dynamically allocating memory between the two key tasks; 2) dynamically monitoring the flows of importance. To realize the key design, we propose a key technique, leveraging Fermat's little theorem to devise a flexible data structure, namely FermatSketch. FermatSketch is dividable, additive, and subtractive, supporting the two key tasks. We have fully implemented a ChameleMon prototype on a testbed with a Fat-tree topology. We conduct extensive experiments and the results show ChameleMon supports the two key tasks with low memory/bandwidth overhead, and more importantly, it can automatically shift measurement attention as network state changes.

Introduction

Network measurement is a fundamental balancing act for operators who must simultaneously track packet accumulation (e.g., heavy hitters) and packet loss. Historically, these tasks required disparate data structures. Accumulation tasks typically use sketches that embrace hash collisions to save space, while loss detection requires recording exact flow IDs, which often scales linearly with the number of flows—a significant constraint for the limited SRAM available in modern programmable switches.

Furthermore, static resource allocation is inherently inefficient. In a healthy network, memory is best spent on traffic engineering and accounting. However, when the network experiences high loss, resources must pivot immediately to identify victim flows and diagnose faults. ChameleMon addresses this by shifting its "attention" based on real-time network health.

System Architecture

ChameleMon operates through a four-step cycle designed to adapt to changing network states. It utilizes two dimensions of dynamics: dynamic memory allocation between tasks and dynamic flow monitoring that prioritizes flows of importance, such as Heavy Hitters (HH) or Heavy Losses (HL).

Overview of ChameleMon's four-step measurement cycle and network deployment.
  1. Capture (Step 1): A Flow Classifier (TowerSketch) at the ingress categorizes flows into hierarchies. Upstream and downstream encoders then track packets entering and exiting the network.
  2. Collect (Step 2): The system periodically collects statistics from the edge switches.
  3. Analyze (Step 3): A central analyzer performs network-wide analysis, including packet loss and heavy-hitter detection.
  4. Shift (Step 4): Based on the analysis, the controller pushes reconfiguration rules back to the data plane to reallocate memory or adjust thresholds.

The FermatSketch Technique

The core technical innovation of ChameleMon is the FermatSketch. Traditional Invertible Bloom Lookup Tables (IBLTs) often use XOR operations to store flow IDs, but XORing identical packets—common in loss detection—cancels them out. FermatSketch solves this by using modular addition to aggregate flow IDs.

To extract a flow ID from a "pure" bucket (a bucket containing only one flow), ChameleMon leverages Fermat’s Little Theorem. Specifically, it uses the property that for a prime $p$, $a^{p-2} \equiv a^{-1} \pmod p$. This allows the system to perform modular division in hardware-friendly ways to recover flow IDs and sizes without the overhead of standard IBLTs.

The decoding process of FermatSketch using Fermat's Little Theorem to extract flow IDs.

Key Results

The authors evaluated ChameleMon using CAIDA anonymized IP traces and synthetic workloads (DCTCP, HADOOP, VL2, CACHE) on a physical testbed with 10 Tofino switches. Key findings include:

  • Memory Efficiency: FermatSketch achieves a 15.9x to 276x memory saving compared to state-of-the-art competitors like FlowRadar and LossRadar. Its memory requirements for loss detection scale only with the number of victim flows, rather than total flows.
  • Agility: The system successfully shifts its attention within 1 to 3 epochs (50ms to 150ms) following a change in network state.
  • Low Overhead: ChameleMon monitors the entire network every 50ms using a single CPU core at the controller and consumes just 0.8% of the bandwidth on a 40Gb NIC.
  • Versatility: It supports seven different tasks simultaneously, including loss detection, flow size estimation, and entropy calculation, with accuracy comparable to specialized single-task sketches.

Conclusion

ChameleMon demonstrates that network measurement does not have to be a static, zero-sum game. By leveraging the mathematical properties of Fermat's Little Theorem through FermatSketch, the system provides a flexible, hardware-efficient way to prioritize resources for the most critical measurement tasks as network conditions evolve.

Summary updated

Abstract

Network measurement is critical to many network applications. There are mainly two kinds of flow-level measurement tasks: 1) packet accumulation tasks and 2) packet loss tasks. In practice, the two kinds of tasks are often required at the same time, but existing works seldom handle both. In this paper, we design ChameleMon to support the two kinds of tasks simultaneously. The key design of ChameleMon is to shift measurement attention as network state changes, through two dimensions of dynamics: 1) dynamically allocating memory between the two kinds of tasks; 2) dynamically monitoring the flows of importance. To realize the key design, we propose a key technique, leveraging Fermat's little theorem to devise a flexible data structure, namely FermatSketch. FermatSketch is dividable, additive, and subtractive, supporting the two kinds of tasks. We have implemented a ChameleMon prototype on a testbed with a Fat-tree topology. We conduct extensive experiments and the results show ChameleMon supports the two kinds of tasks with low memory/bandwidth overhead, and more importantly, it can automatically shift measurement attention as network state changes.
BibTeX
@inproceedings{yang2023chamelemon,
  author = {Kaicheng Yang and Yuhan Wu and Ruijie Miao and Tong Yang and Zirui Liu and Zicang Xu and Rui Qiu and Yikai Zhao and Hanglong Lv and Zhigang Ji and Gaogang Xie},
  title = {{ChameleMon: Shifting Measurement Attention as Network State Changes}},
  booktitle = {SIGCOMM},
  year = {2023},
  doi = {10.1145/3603269.3604850},
}
Figure