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.
- 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.
- 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