Skip to main content

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.cc and nsb.pb.h โ€” C++ generated code
  • python/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.

nsb.pc.inโ€‹

Template for generating the nsb.pc pkg-config file. Installed to [prefix]/lib/pkgconfig/nsb.pc so that projects can use:

pkg-config --cflags --libs nsb

Generated Build Artifactsโ€‹

After running cmake --build:

ArtifactLocationDescription
nsb_daemonbuild/NSB Daemon executable
libnsb.so / libnsb.dylibbuild/ โ†’ [install]/nsb/lib/Shared client library
nsb.pb.cc / nsb.pb.hbuild/generated/Compiled Protobuf bindings
nsb_pb2.pybuild/generated/python/proto/Python Protobuf bindings
libnsb_rabbitmq_cpp.acpp/rabbit/build/RabbitMQ C++ static library
libnsb_unified_cpp.acpp/rabbit/build/Unified C++ static library

Go Deeperโ€‹