Skip to main content

Simulator Modes

NSB supports two simulator modes that control how many NSBSimClient instances exist and which payloads each one can see: System-Wide and Per-Node. This page owns the conceptual explanation of each mode. To set the simulator_mode field in your YAML config, see Configuration β†’ Simulator Modes.

System-Wide Mode (simulator_mode: 0)​

A single simulator client handles all message routing. When a payload is fetched, it can come from any source node.

AppClient(node0) ──send──► Daemon ──fetch──► SimClient (global)
AppClient(node1) ──send──► Daemon ──fetch──► SimClient (global)
  • A single NSBSimClient handles all message fetching and posting for the entire simulation
  • The single simulator client fetches any message regardless of source

Best for: Top-down simulators like ns-3, custom script-driven simulations β€” where a single simulation script manages the entire network topology and traffic.

Constraint: Only one NSBSimClient may connect to the daemon at a time in this mode.

Per-Node Mode (simulator_mode: 1) β€” Default​

Each simulated node has its own simulator client. The client identifier for NSBSimClient must match the corresponding NSBAppClient identifier.

AppClient("node0") ──send──► Daemon ──fetch──► SimClient("node0")
AppClient("node1") ──send──► Daemon ──fetch──► SimClient("node1")
  • Each simulated node has its own NSBSimClient
  • NSBSimClient("node0").fetch() fetches only messages from NSBAppClient("node0")
  • NSBSimClient("node0").post(...) makes the payload available to NSBAppClient at the destination

Best for: Bottom-up simulators like OMNeT++, node-module-based simulators β€” where each simulated host module directly handles its own traffic.

Choosing a Mode​

If your simulator...Use
Manages the entire network from one script (ns-3 style)System-Wide
Models each host as an independent module (OMNeT++ style)Per-Node

See Integrations β†’ System-Wide vs Per-Node for a deeper comparison and which integration tutorials use which mode.

Go Deeper​