Network Simulator 2: a Simulation Tool for Linux
The ARIES (Advanced Research on Internet E-Servers) Project started in 2000 as part of the Open Systems Lab research activities at the Ericsson Corporate Unit of Research. Initially, the project aimed to find and prototype the necessary technology to prove the feasibility of an internet server that had the guaranteed availability, response time and scalability using Linux and open-source software. The project was successful, and it continued in 2001 to focus on enhancing the clustering capabilities of Linux to be the operating system of choice for the Mobile Internet servers. Many enhancements were added in the areas of load balancing, traffic distribution and security, in addition to IPv6 support.
One interesting question that came up was what is the impact of supporting IPv6 on other protocols used by different applications on our Linux clusters? To answer this question, we started a study investigating the effects of IPv6 support on other protocols, such as SCTP. Part of the study is to test applications in SCTP over IPv6. However, we did not have the time and resources to set up a lab with multiple nodes and applications that use SCTP over IPv6. Instead, we chose the next best solution, network simulation.
There is a growing recognition within different internet communities of the importance of simulation tools that help design and test new internet protocols. New services and protocols present challenges for testing. For instance, quality of service and multicast delivery require large and complex environments. Protocol designers recognize the advantages of simulation when computing resources are not available or are too expensive to duplicate a real lab setup. With simulation, you can do large-scale tests that are controlled and reproducible. This was exactly what we needed to build our case scenarios; the search started primarily for an open-source tool because most of our work targets the deployment of open-source software based on Linux.
Our target application is a real-time network simulation tool that we can use to define the different scenarios. A very interesting open-source tool we came across was Network Simulator 2 (NS2), which was developed by the Information Sciences Institute at the University of Southern California.
In this article, we summarize how to install and configure NS2 and look at two different simulation scenarios. The first scenario involves monitoring SCTP traffic between two nodes, and the second scenario looks at the behavior of web traffic and web applications over TCP over a six-node network.
NS2 is an open-source simulation tool that runs on Linux. It is a discreet event simulator targeted at networking research and provides substantial support for simulation of routing, multicast protocols and IP protocols, such as UDP, TCP, RTP and SRM over wired and wireless (local and satellite) networks. It has many advantages that make it a useful tool, such as support for multiple protocols and the capability of graphically detailing network traffic. Additionally, NS2 supports several algorithms in routing and queuing. LAN routing and broadcasts are part of routing algorithms. Queuing algorithms include fair queuing, deficit round-robin and FIFO.
NS2 started as a variant of the REAL network simulator in 1989 (see Resources). REAL is a network simulator originally intended for studying the dynamic behavior of flow and congestion control schemes in packet-switched data networks.
Currently NS2 development by VINT group is supported through Defense Advanced Research Projects Agency (DARPA) with SAMAN and through NSF with CONSER, both in collaboration with other researchers including ACIRI (see Resources). NS2 is available on several platforms such as FreeBSD, Linux, SunOS and Solaris. NS2 also builds and runs under Windows.
Simple scenarios should run on any reasonable machine; however, very large scenarios benefit from large amounts of memory. Additionally, NS2 requires the following packages to run: Tcl release 8.3.2, Tk release 8.3.2, OTcl release 1.0a7 and TclCL release 1.0b11.
The process of installing NS2 is straightforward yet lengthy. At the time of writing, the most recent version was 2.1b8. We are interested in the "all-in-one" package because it includes the source code that we want to patch in SCTP support.
You can download the all-in-one package from the NS2 home page (see Resources) into /usr/src and extract it as follows:
cd /usr/src tar xzvf ns-allinone-2.1b8.tar.gz cd ns-allinone-2.1b8
Because we want to examine a case scenario involving SCTP, we need to apply the SCTP patch to NS2 from the University of Delaware. The patch is available for the NS2 all-in-one 2.1b8 version and can be downloaded from the Protocol Engineering Lab home page (see Resources). With the Linux patch utility, you can update the NS2 source code to include support for SCTP by applying the patch:
patch -p0 < ns-allinone-2.1b8.sctp-rel2.2_patch_orig
In the same directory, there is a script named install that will configure, compile and install the required and optional NS2 components. There is no interaction with the user while installing; the script is completely automated. You must execute the script as superuser so that installation of binaries will be completed:
When the installation process is complete, the following message will appear on your shell
Please put $CUR_PATH/bin:$CUR_PATH/tcl$TCLVER/unix:$CUR_PATH/ tk$TKVER/unix into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph. IMPORTANT NOTICES: [...]
Carefully follow all instructions given in the notices. The above-mentioned variables can be updated either by editing /etc/profile or changing environment variables directly. In case you updated /etc/profile, you need to source your new environment for the changes to take effect (i.e., source /etc/profile).
The NS2 validation suite will verify that all protocols are functional. This will fail if the install process was not completed; however, running validation is optional, and it consumes twice as much time as the compilation and installation process.
To run the validation suite:
cd ./ns-2.1b8 ./validate
|Designing Electronics with Linux||May 22, 2013|
|Dynamic DNS—an Object Lesson in Problem Solving||May 21, 2013|
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
- RSS Feeds
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Designing Electronics with Linux
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- A Topic for Discussion - Open Source Feature-Richness?
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Validate an E-Mail Address with PHP, the Right Way
- What's the tweeting protocol?
- Kernel Problem
9 hours 47 min ago
- BASH script to log IPs on public web server
14 hours 14 min ago
17 hours 50 min ago
- Reply to comment | Linux Journal
18 hours 23 min ago
- All the articles you talked
20 hours 46 min ago
- All the articles you talked
20 hours 49 min ago
- All the articles you talked
20 hours 51 min ago
1 day 1 hour ago
- Keeping track of IP address
1 day 3 hours ago
- Roll your own dynamic dns
1 day 8 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?