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_fairQoS 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 janssonlibcurl- A switch/environment where
show flow tracking sampled flow-table hardware counters tracker t1is available
g++ -g -O0 -std=gnu++14 \
-I/usr/local/include \
-L/usr/local/lib \
-o dafra main.cpp dafra.cpp \
-leos -ljansson -lcurl -lrtAdjust include/library paths for your EOS SDK installation.
./dafra [options]Options:
--interval,--polling-period <seconds>: polling interval (default0.1)--eta,--threshold <value>: donor threshold eta (default0.2)--t,--max-timeouts <count>: number of polling cycles before exit (default1000)--gt,--tau_g <value>: growth threshold tau_g (default0.13)--et,--tau_e <value>: excess threshold tau_e (default0.02)--cb,--burst <value>: burst constant (default0.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 themmf_fairpolicy-map.
- 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.