Friday, May 30, 2008

Script to apply a patch to NS-2

This script will apply any patch the user wants. Just give URL of the patch when the script asks.


# Downloading the requested patch
cd ~/.
cd ns-2
mkdir tempPatch
cd tempPatch
echo "Give the URL of patch. I will download and patch it for you."
read ans
sudo wget $ans
dir1="$HOME/ns-2/tempPatch/"
dir2=$HOME/ns-2/ns-allinone-2.31/ns-2.31/
file=$dir1/*
cp $file $dir2
cd $dir2


# Applying the patch
make clean
patch -p1 < $file
rm -rf $HOME/ns-2/tempPatch
sudo make
sudo make install

Auto install script Network Simulator NS-2

This scripts installs the AllinOne package of NS,NAM,TCL,TK. Please take note that these packages get installed in a specific account. If another user wants to get access to these packages he will have to add the environment variables given below in his ~/.bashrc file.

Enjoy!


echo "This script installs NS-2 on Debian Linux(Need to be root)"
cd ~/.
mkdir ns-2
cd ns-2
wget http://nchc.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.31.tar.gz
tar -xzvf ns-allinone-2.31.tar.gz
cd ns-allinone-2.31/
sudo apt-get -y install build-essential autoconf automake libxmu-dev
echo "This command may generate some errors, and if it does, restart your computer and uncomment the step giving in script"
# Uncomment the following command
# sudo apt-get install -f build-essential libxt-dev lins-2.31bxt6 libsm-dev libsm6 libice-dev libice6 libxmu-dev
#
./install
echo "If the script meshes up your environment variables then restore the backup file"
cp ~/.bashrc ~/.bashrc.bak_by_ns2

# Inserting paths in environment file.
echo "# LD_LIBRARY_PATH" >> ~/.bashrc
echo "OTCL_LIB=$HOME/ns-2/ns-allinone-2.31/otcl-1.13" >> ~/.bashrc
echo "NS2_LIB=$HOME/ns-2/ns-allinone-2.31/lib" >> ~/.bashrc
echo "X11_LIB=/usr/X11R6/lib" >> ~/.bashrc
echo "USR_LOCAL_LIB=/usr/local/lib" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$OTCL_LIB:$NS2_LIB:\$X11_LIB:\$USR_LOCAL_LIB" >> ~/.bashrc


echo "# TCL_LIBRARY" >> ~/.bashrc
echo "TCL_LIB=$HOME/ns-2/ns-allinone-2.31/tcl8.4.14/library" >> ~/.bashrc
echo "USR_LIB=/usr/lib" >> ~/.bashrc
echo "export TCL_LIBRARY=\$TCL_LIB:\$USR_LIB" >> ~/.bashrc


echo "# PATH" >> ~/.bashrc
echo "XGRAPH=$HOME/ns-2/ns-allinone-2.31/bin:$HOME/ns-2/ns-allinone-2.31/tcl8.4.14/unix:$HOME/ns-2/ns-allinone-2.31/tk8.4.14/unix" >> ~/.bashrc
echo "NS=$HOME/ns-2/ns-allinone-2.31/ns-2.31/" >> ~/.bashrc
echo "NAM=$HOME/ns-2/ns-allinone-2.31/nam-1.13/" >> ~/.bashrc
echo "PATH=\$PATH:\$XGRAPH:\$NS:\$NAM" >> ~/.bashrc

# Immediatly taking effect
source ~/.bashrc

# Validating installation
echo "Press Enter to Validate Installation(time consuming) or press CTR-C"
read
cd ns-2.31
./validate

Brainstorming - TCP ideas

1) self stabilizing parameters/values
e.g. Increased initial window.

Use: A server operating system (e.g VMware's ESX server) might be deployed in networks of different speed thus it would be efficient if the TCP IP stack can set its parameters depending on network speed and usual network traffic.


2) Dynamically switching between different congestion avoidance algorithms.

Use: laptops which roam in networks of different throughput. Different congestion avoidance are effective in different networks thus to find the optimum algorithm for that specific network. e.g. it should switch to TCP Hybla when using wireless interface and to HS-TCP when it is connected to wired link.
Another parameter to change congestion avoidance can be network bandwidth

3) Connection based - congestion avoidance algorithm based on tracert or hop count

It is very unfair to server a client in china as compared to client sitting in CA, which is the same place where the server is located. TCP hybla suggestion an avoidance algorithm which is not based on RTT e.g A client using virtual machine running in california from india should use TCP Hybla and a client sitting in same building should use TCP westwood.

4) congestion avoidance algorithm based on the type of traffic. E.g. calculate the behavior of window as a function of type of data. Large file, chat application, etc (not sure how this can be done)

5) Initial window size probing using ICMP or UDP protocol.
(An approach equivalent to Autotuning with Autobuf has been shown to improve file transfer speeds (goodput), and is therefore an extremely useful tool for speeding up large file transfers.)

Thursday, May 29, 2008

Script to make your debian box a network weapon

apt-get -y install wireshark
apt-get -y install bmon
apt-get -y install iperf
apt-get -y install netperf
apt-get -y install gnuplot
apt-get -y install wireshark
apt-get -y install nmap
apt-get -y install nessus
apt-get -y install traceroute

-y means it will take yes as default for installing all packages.

PS: dont forget to make the file executable.
chmod 700 filename

Tuesday, May 27, 2008

First post

Bla bla bla.........