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
NSBSimClienthandles 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 fromNSBAppClient("node0")NSBSimClient("node0").post(...)makes the payload available toNSBAppClientat 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β
- Configuration β Simulator Modes β the YAML field reference (
simulator_mode: 0/simulator_mode: 1) - ns-3 Overview β System-Wide mode in practice
- OMNeT++ Overview β Per-Node mode in practice