Dynamic Allocation for Flow-based Redistribution Algorithm.
DAFRA is an Arista EOS agent that reads hardware flow counters, classifies flows based on observed utilization/growth, and updates QoS policers to redistribute unused bandwidth across active flows.
- Polls EOS flow tracking (tracker t1) at a fixed interval.
- Maintains per-flow state (rate, EMA rate, growth, policing state).
- Recomputes per-flow policing rates using staged redistribution.
- Programs ACL/class-map/policy-map entries through EOS eAPI.
- Applies mmf_fair QoS service policy on configured interfaces.
- main.cpp: EOS agent lifecycle, timer loop, CLI argument parsing.
- dafra.h: data structures, defaults, constants, function declarations.
- dafra.cpp: flow parsing, redistribution logic, QoS config application.
- Arista EOS SDK (eosdk) headers and libraries
- jansson
- libcurl
- A switch/environment where show flow tracking sampled flow-table hardware counters tracker t1 is available
g++ -g -O0 -std=gnu++14 \
-I/usr/local/include \
-L/usr/local/lib \
-o dafra main.cpp dafra.cpp \
-leos -ljansson -lcurl -lrt
Adjust include/library paths for your EOS SDK installation.
Options:
- --interval, --polling-period <seconds>: polling interval (default 0.1)
- --eta, --threshold <value>: donor threshold eta (default 0.2)
- --t, --max-timeouts <count>: number of polling cycles before exit (default 1000)
- --gt, --tau_g <value>: growth threshold tau_g (default 0.13)
- --et, --tau_e <value>: excess threshold tau_e (default 0.02)
- --cb, --burst <value>: burst constant (default 0.25)
- -h, --help: print help
Example:
./dafra --interval 0.1 --eta 0.2 --gt 0.13 --et 0.02 --cb 0.25 --t 2000
- On startup, the agent performs cleanup of previously created QoS policy/class-map/ACL artifacts and detaches applied QoS service-policy bindings.
- Flow collection, policy attachment targets, and link-capacity assumptions are defined as constants in source code.
- If your topology or interface mapping differs, update those constants before deployment.
At each epoch:
- Read current flow counters and update per-flow moving averages.
- Build a bandwidth pool from flows underutilizing or above fair-share assignments.
- Satisfy new/smaller flows up to fair share where possible.
- Redistribute remaining pool across eligible larger flows.
- Reprogram policers (police rate ... burst-size ...) in the mmf_fair policy-map.
Safety / Deployment Guidance
- Validate in a lab before production deployment.
- This agent actively mutates live QoS configuration.
- Use conservative polling/threshold values initially and monitor effect on traffic.
- DAFRA source code in this repository is licensed under Apache License 2.0 (LICENSE).
- This project depends on Arista EOS SDK (eosdk), which is BSD 3-Clause licensed.
- Third-party license text and attribution are provided in THIRD_PARTY_NOTICES.md.
- If you redistribute binaries that include or are linked with EOS SDK, include the BSD 3-Clause notice in accompanying documentation/materials.