Queen's chamber · Shared module · swarm-routing/ns3-swarm-core
swarm-core
What two or more protocols share: the swarm-core contrib module every protocol links against.
Under construction: Phase 2: skeleton with every CI gate
What it does
swarm-core is the shared ns-3 contrib module (libns3.<ver>-swarm-core, #include "ns3/swarm-core-module.h"). Its core/ will hold simulator-free C++20 primitives extracted from AntHocNet's dual-licensed core: the bounded VisitedPath, little-endian wire helpers, PheromoneTable, RouteDecision, the ILinkState / ILinkMetric seams, evaporation and roulette selection.
Its model/ will hold the ns-3 glue: SwarmRoutingBase, a DeferredPacketQueue, WifiLinkMonitor, EnergyMetricHook over ns3::EnergySource, and IslLinkMonitor for satellite links. Nothing protocol-specific lands here: code is promoted only when a second protocol needs it.
Today the skeleton is in place (kSwarmCoreApiVersion, SwarmCoreSeed) and CI already runs every org quality gate on it: strict warnings, debug and sanitized builds, coverage, format, licence headers, and the determinism gate (same seed twice byte-identical, another seed different).
Diagrams
model includes ns3/*.Package structure
The repository's layout, its licence per directory (LICENSING.md) and what exists today.
| Path | What | Licence | State |
|---|---|---|---|
CMakeLists.txt | build_lib(LIBNAME swarm-core ...); ns-3 generates ns3/swarm-core-module.h | GPL-2.0-only | present |
core/ | simulator-free primitives, injected ports, carries core/LICENSE | MIT OR GPL-2.0-only | planned |
model/ | ns-3 glue (today: kSwarmCoreApiVersion, SwarmCoreSeed) | GPL-2.0-only | present |
helper/ | ns-3 helpers | GPL-2.0-only | planned |
test/ | swarm-core test suite: roundtrip, fuzz, primitives, glue | GPL-2.0-only | present |
examples/ | swarm-core-seed: the determinism gate's program | GPL-2.0-only | present |
Where it sits in the colony
Quests
- Open: test.py -s swarm-core green on debug and sanitized; core/ passes the include check
- Open: Every wire helper has deterministic roundtrip + fuzz tests
- Open: A downstream module builds with dependencies: swarm-core=swarm-routing/ns3-swarm-core@main
Sources
- AntHocNet core/include/anthocnet/core/ (the primitives' source), docs/wire-format.md, ADR-0006
Facts as of 2026-11-08, from the repository's AGENTS.md and the org ROADMAP.