Getting Started with Network Simulator-3 (ns-3)
The main reasons for using network simulators are setting up a variety of wired or wireless networks and analyzing their protocols and application performance systematically. Conducting networking experiments is highly complex and incurs a lot of cost with real systems. Network Simulator-3 (ns-3) is an open source simulation platform written in C++ for conducting systematic experiments on wired and/or wireless networks. ns-3 provides important models, such as core, internet, and Ethernet-related modules, routing, applications, and flow-level statistics monitoring for setting up network topologies and conducting basic simulation experiments. Moreover, ns-3 offers important modules such as mobility, placement, spectrum, and antenna for conducting advanced network simulations related to Wi-Fi, WiMAX, and LTE networks. The ns-3 team is planning to introduce 5G simulation topics in upcoming ns-3 versions.
In general, ns-3 helps users to re-create real-time scenarios quickly and in a scalable manner. ns-3 is implemented as a discrete-event simulator to handle various events of a simulation setup. It offers a simulation engine with a scheduler that handles all types of events generated in user-written simulation experiments. ns-3’s unique basic features, such as supporting logging, debugging, tracing, and computing flow-level statistics, are highly useful for conducting simulations by researchers, engineers, and students. ns-3 also supports NetAnimator (NetAnim) for visualizing ns-3 simulations. It is highly useful for beginners or advanced users to easily conduct simulations. In this chapter, we will mainly introduce the ns-3 installation procedure, and how to integrate ns-3 with Code::Blocks
editors to quickly start ns-3 simulations. Next, we will discuss a typical ns-3 simulation program structure and how to implement and evaluate your first simulation program. Finally, we will discuss how to install and integrate NetAnim with ns-3 for visualizing ns-3 simulations. Specifically, we will discuss all the important features of NetAnim to perform systematic network simulation inspections and visualization.
In summary, in this chapter, we are going to cover the following main topics:
- Getting started with installing ns-3
- Exploring ns-3 code easily using the
Code::Blocks
editor - Understanding a ns-3 program’s structure
- Starting your first network simulation
- Playing ns-3 simulations using NetAnim