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 .
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
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/*.Package structure
The repository's layout, its licence per directory (LICENSING.md) and what exists today.
| Path | What | Licence | State |
|---|---|---|---|
CMakeLists.txt | reads swarm-core.lock, fetches that release (SOURCE_SUBDIR core), links swarm::core PUBLIC; build_lib(LIBNAME swarm-core ...) | GPL-2.0-only | present |
swarm-core.lock | the swarm-core release the module builds on (repo, tag, commit, asset, SHA256), written by release_lock.py | GPL-2.0-only | present |
core/ | the simulator-free primitives and the testbench: moved with their history to swarm-core (swarm-adapter-ns3#231) | MIT OR GPL-2.0-only | moved |
model/ | ns-3 glue: SwarmRoutingBase, DeferredPacketQueue, the link monitors, EnergyMetricHook | GPL-2.0-only | present |
helper/ | SwarmRoutingHelper, SwarmMonitorHelper, SwarmLifecycleHelper | GPL-2.0-only | present |
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-core | GPL-2.0-only | present |
examples/ | swarm-core-seed: the determinism gate's program; swarm-core-queue-bench (dev-only) | GPL-2.0-only | present |
tools/ | checks (the locked swarm-core release's C++ standard, the API record), release | MIT OR GPL-2.0-only | present |
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-only | present |
Where it sits in the colony
Quests
The repository's epics and their sub-issues, as the issues stood on 2026-11-30: 15 of 19 sub-issues closed.
- #177 developer experience: a newcomer can build, test and contribute from the docs alone
In progress · 1 / 2 sub-issues closed - #228 Post-rename stabilization & v2.0.0 migration to swarm-core PUBLIC dependency
In progress · 2 / 5 sub-issues closed
Closed: 2 epics
- #82 swarm-core 3.0.0: the host contract, so a protocol core runs on any host
Dropped, closed 2026-11-24 · 3 / 3 sub-issues closed - #6 swarm-core: the shared contrib module every swarm protocol links (Phase 2)
Done, closed 2026-11-11 · 9 / 9 sub-issues closed
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
- 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
- Di Caro, Ducatelle & Gambardella, AntHocNet: An Ant-Based Hybrid Routing Algorithm for Mobile Ad Hoc Networks, Parallel Problem Solving from Nature - PPSN VIII, 2004, pp. 461–470. DOI 10.1007/978-3-540-30217-9_47
Software it builds on
- Joppi, swarm-core, Zenodo, 2026. DOI 10.5281/zenodo.24476619
- Joppi, AntHocNet for NS-3, Zenodo, 2026. DOI 10.5281/zenodo.20981979
- Riley & Henderson, The ns-3 Network Simulator, Modeling and Tools for Network Simulation, 2010, pp. 15–34. DOI 10.1007/978-3-642-12331-3_2
Sources
- swarm-adapter-ns3 AGENTS.md at v2.0.0: what the repository is, its layout
- swarm-adapter-ns3 docs/api-policy.md at v2.0.0: the frozen API and what v2.0.0 breaks
- swarm-adapter-ns3 docs/adopters.md at v2.0.0: which protocol uses which piece
- AntHocNet ADR-0029 (v2.8.0): its ns-3 module derives from SwarmRoutingBase
- AntHocNet core/include/anthocnet/core/ (the primitives' source), docs/wire-format.md, ADR-0006
- swarm-routing ROADMAP.md: the four layers and the migration (decided 2026-11-22)
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).