Play the game

Ant nest · Protocol · swarm-routing/AntHocNet

AntHocNet

Ant colony optimisation for mobile ad hoc networks: the colony the org grew out of.

Unlocked: v2.6.1 released, 3 epics in progress, 5 planned Computed from its 40 epics · release v2.6.1, as they stood on .

Play the gameDocsAPI referenceHow it runs: C++ core → WebAssemblyRepository

What it does

AntHocNet (Di Caro, Ducatelle & Gambardella, 2005) routes like a foraging colony. When a data packet finds no route, the source sends reactive forward ants that search towards the destination; each one flips into a backward ant there and walks the path home, laying pheromone that scores each next hop. The backward ant is the only thing that deposits regular pheromone.

While a session runs, proactive ants keep sampling and improving the path, hello beacons keep the neighbour set fresh and diffuse a virtual pheromone, and when a link breaks the node sends repair ants or a LinkFail notification upstream. Data follows the pheromone stochastically, so load spreads over several good paths.

The algorithm is written once, as a simulator-agnostic core/ (C++14) that takes time, randomness, neighbours and timers through ports. The ns-3 module and the browser adapter only convert headers and carry out the core's RouteDecisions; the game here runs that same core/ compiled to WebAssembly, byte-identical to the native trace.

Diagrams

AntHocNet: how a route forms (UML sequence diagram)Sequence diagram of AntHocNet's mechanism across 4 lifelines: data for D, no pheromone; reactive forward ant (broadcast); forward ant, visited[] grows; forward ant; backward ant: deposit τ(2→D); backward ant: deposit τ(1→2); backward ant: deposit τ(S→1); data, next hop drawn ∝ τ^β; data; data; proactive forward ant (unicast, may broadcast); … backward ant refreshes pheromone; repair ant if no other route, else …; LinkFail: discount τ via 1.source Snode 1node 2destination Ddata for D, no pheromonereactive forward ant (broadcast)forward ant, visited[] growsforward antbackward ant: deposit τ(2→D)backward ant: deposit τ(1→2)backward ant: deposit τ(S→1)data, next hop drawn ∝ τ^βdatadataproactive forward ant (unicast, may broadcast)… backward ant refreshes pheromonerepair ant if no other route, else …LinkFail: discount τ via 1opt [no route: reactive set-up]loop [every ProactiveInterval while the session lives]alt [link 1→2 breaks]
Sequence diagram (UML): solid arrows are control messages, dashed arrows return, bold arrows carry data; boxes are combined fragments (opt, loop, alt). Read from AntHocNet's core/ and its ant-types page.
AntHocNet: hexagonal architectureAntHocNet's simulator-agnostic core in the centre, reached only through ports; the ns-3 module and the browser adapter outside only convert headers and carry out the core's route decisions.«MIT OR GPL-2.0-only»core/AntRouterLogic::onReceiveAntPheromoneEngine, PheromoneTableAntMessage codec (kWireVersion)VisitedPath, AntHistoryIClockIRngINeighborProviderITimerSchedulerILinkStateIRouterObserver«GPL-2.0-only»ns-3 adaptercontrib module anthocnetheader ⇄ messagetimers, queueon swarm-coreimplementsthe ports«GPL-2.0-only»browser adaptercore/ → WebAssembly-ffp-contract=offdetSin / detCosthis siteimplementsthe portsports on the rim: the only way in or out of core/
Ports and adapters: core/ includes no simulator header; time, randomness, neighbours and timers arrive through ports, and every adapter only carries out the core's decisions.
AntHocNet: package diagramUML package diagram of AntHocNet: the core package, the ns-3 module that uses it, the shared swarm-core module, the docs, the ns3-tools harness the module registers with, and this site.«use»registers armbuildscitesextracted intocore«MIT OR GPL-2.0-only»algorithm, messages, codecports (injected)unit testsns3::anthocnet«GPL-2.0-only»header codec, adapterhelper, examplestest.py suiteswarm-core«ns-3 contrib module»primitives extractedfrom AntHocNet core/(Phase 2)docs«GPL-2.0-only»fidelity sheetpaper § → implementationparameters with sourcesns3-tools::routing-bench«harness»arm registration##RUN## / ##BENCH## linesColony Arena«this site»core/ → WebAssemblypinned in protocols.lock
Package diagram (UML): dashed arrows are «use» dependencies; the licence of each package is its stereotype. The dependency never points from core to GPL-only code.

Package structure

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

Directories of swarm-routing/AntHocNet
PathWhatLicenceState
core/the algorithm: router logic, pheromone engine and table, codec, ports + unit testsMIT OR GPL-2.0-onlypresent
ns3/anthocnet/the ns-3 module: model (header, adapter), helper, examples, test suiteGPL-2.0-onlypresent
ns3/routing-bench/the comparison harness (moving to ns3-tools; switch-over open)GPL-2.0-onlypresent
ns3/baselines/vendored comparator arms (AOMDV, GPSR) and the adaptive armsGPL-2.0-onlypresent
web/the browser adapter and the game: moved to this site (site/anthocnet/)GPL-2.0-onlymoved
tools/shipped scripts: bench statistics, CI checks, releaseMIT OR GPL-2.0-onlypresent
docs/architecture, ADRs, benchmarks (served at /AntHocNet/docs/)GPL-2.0-onlypresent
results/raw benchmark data: harness cells, campaign CSVsGPL-2.0-onlypresent
api/Doxygen config (served at /AntHocNet/api/)GPL-2.0-onlypresent

Where it sits in the colony

The swarm-routing organisation: who depends on whomDependency graph of the swarm-routing organisation. ARA, BeeAdHoc, Termite and HOPNET link against swarm-core, which was extracted from AntHocNet, and register as arms in ns3-tools; AntHocNet runs its benchmarks on ns3-tools' harness; swarm-core and ns3-tools build and run inside the ns3-containers images; ns3-tools writes verdicts into benchmarks; 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 ns3-containers images.linkslinkslinkslinksextractsarmarmarmarmbenchbuilds inruns inverdictscore/ → WASMleaderboard (planned)CI imagesAntHocNetprotocol · liveARAprotocolBeeAdHocprotocolTermiteprotocolHOPNETprotocolswarm-coreshared modulens3-toolsharness · readersns3-containersns3-dev imagesbenchmarksdatasets · verdictsColony Arenathis site.githubreusable CI · templatesdashed arrow: «use» dependency (UML); highlighted: this project and its neighbours
AntHocNet and its neighbours in the organisation.

Quests

The repository's epics and their sub-issues, as the issues stood on 2026-11-13: 117 of 141 sub-issues closed.

Closed: 32 epics

Cite this project

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

Text

Joppi, Daniel Henrique (2026). AntHocNet for NS-3 (version 2.6.1) [Computer software]. https://doi.org/10.5281/zenodo.20981979

BibTeX

@software{anthocnet,
  author  = {Joppi, Daniel Henrique},
  title   = {AntHocNet for NS-3},
  version = {2.6.1},
  year    = {2026},
  doi     = {10.5281/zenodo.20981979},
  url     = {https://github.com/swarm-routing/AntHocNet}
}

Version
2.6.1 · released 2026-10-29
Author
Daniel Henrique Joppi · ORCID
DOI
10.5281/zenodo.20981979
Licence
GPL-2.0-only, MIT

Read from CITATION.cff at 46d63efe1b35 (protocols.lock) when this site was built.

References

The 20 works docs/references.bib lists, read at 46d63efe1b35 (protocols.lock) when this site was built. Each links its DOI; a work with none links its publisher's or institution's page.

Implemented

Restates

Compared against

Datasets

Software it builds on

Background

Sources

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