Вы находитесь на странице: 1из 4

Aim: Study installation of NS2 and run a simple program

Theory:
Steps for installation
1. Internet connection should be there
2. Go to terminal
3. $sudo apt-get update (for ubuntu)
4. $sudo apt-get install ns2*nam*
5. $sudo apt-get purge nam
6. $ls
7. $sudo dpkg -i nam_1.14_amd64.deb
To run the program
ns ns-simple.tcl

sudo - It originally stood for "superuser do"[6] as the older versions of sudo were designed to
run commands only as the superuser.
apt-get : apt-get is for installing, upgrading and cleaning packages while apt -cache is
used for finding new packages.
eg : apt-get update –It is used to update the packages.
apt-get install–It is used to install new packages.
purge - To systematically and permanently remove old and unneeded data. The term purge is
stronger than delete. It is often possible to regain deleted objects by undeletingthem,
but purged objects are gone forever.

apt-get purge <package_name>: This command completely removes a package and the
associated configuration files. Configuration files residing in ~ are not usually affected by this
command. The package_name in this case is nam

ls – This command is used to list all the names of the directories and files present in the system.
dpkg - dpkg is the software that forms the low-level base of the Debian package management
system. It is the default package manager on Ubuntu. You can use dpkg to install, configure,
upgrade or remove Debian packages, and retrieve information of these Debian packages.
sudo dpkg -i filename.deb
This installs a .deb file
where, filename is the name of the local .deb file you wish to install.
In this case it is nam_1.14_amd64

This network consists of 4 nodes (n0, n1, n2, n3) as shown in above figure. The duplex links
between n0 and n2, and n1 and n2 have 2 Mbps of bandwidth and 10 ms of delay. The duplex
link between n2 and n3 has 1.7 Mbps of bandwidth and 20 ms of delay. Each node uses a
DropTail queue, of which the maximum size is 10. A "tcp" agent is attached to n0, and a
connection is established to a tcp "sink" agent attached to n3. As default, the maximum size of
a packet that a "tcp" agent can generate is 1KByte. A tcp "sink" agent generates and sends ACK
packets to the sender (tcp agent) and frees the received packets. A "udp" agent that is attached
to n1 is connected to a "null" agent attached to n3. A "null" agent just frees the packets
received. A "ftp" and a "cbr" traffic generator are attached to "tcp" and "udp" agents
respectively, and the "cbr" is configured to generate 1 KByte packets at the rate of 1 Mbps. The
"cbr" is set to start at 0.1 sec and stop at 4.5 sec, and "ftp" is set to start at 1.0 sec and stop at
4.0 sec.

Fig : Initialisation
Fig 2 : After running the code on the simulator

Вам также может понравиться