Search This Blog

Xgraph and AWK Scripts in NS-2

Labels: , ,

AWK scripts (.awk), which are used to extract the necessary information from trace files (.tr) are also useful to plot graphs using Xgraph (.xgr) utility of NS-2. However, the AWK scripts that are used to plot graphs differ from the AWK scripts that just print the values on the terminal.

I will try to explain the difference between these two types of AWK scripts with the help of an example. Assume that we have designed a tcl script named “energy.tcl” which simulates a network for 100 seconds. We run this tcl script with the following command:

ns energy.tcl

After executing the tcl script we get a trace file (.tr) and a NAM file (.nam) i.e. “energy.tr” and “energy.nam”. Now we may have two scenarios as explained below:

1. We want the value of residual (remaining) energy of a node at the end of the simulation. (Here graph of Time v/s Residual energy is not required).

2. We want the value of residual (remaining) energy of a node at each instance of time i.e from beginning of the simulation to the end of the simulation. (Time v/s Residual energy graph is required to observe the decrease in the total energy of a node).

For both of the above mentioned scenarios we need to design two different AWK scripts. However, the main logic to calculate the residual energy will remain the same. Only the way we print the values differs.

Let scen1.awk be the awk file for first scenario and scen2.awk be the awk file for second scenario. scen1.awk should be designed such that when we run it by using the following command:

awk  -f  scen1.awk  energy.tr

it should print the residual (remaining) energy of a node on the terminal.

And scen2.awk should be designed such that when we run it by using the following command:

awk  -f  scen2.awk  energy.tr  >  energy.xgr

it should print two values in “energy.xgr”: time and residual (remaining) energy of a node.

If you open “energy.xgr” you will notice that there are two columns created. In first column, values related to “time” are printed and in another column values related to “residual energy” are printed. The values in first column form X-axis of the graph and the values in second column form Y-axis of the graph (thus you get a graph of Time v/s Residual Energy). Give the following command to see the graph:

xgraph  energy.xgr

Default background color of the graph is grey. If you want a graph with background color as white, give the following command:

xgraph  energy.xgr  -bg  white

Other options (like changing background colors, plotting bar graphs, etc) related to Xgraph are available in the pdf file given below:


Hope it helps.

Regards,
Mohit P. Tahiliani

[Latest Update] You can also check the latest Automated Post Processing (APP) Tool which works based on AWK Scripts and automatically plots the graphs.

Here is the link to APP Tool's blog post:

http://mohittahiliani.blogspot.in/2014/10/automated-post-processing-app-tool-for.html 

Related Blogs: 

Comments (338)

«Oldest   ‹Older   1 – 200 of 338   Newer›   Newest»

I am doing the project on"performance comparision of AODV,DSR & DSDV in adhoc and hybrid networks using NS2" using the performance metrics are packet delivery ratio,routing overhead,path optimality and end-to-end delay.Can you help me how to include these metrics into my code for AODV,DSR & DSDV protocols.
Thanks
From
Rama Krishna.V

hello mohit

i used ur awk script genthroughput.awk,and try it to get in .xgr as an xgraph file.
then it is generating the following error.........
Error in file `out.xgr' at line 1:
Unknown line type
Problems found with input data.
could u plz tell me ,why it is not working?

@Rama: AWK Scripts to calculate packet delivery fraction and average end-to-end delay are provided in this blog. You can download them and run them by using the command given in this post to obtain the necessary values.

@VijayalakshmiL genthroughput.awk is not designed to print the values according to the format used by .xgr files. Hence it is giving you the error. Try using the following command to get values

awk -f genthroughput.awk yourfilename.tr

Hope it helps.

Regards,
Mohit P. Tahiliani

where do we write these commands? is it in the tcl file or in the terminal window?

@Srinivas: Both ways are possible. You can include these commands in TCL script and run it directly in the terminal window as well. The only difference is if you include it in TCL script, as soon as you run the script...these commands will also execute and display the graphs (e.g.: like NAM opens). If you do not include it in TCL script you have to manually execute them on the terminal window to see the graphs.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi Mohit! I've downloaded all your awk file, but i can't see the second scenario of awk file (instance of time)you talking. Can you show me some example or awk file belong to this type of what i have to modify on your files to do this? I really need it. Many thanks!

hello Sir,
I had earlier asked u abt SIP protocolpatch, do you know any other patch.
Can u suggest some QoS parameters for wired scenarios, also plz provide some links for awk scripts for wired scenarios.

Jitter is only possible if two or more different types of traffic are there....is this correct....??

Plz giv some idea to prepare awk script for wired scenario, or straight away suggest any file if u r having...!

my friends from pune had visited a seminar this july at gujarat, from there i came to know about you, u had really done a very sincere effort in this field. gr8 work.

Here is an example of my trace file....

v 1 eval {set sim_annotation {Registering alice@atlanta.com}}
+ 1 7 3 SIP 300 ------- 0 1.1.1.0 1.0.1.0 -1 0
- 1 7 3 SIP 300 ------- 0 1.1.1.0 1.0.1.0 -1 0
r 1.0124 7 3 SIP 300 ------- 0 1.1.1.0 1.0.1.0 -1 0
+ 1.0124 3 1 SIP 300 ------- 0 1.1.1.0 1.0.1.0 -1 0
- 1.0124 3 1 SIP 300 ------- 0 1.1.1.0 1.0.1.0 -1 0
r 1.0248 3 1 SIP 300 ------- 0 1.1.1.0 1.0.1.0 -1 0
+ 1.0248 1 5 SIP 300 ------- 0 1.1.1.0 1.0.1.0 -1 0
- 1.0248 1 5 SIP 300 ------- 0 1.1.1.0 1.0.1.0 -1 0
r 1.0372 1 5 SIP 300 ------- 0 1.1.1.0 1.0.1.0 -1 0
+ 1.0372 5 1 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 1
- 1.0372 5 1 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 1
r 1.0492 5 1 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 1
+ 1.0492 1 3 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 1
- 1.0492 1 3 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 1
r 1.0612 1 3 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 1
+ 1.0612 3 7 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 1
- 1.0612 3 7 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 1
r 1.0732 3 7 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 1
v 1.1000000000000001 eval {set sim_annotation {Registering bob@biloxi.com}}
+ 1.1 8 4 SIP 300 ------- 0 2.1.1.0 2.0.1.0 -1 2
- 1.1 8 4 SIP 300 ------- 0 2.1.1.0 2.0.1.0 -1 2
r 1.1124 8 4 SIP 300 ------- 0 2.1.1.0 2.0.1.0 -1 2
+ 1.1124 4 2 SIP 300 ------- 0 2.1.1.0 2.0.1.0 -1 2
- 1.1124 4 2 SIP 300 ------- 0 2.1.1.0 2.0.1.0 -1 2
r 1.1248 4 2 SIP 300 ------- 0 2.1.1.0 2.0.1.0 -1 2
+ 1.1248 2 6 SIP 300 ------- 0 2.1.1.0 2.0.1.0 -1 2
- 1.1248 2 6 SIP 300 ------- 0 2.1.1.0 2.0.1.0 -1 2
r 1.1372 2 6 SIP 300 ------- 0 2.1.1.0 2.0.1.0 -1 2
+ 1.1372 6 2 SIP 250 ------- 0 2.0.1.0 2.1.1.0 -1 3
- 1.1372 6 2 SIP 250 ------- 0 2.0.1.0 2.1.1.0 -1 3
r 1.1492 6 2 SIP 250 ------- 0 2.0.1.0 2.1.1.0 -1 3
+ 1.1492 2 4 SIP 250 ------- 0 2.0.1.0 2.1.1.0 -1 3
- 1.1492 2 4 SIP 250 ------- 0 2.0.1.0 2.1.1.0 -1 3
r 1.1612 2 4 SIP 250 ------- 0 2.0.1.0 2.1.1.0 -1 3
+ 1.1612 4 8 SIP 250 ------- 0 2.0.1.0 2.1.1.0 -1 3
- 1.1612 4 8 SIP 250 ------- 0 2.0.1.0 2.1.1.0 -1 3
r 1.1732 4 8 SIP 250 ------- 0 2.0.1.0 2.1.1.0 -1 3
v 5 eval {set sim_annotation {alice@atlanta.com starts session to bob@biloxi.com}}
+ 5 7 3 SIP 800 ------- 0 1.1.1.0 1.0.1.0 -1 12
- 5 7 3 SIP 800 ------- 0 1.1.1.0 1.0.1.0 -1 12
r 5.0164 7 3 SIP 800 ------- 0 1.1.1.0 1.0.1.0 -1 12
+ 5.0164 3 1 SIP 800 ------- 0 1.1.1.0 1.0.1.0 -1 12
- 5.0164 3 1 SIP 800 ------- 0 1.1.1.0 1.0.1.0 -1 12
r 5.0328 3 1 SIP 800 ------- 0 1.1.1.0 1.0.1.0 -1 12
+ 5.0328 1 5 SIP 800 ------- 0 1.1.1.0 1.0.1.0 -1 12
- 5.0328 1 5 SIP 800 ------- 0 1.1.1.0 1.0.1.0 -1 12
r 5.0492 1 5 SIP 800 ------- 0 1.1.1.0 1.0.1.0 -1 12
+ 5.0492 5 1 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 13
- 5.0492 5 1 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 13
+ 5.0492 5 1 SIP 800 ------- 0 1.0.1.0 2.0.1.0 -1 14
- 5.0512 5 1 SIP 800 ------- 0 1.0.1.0 2.0.1.0 -1 14
r 5.0612 5 1 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 13
+ 5.0612 1 3 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 13
- 5.0612 1 3 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 13
r 5.0676 5 1 SIP 800 ------- 0 1.0.1.0 2.0.1.0 -1 14
+ 5.0676 1 0 SIP 800 ------- 0 1.0.1.0 2.0.1.0 -1 14
- 5.0676 1 0 SIP 800 ------- 0 1.0.1.0 2.0.1.0 -1 14
r 5.0732 1 3 SIP 250 ------- 0 1.0.1.0 1.1.1.0 -1 13
....................................................
why $8(flow_id, after the flag) is always zero...?
why the(seq_no, second last) is always -1...?

This trace file is generated for wired scenario in which the user agents communicates with each other via sip packets.

TOPOLOGY: 5---------1------------0-----------2----------6
It is not coming properly in diagram, actually 1 is connected to 7 via 3, like
1------3-------7
2------4-------8

0,1,2,3,4 arethe intermediate routers.
5 & 6 are the proxy servers.
7 & 8 are the user agents that communicate.

@Dong - You can find that type of AWK Script on the following link:

http://mohit.ueuo.com/AWK_Scripts.html

Name - Plotting a Congestion Window (Wired)

@Vaibhav - Some AWK Scripts for Wired Networks to calculate delay, jitter and packet loss rate are available on the following link:

http://140.116.72.80/~smallko/ns2/tool_en.htm

Hope it helps.

Regards,
Mohit P. Tahiliani

Thank you for reply. But it's not simple like that. I have a tcl file (script-olsr-etx.tcl)with new trace format from olsr patch and an awk file calculating normalized routing load :
BEGIN{
recvs = 0;
routing_packets = 0;
}

{
if (( $1 == "r") && ( $35 == "cbr" ) && ( $19=="AGT" )) recvs++;
if (($1 == "s" || $1 == "f") && $19 == "RTR" && $35 =="OLSR" routing_packets++; # 1
}

END{
printf("NRL = %.3f", routing_packets/recvs);
}
With those file, would you please tell me where can I put time index ($1) to have NRL's instance of time?
I really appreciate your help!
Best regards!

hello sir
i am doing a protocol comparison for comparing aodv,dsr and dsdv..i have the tcl script and awk script for calculating the packet delivery ratio in the terminal.i need a awk script for generating the xgraph for the same.pls help me.

thanks and regards

@Dong - You just need to cut the following statement

printf("NRL = %.3f", routing_packets/recvs);

and paste it after the following line

if (($1 == "s" || $1 == "f") && $19 == "RTR" && $35 =="OLSR" routing_packets++; # 1

i.e. before the brace } closes.

Leave END as blank. It should work.

@Haripriya - You can modify the awk script that you have for packet delivery ratio such that it prints the values in two columns (first column containing "time" and second column containing "packet delivery ratio".

After modifying use the set of commands given in the blog above to plot the graph.

Hope it helps.

Regards,
Mohit P. Tahiliani

HI SIR,

WE R WORKING ON THE AODV PROTOCOL,CAN U HELP ME FOR SOME AWK SCRIPTS OF (1)Average end-to-end delay of data packets
(2)Throughput
(3)Packet delivery Fraction (PDF)
(4)Data Packet Loss
FOR THE EXAMPLE WHICH U HAV MENTIONED IN YOUR BLOG FOR 4NODES.........

WILL BE VRY THANKFULL....


REGARDS
ASIT & DEEPAK

Thank you so much. But can you show me how I can print the "time"? For new trace format i place time in the command like that :
printf("%.9f %.3f \n", $3,routing_packets/recvs);
But the problem is that time in here is duplicated in the result file like (maybe due to calculating delay):
80.080000000 2.505
80.080000000 2.505
80.080000000 2.505
80.080000000 2.505
80.080000000 2.505
80.080000000 2.505
80.080000000 2.505
80.080000000 2.505
80.080000000 2.505
80.080000000 2.505
80.080000000 2.505
80.080000000 2.505
80.082338891 2.502
80.114658481 2.503
80.116100126 2.501
80.117982429 2.501
80.117982429 2.501
80.117982429 2.501
80.117982429 2.501
80.117982429 2.501
80.117982429 2.501
80.117982429 2.501

Have you ever seen that problem before? If yes help me solve it please! Thanks in advance!
Best Regards!

hi, I am doing the performance comparison of AODV and DSR routing protocols in term of energy consumption by NS2. can any body help me by some codes to get the energy of nodes and analyzing their trace file? thanks in advance

Sir ,
you are working on WSN(it seems so) i don't know much about WSN just know a little bit of "cluster head selection algorithm" ( LEACH and PEACH)
but i found your blog fantastic .... to press follow is the act in mind ryt nw

@Dong - If you just want to print time, give printf("%.9f \n",$3); in the main loop of your code.

@Mehdi - You can find a sample TCL script named "wireless-newnode-energy.tcl" in the following directory:

ns-allinone-2.xx/ns-2.xx/tcl/ex

and to analyze the trace file, use the following link:

http://www.isi.edu/ilense/software/smac/ns2_energy.html

See section named "Energy Analysis Through Trace Files" on the above link.

Hope it helps.

Regards,
Mohit P. Tahiliani

@Asit & Deepak - You can find the AWK scripts of same parameters on the following link:

http://mohittahiliani.blogspot.com/2010/02/few-more-awk-scripts-for-ns2.html

Hope it helps.

Regards,
Mohit P. Tahiliani

MOHIT: "Some AWK Scripts for Wired Networks to calculate delay, jitter and packet loss rate are available on the following link:

http://140.116.72.80/~smallko/ns2/tool_en.htm"
I try to use those script, but i was wondering can it works for UDP as well as TCP? and for how many traffic agents it is valid?
Thank you, please do reply me asap.

@Bahareh - Yes, the scripts provided on that link work for UDP as well as TCP and are independent of the number of traffic agents.

Hope it helps.

Regards,
Mohit P. Tahiliani

hi
i need to compare protocols output on xgraph.
i am having xgraphs for AODV,DSDV and GPSR i need their performance evaluation on 1 graph.
how can i do that

@Shaveta - Assuming you have named xgraph files of AODV, DSDV and GPSR as aodv.xgr, dsdv.xgr and gpsr.xgr respectively. Give the following command to plot them in the same window:

xgraph aodv.xgr dsdv.xgr gpsr.xgr

Hope it helps.

Regards,
Mohit P. Tahiliani

hi sir,

thanx for initial support....

presently we are working on the AODV performance measure(pdf,routing overhead,dpr and delay).we have generated the awk scripts and calculated the above parameters for different -2 scenaio varying the no. of nodes,pause time and some other factors. Now we want to plot the xgraph b/w pdf and no. of nodes and other above parameters.what should we next to do...???

i m pasting here my awk script

BEGIN {

sends=0;

recvs=0;

droppedBytes=0;

droppedPackets=0;

sum=0;

recvnum=0;

routing_packets=0.0;

}


{
time = $3;
packet_id = $41;


# CALCULATE DELAY

if ( start_time[packet_id] == 0 ) start_time[packet_id] = time;

if (( $1 == "r") && ( $35 == "cbr" ) && ( $19=="AGT" )) { end_time[packet_id] = time; }

else { end_time[packet_id] = -1; }


# CALCULATE PACKET DELIVERY FRACTION

if(( $1 == "s")&& ( $35 == "cbr" ) && ( $19=="AGT" )) { sends+=1; }


if(( $1 == "r")&& ( $35 == "cbr" ) && ( $19=="AGT" )) { recvs+=1; }


# DROPPED PACKETS

if (( $1 == "d" ) && ( $35 == "cbr" ) && ( $3 > 0 ))

{
droppedBytes=droppedBytes+$37;
droppedPackets=droppedPackets+1;
}


# CALCULATE TOTAL OVERHEAD

if (($1 == "s" || $1 == "f") && $19 == "RTR" && $35 =="AODV") routing_packets++;
}

END
{

for ( i in end_time )

{
start = start_time[i];
end = end_time[i];

packet_duration = end - start;

if ( packet_duration > 0 )

{ sum += packet_duration;
recvnum++;
}
}



delay=sum/recvnum;



printf("Delay(ms)= %.2f\n",delay*1000);

NRL = (routing_packets/recvs)*100;

#normalized routing load


printf("Routing Overhead(%) = %.2f\n",NRL);

PDF = (recvs/sends)*100;
printf("PDF (or PDR) = %.2f\n",PDF);


DPR = (droppedPackets/sends)*100;


printf("DPR = %.2f\n", DPR);
}


regards
Asit & deepak varshney

Sir,
I am using NS2.34 in fedora13 i could not run xgraph utilty i generated .xgr file using the AWK script but when i give xgraph the error is like

[Pavithra@localhost ns-2.34]$ awk -f droppacket.awk 1_out.tr >1_out.xgr
[Pavithra@localhost ns-2.34]$ xgraph 1_out.xgr
Command not found. Similar command is: 'graph

i have added the following lines to ~/.bashrc file

export PATH=$PATH:”/opt/ns-allinone-2.34/bin:/opt/ns-allinone-2.34/tcl8.4.18/unix:/opt/ns-allinone-2.34/tk8.4.18/unix”
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:”/opt/ns-allinone-2.34/otcl-1.13:/opt/ns-allinone-2.34/lib”
export TCL_LIBRARY=$TCL_LIBRARY:”/opt/ns-allinone-2.34/tcl8.4.18/library”

please can you help me to make out this.

@Asit - As explained in above blog - if your requirement is similar to Scenario 1 - take the values printed by your AWK script and use any tool to plot graphs (e.g. MS Excel, etc). If your requirement is similar to Scenario 2 - cut the printf statements from where they are written now and paste them in their appropriate loops in your AWK script (e.g. printf statement related to Total overhead should be placed in that loop).

@Pavithra - Give the following command in ns-allinone-2.34/xgraph folder

./configure
make clean
make
make install

Hope it helps.

Regards,
Mohit P. Tahiliani

Sir for make i got the following error,
[root@localhost xgraph-12.1]# make clean
test -z "xgraph" || rm -f xgraph
rm -f *.o core *.core
[root@localhost xgraph-12.1]# make
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -c xgraph.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -c xgX.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -c hard_devices.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -c dialog.c
dialog.c: In function ‘make_msg_box’:
dialog.c:780: warning: passing argument 2 of ‘getline’ from incompatible pointer type
/usr/include/stdio.h:673: note: expected ‘size_t * __restrict__’ but argument is of type ‘char *’
dialog.c:780: error: too few arguments to function ‘getline’
dialog.c: In function ‘getline’:
dialog.c:899: error: argument ‘lptr’ doesn’t match prototype
/usr/include/stdio.h:673: error: prototype declaration
dialog.c:899: error: number of arguments doesn’t match prototype
/usr/include/stdio.h:673: error: prototype declaration
make: *** [dialog.o] Error 1
[root@localhost xgraph-12.1]#

Hello sir,

my project titles "adaptation of DSR for multimedia input for MANET" ...i am running a code for dsr.tcl... it simulates fine and is shown in NAM ... however i get a error of Unknown file type wen i try to run xgraph... i reinstalled the xgraph package ,yet no help.. any suggestions ??

Dear Mohit,
Please help me following error :

awk : measure-loss.awk:1: BEGIN {
' error in expression: ^invalid char'
[root@...root]# Problems found with input data
p/s : I have installed all packets, if not please tell me which packet I should install.
Wish your reply. You can reply me at here or via my email (phathienhung@gmail.com).
Thank you so much !
Best regards,
phathienhung

@Pavithra - The solution to that problem is available on the following link:

http://www.linuxquestions.org/questions/linux-newbie-8/problem-in-installing-xgraph-12-1-in-fedora-for-ns-2-34-a-862233/

@Akshat - For which parameter you are trying to plot the graph? Open .xgr file and verify it has exactly 2 columns.

@Tran - As explained in the blog above, make sure your .xgr file has exactly 2 columns.

Hope it helps.

Regards,
Mohit P. Tahiliani

Dear Mohit,

can you please check if you still have the "Calculating total number of dropped packets, average throughput, average end-to-end delay and node energy consumption (Wireless)" script. If so, can you please re-put it into you website because I could not download it..It says that the page is not found!

Thank You!

Dear Mohit,
When waiting for your reply, I fixed the error. My .xgr file has several columns.
Thank you for your blog. your blog is great for beginners as me :)
p/s : can you give me your email address ? I'm doing my master thesis about handover and have something I being ambigous. I think only you can help me.
My email address : phathienhung@gmail.com
Thank you so much !
Best regards,
phathienhung.

dear sir


thanx a lot...
can u tell me how to create yhe .xgr file from my awk scripts.....dnt have any idea....plz sir its only 10 days remained for my project submission and still i have to plot xgraph.......


regards

ASIT KUMAR SINGH

@Asit : As the blog above mentioned, at command line you type :
awk -f file.awk file.tr > file.xgr
then you run xgraph at command line :
xgraph file.xgr

Hope it helps,
regards,
phathienhung

please tell me the location from where I can get the awk scen1.awk file for calculating the value of residual (remaining) energy of a node at the end of the simulation. (Here graph of Time v/s Residual energy is not required).also scen2.awk for calculating the value of residual (remaining) energy of a node at each instance of time i.e from beginning of the simulation to the end of the simulation. (Time v/s Residual energy graph is required to observe the decrease in the total energy of a node).

Sir,
Can you please send the tcl and awk script for recording the nodes energy for AODV.



Thanks,
Janani

sir,
i want tcl script for energy efficiency and resilience.i am using a authentication protocol

@Sachin - AWK file similar to scen2.awk can be downloaded from the following link:

http://www.megaupload.com/?f=0211SAG1

You can easily modify it to make it of scen1.awk type by including printf statement within the loop.

@Janani & Samantha - You can find the TCL script named "wireless-newnode-energy.tcl" in the following directory:

ns-2/tcl/ex

and AWK script on the following link:

http://www.megaupload.com/?f=0211SAG1

Hope it helps.

Regards,
Mohit P. Tahiliani

Dear sir

i am trying to compare the routing protcol for manet. i want to draw the graph between the packet delivery vs pause time,throughput vs pause time, control overhead vs pause time. the awk script provide by you gives me the a single avg. value. how the graph for the above metrics can be drawn wrt to pause time. will u please sugeest me the necessary modification in awk scripts.

SACHIN

Hi Sir,
Can u plz tell me how to add delay over wireless node..

Pragati

hello sir,
i am doing my UG i CSE .now am in project phase.i am very much interested in NS 2. so i like to do my project titled"DCCP-based multiple retransmission technique using geometrical progression".So Please help me for do my project.Please send the coding & execution part to my Mailid.Please sir am tamil medium student.now am unable to do anything in My project.please help me for my future.My mail id is mail2ska@gmail.com

@Sachin - You can try plotting it manually by using MS Excel or any other tool. For every value of pause time, note down pdf, throughput, delay, etc and plot it.

@Pragati - Give the following command:

LL set delay_ 25us (you can chose the required value instead of 25)

For more details see: ns-2/tcl/ex/wireless.tcl

@Suresh - DCCP is now available in the basic ns-2 package of ns-allinone-2.35. Try installing it and working with some basic TCL scripts.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello Sir,

I am planning to utilize the reserved bit field in the RREQ and RREP packets of AODV.
Please let me know how to accomplish it in NS2

Dear Mohit,

There any command to monitor a packet in NAM (not click on animated packet)?
For example, I want to monitor packet 6440, which command I will to monitor?
If so, where I put that command into ? tcl code or...

Thank you.
Best regards,
phathienhung.

The AWK script " Calculating total number of dropped packets, average throughput, average end-to-end delay and node energy consumption (Wireless)" points to a broken link. Is there any other place to download the awk script for the same.

Thanks

vivek

@Sena - You need to create a new variable in aodv_packet.h file (available in ns-2/aodv directory) that corresponds to the bit you want to utilize (e.g.: see ecn and eln bits in tcp packet).

@Tran - I have not come across any such command so I am not sure. However, you can use .nam file (open in an editor rather than as an executable) to get more information regarding any packet e.g. packet 6440.

@Vivek - I am trying to remove unnecessary code from that AWK script and will upload it soon.

Hope it helps.

Regards,
Mohit P. Tahiliani

Thanks a ton Mohit.

hi mohit


using your packet delivery awk script on my wireless trace file
i have used the command packetdelivery.awk wireless1.tr > wireless1.xgr this then just outputs a file with a print of the packet delivery statistics. how do i get an xgraph file?

and if i try to open the .xgr file with xgraph i get an error

Error in file `wireless1.xgr' at line 1:
Unknown line type
Problems found with input data.

any help would be very appreciated

regards

@Stueeeb - AWK scripts provided on my blog can be used only to obtain values on the terminal (one of the cases explained above). You cannot directly use them to plot graphs. You need to modify packet delivery ratio AWK script so as to plot graphs OR using the scripts provided in this blog you can note down the values and print graphs manually by using any other tool such as gnuplot, MS Excel, etc.

Hope it helps.

Regards,
Mohit P. Tahiliani

Dear Mohit,

I am not getting any packet loss, i have already sent u a TCL script.. can u suggest me what to do please????

@ mohit how would i go about modifying the packet delivery ratio AWK script?

many thanks

stueeeb

@Stueeeb - To get a graph you need to put a printf statement inside a loop and print two values - one for time and another for packet delivery ratio. Sample AWK script of that type is available on the following link:

http://mohit.ueuo.com/AWK_Scripts.html

Name: Plotting a Congestion Window

OR

energy.awk available on the following link:

http://www.megaupload.com/?f=0211SAG1

Hope it helps.

Regards,
Mohit P. Tahiliani

@mohit how would i go about creating a loop? do i need an if statement if so what would the if statement consist of?

many thanks

stueeeb

dear mohit,
i have a project that consist in a comparaison between wifi and ad-hoc network with using tcp and udp protocole... i'm using fedora 10 and ns 2.31... firstlu could you give me the appropriate command to visualise the .nam file... and how to excute the code file, in other words, how could i make the "run" of my program... thanks very much in advance

@Stueeeb - Yes you need "if" or any other loop. But note one thing that PDF is a parameter which is generally computed only at the end of the simulation. This is because it is a ratio of total packets received / total packets sent * 100. Hence as far as I think, it wont be much useful to calculate PDF at every instance of time. But if your scenario requires calculating it at every instance of time - then yes, you need to introduce a loop in the AWK script.

@Oumayma - To execute a TCL script use following command:

ns filename.tcl

To visualize NAM file use:

nam filename.nam

Commands to execute AWK Scripts and Xgraph are mentioned in the blog above.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi Mohit ,


I am trying to change the code in dsragent.cc and dsragent.h for malicious node. when I run ./install the errors are

dsr/dsragent.cc: In member function ‘void DSRAgent::handleFlowForwarding(SRPacket&, int)’:
dsr/dsragent.cc:838: warning: unused variable ‘srh’
dsr/dsragent.cc:841: warning: unused variable ‘amt’
dsr/dsragent.cc: At global scope:
dsr/dsragent.cc:863: error: expected constructor, destructor, or type conversion before ‘(’ token
dsr/dsragent.cc:869: error: expected unqualified-id before ‘if’
dsr/dsragent.cc:883: error: expected unqualified-id before ‘if’
dsr/dsragent.cc:892: error: expected constructor, destructor, or type conversion before ‘->’ token
dsr/dsragent.cc:893: error: expected constructor, destructor, or type conversion before ‘.’ token
dsr/dsragent.cc:894: error: expected constructor, destructor, or type conversion before ‘.’ token
dsr/dsragent.cc:895: error: expected declaration before ‘}’ token
dsr/dsragent.cc:95: warning: ‘dsr_salvage_max_attempts’ defined but not used
dsr/dsragent.cc:100: warning: ‘dsr_salvage_max_requests’ defined but not used
dsr/dsragent.cc:105: warning: ‘dsr_salvage_allow_propagating’ defined but not used
dsr/dsragent.cc:321: warning: ‘bool BackOffTest(Entry*, Time)’ defined but not used
make: *** [dsr/dsragent.o] Error 1
Ns make failed!


Could you please help me if I have used the code in right place???

The changes I have done to dsragent.h and dsragent.cc

In dsragent.h declare if node is malicious


// will eventually need to handle multiple infs, but this is okay for
// now 1/28/98 -dam
ID net_id, MAC_id; // our IP addr and MAC addr
NsObject *ll; // our link layer output
CMUPriQueue *ifq; // output interface queue
Mac *mac_;
bool = malicious;
// extensions for wired cum wireless sim mode
MobileNode *node_;
int diff_subnet(ID dest, ID myid);




In dsragent.cc I added


int
DSRAgent::command(int argc, const char*const* argv)
{
TclObject *obj;

if (argc == 2)
{
if (strcasecmp(argv[1], "testinit") == 0)
{
testinit();
return TCL_OK;
}
if (strcasecmp(argv[1], "reset") == 0)
{
Terminate();
return Agent::command(argc, argv);
}
if (strcmp(arg[1], "hacker")==0) {
malicious=true;
return TCL_OK;
}
}


In dsragent.cc Here I added malicious check to process coming packets, to check if it is a route reply, route request, error etc.

if (srh->route_request())
{ // propagate a route_request that's not for us
handleRouteRequest(p);
}
else
{ // we're not the intended final recpt, but we're a hop

handleForwarding(p);
malicious =false;
}
}


Dropping the packets

void
DSRAgent::handleFlowForwarding(SRPacket &p, int flowidx) {
hdr_sr *srh = hdr_sr::access(p.pkt);
hdr_ip *iph = hdr_ip::access(p.pkt);
hdr_cmn *cmnh = hdr_cmn::access(p.pkt);
int amt;

assert(flowidx >= 0);
assert(!srh->num_addrs());

cmnh->next_hop() = flow_table[flowidx].nextHop;
cmnh->addr_type() = ::IP;

cmnh->xmit_failure_ = XmitFlowFailureCallback;
cmnh->xmit_failure_data_ = (void *) this;

// make sure we aren't cycling packets
//assert(p.pkt->incoming == 0); // this is an outgoing packet
assert(cmnh->direction() == hdr_cmn::UP);

if (!iph->ttl()--) {
drop(p.pkt, DROP_RTR_TTL);
p.pkt = 0;
return;
}
if (malicious == true){
drop(p, DROP_RTR_ROUTE_LOOP);
//DROP_RTR_ROUTE_LOOP is added for no reason
}

Thank you
Sandhya Prathikantham

@Sandhya - Cross verify the modifications that you made in DSR with respect to the modifications shown in AODV on the following link:

http://elmurod.net/?p=196

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello Mohit
I am doing a project on TEACH protocol.I need to plot a graph-'No. of alive nodes vs round number...No. of alive nodes are stored in a variable 'A'...I am able to calculate No. of alive nodes in each round and display it on terminal...unable to plot it....Pls suggest me with the proper ns2 command.
Thank you

hello sir,
can you plz tell me how to write awk script to extract "s" "r" "d" value of trace file into a .dat file for plotting graphs???

@Raghavendra - Re-direct the values which are printing on the terminal in a new file say "filename.xgr". To plot a graph give the following command

xgraph filename.xgr

@Rahul - You can initialize three variables in BEGIN loop of the AWK script to calculate sent, received and dropped packets respectively. When the corresponding event occurs, increment the counter. At the end, print the value in END loop of the script.

BEGIN {
count_sent = 0;
count_received = 0;
count_dropped = 0;
}
{
if ($1 == "s") {
count_sent++;
} . . . similarly for received and dropped.

Finally print these values.

I have not worked with .dat file so not much idea on that part :)

Hope it helps.

Regards,
Mohit P. Tahiliani

hi, i'm using 802.11b wireless with vbr ... the problem is that when i calculate the rate of loss the result is < 0 ... can you help me how to use the vbr and a simple explination about trace file plz... or just a code for 801.11b and i'lll try it...
so thankfull

@Oumayma - Trace file interpretation is nicely explained on the following link:

http://www.cs.binghamton.edu/~kliu/

and how to configure 802.11a,b,g in NS-2 is explained in Question #6 on the following link:

http://www.cpe.ku.ac.th/~aphirak/myweb/wpress/2009/09/26/%E0%B8%9A%E0%B8%B1%E0%B8%99%E0%B8%97%E0%B8%B6%E0%B8%81-ns2-faq-%E0%B8%88%E0%B8%B2%E0%B8%81%E0%B9%80%E0%B8%A7%E0%B9%87%E0%B8%9A-httpweb-syr-edudchen02faq-txt

Hope it helps.

Regards,
Mohit P. Tahiliani

thanku so much.... :)
this article was really a gr8 help for my project. :)

how i get the awk file for BER..i have to plot BER vs SNR plot in ns2..can i plot it with the help of xgraph? How? please give me any idea for both awk file and xgraph..

Hi
Below is my tracefile while is i think the old format tracefile
0.500095000 _0_ MAC --- 0 AODV 106 [0 ffffffff 0 800] ------- [0:255 -1:255 30 0] [0x2 1 1 [5 0] [0 4]] (REQUEST)
r 0.500943471 _1_ MAC --- 0 AODV 48 [0 ffffffff 0 800] ------- [0:255 -1:255 30 0] [0x2 1 1 [5 0] [0 4]] (REQUEST)
r 0.500943745 _2_ MAC --- 0 AODV 48 [0 ffffffff 0 800] ------- [0:255 -1:255 30 0] [0x2 1 1 [5 0] [0 4]] (REQUEST)
r 0.500968471 _1_ RTR --- 0 AODV 48 [0 ffffffff 0 800] ------- [0:255 -1:255 30 0] [0x2 1 1 [5 0] [0 4]] (REQUEST)

i am using genthroughput.awk for throughput
Average Throughput[kbps] = -0.00 StartTime=400.00 StopTime=0.00

throughput is zero although Packet Size is 1000
so please tell me whats the problem?

@Rohit - Sorry I have not tried that :). If I come across any information related to it I will upload it here!

@Umair - Yes your trace file format is an old trace format. Check once from your trace file whether data packets are received successfully at Application layer at the receiver or not since the lines in your trace file (which you posted in my another blog) show sending and receiving only at Network and MAC layer.

Hope it helps.

Regards,
Mohit P. Tahiliani

hi, i downloaded totalpacketssent.awk and totalpacketsreceived.awk from this blog... when i apply it on my trace file for aodv,dsr,dsdv for 6 nodes, the result comes 0.... why is it coming??

@Shruti - Check whether your trace format is an old trace format or not because these scripts are designed only for old trace format. Moreover, these scripts were designed for a specific scenario and hence source node ids and destination node ids are manually written. You need to change them according to your scenario.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi
I am having problem while running e2edelay file
awk: e2edelay.awk:92: (FILENAME=simple.tr FNR=1096) fatal: division by zero attempted
I guess count in the loop is not increasing
please help me asap

@Umair - e2edelay.awk is designed to be used with TCP. If you are using UDP in your simulation you need to replace "tcp" by "cbr" in e2edelay.awk.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi Sir,

i am working on adhoc routing protocols. i need ZRP and OLSR in Ns-2.34, is these protocols are prebuild in Ns-2.34 or i have to patch these protocols. if i need to patch where from patches for these protocols will be available and how to patch them.

regards.

@Mohit - what to add in a loop in throughput.awk and e2edelay.awk to calculate the graph at every instance ??

@Babar - ZRP and OLSR are not available in the default allinone package of NS-2. You need to apply patches for simulating these two protocols. ZRP patch for ns-2.33 is available on the following link:

http://magnet.daiict.ac.in/magnet_members/MTech/2007/PatelBrijesh/Simulation.html

and OLSR patch for different versions of NS-2 is available on the following link:

http://masimum.inf.um.es/?Software:UM-OLSR

@Shruti - You need to put printf statement (which is given in the body of END) inside the loop so that it will print values at each instance of time.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi Sir,

Thanks i have patched both protocols.
kindly help for patching TCP_Yeah In NS 2.34, i have patched Fast-TCP but can not find TCP_Yeah source for patching.

i have to simulate multimedia & VoIP traffic over SCTP agent in NS 2 how i can use multimedia & VoIP traffic in NS 2.


regards.

@Babar - YeAH TCP is available in the default package of NS-2. You need not apply patch for it. You can find the source code of YeAH in the following directory:

ns-allinone-2.34/ns-2.34/tcp/linux/src

For generating Multimedia traffic you may either use CBR and vary its interval_ parameter accordingly or you can also use RealAudio. See the default values of RealAudio in

ns-allinone-2.34/ns-2.34/tcl/lib/ns-default.tcl

Syntax to use RealAudio is

set ra [new Application/Traffic/RealAudio]

For simulating VoIP you may follow the link given below. It provides a VoIP patch for ns-allinone-2.34.

http://cng1.iet.unipi.it/wiki/index.php/Ns2voip++

Hope it helps.

Regards,
Mohit P. Tahiliani

Thanks Sir Mohit,

i have downloaded patches for VoIP and your blog help me alot. May God bless you and give you health and prosperity.


thanks & regards.

@Mohit- while executing droppackets.awk for dsdv.tcl , error is coming

Segmentation fault (core dumped)

totalpacketssent.awk and totalpacketsreceived.awk are working fine for dsdv.tcl.. what would be the reason??

sir,pls tell me how to run awk command, is it correct way ./analysis file.tr
coz i hav run it, but it says check file.nam in blank, but after that nam animator is not opening,and where to store this ./analysis(awk script)

plsss help

@Shruti - totalpacketssent, totalpacketsreceived and droppackets AWK scripts are designed for specific purpose (e.g. only for specific nodes). You need to modify it as per your requirements.

@Reena - To run AWK script you must the following command:

awk -f filename.awk filename.tr

Read above blog to know more details.

To run NAM file you can use following command:

nam filename.nam

If your simulation is not proper, it will generate an empty NAM file.

Hope it helps.

Regards,
Mohit P. Tahiliani

Dear Sir,
I would like you to send energy.tcl, scen1.awk and scen2.awk if possible. Or if it is available in your wbesite, please tell me how to download this script.
Thanks
Sincerely,
saisaimmz

Hi Mohit,
can u help in the this algorithm, Adaptive competitive on-line routing algorithm ieee 802.16j for wimax multihop relay networks, not able to enough document to write algorithm in c++, plz help me in this regard soon. implementing in C++ with TCL .

with regards
chiru
mail id : chiru.dollar@gmail.com

@Saimmz - You can find a sample TCL script for energy in the following directory:

ns-allinone-2.xx/ns-2.xx/tcl/ex

with name "wireless-newnode-energy.tcl"

AWK Scripts for same can be downloaded from the following link:

http://www.megaupload.com/?f=0211SAG1

@Chiru - WiMAX implementation (802.16j) for NS-2 is available on the following link:

sites.google.com/site/lwxns2/

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi mohit, can you suggest me the modifications i have to do in NS2 to support partially overlapping channels? please respond me as early as possible...I have time constraint...thanks in advance sir.

@Sivaleela - The modifications to support partially overlapping channels are contributed in "Miracle" framework. Following link may be useful:

http://www.hindawi.com/journals/wcn/2010/761792/

Hope it helps.

Regards,
Mohit P. Tahiliani

Thank you so much for your information...i will check it out.....

hi mohit,
This is Zain, i have to implement voip in ns2 using cbrgen.tcl. Voip is already configured in ns2, can you please help me with this.

@Zain - cbrgen.tcl will generate either CBR or FTP traffic. You can simply generate a file with CBR connections and later "Find and Replace" few lines in it related to VoIP.

Hope it helps.

Regards,
Mohit P. Tahiliani

when i run the awk script, animator is not running, as u said simulation is not proper is the reason, so now i hav to again run the simulation? or what else

Pls help

@Reena - I think you have confused AWK with NAM.

To run Network Animator (NAM), you do not have to run AWK script.

Just give the following command after running the TCL Script:

nam filename.nam

(filename.nam must be replaced by the NAM file name which you have given in the TCL Script).

Hope it helps.

Regards,
Mohit P. Tahiliani

hi this is zain again but as i knew that i jst have to use voip as an application instead of cbr in cbrgen.tcl but still its not working.:(

@Zain - Make sure you configure VoIP parameters appropriately after generating the traffic by using cbrgen.tcl. There are few parameters such as interval_, packetSize_ and rate_ which are specific to CBR. You need to replace them by VoIP parameters.

Hope it helps.

Regards,
Mohit P. Tahiliani

hi.. how to differentiate control packets and data packets by seeing the trace file.. for control packet in aodv is it enough to check whether fields
> packet type(It):AODV
> network trace level(nl):RTR

@Varusha - Yes, it is enough to check these two fields to differentiate control packets from data packets in a trace file!

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi Mohit.. thanku for the info and wat is AGT,RTR and MAC.. Wat does the combinations mean from the trace file..

(It) and (nl)
------------------
> AODV and RTR
> cbr and RTR
> cbr and AGT.. how it can be interpreted..

@Varusha - AGT = indicates that the event occurred at Application layer, RTR = indicates that the event occurred at Routing Layer and MAC = indicates event occurred at MAC Layer.

AODV and RTR = indicates event related to AODV occurred at RTR Layer
cbr and RTR = indicates event related to cbr (i.e. data packet) occurred at RTR Layer
cbr and AGT = indicates event related to cbr occurred at AGT Layer.

Follow the link given below to know how to interpret trace files (See Link named "How to interpret the NS2 trace file for wireless simulation"):

http://www.cs.binghamton.edu/~kliu/

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi Mohit..im working on aodv in ns2.i want to find hop count from trace file... also on what basis is aodv in ns2 selecting a particular path to transfer pkts to the mentioned destination?

@Varusha - You may use "god" object available in the mobility pattern (i.e. scenario file) that you generate to find out the exact number of hops between source and destination. Each time source and destination move far (or near), "god" object updates the hop count.

AODV selects the shortest path from source to destination based on least number of hops.

Hope it helps.

Regards,
Mohit P. Tahiliani

I want to know as to how to drop packets in a simple wired scenario tcl in ns2 plz help. jus by using bandwidth and delay values

@Jan - Just by using bandwidth and delay? I guess it can be done only by creating congestion in the network. You can design a Dumbbell topology wherein give bottleneck bandwidth much lower and delay much higher than other links in the network. Sample TCL Scripts for dumbbell topology are available on the following links:

http://nile.wpi.edu/NS/

and

http://www-sop.inria.fr/members/Eitan.Altman/COURS-NS/n3.pdf

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi Mohit.. that was useful & thanku.. then how to create more than one malicious node??.. wat is the command for dropping data packet and control packet separately.. and can u suggest a site which will explain aodv.cc code..

@Varusha - To drop data packets or control packets, you need to call a single function called drop target.

The following link explains the implementation of AODV in NS-2:

www-npa.lip6.fr/~rehmani/aodv_v2.pdf

Hope it helps.

Regards,
Mohit P. Tahiliani

I would like to know how to calculate residual energy for a node in tcl to perform intrusion detection.

zeeshan
can u please give me awk file to calculate energy consumption

@Jisha - Generally residual energy gets printed in the trace file but that will be not of much use to you! You will have to use a variable called "energy_" available in energy-model.cc for your purpose. energy-model.cc is available in the following directory:

ns-allinone-2.xx/ns-2.xx/mobile

@Zeeshan - You can download it from the following link:

http://www.megaupload.com/?f=0211SAG1

Hope it helps.

Regards,
Mohit P. Tahiliani

I tried to run the tcl script wireless-newnode-energy.tcl but it is showing errors. How to run and see the output for this program.

Sir.. Can u pls give me an idea about ns2 coding for configuring dynamic IP in MANET..?

I found the code for energy-model.cc but does not know how to run it and don't know what is its output

@Jisha - We cannot obtain output by executing energy-model.cc file or any .cc file of ns2. Try to run the TCL script by using following command:

ns filename.tcl

@Ann - You may find some useful information on the following link:

http://nsnam.isi.edu/nsnam/index.php/Contributed_Code

Hope it helps.

Regards,
Mohit P. Tahiliani

i am not able to download the energy.tcl file. plz give the link.

I used a modified code using aodv.cc and aodv.h and I am able to get the energy at that particular instant with the time displayed. I dont know how to link the tcl script with the energy.cc. Have got any idea about intrusion detection that can be done in ns2.

gud day to u mohit sir, hope u r fine...
when i used it posted an error which is mentioned just below-
# awk -f e2edelay.awk MyTest.tr
awk: e2edelay.awk:91: (FILENAME=MyTest.tr FNR=25294) fatal: division by zero attempted

can u plz tell me how to no. this fields given below (like for ex- time is $2 ..etc. ) so that i can make changes in awk script to make it work for me because i m little confused.
or if u can provide me the awk script.

this trace is the output of smac with 5 nodes in sensor network if i m not wrong...

s 1.500339577 _0_ AGT --- 2 cbr 512 [0.00 0 0] [energy 998.485984] ------- [0:0 4:0 32 0] [1] 0 0
r 1.500339577 _0_ RTR --- 2 cbr 512 [0.00 0 0] [energy 998.485984] ------- [0:0 4:0 32 0] [1] 0 0
s 1.500339577 _0_ RTR --- 2 cbr 512 [0.00 0 0] [energy 998.485984] ------- [0:0 4:0 32 0] [1] 0 0
D 1.500339577 _0_ IFQ ARP 0 cbr 512 [0.00 0 0] [energy 998.485984] ------- [0:0 4:0 32 0] [0] 0 0
s 1.514016091 _0_ MAC --- 0 ACK 10 [0.00 4 0] [energy 998.485984]
r 1.514016091 _0_ MAC --- 0 ARP 28 [0.01 0 4] [energy 998.474984] ------- [REPLY 4/4 0/0]
N -t 1.514016 -n 3 -e 998.474984
N -t 1.514016 -n 1 -e 998.474984
N -t 1.514016 -n 4 -e 998.474984
N -t 1.514016 -n 2 -e 998.474984

and thanks to u,i have learned allot through this blog and i hope to learn more

hi mohit.. how to print routing table and neighbor table for AODV protocol..

hi sir,
I am doing a project to test TCP fairness in upstream and down stream, for that i need to extract the throughput of a particular file. I s it possible to extract the through put of a particular file, if so what changes need to be done in awk script,,

Thank you.

@Ashish - You can find a sample TCL Script with energy model called "wireless-newnode-energy.tcl" in the following directory:

ns-allinone-2.xx/ns-2.xx/tcl/ex

@Jisha - IDS has already been implemented in NS-2. Following links may be useful:

http://apachepersonal.miun.se/~qinwan/resources.htm

http://arqos.csc.ncsu.edu/software.htm

@Vijay - Every column is represented in AWK Script by its number e.g. $1 means first column (i.e. event), $2 means second column (i.e. time) and so on. Since you are using an Energy model in your TCL Script, you are getting values related to energy model from $14 onwards. Hence you will have to make modifications in the AWK Script accordingly.

Following link will help you to understand trace file format:

http://www.cs.binghamton.edu/~kliu/research/ns2code/#trace

@Varusha - See section named "Functions for Routing Table Management" in the tutorial given on the following link and print the necessary information as per your requirements:

http://www-npa.lip6.fr/~rehmani/aodv_v2.pdf

@Manoj - Throughput of a particular file..or flow?

Hope it helps.

Regards,
Mohit P. Tahiliani

hi mohit,
I am sorry,
The question is to find throughput of desired node?

hi sir how to combine two xgraph in one xgraph

@Manoj - AWK Script given on the following link provide instantaneous and average throughput of a particular flow i.e. source - destination pair:

http://www.reti.polito.it/fiore/trace2stats_v05b.tgz

@Shine - Assuming you have named xgraph files as 01.xgr and 02.xgr respectively. Give the following command to plot them in the same window:

xgraph 01.xgr 02.xgr

Hope it helps.

Regards,
Mohit P. Tahiliani

please help me out<,I have been stuck for 6 days
I am trying to simulate wireless network in ns2, and i want to set the Mac type to Csma/Ca, but when i changed it form 802_11 to csma/ca, i got error which is

invalid command name "Mac/Csma/Ca"
et val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/Csma/Ca ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(rp) DSDV ;# routing protocol

I am going to be crazy

hi sir,

am trying to generate a wired network with multicasting and trying to produce a xgraph for through put and i want to calculate bandwidth utilization for my scenario ,i am v.new to ns2 plz help

@Osama - TCL Script named "mac-test.tcl" available in the following directory may be helpful:

ns-allinone-2.xx/ns-2.xx/tcl/ex

@Sinju - Some AWK Scripts for Wired Networks to calculate delay, jitter and packet loss rate are available on the following link:

http://140.116.72.80/~smallko/ns2/tool_en.htm

However, you need to modify them somewhat to meet your requirements of multicast routing.

You may also try to use Tracegraph which eliminates the use of AWK Scripts for such specific scenarios. Installation and more details about Tracegraph are available in Facebook group called "Network Simulator - 2 (NS-2)" - Link is available in the "Useful Links" Page of this blog.

Hope it helps.

Regards,
Mohit P. Tahiliani

sir plz can u help me...plz post me energy model tcl file for tora, directed diffusion, aodv, dsr ,dsdv and many multipath routing algorithm in ns2

sir i m not getting idea what to do .........in energy efficiency i routing of wireless sensor networkks

@Itu - Sample TCL Script for energy model named "wireless-newnode-energy.tcl" is available in the following directory:

ns-allinone-2.xx/ns-2.xx/tcl/ex

To know more details about Wireless Sensor Network Simulation in NS-2, visit the following link:

http://mohittahiliani.blogspot.com/2010/02/installing-ns226-with-nrlsensorsim-on.html

Hope it helps.

Regards,
Mohit P. Tahiliani

hi sir thank you so much for your reply..i need another one help sir...i need the awk script for energy consumption for the following trace file format

s 10.936679222 _0_ AGT --- 0 cbr 512 [0 0 0 0] ------- [0:0 2:0 32 0] [0] 0 3
r 10.936679222 _0_ RTR --- 0 cbr 512 [0 0 0 0] ------- [0:0 2:0 32 0] [0] 0 3
s 10.936679222 _0_ RTR --- 0 AOMDV 52 [0 0 0 0] ------- [0:255 -1:255 30 0] [0x2 0 1 [2 0] [0 4]] (REQUEST)
s 10.936854222 _0_ MAC --- 0 AOMDV 110 [0 ffffffff 0 800] ------- [0:255 -1:255 30 0] [0x2 0 1 [2 0] [0 4]] (REQUEST)
r 10.937734888 _10_ MAC --- 0 AOMDV 52 [0 ffffffff 0 800] ------- [0:255 -1:255 30 0] [0x2 0 1 [2 0] [0 4]] (REQUEST)
r 10.937759888 _10_ RTR --- 0 AOMDV 52 [0 ffffffff 0 800] ------- [0:255 -1:255 30 0] [0x2 0 1 [2 0] [0 4]] (REQUEST)
s 10.946774270 _10_ RTR --- 0 AOMDV 52 [0 ffffffff 0 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
s 10.947229270 _10_ MAC --- 0 AOMDV 110 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
r 10.948109741 _4_ MAC --- 0 AOMDV 52 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
r 10.948109797 _6_ MAC --- 0 AOMDV 52 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
r 10.948109936 _0_ MAC --- 0 AOMDV 52 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
r 10.948109936 _1_ MAC --- 0 AOMDV 52 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
r 10.948109977 _8_ MAC --- 0 AOMDV 52 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
r 10.948110015 _9_ MAC --- 0 AOMDV 52 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
r 10.948134741 _4_ RTR --- 0 AOMDV 52 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
r 10.948134797 _6_ RTR --- 0 AOMDV 52 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
r 10.948134936 _0_ RTR --- 0 AOMDV 52 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
r 10.948134936 _1_ RTR --- 0 AOMDV 52 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
r 10.948134977 _8_ RTR --- 0 AOMDV 52 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
r 10.948135015 _9_ RTR --- 0 AOMDV 52 [0 ffffffff a 800] ------- [10:255 -1:255 29 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)

dear sir,

thanks for ur valuable reply,am confident that i can finish my project in time , i ll try those links and ask u doubts in future,i think u ll help me in future too,

i have a v.basic doubt, to send data from 1 to 5 in the following scenario ,if i change the link as 1 to 2 , 2 to 5 instead of 1 to 2 ,2 to 3,and 3 to 5 will my bandwidth utilization decrease???

5---------------3-------------2----------------1


sorry if doubt is funny

@Shine - You can download awk script for energy consumption from the following link:

http://www.megaupload.com/?f=0211SAG1

Name of the script: energy.awk (Make sure you modify it as per your requirements)

@Sinju - It depends on several other factors such as load on node 2, the physical distances between the nodes, etc.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello sir, Im working on optimization of DSR. I have run the DSR with a network of 20 nodes. I want to know how to send RREQ request packet to selected nodes in the network instead of sending it to all the neighbour nodes. So i want to know how to override send methods that are used to send request and data packets.

hi mohit.. how to change the transmission range in aodv.. can u tell for 50m of range.. wer to change and wat to add in tcl code for it??

hi mohit,
i am comparing the performance of AODV,DSR and DSDV routing protocol.i have generated the trace files.for a single protocol a number of trace file are generated using different pause time,speed in scenario.now i have to use a awk file to calculate end to ene delay,control overhead and packet delivery ratio.so now i don't know how to use a end to end delay awk file for multiple trace files of one protocol.pls help me i am new to ns-2.....its urgent...

@Harish - Following link may be helpful:

http://www.skynet.ie/~bryan/dsr_faq/

@Varusha - See the following link

http://www-mobile.ecs.soton.ac.uk/scripts/viewvc.cgi/ns-2.33/tcl/ex/wpan/wpan_demo1.tcl?r1=1.1&r2=1.1.1.1&diff_format=s

wherein you can find commands such as

set dist(15m) 8.54570e-07
Phy/WirelessPhy set CSThresh_ $dist(15m)
Phy/WirelessPhy set RXThresh_ $dist(15m)

You need to do similar changes for setting 50m of range. Values of upto 40m are given in the same link.

You may also refer to Question #12 on the following link:

http://apachepersonal.miun.se/~qinwan/resources/ns2%20resources/FAQ.txt

@Smita - AWK Scripts for all those parameters can be downloaded from the following link:

http://www.megaupload.com/?f=0211SAG1

and the procedure to execute AWK Scripts is explained in the post above.

Hope it helps.

Regards,
Mohit P. Tahiliani

hi mohit,
thanx for ur reply.now i am facing another problem in generating trace file for DSR with my tcl file.when my trace file is generated for dsr its starting with an error as..

Sconfig 0.00000 tap: on snoop: rts? on errs? on
Sconfig 0.00000 salvage: on !bd replies? on
Sconfig 0.00000 grat error: on grat reply: on
Sconfig 0.00000 $reply for props: on ring 0 search: on
Sconfig 0.00000 using MOBICACHE

now i am not able to understand why this error is comming...pls reply me as soon as possible...

Hi Smita,

They does not look like error. it looks like some configuration stuff of DSR routing.

If you will look closely in the above lines, it start with "Sconfig" and ends with "on" which shows its actually starting the trace file with parameters on.

Though i am not sure and i guess Mohit can explain it better.

Looking ahead for Mohit's reply.

Hey Mohit,

I want to know how can we simulate the Wireless sensor network? in your previous post i saw that you referred WPAN directory in NS-2, but is WPAN simuation same as WSN simulation. Also in WSN simulation i want to see the colors of nodes fading as the energy of nodes reducing but i could not find any demo example for such type of WSN simulation. Can you kindly help me in this by sending some demo example or by referring to some link/reference?

Awaiting for your reply

hi Mohit,

do you have perl script for analysing trace files of DSR,DSDVand AODV to evaluate packet delivery ratio,control overhead and end to end delay.if u have pls reply me as soon as possible..

thanx

dear Mohit,

please help me how to count the number of MPR in OLSR (UM-OLSR) on NS2.34.

Thanks in advance,
Rudy

hi Mohit,i want to fetch data from trace file to set the properties of neigbour node during the simulation.?pls help with some tcl scripts....

Hey Mohit,

I've been reading your blog but i couldn't find scen1 and scen2........
so, can you please mail me both scen1.awk and scen2.awk at

sahil.sachdeva40@gmail.com

Thanks,
Sahil

bjjr, svp vrt jé besoin d'aiide :(
je voudrais tracer le packet dilevery ratio en fct de temps, jé modifier votre code afin de tracer une courbe
voila le script :
BEGIN
{
t=0;
sends=0;
recvs=0;
start_time = 0;
i=0;
}


{
time=int($3);
if(i<10)
{

# CALCULATE PACKET DELIVERY FRACTION
if (( $1 == "s") && ( $35 == "cbr" ) && ( $19=="AGT" ))
{
sends++;
}


if (( $1 == "r") && ( $35 == "cbr" ) && ( $19=="AGT" ))
{
recvs++;
}

start_time = time + start_time;
}
if(i==10)
{
i=0;
PDF = (recvs/sends)*100;
printf("%f\t%.2f\n",start_time,PDF);
}

}
END
{
}

jé exécuter avec commande awk -f script.awk trace-dsdv.tr >extract

voila il me dit l'erreur suivant:
awk:2: les blocs BEGIN doivent avoir une partie action
awk:31: les blocs END doivent avoir une partie action
heeeeeeeeeelp pleaase

Vanet

segmentation fault (core dumped) when using dsr protocol in ns2.34

hi Sir,
i have problem in ns2 to plot graphs with the following command

xgraph filename.txt

this filename.txt file generated by matching between awk file and .tr file.

now i try above command the problem comes

'Problems found with input data'

please Sir help me
regards
jamil

@Smita - Rahul is correct. It is not an error. This is how trace format for DSR is defined.

I have not worked with PERL Script so no idea about that. However, if you want AWK Scripts for same parameters you can find it on the link I gave you in my previous reply.

@Rahul - Upto some extent you can design a TCL Script for WSN using 802.15.4 which is available in WPAN implementation. Sample TCL Scripts provided in

ns-allinone-2.xx/ns-2.xx/tcl/ex/wpan

will help you to configure energy model wherein you can see the color of nodes changing from green to yellow to red. I will upload a sample TCL Script with energy model soon. Keep checking the following link:

http://www.megaupload.com/?f=0211SAG1

@Rudy - To count MPRs, you will have to introduce a counter in C++ code of UM-OLSR - probably in olsr.cc.

@Chidu - You cannot use the data printed in the trace file to take routing decisions during the simulation. You need to collect the data related to neighbors from "neighbor function" which is available in most of the routing protocol's C++ code.

@Sahil - You can find AWK Scripts similar to scen1.awk and scen2.awk on the following link:

http://www.megaupload.com/?f=0211SAG1

pdf.awk is similar to scen1.awk

and

energy.awk is similar to scen2.awk

NOTE: Make modifications in AWK Scripts as per your requirements.

@Yasmin - Please convert it to English and re-post.

@Vanet - Use

CMUPriQueue

instead of

Queue/DropTail/PriQueue

for DSR protocol

@Jamil - You need to check few things: (1) Make sure your trace file format is wireless old trace format. (2) Make sure your packet size in TCL is set to atleast 500. If not, change it accordingly in the AWK Script as well.

Hope it helps.

Regards,
Mohit P. Tahiliani

Dear Mohit,
I am an M.tech student currently working with ZRP.I already dowloaded the ZRP patch from the link http://magnet.daiict.ac.in/magnet_members/MTech/2007/PatelBrijesh/Simulation.html,but one file was unable to download - zrp4NS2_33.patch.While trying to download it was showing like "The requested URL /magnet_members/MTech/2007/PatelBrijesh/Thesis_files/ZRP_NS2_Patch/zrp4NS2_33.patch was not found on this server".
Can I proceed without that?Please help me for the same.I think Babar Saeed suceeded in patching the same,can I get his help?
Regards,
Dhanya

@Mohit we could not able to generate graphs in the code it is giving error as "could not able to execute xgraph". Do we need to set up anything kindly reply me as soon as possible

Thank you Sir for all your support.....All the stuff that was there in your blog really helped me to simulate my project results.

Hi,
i m working on the reliability of WSN and trying simulate leach tcl script generated by mannasim script generator tool provided with ns-2.29 but when i run the script i get the segmentation fault error. the trace file is also empty and no captured data available.

i'll be grateful if you can help me in this regard.

Hi,
Please help me, I'm having trouble installing MNS-for-2.33.
"make: *** [mns_v2.0/ldp.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems"
I installed ns-allinone-MNS for 2.33 on ubuntu10.04-LTS.
I find the MNS for ns-allinone-2.31 ​​or lower version, but not seen. If you have, you can send my mail address is not? phamhuongcntt@gmail.com

Dear Mohit Sir,
I m a masters student. i m dng my thesis in VANET security. I m going to use NS2 for the simulation. I read ur blog and try to do as u mentioned. Bt nw i m facing prob in the generation of XGRAPH. I m nt able to understand how the write the awk file so that it generates two column for the xgraph. Plz tell me how should i proceed.
Hope to get reply soon. I'll b very grateful to u.

can i implement query processing in sensor networks in ns2?

Dear Mohit,
I m doing a project in wireless sensor nodes in ns2.34 on linux 11.04. While adding malious node based on the following link http://elmurod.net/?p=196. I got the following error



SORTING LISTS ...DONE!
ns: _o35 hacker:
(_o35 cmd line 1)
invoked from within
"_o35 cmd hacker"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o35" line 2)
(SplitObject unknown line 2)
invoked from within
"_o35 hacker"

plzzz help me to solve it

@Dhanya - ZRP patch can also be downloaded from the following link:

http://magnet.daiict.ac.in/magnet_members/MTech/2007/PatelBrijesh/Simulation.html#Sec_3.1

I tried downloading and it works!

@Appu - Make sure Xgraph package is correctly installed. If you are using Ubuntu, give the following command:

sudo apt-get install xgraph

@Najma - Mannasim patch has these problems since long and hence it is of limited benefit. You may try working NRLSensorsim and install Leach patch (both are available for ns-2.27).

@Phamminhhuong - If I find it I will surely post it here!

@Alka - You can find a sample AWK Script which prints two columns on the link given below:

http://www.megaupload.com/?f=0211SAG1

Name: energy.awk

@Jeni - Yes you can do that. See the sample scripts for Directed Diffusion given in

ns-allinone-2.xx/ns-2.xx/tcl/ex directory

@Shiksha - Did you recompile ns-2 after making all the changes? If not, then give the following commands in ns-allineone-2.xx/ns-2.xx directory:

make clean

make

make install

Hope it helps.

Regards,
Mohit P. Tahiliani

Thanx Mohit I will do it. Thank you very much

hello sir,
how to give input values for xgraph. when i am trying to plot m getting this error..

ns2@ubuntu:~/Desktop/ns-allinone-2.30/ns-2.30$ awk -f genthroughput.awk aodv.tr
Average Throughput[kbps] = 101.19 StartTime=0.00 StopTime=6.07
ns2@ubuntu:~/Desktop/ns-allinone-2.30/ns-2.30$ awk -f genthroughput.awk aodv.tr > aodv.xgr
ns2@ubuntu:~/Desktop/ns-allinone-2.30/ns-2.30$ xgraph aodv.xgr
Error in file `aodv.xgr' at line 1:
Unknown line type
Problems found with input data.

sir,
how can i get the number of packets dropped by a node within a fixed time dynamically so that i can route the next data packet to the less dropped node..please respond i need to start my project

sir,we are working on weight based DSR .. can u please help how to add the weight based metric to our project

Thank you sir..I think I am almost successful in patching ZRP with ns2.33 using the recommended link.Problem is like when the simulation tcl script given in that manual was run I got the following error.

invalid command name "Agent/ZRP set radius_ 2"
while executing
""Agent/ZRP set radius_ 2""
(file "new.tcl" line 1)

When that particular line was commented,error changed like:

num_nodes is set 25
invalid command name "25"
while executing
"$val(nn)"
invoked from within
"$ns_ node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-pr..."
(file "new.tcl" line 43)
But an empty nam and trace file is getting generated.When the syntax
Agent/ZRP set radius_ 2 ;# Setting ZRP radius=2
was changed to : set Agent/ZRP/radius_ 2 ;# Setting ZRP radius=2
error remained the same as above.
I am struck over here.Was it the problem with patching..or from where can I get a correct tcl code to check whether the patching was a success or not.Please help me for the same.
Thanks and Regards,
Dhanya

@Rama - The AWK Script which you are using is the one which prints the value on the terminal and not the one which is used to plot a graph. Modify it according to the steps explained in the post above.

@Arifa - You will have to do that in C++ by keeping track of drop-target. For every node, you can count how many packets it has dropped till now since the simulation started.

@Michael - The following link will be helpful to you:

http://www.skynet.ie/~bryan/dsr_faq/

@Dhanya - Looking at the second error that you are getting (i.e. after you commented Agent/ZRP line), it seems there is a typo in $ns_ node-config part. The error is mainly because the number of nodes (25) are not correctly defined. I guess you just need to check for the typos in $ns_ node-config part.

Hope it helps.

Regards,
Mohit P. Tahiliani

hi sir..
i have project to simulate olsr protocol ini ns2..could you help me ?

Hi sir..

I m doing a project in wireless sensor nodes in ns2.34 on linux 10.04
Can you give me example on how to insert key in node.. and also to do clustering.. I really hope you can help me..pls reply, i'm stuck in my project

@Spyware - Patches of OLSR are available for most of the latest versions of NS-2 on the following link. Also you can find installation guide and sample TCL Scripts for OLSR on the same link.

http://masimum.inf.um.es/fjrm/?page_id=116

@She - Security related stuff in WSNs is provided in the patch available on the following link:

http://apachepersonal.miun.se/~qinwan/resources.htm

Hope it helps.

Regards,
Mohit P. Tahiliani

sir how to integrate VanetMobiSim and ns2 the do my vanet project .and we do i get VDTP(vehicular data transfer protcol) and how to patch it in ns2

can i use in ns-2.35 ?

hi sir

I am doing project on NEMO handoff by using AODV.

1. how to find the shortest path between the nodes for transferring a packet..

2. how to maintain table in the particular node..because for my project i have to maintain nested level of the mobile nodes...

Hi sir
I am doing a project on resource congestion control protocol for sensor network. Any tcl script or advise about the procedure to follow is highly appreciated. Thank you

Hello,sir.
i'm requested to get the avg-e-2-e delay for directed diffusion ,i edit a c# prog. for trace file analysis.but as i increase the network size,the delay is decreased which is against the paper results .
do you think it's prob. in TCL X,Y,Z position of node wit antenna range variable or the way i get the delay .
let me know if i can provide you with source code
thanks for this helpful blog.

Hello! can you help me with a sample ns2 protocol script to for congestion control in wireless sensor network. eg. CODA, ESRT or any. Thank you.

Hello,
i have another Q.
How i can change the antenna(radio range)?
i change the channel.cc file (distCST_ variable)and recompile ns2 but no changes happened .am i right??
thanks..

i want to add extra field to packet to hold the extra information value in AODV routing protocol?.how do i do that? plz help.

hi mohit,
i am comparing the performance of AODV,DSR and DSDV routing protocol.i have generated the trace files.for a single protocol a number of trace file are generated using different pause time,speed in scenario.now i have to use a awk file to calculate end to ene delay,control overhead and packet delivery ratio.so now i don't know how to use a end to end delay awk file for multiple trace files of one protocol.pls help me i am new to ns-2.....its urgent...

hello sir,
I hav to find the throughput...
BEGIN {
ans=0;
}
{
if ($1=="r" && $7=="cbr" && $3=="_1_")
sec[int($2)]+=$8;
ans=sec[int($2)];
}
END
{
printf("NRL = %.3f", ans);
}


is this correct ???

Hi mohit sir,
I am using ns2.34 in ubuntu. My project is on implementation of DYMO routing protocol.
I have downloaded dymoumv0.3 and also dymoum0.3 patch.
When i unzip and apply ./configure for Dymoum I get unrecognizable makefile error.
Also if i proceed by patching it and then simulating a dymo tcl example file i get an error as : Command not found "AGENT/DYMO"...
please help me out sir or give any working solution.
Thank you

hey sir mohhit..
can you explain to me, step by step to plot throughput , delay, jitter..
using MS. Excel

regard

hai!!! can any one help me in plotting graph using xgraph command..

it is showing error when i used xgraph command like this..
“exec xgraph temp4.tr”
im working in NS-2.35 in fedora 13..

thanq in advance..

Sir,
Can you provide tcl scripts for implementing various protocols in hybrid networks(i.e., wired and wireless)
from
V.Rama Krishna

The AWK script " Calculating total number of dropped packets, average throughput, average end-to-end delay and node energy consumption (Wireless)" points to a broken link and also, www.megaupload.com/?f=0211SAG1 site has been blocked by FBI, so I couldn't download it. Please is there any other place to download the awk script for the same.

Thanks

Kayode(okikayode5@gmail.com)

Hello, Please have been trying to get an AWK script that I can use for connectivity and coverage, but all effort proof abortive. Kindly assist.
Thanks.


Zama

hai!!! can any one help me in plotting graph using xgraph command..

it is showing error when i used xgraph command like this..
“exec xgraph temp4.tr”
im working in NS-2.35 in fedora 13..
my mailid: jamipriyanka53@gmail.com
thanq in advance..

Hello

can one help me I need to simulate my leader selection protocol for Wireless network on ns2 but I am a beginner on it. This the description of my protocol: node select their leader based on the remaining energy.
nathiristo079@gmail.com

@priyanka

Just give " xgraph filename.tr " in terminal ...

this is enough to generate the graph...

hi can any one say the steps to create wireless sensor node with 802.11 in ns2.
help me

can any one please mail me the .AWK file to compute delay in aomdv ....

my email id is sharadkumarsharma19@gmail.com

THANKS

i executed the command as
"xgraph filename.tr" for generating graphs...
but i'm still getting errors as shown below.

Error in file `temp4.tr' at line 37812:
Unknown line type
Error in file `temp4.tr' at line 37813:
Unknown line type
Error in file `temp4.tr' at line 37814:
Unknown line type
Error in file `temp4.tr' at line 37815:
Unknown line type
Problems found with input data.


can any one suggest a solution?

hello everyone,
I am working with ns-2.35,and want to simulate OLSR protocol.Has anyone used OLSR with ns-2.35.Pls reply me its very urgent..plsssss

Smita

Hi Mr. Mohit

Hope you will be fine,
i have a query, i have to simulate multimedia traffic over udp, tcp and sctp agents, for this purpose i wana use CBR traffic will u help me to know what cbr interval i,ll use for multimedia traffic. the other things is it possible to use cbr as voip traffic with variation of intervals?

regards

Hi can you help to simulate the malicious behavior in DSR protocol

Sir,
Could you give me those enrgy tcl file and ,awk file?I can't access on megaupload link.

my e-mail: teddyparry@gmail.com

Regards,

hi mohith
my name is adarsha from the nitte meenakshi institute of technology.
we are doing the project on qos routing in adhoc we need the patch file and procedure to patch. plz help us..
with regards
adarsha

hi mohith
my name is adarsha from the nitte meenakshi institute of technology.
we are doing the project on qos routing in adhoc we need the patch file and procedure to patch for the olsr protocol. plz help us..
with regards
adarsha

Hello sir,

i am trying to plot xgraph for wireless simulations. when i use the awk files posted on this blog, it does not give me the result.. shows an error.
"Error in file 'delay.xgr' at line1
unknown line type
Problems found with input data"

This comes when i use e2e.awk for wireless
Please help..

hello sir,
we are doing a project on "CLUSTER BASED VEHICULAR COLLISION AVOIDANCE SYSTEM"

we need a help from u..

1. HOW TO FIND INTER NODE DISTANCE ?
2. HOW TO ASSIGN RANDOM SPEEDS TO THE NODES ? (A SINGLE NODE MOVING WITH DIFF SPEEDS AT DIFF TIMES) ?
3. HOW TO FIND THE NO OF COLLISIONS OF NODES WHEN THEY MOVE RANDOMLY ?
4. HOW TO DRAW GRAPH ? (EG.INTER NODE DISTANCE Vs SPEED)
5. HOW TO EDIT THE MAC PROTOCOL 802.11 IN NS2 ?

pls reply sir !!!!


WAITING FOR UR REPLY.....

hello sir, im trying to find tcl script for zone routing protocol (zrp) that is needed to run in MANET environment by using ns2..do u have any idea where i can find suitable script?plz help me...how can i change the script according to my parameters?

hello sir,i trying to do performance evaluation of different queus(i select DropTail,RED queus).sir for this 2 queues i used separate tcl file(one for DropTail and other for RED).both cases my topology is same....and i got number of dropped packet,number of received packet both cases.i used 2 tcl file and run 1 awk file to show the output of both tr file as in separate run.sir,i want to draw a single graph for peformance evaluation of both queues.performance is evaluating based on buffer size and dropped packet(X and Y axis).how can i do this sir??

How can I add extension to packets in AODV?

sir i do not know how to plot Xgraph in ns2. I want to know that like instantJitter.awk run on terminal or the code which instantJitter.awk is print in side the .tcl file and if the instantJitter.awk run on teminal than how it plot the xgraph of .tr .Sir have lot of confusion.May you please tell me all the process to plot the xgraph in layman term

Sir when i run the command xgraph .xgr then it shows that no plot incorrect input method

hello sir
how we can create a malicious node in dsr or aodv please help me....
thnx sushil chamoli

Dear Mohit
AWK files are no more present on your website http://mohit.ueuo.com/AWK_Scripts.html
can you spare some time to correct the link

hello sir...
i modified dsdv for dynamically measuring energy and position of node.but when i send packets
classifier:no slot error is coming..
could u plz me tell me solution for it...plz sir

Hello sir,

I am trying to use xgraph to plot throughput after using your genthroughput.awk file but I cannot as there is no data to plot with.

Can you please help me with this problem?

Thanks.

hello sir i hv downloaded the throughtput and packet loss awk files.but when i run that i just get 0.0 values for all the feild.may be there is some code missing in my AODV and DSDV tcl file code can u plz gv me aodv and dsdv tl file code from where i can get the output

i hope and pray that every one is good in working with ns2.35..... can some one give help in handling "segmentation fault (core dumped)"
error ,,, while running tcl script of a wireless network with 9 sensor nodes and a base station node as a major sink node.

Thank you in advance for the favour and help. ..... any response please!!!!!

«Oldest ‹Older   1 – 200 of 338   Newer› Newest»