Stratum

A QoS substrate composing DiffServ, L4S, and CAKE in ns-3
Categories: Traffic control

Stratum: one composer, four pluggable slots, three clients

Stratum is a QoS substrate for ns-3: a single composer with four pluggable strategy slots, on which DiffServ, L4S, and CAKE are expressed as three clients, each selecting one strategy per slot. Any node — edge or core — can be configured as any of the three, so one ns-3 module covers class-aware queueing (DiffServ), low-latency AQM (L4S), and per-flow isolation (CAKE).

Every node builds its queueing discipline from four slots, populated independently (an edge and a core node need not carry the same strategies, per RFC 2475 §2.4):

  1. Classify-and-Meter — a meter strategy plus a classifier: which traffic, and how much of it.
  2. Mark-and-Route — a DSCP tag plus a PHB (per-hop behaviour) table: how packets are labelled and steered.
  3. Per-class slot array — up to eight inner queue discs: where packets wait.
  4. Across-slot service policy — the scheduler / dispatcher: who is served next.

Three clients, one substrate

Each client selects one strategy per slot:

DiffServ (RFC 2475)

  • Classify-and-Meter: sr-TCM / tr-TCM / TSW2CM·3CM + byte-accounting
  • Mark-and-Route: DSCP + PHB table
  • Slot array: RED / RIO / drop-tail
  • Service policy: PQ · WRR · WFQ · WF2Q+ · SCFQ · SFQ · LLQ · hybrid-LLQ

L4S (RFC 9331 / 9332)

  • Classify-and-Meter: DualPI2 ECT(1) classifier
  • Mark-and-Route: DSCP + L4S identifier
  • Slot array: classic + L4 inners
  • Service policy: coupled marking probability

CAKE (sch_cake parity)

  • Classify-and-Meter: DSCP-to-tin (besteffort, precedence, diffserv3/4/8)
  • Mark-and-Route: tin assignment
  • Slot array: per-tin FqCobalt
  • Service policy: across-tin DRR + optional LLQ

Each client is a complete implementation in its own right; the substrate is what brings all three together.

Extensible by registry

External AQMs and schedulers plug in as cells in a registry template — no fork, no edits to the composer core. Downstream consumers (CLI catalogues, plot palettes, documentation tables, smoke tests) auto-derive their coverage from the registry, so adding a cell propagates everywhere without manual fan-out. In-tree today: 13 AQM cells and 9 scheduler cells.

Validation & reproducibility

17 test suites cover the three clients and RFC conformance vectors (RFC 2697 / 2698 / 2859 for metering; RFC 9331 / 9332 for L4S). The accompanying paper's figures reproduce from the source tree via scripts/reproduce-paper.sh.

Lineage

Stratum's DiffServ client derives from the author's 2001 DiffServ4NS ns-2 module (MSc thesis, University of Pisa; IEEE ISCC 2002; SourceForge 2006). The L4S and CAKE clients are new for this work.

Cite this

  • Software archive: DOI 10.5281/zenodo.20723772 — Zenodo concept DOI (always resolves to the latest release).
  • Validation dataset: DOI 10.5281/zenodo.20724063 — Zenodo concept DOI (always resolves to the latest version; covers both the host-isolation fairness and autorate-ingress cross-stack measurements).
  • Paper: under peer review; its DOI will be added here once published.
  • See also the repository's CITATION.cff.

Links

License: GPLv2.

v1.3.0

Works with ns-3.48

Latest Build :

Build History : Stratum v1.3.0

Release Notes

<p>Stratum v1.3.0 composes DiffServ, L4S, and CAKE as three first-class clients on a single ns-3 edge queue disc. Built and tested against ns-3.48. No breaking API changes.</p> <p><strong>This release</strong> — primarily a correctness release. An adversarial review of the substrate against its primary references (the RFCs, Linux <code>sch_cake</code>, the reference DualPI2, and the fair-queueing papers) found and fixed a set of behavioural defects, each pinned by a regression test. The most significant: - <strong>WFQ</strong> regained weighted fairness after a full drain and reactivation (a floating-point virtual-time blow-up had collapsed it to strict priority). - <strong>L4S</strong> now applies its congestion signal at dequeue, from each packet's own queue-sojourn time, and suppresses coupled signalling below a two-MTU standing queue — matching the reference DualPI2. - <strong>LLQ</strong> priority-lane rate cap now engages and releases correctly. - <strong>CAKE</strong> ACK-filter triggering, the autorate-ingress reconfigure cadence, and the diffserv-precedence DRR weights were corrected to match the Linux kernel. - New option: the <strong>TSW averaging-window length</strong> is now configurable through the helper (previously fixed at one second).</p> <p><strong>Composition</strong> - Four pluggable per-node slots: Classify-and-Meter, Mark-and-Route, a per-class slot array, and an across-slot service policy. Each client selects one strategy per slot.</p> <p><strong>DiffServ client</strong> — RFC 2697 (sr-TCM), RFC 2698 (tr-TCM), and TSW2CM/TSW3CM meters; DSCP classification and PHB marking with a configurable PHB table; RED / RIO / drop-tail inner queue discs; schedulers PQ, WRR, WFQ, WF2Q+, SCFQ, SFQ, LLQ, and hybrid-LLQ.</p> <p><strong>L4S client</strong> — DualPI2 coupled AQM (RFC 9332) with ECT(1) classification (RFC 9331) and coupled classic / scalable congestion marking.</p> <p><strong>CAKE client</strong> — DSCP-to-tin mapping (besteffort, precedence, diffserv3, diffserv4, diffserv8) over per-tin FqCobalt under an across-tin DRR dispatcher; host-pair isolation, ACK filtering, optional per-tin shaping, named link-layer-overhead and RTT presets, and per-tin diagnostics aligned with <code>tc -s qdisc show</code>.</p> <p><strong>Validation</strong> — 17 test suites covering the three clients, RFC conformance vectors (RFC 2697 / 2698 / 2859 / 9331 / 9332), and cross-implementation reference fixtures. The accompanying paper's figures reproduce via scripts/reproduce-paper.sh.</p> <p><strong>Requirements</strong> — a small set of ns-3 mainline patches (bundled in patches/ns3/), applied at the pinned ns-3.48 revision. See the Installation tab for the three install paths: into an existing ns-3 tree, a script-managed sibling clone, or Bake.</p>
Bakefile : Link


v1.2

Works with ns-3.48

Latest Build :

Build History : Stratum v1.2

Release Notes

<p>Stratum v1.2 composes DiffServ, L4S, and CAKE as three first-class clients on a single ns-3 edge queue disc. Built and tested against ns-3.48. The substrate model is unchanged from v1.1; this release adds reproducibility and revises the handbook.</p> <p><strong>This release</strong> - CAKE host-fairness is now reproducible directly from the module: a new example and a gated regression test reproduce the per-host bandwidth share and backlog occupancy that previously required external measurement scripts. - Handbook: notation and terminology tightened across all three parts; the CAKE evidence chapter aligned with the reproducible host-fairness result, with a share-versus-throughput trade-off figure added; deferred recipe walkthroughs and their estimated run times filled in.</p> <p><strong>Composition</strong> - Four pluggable per-node slots: Classify-and-Meter, Mark-and-Route, a per-class slot array, and an across-slot service policy. Each client selects one strategy per slot.</p> <p><strong>DiffServ client</strong> — RFC 2697 (sr-TCM), RFC 2698 (tr-TCM), and TSW2CM/TSW3CM meters; DSCP classification and PHB marking with a configurable PHB table; RED / RIO / drop-tail inner queue discs; schedulers PQ, WRR, WFQ, WF2Q+, SCFQ, SFQ, LLQ, and hybrid-LLQ.</p> <p><strong>L4S client</strong> — DualPI2 coupled AQM (RFC 9332) with ECT(1) classification (RFC 9331) and coupled classic / scalable congestion marking.</p> <p><strong>CAKE client</strong> — DSCP-to-tin mapping (besteffort, precedence, diffserv3, diffserv4, diffserv8) over per-tin FqCobalt under an across-tin DRR dispatcher; host-pair isolation, ACK filtering, optional per-tin shaping, named link-layer-overhead and RTT presets, and per-tin diagnostics aligned with <code>tc -s qdisc show</code>.</p> <p><strong>Validation</strong> — 17 test suites covering the three clients, RFC conformance vectors (RFC 2697 / 2698 / 2859 / 9331 / 9332), and cross-implementation reference fixtures. The accompanying paper's figures reproduce via scripts/reproduce-paper.sh.</p> <p><strong>Requirements</strong> — a small set of ns-3 mainline patches (bundled in patches/ns3/), applied at the pinned ns-3.48 revision. See the Installation tab for the three install paths: into an existing ns-3 tree, a script-managed sibling clone, or Bake.</p> <p>Earlier release — v1.1 corrected the L4S DualPI2 coupling cascade to RFC 9332 equation (1) (coupled-drop p'², coupled-mark min(k·p', 1); PI gains α = 0.16 Hz, β = 3.2 Hz), pinned by a golden controller vector and a three-seed fairness-parity gate.</p>
Bakefile : Link


v1.1

Works with ns-3.48

Latest Build :

Build History : Stratum v1.1

Release Notes

<p>Stratum v1.1 composes DiffServ, L4S, and CAKE as three first-class clients on a single ns-3 edge queue disc. Built and tested against ns-3.48.</p> <p><strong>This release</strong> - Corrected the L4S DualPI2 coupling cascade to RFC 9332 §2.1 equation (1): the classic coupled-drop probability is p'² and the L4S coupled-mark probability is min(k·p', 1), honouring the CouplingFactor attribute (previously a hardcoded factor of 2); the PI controller gains moved to the RFC defaults (α = 0.16 Hz, β = 3.2 Hz). The corrected cascade is pinned by a golden controller vector derived from the RFC pseudocode, ECN codepoint-transition and DSCP-preservation checks, and a three-seed fairness-parity gate against a reference DualPI2 implementation under mixed scalable + classic TCP traffic.</p> <p><strong>Composition</strong> - Four pluggable per-node slots: Classify-and-Meter, Mark-and-Route, a per-class slot array, and an across-slot service policy. Each client selects one strategy per slot.</p> <p><strong>DiffServ client</strong> — RFC 2697 (sr-TCM), RFC 2698 (tr-TCM), and TSW2CM/TSW3CM meters; DSCP classification and PHB marking with a configurable PHB table; RED / RIO / drop-tail inner queue discs; schedulers PQ, WRR, WFQ, WF2Q+, SCFQ, SFQ, LLQ, and hybrid-LLQ.</p> <p><strong>L4S client</strong> — DualPI2 coupled AQM (RFC 9332) with ECT(1) classification (RFC 9331) and coupled classic / scalable congestion marking.</p> <p><strong>CAKE client</strong> — DSCP-to-tin mapping (besteffort, precedence, diffserv3, diffserv4, diffserv8) over per-tin FqCobalt under an across-tin DRR dispatcher; host-pair isolation, ACK filtering, optional per-tin shaping, named link-layer-overhead and RTT presets, and per-tin diagnostics aligned with <code>tc -s qdisc show</code>.</p> <p><strong>Validation</strong> — 17 test suites covering the three clients, RFC conformance vectors (RFC 2697 / 2698 / 2859 / 9331 / 9332), and cross-implementation reference fixtures. The accompanying paper's figures reproduce via scripts/reproduce-paper.sh.</p> <p><strong>Requirements</strong> — a small set of ns-3 mainline patches (bundled in patches/ns3/), applied at the pinned ns-3.48 revision. See the Installation tab for the three install paths: into an existing ns-3 tree, a script-managed sibling clone, or Bake.</p>

Dependencies

Compulsory

  • cmake
  • ns-3.48

Stratum is a contributed ns-3 module: install it in the usual way (in the `contrib` directory), named `stratum`. It builds with a C++17 compiler against ns-3.48. Stratum carries a small set of ns-3 mainline patches that must be applied before building. ## From a source archive Use the blue **Download** button, or the **Release History** tab, to fetch a released version. Unpack it into `contrib/stratum` in an ns-3.48 tree, apply the bundled patches, then build: for p in contrib/stratum/patches/ns3/*.patch; do git apply "$p"; done ./ns3 configure --enable-tests --enable-examples ./ns3 build stratum python3 test.py -s stratum -v ## From git — into an existing ns-3 tree (recommended) git clone https://gitlab.com/nsnam/ns-3-dev.git ns-3 cd ns-3 git clone https://github.com/digitalities/stratum-ns3.git contrib/stratum git checkout "$(contrib/stratum/scripts/fetch-ns3.sh --print-pin)" for p in contrib/stratum/patches/ns3/*.patch; do git apply "$p"; done ./ns3 configure --enable-tests --enable-examples ./ns3 build stratum python3 test.py -s stratum -v ## From git — standalone (script-managed sibling clone) git clone https://github.com/digitalities/stratum-ns3.git cd stratum-ns3 ./scripts/fetch-ns3.sh # clones the pinned ns-3 as a sibling dir, applies patches, symlinks contrib/stratum `fetch-ns3.sh` clones the pinned ns-3 revision (query it with `--print-pin`), applies the patches in `patches/ns3/`, and creates the `contrib/stratum` symlink ns-3 expects. ## With Bake The repository ships a `bakeconf.xml` module definition. Add it to Bake's `contrib/` folder, then: ./bake.py configure -e ns-3.48 -e stratum-1.0 ./bake.py download # apply the bundled mainline patches inside the downloaded ns-3 tree ( cd source/ns-3.48 && for p in contrib/stratum/patches/ns3/*.patch; do git apply "$p"; done ) ./bake.py build Applying the mainline patches as the first build step follows the ns-3 external-module guide (section 5.2) for patch-carrying modules. (Bake itself runs under Python 3.11–3.13 with the `distro` and `requests` packages installed.)

Stratum is maintained by Sergio Andreozzi, the original DiffServ4NS author. Please report bugs and request features on the GitHub issue tracker: [https://github.com/digitalities/stratum-ns3/issues](https://github.com/digitalities/stratum-ns3/issues) The module is released under the GNU General Public License v2.0 (GPLv2), matching ns-3 mainline.

New AQMs and schedulers integrate as cells in a registry template — no fork, no edits to the composer core. A cell registers a factory and a name; CLI catalogues, plot palettes, documentation tables, and the smoke-registry tests then pick it up automatically. In-tree today: 13 AQM cells and 9 scheduler cells. ### Running the tests The module registers a suite per component area. ns-3's `test.py -s` takes one exact suite name, so run them individually or loop over the module's full set: python3 test.py -s stratum -v # DiffServ core (+ RFC 2697/2698 vectors) python3 test.py -s stratum-l4s -v # L4S DualPI2 (RFC 9331/9332) python3 test.py -s stratum-cake-q15 -v # CAKE composition # every stratum-module suite in turn: for s in $(./ns3 run "test-runner --print-test-name-list" 2>/dev/null \ | grep -E '^(stratum|tcp-gso-egress)'); do python3 test.py -s "$s" done RFC conformance vectors run inside these suites: RFC 2697 / 2698 metering in `stratum` and `stratum-meter-trace`; RFC 9331 / 9332 L4S identification and coupling in `stratum-l4s`. ### Contributing Development is spec-driven: a layered Intent → Structural → Quality spec suite gates every change. See `CONTRIBUTING.md` in the repository for the workflow, coding style, and the mainline-patch process. The architecture and the evidence base are documented in the in-tree handbook (Part II — architecture; Part III — evidence). Source code: [https://github.com/digitalities/stratum-ns3](https://github.com/digitalities/stratum-ns3)

This ns-3 extension is one or more contributed modules.

Version v1.3.0

Released June 17, 2026

Works with ns-3.48

Bake bakeconf.xml