AWK Scripts are very good in processing the data from the log (trace files) which we get from NS2. If you want to process the trace file manually, here is the detailHere is a sample of trace file from NS2 (However ns2 supports a new type of trace file also), but this post will make you understand the old trace format only.r 0.030085562 _0_ MAC --- 0 message 32 [0 ffffffff 1 800] ------- [1:255 -1:255 32 0] r 0.030110562 _0_ RTR --- 0 message 32 [0 ffffffff 1 800] ------- [1:255 -1:255 32 0] s 1.119926192 _0_ RTR --- 1 message 32 [0 0 0 0] ------- [0:255 -1:255 32 0] AWK Scripts are very good in processing the data column wise. For example the first column in the above trace file represents r, s which indicates receive, sent respectively. If we want to trace the entire r and s alone from this trace file we can represent it as $1 So $1 represents ACTION $2 Time $3 Node ID $4 Layer $5 Flags $6 seqno $7 type $8 Size $14 Energy (if the network nodes includes EnergyModel)To run the awk script in Li…
Xgraph is an X-Windows application that includes: interactive plotting and graphing animation and deritives portability and bug fixes So to plot the characteristics of NS2 parameters like throughput, end to end delay, packets information, etc can be plotted using xgraph The successful installation of NS2 will install xgraph also along with it. To run xgraph from a shell prompt: # xgraph filename.xginside TCL scripts, xgraph can be written like this exec xgraph filename.xg -geometry 500×500 if there are more xgraph files then, exec xgraph filename1.xg -geometry 500×500 & exec xgraph filename2.xg -geometry 500×500 & The ambersand is mandatory to popup all the graph windows, if & (ambersand) is not there, then only the last xgraph window will be popped up.Sample xgraph file and its contents /*** The xgraph file shows the information about the overhead with size of the network, Overhead is compared with four routing protocols like AODV, DSR, D…
This post shows you the method to install the LEACH protocol developed by MIT called MIT-uAMPS which was developed in the year 2000. So you may face some problem in installing this protocol in recent Operating Systems.
I have tried to compile this protocol in ns-2.35 which was running under Ubuntu 14.04 64 bit OS
Here is the requirement before you proceed to install.
Assuming that you have successfully installed ns-2.35 before you start compiling LEACH. If you need any help in installing ns2, refer this post. http://www.nsnam.com/2014/11/ns2-installation-in-ubuntu-1404.html
Install gcc-4.4 and g++-4.4 for compiling this LEACH (but the recommended is gcc-4.3 but it is not there in the synaptic package manager)To install the above, first you tries these packagessudo apt-get update sudo apt-get install build-essential autoconf automake libxmu-dev gcc-4.4 g++-4.4After installing these packages, download the mit-leach-patch here.
Please see the video for more instructions