What is TCL in Ns2

As the matter of fact, the installation of Ns2 packages in network simulator 2 includes some significant steps and they are highlighted in this article. TCL is defined as the scripting language which is capable to create and simulate the network applications in NS2.

Install Ns2 in Ubuntu

The open terminal window is derived through the execution of below mentioned commands in Ns2.

sudo apt-get update

Updating Ubuntu Package

sudo apt-get install ns2

Installation of Ns2

Install TCL in Ubuntu

To install the TCL files in Ubuntu, we have to implement the following commands in terminal.

sudo apt-get install tcl

Install TCL

TCL Sample Code

For your ease, we have highlighted the sample code to configure the 1.5m height and Omni directional antenna and that is stored with the file extension of .tcl.

Antenna/OmniAntenna set X_ 0

Antenna/OmniAntenna set Y_ 0

Antenna/OmniAntenna set Z_ 1.5

Antenna/OmniAntenna set Gt_ 1.0

Antenna/OmniAntenna set Gr_ 1.0

Run TCL File

Following that, we have to run the TCL file through the implementation of the below mentioned commands.

cd /home/research/TCL_code_in_NS2

sudo ./ns Main.tcl

Run TCL File

Following that, we have highlighted acquired result based on running the TCL file.

Result of Running TCL File

The research scholars can ping to clarify you issues based on TCL in Ns2

Opening Time


Lunch Time


Break Time


Closing Time


  • award1
  • award2