Pages

Search This Blog

Wednesday 28 December 2011

TCL Script generator

NS2 Scenarios Generator (NSG) is a tcl script generator tool to generate TCL Scripts automatically . . . !!!

It is created and maintained by Peng-Jung Wu, Department of Computer Science and Engineering, National Sun Yat-Sen University, Kaohsiung, Taiwan.

NSG is a Java based tool that runs on any platform and can generate TCL Scripts for Wired as well as Wireless Scenarios for Network Simulator - 2. The procedure to execute these TCL Scripts on NS-2 is same as those of manually written TCL Scripts.

Some of the main features of NS2 Scenarios Generator (NSG) are as mentioned below:

(1) Creating Wired and Wireless nodes just by drag and drop.
(2) Creating Simplex and Duplex links for Wired network.
(3) Creating Grid, Random and Chain topologies.
(4) Creating TCP and UDP agents. Also supports TCP Tahoe, TCP Reno, TCP New-Reno and TCP Vegas.
(5) Supports Ad Hoc routing protocols such as DSDV, AODV, DSR and TORA.
(6) Supports FTP and CBR applications.
(7) Supports node mobility.
(8) Setting the packet size, start time of simulation, end time of simulation, transmission range and interference     range in case of wireless networks, etc.
(9) Setting other network parameters such as bandwidth, etc for wireless scenarios.

The Snapshot of NSG is as shown below:

 
 NSG Download
To execute NSG you need to install Java 6.0. NSG does not require any installation . . . !!! Just double click on the jar file to launch NSG. 

Tuesday 18 October 2011

Installing ns-2.34 on Ubuntu 11.04

NS2 is a popular discrete event simulator for simulating different types of networks. In this article i will show you how to install NS-2.34 on Ubuntu 11.04.  

Note: Please connect your pc to internet, it is very important because failure of connection may cause some error in installing ns2 or in some future work.

  • Download ns2.34 from here. 
  • Copy ns-allinone-withpath-2.34.tbz to /tmp directory.
  • Copy it to the /usr/local directory using terminal by using following command
       sudo cp /tmp/ns-allinone-withpath-2.34.tbz /usr/local/     
  • Change directory to /usr/local
       cd /usr/local/
  • Extract it using the following command
       sudo tar -jxvf ns-allinone-withpath-2.34.tbz 
  • Change directory to ns-allinone-2.34
       cd ns-allinone-2.34/
  • Now, install the development files for X Windows plus the g++ compiler:
       sudo apt-get install xorg-dev g++ xgraph
  • Fix the error in the linking of otcl by editing line 6304 of otcl-1.13/configure so that it reads                    
        SHLIB_LD="gcc -shared"
        instead of
        SHLIB_LD="ld -shared"

  • Then, edit the file ns-2.34/tools/ranvar.cc and change the line 219 from
        return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
        to
        return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);

  • Next, change the lines 183 and 185 in file ns-2.34/mobile/nakagami.cc to read
        resultPower = ErlangRandomVariable(Pr/m, int_m).value();
        and
        resultPower = GammaRandomVariable(m, Pr/m).value(); 

  • Install gcc-4.4 and g++-4.4 including dependencies using the code below:
        $ sudo apt-get install gcc-4.4 g++-4.4 
              If there is any occur while installing these than you can use 
        sudo synaptic
        here you can search it and easily download and install it. 
  • Now, change the line 270 in tcl8.4.18/unix/Makefile.in that reads
        CC = @CC@
        so it appends the version parameter for version 4.4:
        CC = @CC@ -V 4.4
         Make sure it is a capital V.

  • Finally,run the command
         sudo ./install
  • After installation type the following command in a terminal
          source /etc/profile.d/ns2.sh
Now ns-2.34 is installed on ubuntu 11.04, you can check it by typing "ns" on terminal and press enter.