The ns-3 gateway facilitates time synchronization and data exchange between a ns-3 network model and external processes such as the CARLA simulator.
This software enables the integration of network models developed using the ns-3 network simulator with external software and hardware. Data from an ns-3 network model can be exchanged at runtime with other software to create high-fidelity simulations of both communication networks and the underlying physical processes. For instance, this software can be used to integrate a vehicle-to-vehicle communications network in ns-3 with a road traffic simulation in Simulation of Urban Mobility (SUMO) to combine high-fidelity network models with high-fidelity traffic and mobility simulations.
The software is released as a new gateway class that can be instantiated and configured within existing ns-3 network models. The gateway is based on a client-server architecture, where the gateway inside ns-3 (client) connects to an external process (server) using a TCP/IP socket connection. There is a simple string-based message protocol defined for the data exchange between client and server. In addition, the gateway synchronizes the ns-3 simulation time to follow an external time reference to ensure a consistent notion of simulation time between different simulators.
Documentation on installation, usage, and the software architecture is available on the GitHub page below.
Download from GitHub:
https://github.com/usnistgov/ns3-cosim