Project Structure
A complete reference of all files and directories in the NSB repository.
Top-Level Layoutโ
nsb/
โโโ CMakeLists.txt # Main build configuration
โโโ LinuxCMakeLists.txt # Linux-specific build configuration
โโโ config.yaml # Default NSB system configuration
โโโ minconfig.yaml # Minimal configuration for quick testing
โโโ nsb.pc.in # pkg-config template file
โโโ linux-setup-guide.md # Linux (Ubuntu 24.04) setup instructions
โโโ RabbitMQ_Enhancements.md # RabbitMQ improvement proposals
โโโ README.md # Project overview and quickstart
โโโ proto/ # Protobuf message definitions
โโโ cpp/ # C++ source code
โโโ python/ # Python source code
โโโ rabbit/ # Python RabbitMQ backend
โโโ examples/ # Simulator integration examples
proto/โ
Protobuf message schema shared across all NSB components and languages.
proto/
โโโ nsb.proto # NSB message definitions (nsbm type)
The compiled output is placed in:
cpp/proto/nsb.pb.ccandnsb.pb.hโ C++ generated codepython/proto/proto/nsb_pb2.pyโ Python generated code
See Protobuf Schema for the full message definition.
cpp/โ
C++ client library and daemon.
cpp/
โโโ Doxyfile # Doxygen configuration for C++ docs
โโโ README.md # C++ API documentation
โโโ include/
โ โโโ nsb.h # Core header: Config, MessageEntry, SocketInterface, logging
โ โโโ nsb_client.h # Client header: NSBClient, NSBAppClient, NSBSimClient
โ โโโ nsb_daemon.h # Daemon header: NSBDaemon class
โโโ src/
โ โโโ nsb.cc # Core implementation
โ โโโ nsb_client.cc # Client implementation (send, receive, fetch, post)
โ โโโ nsb_daemon.cc # Daemon implementation (routing, client registration)
โโโ proto/
โ โ โโ nsb.pb.cc # Generated Protobuf C++ implementation
โ โโโ nsb.pb.h # Generated Protobuf C++ header
โ โโโ proto/
โ โโโ nsb.pb.cc # (duplicate; retained for compatibility)
โ โโโ nsb.pb.h
โโโ nsb_test.cc # C++ test file
โโโ rabbit/ # RabbitMQ C++ implementation
โโโ CMakeLists.txt # RabbitMQ C++ build config
โโโ README.md # RabbitMQ C++ documentation
โโโ GetStarted.txt # Quick start notes
โโโ buildsteps.txt # Manual build steps
โโโ include/
โ โโโ RabbitMQInterface.hpp # Low-level AMQP transport
โ โโโ NSBClientRMQ.hpp # Base RMQ client (INIT, PING, EXIT)
โ โโโ NSBAppClientRMQ.hpp # Application client (send/receive/listen)
โ โโโ NSBSimClientRMQ.hpp # Simulator client (fetch/post/listen)
โ โโโ NSBDaemonRMQ.hpp # Standalone C++ RabbitMQ daemon
โโโ src/
โ โโโ RabbitMQInterface.cpp
โ โโโ NSBClientRMQ.cpp
โ โโโ NSBAppClientRMQ.cpp
โ โโโ NSBSimClientRMQ.cpp
โ โโโ NSBDaemonRMQ.cpp
โโโ examples/
โโโ example_send_recv.cpp # Two RMQ app clients exchanging a message
โโโ example_daemon.cpp # Standalone RMQ daemon demo
โโโ example_unified.cpp # Unified client with CLI backend selection
See C++ API for the full method reference.
python/โ
Python client library (socket backend).
python/
โโโ Doxyfile # Doxygen configuration for Python docs
โโโ README.md # Python API documentation
โโโ pyproject.toml # Python package metadata
โโโ requirements.txt # Python dependencies
โโโ nsb_client.py # Main client library (NSBAppClient, NSBSimClient)
โโโ nsb_test_client.py # Single-node test script
โโโ nsb_test_client_multipleHosts.py # Multi-node test script
โโโ tests.py # Full Python test suite
โโโ proto/
โโโ proto/
โโโ nsb_pb2.py # Generated Protobuf Python bindings
See Python API for the full method reference.
rabbit/โ
Python RabbitMQ backend (transport layer alternative).
rabbit/
โโโ README.md # RabbitMQ Python documentation
โโโ Implementation.md # Implementation notes and class overview
โโโ requirements.txt # Dependencies: pika, redis
โโโ nsb_rabbitmq.py # Core: RabbitMQInterface, NSBAppClient, NSBSimClient
โโโ nsb_daemon.py # RabbitMQ daemon: NSBDaemon, NSBDaemonConfig
โโโ nsb_unified.py # Unified client supporting socket + RabbitMQ
โโโ example_usage.py # 5 standalone RabbitMQ examples
โโโ proto/
โ โโโ __init__.py
โ โโโ (proto stubs)
โโโ tests/
โโโ example_unified.py # 7 examples using the unified client
โโโ test_unified.py # Comprehensive test suite with benchmarks
โโโ testing.txt # Test prerequisites, env vars, troubleshooting
See RabbitMQ Backend for full usage.
examples/โ
Simulator-specific example scripts and project files.
examples/
โโโ ns3/
โ โโโ README.md # ns-3 integration guide
โ โโโ ns3Simple-testing.cc # Simple NSB AppClient in ns-3 scratch script
โ โโโ nsb-testing.cc # Full NSB SimClient integration in ns-3
โ โโโ nsb-testing-tcp.cc # NSB integration using TCP in ns-3
โโโ omnet/
โโโ README.md # OMNeT++ integration guide
โโโ nsb_omnet_basic/ # Pure OMNeT++ example (no INET)
โ โโโ NSBMessage.msg # Custom OMNeT++ message type
โ โโโ NSBMessage_m.cc # Generated message implementation
โ โโโ NSBMessage_m.h # Generated message header
โ โโโ NSBHost.cc # Host module: fetch, route, post
โ โโโ NSBHost.h
โ โโโ NSBHost.ned # Host NED definition
โ โโโ NSBHostNetwork.ned # Two-host network topology
โ โโโ NSBHostNetworkTenHosts.ned # Ten-host network topology
โ โโโ omnetpp.ini # Simulation configuration
โ โโโ Makefile # Build file
โ โโโ makefrag # NSB include/library injection for make
โโโ nsb_omnet_inet/ # OMNeT++ with INET framework
โโโ INETAppFiles/ # NSB-INET application layer files
โ โโโ nsbBasicApp.cc # Message source: fetch from NSB โ UDP inject
โ โโโ nsbBasicApp.h
โ โโโ nsbBasicApp.ned
โ โโโ nsbAppSink.cc # Message sink: UDP receive โ NSB post
โ โโโ nsbAppSink.h
โ โโโ nsbAppSink.ned
โโโ nsb_beta_simulations/
โโโ Makefile
โโโ simulations/
โโโ omnetpp.ini
โโโ WirelessNetworkTwoHosts.ned # Two-host wireless topology
โโโ WirelessNetworkTenHosts.ned # Ten-host wireless topology
See Tutorials โ Integrate ns-3, OMNeT++ Basic, and OMNeT++ with INET for usage walkthroughs of these example files.
Key Configuration Filesโ
config.yamlโ
Full system configuration file. Passed to nsb_daemon at startup.
---
system:
daemon_address: 127.0.0.1
daemon_port: 65432
mode: 0 # PULL (0) or PUSH (1)
simulator_mode: 1 # System-Wide (0) or Per-Node (1)
database:
use_db: true
db_address: 127.0.0.1
db_port: 5050
db_num: 0
minconfig.yamlโ
Minimal configuration for quick testing. Uses defaults for most settings.