Colony Arena swarm-routing ⌥

Ant nest · Protocol · swarm-routing/AntHocNet

AntHocNet

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

Unlocked: Live: game, docs and API

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. The five protocols link against swarm-core and register as arms in ns3-tools; 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 provides every repository's reusable CI.linkslinkslinkslinksextractsarmarmarmbuilds inruns inverdictscore/ → WASMleaderboardCIAntHocNetprotocol · 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

Sources

Facts as of 2026-11-08, from the repository's AGENTS.md and the org ROADMAP.