Queen's chamber · Shared module · swarm-routing/swarm-adapter-ns3

swarm-adapter-ns3

The ns-3 adapter of swarm-core's ports: the swarm-core contrib module every protocol links against.

Unlocked: v2.2.2 released, 2 epics in progress Computed from its 4 epics · release v2.2.2, as they stood on .

RepositoryEpic swarm-adapter-ns3#6API policyWho uses what

What it does

swarm-core is the shared ns-3 contrib module (libns3.<ver>-swarm-core, #include "ns3/swarm-core-module.h") every protocol links against: the ns-3 adapter of swarm-core's ports. It has no core/ of its own any more: the simulator-free C++23 primitives (the bounded VisitedPath, little-endian wire helpers, PheromoneTable, RouteDecision, the ILinkState / ILinkMetric seams, evaporation and roulette selection, the testbench) live in swarm-core, extracted from this repository's core/ with its history. The module's CMakeLists.txt reads swarm-core.lock, fetches that swarm-core release's tarball (FetchContent, URL and SHA256, SOURCE_SUBDIR core) and links its target swarm::core to libswarm-core as a PUBLIC dependency, so a module that links ${libswarm-core} gets the primitives, their include directory, their C++ standard and their headers as ns3/swarm-*.h with no edit of its own.

Its model/ holds the ns-3 glue: SwarmRoutingBase (sockets, deferred routes, node lifecycle, the observer's trace sources), a DeferredPacketQueue, WifiLinkMonitor, EnergyMetricHook over ns3::EnergySource, and IslLinkMonitor for satellite links; helper/ installs a protocol in one call. Nothing protocol-specific lands here: code is promoted only when a second protocol needs it.

v1.0.0 froze the API: kSwarmCoreApiVersion is 2, the module's public API is recorded in docs/api-surface.txt and a required api-surface check fails a change that removes or alters an item without a breaking mark, and a breaking change waits for a major after a deprecation (docs/api-policy.md). v2.0.0's breaking change is the layout, not the C++ API: the primitives' names, signatures and headers are unchanged, but contrib/swarm-core/core/ is gone (a module takes swarm-core's include directory from linking ${libswarm-core}), core/ no longer builds from this repository or its release tarball, and the API record keeps the module's ns-3 items only (swarm-core keeps its own). IslLinkMonitor, with the base API only it drives, is experimental, outside that promise until a second protocol adopts it. CI runs every org quality gate, the determinism gate included (same seed twice byte-identical, another seed different).

Renamed from ns3-swarm-core on 2026-11-22 (ROADMAP phase 0): it is layer 2 of the org's four layers, the ns-3 runtime adapter. The contrib module keeps its name swarm-core. In phase 1 its simulator-free core/ moved with its history to swarm-core (swarm-adapter-ns3#231), and swarm-adapter-ns3 now builds on that release (ROADMAP, Architecture and migration).

Diagrams

swarm-adapter-ns3: the ns-3 glue on swarm-core's primitives (UML class diagram)Class diagram of the swarm-core module, simplified. From swarm-core's release, linked as swarm::core and simulator-free: VisitedPath, PheromoneTable, RouteDecision, the ILinkState and ILinkMetric interfaces, evaporation and roulette selection. In this repository's model, the ns-3 glue: SwarmRoutingBase, DeferredPacketQueue, WifiLinkMonitor realising ILinkState, EnergyMetricHook and IslLinkMonitor.swarm::core (swarm-core release)«MIT OR GPL-2.0-only»VisitedPath+ push(node) : bool+ contains(node) : bool- cap : size_tPheromoneTable+ get(dst, via) : double+ deposit(dst, via, Δτ)+ evaporate(ρ)RouteDecision+ action : Forward|Drop|Queue+ nextHop : NodeId«function»roulette+ pick(weights, rng)«interface»ILinkState+ isUp(nbr) : bool«interface»ILinkMetric+ cost(nbr) : doublemodel«GPL-2.0-only · ns-3»SwarmRoutingBasens3::Ipv4RoutingProtocol+ execute(RouteDecision)DeferredPacketQueue+ enqueue(p, dst)- cap : size_tWifiLinkMonitorMAC tx-failure tracesIslLinkMonitorsatellite ISL stateEnergyMetricHookns3::EnergySource«use»
Class diagram (UML) of the main types, simplified (the module's record is docs/api-surface.txt, swarm-core keeps its own; IslLinkMonitor is experimental). Dashed frames are the packages: swarm::core is fetched from the swarm-core release swarm-core.lock names, not kept here. Hollow triangles: interface realisation; open arrows: «use». Only model includes ns3/*.
swarm-core: the determinism gateThe determinism gate: build swarm-core-seed, run it with seed 1 twice and compare the output byte for byte, then run seed 2 and require a difference.buildns3-build-contrib--strict-warningsseed=1run Aseed=1run Bcmp A Bbyte-identicalseed=2must differ
The determinism gate every run of its CI has (org invariant 5).

Package structure

The repository's layout, its licence per directory (LICENSING.md) and what exists today.

Directories of swarm-routing/swarm-adapter-ns3
PathWhatLicenceState
CMakeLists.txtreads swarm-core.lock, fetches that release (SOURCE_SUBDIR core), links swarm::core PUBLIC; build_lib(LIBNAME swarm-core ...)GPL-2.0-onlypresent
swarm-core.lockthe swarm-core release the module builds on (repo, tag, commit, asset, SHA256), written by release_lock.pyGPL-2.0-onlypresent
core/the simulator-free primitives and the testbench: moved with their history to swarm-core (swarm-adapter-ns3#231)MIT OR GPL-2.0-onlymoved
model/ns-3 glue: SwarmRoutingBase, DeferredPacketQueue, the link monitors, EnergyMetricHookGPL-2.0-onlypresent
helper/SwarmRoutingHelper, SwarmMonitorHelper, SwarmLifecycleHelperGPL-2.0-onlypresent
test/swarm-core test suite: the seed helper and the glue's cases (a toy protocol on the base, each monitor, the observer); the primitives' tests run in swarm-coreGPL-2.0-onlypresent
examples/swarm-core-seed: the determinism gate's program; swarm-core-queue-bench (dev-only)GPL-2.0-onlypresent
tools/checks (the locked swarm-core release's C++ standard, the API record), releaseMIT OR GPL-2.0-onlypresent
docs/api-policy.md (the promise, deprecation), api-surface.txt (the module's API record), adopters.md (who uses what), roadmap.md, adr/, rcapa/GPL-2.0-onlypresent

Where it sits in the colony

The swarm-routing organisation: who depends on whomDependency graph of the swarm-routing organisation, in the colony map's six regions: Protocols on top (AntHocNet, ARA, BeeAdHoc, Termite, HOPNET, and the deferred POSANT, BeeSensor and Q-Swarm); Core (swarm-core) and Adapters (swarm-adapter-ns3, and the deferred swarm-routingd and swarm-adapter-omnet) below them; then Infra (vcpkg-registry, benchmarks, the deferred swarm-web-ui, sim-containers, sim-tools); Others (this site, ns3-upstream-report, .github) and AI (swarm-mcp, skills) at the bottom. The five released protocols link the ns-3 module of swarm-adapter-ns3, which builds on swarm-core's release, and register as arms in sim-tools (AntHocNet runs its benchmarks on its harness); swarm-routingd and swarm-adapter-omnet will use swarm-core's ports; vcpkg-registry ports swarm-core; swarm-adapter-ns3 and sim-tools build and run inside the sim-containers images, where swarm-web-ui will run scenarios too; sim-tools writes verdicts into benchmarks; ns3-upstream-report carries sim-tools' register of ns-3 bugs upstream; the Colony Arena site builds AntHocNet's core to WebAssembly and will render the benchmarks leaderboard; the .github repository's reusable CI runs inside the sim-containers images; swarm-mcp, the org's MCP server, runs the .github repository's scripts, and the skills plugin bundles it.ProtocolsCoreAdaptersInfraOthersAIlinkslinkslinkslinkslinksarmbenchbuilds inruns inverdictscore/ → WASMleaderboard (planned)CI imagesruns its scriptsbundlesbuilds onportsruns in (planned)registerAntHocNetprotocol · liveARAprotocolBeeAdHocprotocolTermiteprotocolHOPNETprotocolPOSANTprotocol · deferredBeeSensorprotocol · deferredQ-Swarmprotocol · deferredswarm-coreports · primitivesswarm-adapter-ns3module swarm-coreswarm-routingdLinux daemon · deferredswarm-adapter-omnetOMNeT++ · deferredvcpkg-registryports of the coresbenchmarksdatasets · verdictsswarm-web-uiworkbench · deferredsim-containersns3-dev imagessim-toolsharness · readersColony Arenathis sitens3-upstream-reportbridge to ns-3.githubreusable CI · templatesswarm-mcpMCP server · read-onlyskillsagent skills · plugindashed arrow: «use» dependency (UML); highlighted: this project and its neighbours
swarm-adapter-ns3 and its neighbours in the organisation.

Quests

The repository's epics and their sub-issues, as the issues stood on 2026-11-30: 15 of 19 sub-issues closed.

Closed: 2 epics

Cite this project

Using swarm-adapter-ns3 in a paper? Cite the project as below, and the works it rests on from its references.

Text

Joppi, Daniel Henrique (n.d.). swarm-adapter-ns3: the ns-3 adapter of swarm-core (version 2.2.2) [Computer software]. https://doi.org/10.5281/zenodo.24138628

BibTeX

@software{swarmadapterns3,
  author  = {Joppi, Daniel Henrique},
  title   = {swarm-adapter-ns3: the ns-3 adapter of swarm-core},
  version = {2.2.2},
  doi     = {10.5281/zenodo.24138628},
  url     = {https://github.com/swarm-routing/swarm-adapter-ns3}
}

Version
2.2.2
Author
Daniel Henrique Joppi · ORCID
DOI
10.5281/zenodo.24138628
Licence
GPL-2.0-only

Read from CITATION.cff at main when this site was built.

References

The 4 works docs/references.bib lists, read at main when this site was built. Each links its DOI; a work with none links its publisher's or institution's page.

Implemented

Software it builds on

Sources

The status and the quests come from the repository's issues and releases (2026-11-30); the other facts on this page are kept by hand from its AGENTS.md (as of 2026-11-08).