Performance Evaluation of ns-3 Real-Time Emulation

Date: 2026-06-10

link: https://ieeexplore.ieee.org/abstract/document/10943112


Motivation

Converting complex applications to discrete-event simulations is time-consuming and prone to inaccuracies. While ns-3's real-time and tap-bridge modes allow direct integration of production software/hardware, this limits throughput and scalability. The authors try to identify these bottlenecks by benchmarking real-time emulation against model-based simulations.

Methodology

  • Executed all simulation test cases using ns-3's real-time scheduler.
  • Configured a hard real-time lag limit of 100 ms; if the lag increased past the limit, the process was aborted.
  • Built and evaluated two setups across matching topologies to isolate processing variables:
  • SimReal-Time: Runs applications and the network layout entirely inside a single, single-threaded ns-3 process utilizing simulated models.
  • EmuTAP: Runs real software applications in an individual host processes while routing traffic via system TAP interfaces into the ns-3 topology using tap bridges.
  • Varied network structural complexity by adding up to 10 simulated routers, and scaled application execution complexity by programming loops that force threads to continuously compute random numbers.
  • Measured maximum packet and data throughput capacities across different packet sizes (256B, 512B, and 1024B) under Constant Bit Rate (CBR) traffic profiles for both TCP and UDP flows.
  • Repeated measurements across different server configurations (2010-2021 CPU generations) and evaluated the impact of standard versus optimized ns-3 compilation build profiles.

Observations (Since it's a benchmark)

  • Network complexity (adding routers) is the primary limiting factor for throughput in both setups, whereas application complexity only affects SimReal-Time process.
  • Running applications natively on the host OS (EmuTAP) offloads heavy computational processing from the simulator, allowing it to scale effectively using modern multicore systems.
  • The simulator is strictly bounded by packet throughput (packets per second) rather than raw data bitrates, because each individual packet triggers a chain of scheduled internal events.
  • Because of the packet-count bottleneck, UDP streams consistently achieve double the maximum concurrent flows of TCP.
  • Under low-complexity conditions, real-time emulation platform peaks between 14 Mbps and 120 Mbps (handling up to approximately 30,000 packets per second for UDP) before aborting.
  • A performance plateau occurs between 80% and 100% CPU utilization when the event queue saturates, forcing the real-time scheduler to substitute expensive, syscall-assisted sleeping with aggressive busy waiting.
  • Packet latency remains stable (between 5 ms and 10 ms) until the setup hits roughly 50% of its maximum throughput capacity, past which the scheduler queue introduces severe, unpredictable delay spikes and jitter.
  • Upgrading to modern CPU generations boosts performance by up to 137%, while compiling ns-3 with an "optimized build profile" increases packet throughput by 42% to 70% over standard builds.
  • Repeated test runs show a highly reproducible flow-termination threshold with minimal standard deviation over different combinations of host operating systems, kernel packet buffering, system nodes, etc.