NS3 installation in Linux Mint 17 (64 bit)

This post tells you how to install the ns3 version in Linux Mint 17 (64bit)- Long Term Support till 2019.

The following development libraries are to be installed before trying ns3
$prompt] sudo apt-get update 
$prompt] sudo apt-get install build-essential autoconf automake libxmu-dev
$prompt] sudo apt-get install ia32-libs 
(the above software ia32-libs is needed only when you want to run the 32 bit applications inside a 64bit OS)

Now download the ns3 software from the website http://www.nsnam.org
I downloaded the version 3.20 (ns-allinone-3.20.tar.bz2).

Please do understand that ns2 is different from ns3 and they are not having any link between them (however, some network models were used in ns3 were adopted from ns2).
Also ns3 will run using the main() of C++ and also it has python bindings.

Here is the installation steps of ns3
1. copy the ns-allinone-3.20.tar.bz2 in the home directory(Ex: /home/pradeepkumar)
2. Set the following path information (type these commands one by one in the terminal or copy these lines in the /home/pradeepkumar/.profile)
export BAKE_HOME=`pwd`/bake
3. Open the terminal and issue this command one by one
$prompt] tar jxvf ns-allinone-3.20.tar.gz
$prompt] cd ns-allinone-3.20/
$prompt] cd bake
$prompt] ./bake.py configure -e ns-3.20
$prompt] ./bake check 
(This step will tell you the extra software that needs  to be installed)
$prompt] ./bake download (download the software)
$prompt] sudo apt-get install python-pygoocanvas python-pygraphviz python-dev qt4-default p7zip-full bzr cmake mercurial git cvs 
See the screenshot after the command ./bake.py check

bake.py check

see the screenshot after the command ./bake.py download
bake.py download
The above command will install the optional files that may need to run ns3 completely. And here is the complete build of ns3
$prompt] ./build.py --enable-examples --enable-tests
See the screenshot below for information
ns3 installation
T S Pradeep Kumar

Time Command in Linux

The time command is linux is very much useful if you want to know the time information while running a program or a process.
The time command usage is as followsprompt $] time <commandname>
prompt $] time ls
The output will be
If you want to see the detailed system parameters occupied during a program or process, then the command will be
prompt$] TIMEFORMAT=”” time -v <commandname>
See the screenshot given below
time command
Time Command in Linux

The output of the above command is
Desktop  Documents  Downloads  examples.desktop  MusicPictures  Public  Templates  Videos
Command being timed: “ls”
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 400%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 3600
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 286
Voluntary context switches: 1
Involuntary context switches: 0
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
Similarly, if a C or C++ program is compiled and linked to a file called helloc (the creation of helloc is given below)
prompt $] gcc -o helloc hello.c 
prompt $] g++ -o helloc tspradeep.cc 
if you want to execute this command 
prompt $] TIMEFORMAT=”” time -v ./helloc
The time command will show you the memory page faults, context swtiching, swap memory used and other system parameters, etc.
If you have any added input for this command, let you write in the comment section.
T S Pradeep Kumar

Simple Screen Recorder for Linux

Recording the screen in Linux OS is always a tedious task, as either the video/audio malfunctions or support may not be there. There is a tools called simple screen recorder for Linux.
Its a very simple tool that is recorded and processed in no time. For example, if you record an 1 hour video, the processing may take another 20 to 50 minutes. But this software does the “On the fly recording and processing”
This software has a straight forward interface and its incomparable to other softwares in the market.
  • Its faster than VLC
  • It never takes more amount of RAM like VLC do.
  • Its multithreaded, if you have more than one core, then the processing happens at all the cores.
  • it can do live streaming also, but it is under experimental setting.
  • it supports many different codecs.
Here is the simple screenshot.
Simple Screen Recorder
Simple Screen Recorder

Simple Screen Recorder
Simple Screen Recorder

Simple Screen Recorder
Simple Screen Recorder

Simple Screen Recorder
Simple Screen Recorder

A 42 minute video is recorded using this software and it takes just 42minute only. no extra time for processing. Please see the youtube video attached below.
See the above video taken using SSR and its about SSR. To download this software follow this URL
For any doubts, just ping me through the comment form
T S Pradeep Kumar

TCP Congestion Control

Congestion control is one of the performance metrics of TCP protocol. There are so many TCP Versions to control congestion in the network.
NS2 also supports various TCP protocols like TCP Vegas, TCP Reno, TCP, TCP Sack, Full TCP, TCP linux, etc.

Each TCP protocols has different mechanism in controlling the congestion. Some are good at Congestion control, some are good at error ands flow control.

Before understanding the congestion control, one has to know the congestion window of TCP. TCP has a congestion window (cwnd_ in ns2), this variable affects or predicts the congestion control.

The value assigned to this variable will alter the congestion control. Here are the files that are of prime importance before dealing with congestion control.
~ns-2.35/tcl/lib/ns-default.tcl (In this file, the constant values for all the protocols in ns2 are set)

For example, the packet size of CBR is 210 by default, this value is represented like this in the ns-default.tcl file.

Application/Traffic/CBR set packetSize_ 210 

if you want to change the packet size of CBR for ns2, you may change the above line to

Application/Traffic/CBR set packetSize_ 500 

which is set to 500 bytes, the above line will affect the entire tcl scripts (the value is changed to 500), instead the packet size can be changed within the TCL file where it is programmed as given below

set cbr [new Application/Traffic/CBR]
$cbr set packetSize_ 500
The above line will change the packet size for this file only. Similarly, the TCP congestion window is set like this
Agent/TCP set cwnd_ 0 

the default value is 0 and you may modify this within the file as given below
set tcp [new Agent/TCP]
$tcp set cwnd_ 3

To know more about congestion control, please see the video given below for detailed instructions. 

T S Pradeep Kumar