Evaluating the performance of two TCP variants: TCP Vegas and TCP new Reno in a simulated SANET network.
Our goal is to compare which TCP variant is best fit in a SANET (Static Ad hoc Network) environment. One of the effective indicators we can use to compare is the Packet Loss Ration (PLR).
Update the package manager apt-get, install basic build tools and prerequisites, then install ns2 using apt-get
sudo apt-get update
sudo apt-get install build-essential autoconf automake libxmu-dev
sudo apt-get install ns2
- Download the nam 1.14 package from this link: https://drive.google.com/file/d/1dkNPNN23Vy6o_zT0uIRBgUAo1VCXcVOY/view
- find its location on your machine and on the same directory:
sudo dpkg --install nam_1.14_amd64.deb
It is usually pre installed on Linux machines
A tool for generating graphs:
sudo apt-get update
sudo apt-get install gnuplot
For viewing images:
sudo apt-get update
sudo apt-get install eog
- Simulate the SANET network using the TCP Vegas variant. In order to do so, we execute the TCL file using ns:
ns sanet_vegas.tcl
This will generate 2 files:
- sanet_vegas.nam: can be used by the nam tool to graphically visualize the simulation.
- sanet_vegas.tr: contains all information about events during the simulation, is often used for analysis.
- Simulate the SANET network using the TCP new Reno variant:
ns sanet_reno.tcl
This will also generate 2 files: sanet_reno.nam and sanet_reno.tr.
- In order to compare the results, an AWK script is provided that measures the PLR accross time for each trace file:
awk -f loss_rate.awk sanet_vegas.tr >> plr_results_vegas.txt
awk -f loss_rate.awk sanet_reno.tr >> plr_results_reno.txt
This way, we can transfer the resulted PLR values in text files, that we can use to visualise the PLR curve for the two TCP variants and determine which one results in the least packet loss.
- use gnuplot on the file: plr_curve.gp which reads data from the generated text files and creates the corresponding graph:
gnuplot plr_curve.gp
This will create the graph in a png format, all we have to do then is open the file:
eog plr.png