Search This Blog

AWK Script for NS2

Labels: , , , ,

AWK is a programming language that is designed for processing text-based data, either in files or data streams, and was created at Bell Labs in the 1970s. The name AWK is derived from the family names of its authors - Alfred Aho, Peter Weinberger and Brian Kernighan.

"AWK is a language for processing files of text. A file is treated as a sequence of records, and by default each line is a record. Each line is broken up into a sequence of fields, so we can think of the first word in a line as the first field, the second word as the second field, and so on. An AWK program is of a sequence of pattern-action statements. AWK reads the input a line at a time. A line is scanned for each pattern in the program, and for each pattern that matches, the associated action is executed." - Alfred V. Aho

 - - - From Wikipedia, the free encyclopedia. 

Links to AWK scripts for NS2 are given below:

AWK script for throughput – Download! (Click again if it doesnt work first time :) )

AWK script for jitter – Download!

AWK script for pdf (packet delivery fraction) – Download!

[Latest Update] You can also check our latest Automated Post Processing (APP) Tool which works based on AWK Scripts and automatically plots graphs. APP contains a set of 20 AWK Scripts which, if required, can be used outside APP also.

Comments (358)

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

hey mohit kem cho?
can i get NS 2.29

Hello Kaushal,

I m fine Thank you!

You can find almost all the versions of NS-2 on the following link:

http://www.isi.edu/nsnam/dist/

Hope it helps.

Regards,
Mohit P. Tahiliani

hi please tell me how to use awk in my tcl code
umang

This comment has been removed by the author.
This comment has been removed by the author.

Sir, where can i get the .awk script or any ther method tp calculate throughput in udp and tcp.

See my another blog named "Few more AWK Scripts for NS2"

Regards,
Mohit P. Tahiliani

Hi
thanks for your useful website,
I have a problem when I want to use a awk file for a .tr file, I use this command "awk -f temlate.awk out.tr > outs.txt"
and my template.awk file is as so:
BEGIN {
}

{
event = $1;
time = $2;
from = $3;
to = $4;
type = $5;
pktsize = $6;
flow_id = $8;
src = $9;
dst = $10;
seq_no = $11;
packet_id = $12;
if( $1 == "s" && $4="RTR") printf("%s \n",$0);

}

END {
}

and the error is:
awk template.awk:1: BEGIN {
' in expressionwk:1: ^invalid char '

Do you have any idea to solve this problem?
Thank you
Regards

Hi Mohit,

Thanks for sharing the scripts. I want to know whether you share tcl files as well for various wired and wireless protocols??

Hello Ankur,

Few TCL Scripts I have made available for download on the following link:

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

Also you can download "TCL Script generator" from the following link to generate TCL scripts as required:

http://mohittahiliani.blogspot.com/2009/10/tcl-script-generator.html

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi Mohit,

Thanks a lot. i have 1 more query. I want to plot a performance cure between "network load (on x-axis) and average delivery time (on y-axis)" for any routing protocol. do u have any script to plot that curve.

my trace file is generated in the below format

+ 0.220587 4 1 rtProtoDV 6 ------- 0 4.1 1.1 -1 32
- 0.220587 4 1 rtProtoDV 6 ------- 0 4.1 1.1 -1 32
+ 0.220587 4 5 rtProtoDV 6 ------- 0 4.1 5.2 -1 33
- 0.220587 4 5 rtProtoDV 6 ------- 0 4.1 5.2 -1 33
r 0.230683 4 5 rtProtoDV 6 ------- 0 4.1 5.2 -1 33
r 0.230747 4 1 rtProtoDV 6 ------- 0 4.1 1.1 -1 32
+ 0.232773 5 4 ack 40 ------- 1 5.0 0.0 0 34
- 0.232773 5 4 ack 40 ------- 1 5.0 0.0 0 34
r 0.243413 5 4 ack 40 ------- 1 5.0 0.0 0 34
+ 0.243413 4 1 ack 40 ------- 1 5.0 0.0 0 34
- 0.243413 4 1 ack 40 ------- 1 5.0 0.0 0 34
r 0.25448 4 1 ack 40 ------- 1 5.0 0.0 0 34
+ 0.25448 1 0 ack 40 ------- 1 5.0 0.0 0 34
- 0.25448 1 0 ack 40 ------- 1 5.0 0.0 0 34
r 0.265547 1 0 ack 40 ------- 1 5.0 0.0 0 34
+ 0.265547 0 1 tcp 1040 ------- 1 0.0 5.0 1 35
- 0.265547 0 1 tcp 1040 ------- 1 0.0 5.0 1 35
+ 0.265547 0 1 tcp 1040 ------- 1 0.0 5.0 2 36

Thanks,
Ankur

Hello Ankur,

The trace script that you have posted is of wired network. AWK scripts provided on my blog are mainly for wireless networks. You need to modify them to support wired networks. For more information on how to work with AWK scripts and graphs, visit my blog named "Xgraph and AWK Scripts in NS-2" (uploaded today).

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi mohit,
its avin here...i need ur help regarding generating awk.
i m new to ns-2 n hav ben given the work to do a mini proj on dis..
i m very much confused in all dis stuff..
can i get ur mail id ,so tat i can mail u my tcl script(cant post bcox its quite long) n help regarding my proj..
my email id is avin.yudi@gmail.com..

plz do rply soon mohit...

hi,
this is dipankar, i m doing a project on ns-2 on aodv and dsr. I already made the code and get the trace file and nam file but i want to get plot(about throughput,avg. end to end delay, packet delivery ratio) and i dont know how to use awk script with trace file.please help me as soon as possible.

@Dipankar: Please visit my blog named "Xgraph and AWK Scripts in NS-2".

Here is the link:

http://mohittahiliani.blogspot.com/2010/08/xgraph-and-awk-scripts-in-ns-2_06.html

Hope it helps.

Regards,
Mohit P. Tahiliani

hi i tried the awk script to find throughput for AODV tcl but am getting the error
awk: cmd. line:1: throughput.awk
awk: cmd. line:1: ^syntax error
even if i run for jitter.awk or any other awk file i get this error...what to do?

Hi Mohit,

Do you have any tcl file for AODV, DSR and DSDV in which the throughput data and other datas are extracted from trace file in tcl script only rather than using awk script.

hello mohit,
i used your e2edelay.awk in my project.but it is giving the following error.

awk: e2edelay.awk:101: (FILENAME=ns.tr FNR=78956) fatal: division by zero attempted

could u plz tell me what'd be the reson for it?

@Vijayalakshmi: Check this line in e2edelay.awk

else if ($1 == "D" && $7 == "tcp" && $8 > 512){

replace tcp by cbr because you may be generating CBR traffic.

Hope it helps.

Regards,
Mohit P. Tahiliani

could you please suggest a good beginners guide for awk

i am getting error in xgraph..... when i typed xgraph it is telling command not found

@Sujan - Go in the following directory

ns-allinone-2.xx/xgraph-xx and give the following commands

./configure

make clean

make

make install

Make sure you have administrative access.

Hope it helps.

Regards,
Mohit P. Tahiliani

hiiiii sir......


i m B.E. final yr. student. m doing my major project on aodv simulation on ns 2.34 at fedora 9. i successfully install the ns 2 environment . what i have next to do?


can any one help me i will be very thankfull ...


regards
asit

@Asit - Try out the sample TCL scripts given for wireless networks in the following directory

ns-allinone-2.34/ns-2.34/tcl/ex

Regards,
Mohit P. Tahiliani

how to enable hello messages in AODV

@Ashok - To enable HELLO messages in AODV you need to comment the following two lines in ns-2/aodv/aodv.cc file.

#ifndef AODV LINK LAYER DETECTION
#endif LINK LAYER DETECTION

After making the changes, re-compile NS-2:

sudo make clean

sudo make

sudo make install

Ref.: For more details on AODV implementation in NS-2, please refer to "A Tutorial on the Implementation of AODV in NS-2" by Mubashir Hussain Rehmani. The tutorial is available on the following link:

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

Hope it helps.

Regards,
Mohit P. Tahiliani

HI, i want to plot time sequence, i have a nam file, from there i need to extract every packet as it was sent by the server, every ack as it was received by the server, and to plot this + cwnd and ssthresh, can you please tell me how can i do this.

Hi Sir,
I need the awk code for finding delay in the directed diffusion algorithm....

Sir,
if we enable hello messages how to find alive nodes

Is there any tcl script to show hello packets
and give me awk file for finding alive nodes

@Irina - You can find the necessary information from the tutorial (Chapter 2, 3 & 4) given on the following link:

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

@Pradeep - You can download the AWK script for delay from the following link and make necessary modifications if required:

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

@Ashok - Hello packets are sent at regular intervals by every node. This is done by implementing a timer in C++. For details refer to the AODV tutorial which I gave you earlier. Look for the following functions:

1. In Section 5.2 - Hello Timer

2. In Section 5.3.5 - sendHello()

3. In Section 5.3.6 - recvHello(Packet *p)

Hope it helps.

Regards,
Mohit P. Tahiliani

HI again, thanks for info very helpful ,but i do not know how to filter out the packets that are data packets and the ones that are ack out of that trace file, i need to plot them.(Lan)

Thanks a lot Sir!!!

Dear Mohit,
I am a new researcher in Diffserv/ NS2.
I was wondering can i use the AWK & Perl you provided on Diffserv such as
"ds-cbr-TSW3CM.tcl" or it is only applicable on simple wired topology?
2. does it matter if the source is UDP or TCP? or does it it matter how many source do we have? or AWk/PERL can be applied for any type and no. of application?

Plz reply me urgently.
Best regards
Spring

Dear Mohit,
I had one more question.
by any chance do you know how to create EF class /Physical queue in NS2? and which policy is the best one for the propose of having multi traffic class?
Regards
Bahareh

what is the awk script to find alive packets

@Irina - You can use "packetsize" as a parameter to differentiate data packets and ACKs. ACKs have small packetsize of 40 bytes whereas data packets are generally in 100s or 1000s of bytes.

Hope it helps.

Regards,
Mohit P. Tahiliani

@Bahareh - AWK Scripts designed for wireless networks will not work on wired networks because the trace format of wireless simulation differs from the trace format of wired simulation.

AWK scripts are mostly designed to be generic i.e. they can be used for UDP/TCP with any number of sources. However, if required, one might specifically design an AWK script which may need protocol information as well.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello Sir,
howz u?and all the best and congratulation for your Ph.D work and helping others for NS2

Sir i installed Ns2.29 bt unable to patch mannasim in it....
i tried both the method specified on website...bt pathfile nt found error is given...

pls help me

Bye(avjo)

@Vish - Give the exact details of the error. It will help to analyze the point of error.

Regards,
Mohit P. Tahiliani

how to find alive nodes using AWK script after enabling hello packets

hi,
Mohit, can you please tell me how to send route information from one node to another in ns2, i'm using ns2.33 for my project, actually your modification to DSDV for multiple interfaces (thanks alot for that)i need to send the route information maintained at one node to another for routing, can you suggest anything. Thanks

@Beea - To send route information from one node to another node in DSDV you may check "makeUpdate" and "updateRoute" functions in dsdv.cc file available in

ns-allinone-2.xx/ns-2.xx/dsdv (xx represents ns2 version number)

Hope it helps.

Regards,
Mohit P. Tahiliani

Here with i am giving u error wht i m getting during installation.........

Error :

./common/packet.h:259: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:261: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:262: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:265: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:268: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:271: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:274: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:276: warning: deprecated conversion from string constant to ‘char*’
In file included from mannasim/processing.h:44,
from mannasim/accessPointApp.h:45,
from mannasim/accessPointApp.cc:37:
mannasim/sensorNode.h: At global scope:
mannasim/sensorNode.h:48: error: expected initializer before ‘<’ token
mannasim/sensorNode.h:73: error: ‘AppList’ does not name a type
In file included from mannasim/processing.h:45,
from mannasim/accessPointApp.h:45,
from mannasim/accessPointApp.cc:37:
mannasim/sensedData.h:49: error: expected initializer before ‘<’ token
mannasim/sensedData.h:50: error: expected initializer before ‘<’ token
mannasim/sensedData.h:65: error: ‘AppDataList’ does not name a type
mannasim/sensedData.h:105: error: ‘AppDataList’ does not name a type
In file included from mannasim/processing.h:47,
from mannasim/accessPointApp.h:45,
from mannasim/accessPointApp.cc:37:
mannasim/dataGenerator.h: In member function ‘virtual AppData* DataGenerator::collect()’:
mannasim/dataGenerator.h:94: warning: no return statement in function returning non-void
mannasim/dataGenerator.h: In member function ‘virtual AppData* DataGenerator::getMaximumAllowedValue()’:
mannasim/dataGenerator.h:132: warning: no return statement in function returning non-void
mannasim/accessPointApp.cc: In member function ‘virtual void AccessPointApp::process_data(int, AppData*)’:
mannasim/accessPointApp.cc:79: error: ‘AppDataList’ was not declared in this scope
mannasim/accessPointApp.cc:79: error: expected `;' before ‘list’
mannasim/accessPointApp.cc:81: error: expected primary-expression before ‘int’
mannasim/accessPointApp.cc:81: error: expected `)' before ‘int’
mannasim/accessPointApp.cc:83: error: ‘AppDataList’ is not a class or namespace
mannasim/accessPointApp.cc:83: error: expected `;' before ‘it’
mannasim/accessPointApp.cc:83: error: ‘it’ was not declared in this scope
mannasim/accessPointApp.cc:83: error: missing template arguments before ‘.’ token
mannasim/accessPointApp.cc: In member function ‘virtual void AccessPointApp::forward_data(int, AppData*)’:
mannasim/accessPointApp.cc:97: error: ‘AppDataList’ was not declared in this scope
mannasim/accessPointApp.cc:97: error: expected `;' before ‘list’
mannasim/dataGenerator.h: At global scope:
mannasim/dataGenerator.h:65: warning: inline function ‘virtual void EventTimer::expire(Event*)’ used but never defined
mannasim/dataGenerator.h:52: warning: inline function ‘virtual void SensingTimer::expire(Event*)’ used but never defined
mannasim/sensorBaseApp.h:84: warning: inline function ‘virtual void DisseminatingTimer::expire(Event*)’ used but never defined
make: *** [mannasim/accessPointApp.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems


pls do needful for me as soon as possible...
and if i m nt installing mannasim then how to differentiat between sink nod and common node for WSN....

Sir I want to one decision making module in Sink node...how can i Do it?

pls reply

Hello Mohit,

Gud to see such a useful blog.

I am very new to ns2 and started learning aodv simulation.

While studying merc gres tutorial I know meaning for commands but find difficulty to combine all the pieces altogether like tck,,awk,perl,.tr,.nam etc.
If possible for you can you give me a overview of how we simulate aodv?

I know my question is very wide but I want to know how and at which state we need a particular type of file.

Thanks in advance,
Ranjana

Good day Mohit,
Thanks for the patient and time for answering most of these challenging questions.
I am as well having this problem while trying to run a simple analysis with the codes given in your blog.the error message I got is;

Packet Delivery Fraction (Percentage): 0.00
Normalized Routing Load (Percentage): 0.00
awk: analysis.awk:139: (FILENAME=trace-IEEABR1.tr FNR=136215) fatal: division by zero attempted

thanks in advance,
Zungeru M.A
adamsmurtala@yahoo.com

Thanks a lot Mohit. Your posts have been of immense help to me!

@Vish - These errors are due to the newer versions of gcc that you may be using. I guess you have switched to NRLSensorSim for simulations which I think is a good move.

@Ranjana - To know about simulations of AODV, I would suggest you to learn more about wireless network simulations in NS-2. There are many sample TCL scripts as well as AWK scripts available. You can also refer the tutorial on following link which gives a nice description of AODV simulation in NS-2:

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

@Adamu - You may have to make some modifications in the AWK script according to your trace file/format. Example: check whether the transport protocol used in your simulation is same as the one mentioned in AWK script. If not, please replace it by the one which you are using in your simulations.

Hope it helps.

Regards,
Mohit P. Tahiliani

Thanks Mohit,
it actually help
Regards,
Adamu M.Z

Thanks a lot Mohit.

hi i am new to ns2...i would like to know how to calculate the average throughput for every 10 secs interval for a simple-wireless.tcl example in ns2..plz help me

@Maddy - The best way to do it would be through TCL script by writing a 'procedure' that calculates and logs throughput every 10 seconds. You can find more details about how to do on the following link (see the TCL scripts provided in this tutorial):

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

Hope it helps.

Regards,
Mohit P. Tahiliani

awk pdr.awk out.tr >pdr.txt
awk: 1: unexpected character '.'


solution the problem plz

sir, i need to implement directional antennas in ns2.30 instead of omnidirectional antennas . i am using fedora8. how u pls help me how to implement directional antennas and clustering. thank u in advance

@Bijan - Command to execute AWK Script is

awk -f pdr.awk > pdr.txt

@Tharan - Check the following link to know the details of adding directional antenna functionality in NS-2:

http://cbg.me/2009/02/adding-directional-antenna-and-multiple-interface-support-to-ns-233/

Hope it helps.

Regards,
Mohit P. Tahiliani

hello brother,
i need an awk file to find the energy consumption. its not present in the site mentioned by you. and when i am trying to edit the awk file it shows an error saying invalid char...... waiting for an early reply..........thanx in advance

@Rohit - I have uploaded a sample AWK Script for Energy Consumption on the following link:

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

However, it is designed for a specific purpose (it calculates energy consumption of node number 4 in the network). You MUST modify the script according to your scenario.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello sir,
I need to put a xgraph between hop count and time taken for transmission. Can you pls give me the awk script for the graph
Thanks

Hello Sir,
I am in need code for anycast and geocast routing..can you pls send me the code to this id nethya4@gmail.com.
Thanks in advance

Hello sir,
I have an algorithm in C++ for symbolic routing. How do i integrated it with tcl and execute??pls help urgent

Hi Mohit,

While executing the TCL script for 50 nodes forming a mobile ad hoc network i get the following error :


ns adhoc.tcl DSDV cbr-50-10-8 scene-50-0-20
num_nodes is set 50
INITIALIZE THE LIST xListHead
Loading connection pattern...
couldn't read file "cbr-50-10-8": no such file or directory
while executing
"source.orig cbr-50-10-8"
("uplevel" body line 1)
invoked from within
"uplevel source.orig [list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig [list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source $val(cp)"
(file "adhoc.tcl" line 70)

The tace file and the nam fie doesnt show anything. Where am i going wrong?

Thanks a lot for the extended help.

-Vivek

@Dhivyaanjali - I do not have that type of an AWK script as of now. Regarding merging of C++ code for routing in NS-2, follow the link given below:

http://masimum.dif.um.es/nsrt-howto/pdf/nsrt-howto.pdf

@Vivek - Replied to your query on "Few more AWK Scripts for NS2" blog post.

Hope it helps.

Regards,
Mohit P. Tahiliani

Ho Mohit, the link where the AWK script for "calculating all the performance parameters" is broken. Is there any other link wherein i can download the same file.?

Thanks

hi
i am murali,
i want to give power input to a node and
i have to transfer that power to a near by node.
that power is used to charge the battery of that node.
is it possible to do like that?
please help me in this regard.
suggest me some script to do this.

hi
i am ankit . I am doing a project on implementing network coding and calculating its throughput in wireless networks.
i want to calculate throughput from a trace file using an awk code . can u tell me what command to use? in which directory the trace file and awk code must be stored?

hey
i ran your awk code to calculate delay and throughput - i got some syntax errors.i am new to awk coding . can u please help me by correcting the errors.
error in delay calculation:
awk: delay.awk:1: > BEGIN {
awk: delay.awk:1: ^ syntax error
awk: delay.awk:2: > for (i in send) {
awk: delay.awk:2: ^ syntax error
awk: delay.awk:3: > send[i] = 0
awk: delay.awk:3: ^ syntax error
awk: delay.awk:4: > }
awk: delay.awk:4: ^ syntax error
awk: delay.awk:5: > for (i in recv) {
awk: delay.awk:5: ^ syntax error
awk: delay.awk:6: > recv[i] = 0
awk: delay.awk:6: ^ syntax error
awk: delay.awk:7: > }
awk: delay.awk:7: ^ syntax error
awk: delay.awk:8: > delay = avg_delay = 0
awk: delay.awk:8: ^ syntax error
awk: delay.awk:9: > }
awk: delay.awk:9: ^ syntax error
awk: delay.awk:10: >
awk: delay.awk:10: ^ syntax error

hi
i am murali,
i want to give power input to a node and
i have to transfer that power to a near by node.
that power is used to charge the battery of that node.
is it possible to do like that?
please help me in this regard.
suggest me some script to do this.

hi mohit ...do these awkscripts work for wireless new format..and if they do do i need to extract the information from the trace file firs or feed it the raw trace file....please help...it is urgent...thanks in advance

Hello Sir,

I found out that hello messages are disabled in AODV by default then how are they identifying the neighbors and sending the packets with hello disabled.

As I found that the only way of finding out a neighbor is through hello message.

Regards,

Sena

@Murali - To achieve that scenario you need to make changes in Energy Model of NS-2 so that the "residual energy" of one node decreases and the same for another increases. You need to obtain appropriate node ids in C++ (Note: Node id in C++ is different than that of TCL) to implement you scenario. Energy model C++ files are available in

ns-2/mobile directory (File name: energy-model.cc, energy-model.h)

@Ankit - You can read my another post named "Xgraph and AWK Scripts in NS2" for more details. Moreover, make sure your trace file is of old trace format before you use the AWK scripts provided in this blog.

@Ravi - AWK script to calculate throughput for new trace format is available on my another post named "AWK Script for NS2 supporting new trace format". Information on how to run AWK scripts and plotting Xgraphs is provided in post named "Xgraph and AWK Scripts for NS2"

@Sena - Hello messages are mainly used to identify link failures on the route. Same purpose is also achieved by using "Link Layer feedback". AODV with Hello packets disabled is sometimes also referred as AODV-LL (i.e. with Link Layer feedback).

Hope it helps.

Regards,
Mohit P. Tahiliani

hey ,
Thanx mohit sir for your reply. can you please tell me how to convert new trace file format to an old one .my trace file format is somethin like this.
+ 0.1 1 2 cbr 1000 ------- 2 1.0 3.1 0 0
- 0.1 1 2 cbr 1000 ------- 2 1.0 3.1 0 0
+ 0.108 1 2 cbr 1000 ------- 2 1.0 3.1 1 1
- 0.108 1 2 cbr 1000 ------- 2 1.0 3.1 1 1
r 0.114 1 2 cbr 1000 ------- 2 1.0 3.1 0 0

also i went through your blog on awk codes for new trace format.but i cant read the throughput file due to forbidden error 403.
can u suggest some solution quickly .
thanx
ankit

and also i am not using xgraph since its make has failed
ankit

hi mohit,
thanks for the reply
i have two questions
1)tora in ns-2.34 doesnt seem to be working i tried to patch it but with no use...i tried patching it with adding prot demux etc
2) do you have any awk scripts that can be used in manets upto 100 nodes to calculate,throughput,delay ,jitter,packet delivery ratio etc.
please do reply it is urgent
thanks in advance

hey
i managed to remove all the syntax errors.now i have another problems

1)throughput.awk
error:awk: throughput.awk:46: (FILENAME=simple.tr FNR=6174) fatal: division by zero attempted

2)delay.awk
i get result as 0 0 always.

3)pkt_loss.awk
i get result as 0 0 0 0 always

@Ankit - You need to comment the following line to convert new trace format to old trace format.

$ns use-newtrace

Regarding Xgraph - if you are using Ubuntu - install it by using apt-get.

Use "genthroughput.awk", "e2edelay.awk" and "pdf.awk" provided in my blog named "Few more AWK Scripts for NS-2" to get correct results. Also, if the packet size in your simulation is less than 500 bytes, modify the same in genthroughput.awk before executing it.

@Ravi - The following link may be helpful to you:

http://hpds.ee.ncku.edu.tw/~smallko/ns2/adhoc_routing.htm

Hope it helps.

Regards,
Mohit P. Tahiliani

I have used the energy.awk on my trace file. but always i have got the result like this 0.0000 0.0000. the trace file contains the energy value of the nodes. still it return the 0 value. what is the problem?

plz help.

Sachin

hey
thanks for your help.I am able to check throughput from awk codes in old trace format.

Can u suggest some documentation on changing the routing protocol in ns-2 . i am relatively new to programming and was facing difficulty in studying .cc and .h files . i need to know where the changes needs to be done and how the files have to be linked. My project is to implement network coding(IEEE paper- Xors in the air) and check its throughput. thanks again
Ankit

@Sachin - energy.awk is designed for a specific purpose (it keeps track of energy of node 4 only). You need to modify it to suit your requirements.

@Ankit - You can download a document named "Implementing a new Unicast MANET Routing Protocol in NS-2" from google. It gives a clear idea of how to implement/modify a routing protocol. Also the following link will be very useful to understand Dependency of classes in NS-2:

http://www-rp.lip6.fr/ns-doc/ns226-doc/html/classes.htm

Hope it helps.

Regards,
Mohit P. Tahiliani

hey
this is my trace file for dsr routing protocol
s 1.000000000 _0_ AGT --- 0 tcp 40 [0 0 0 0] ------- [0:0 1:0 32 0] [0 0] 0 0
r 1.000000000 _0_ RTR --- 0 tcp 40 [0 0 0 0] ------- [0:0 1:0 32 0] [0 0] 0 0
s 1.004334103 _0_ RTR --- 1 DSR 32 [0 0 0 0] ------- [0:255 1:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
s 1.004929103 _0_ MAC --- 1 DSR 84 [0 ffffffff 0 800] ------- [0:255 1:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]

this is part of my trace file for aodv routing protocol
s 1.000000000 _0_ AGT --- 0 tcp 40 [0 0 0 0] ------- [0:0 1:0 32 0] [0 0] 0 0
r 1.000000000 _0_ RTR --- 0 tcp 40 [0 0 0 0] ------- [0:0 1:0 32 0] [0 0] 0 0
s 1.000000000 _0_ RTR --- 0 AODV 48 [0 0 0 0] ------- [0:255 -1:255 30 0] [0x2 1 1 [1 0] [0 4]] (REQUEST)
s 1.000115000 _0_ MAC --- 0 AODV 100 [0 ffffffff 0 800] ------- [0:255 -1:255 30 0] [0x2 1 1 [1 0] [0 4]] (REQUEST)
r 1.000915441 _5_ MAC --- 0 AODV 48 [0 ffffffff 0 800] ------- [0:255 -1:255 30 0] [0x2 1 1 [1 0] [0 4]] (REQUEST)

can u suggest how to write awk codes to calculate throughput from these files .my network is wireless with one node surrounded by 5 nodes .
thanks
ankit

@Ankit - This is an old trace format and hence the AWK scripts provided in this blog can be used. See my another post named "Few more AWK Scripts for NS2" or download the AWK scripts from the following link:

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

Name of AWK Script for throughput = genthroughput.awk

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello sir,
how to conclude that a given trace file is a old format or a new format.Help me to analyse it exactly. And to calculate delay or packet delivery fraction or what ever the parameter it is what are the event types and agents need to be tracked of (i.e.)RTR or AGT or etc. For example if we want to calculate packet loss we need how may AGT's sent and how may received.we then apply its count in the formula Data agent sent- data agent received. So kindly help me in the understanding of which events or fields of trace file needed to calculate the above said performance metric.
Thanks in advance..
awaiting for your reply.

@Porkamala - Old trace format is smaller than the new trace format. New trace format provides more information than old trace format and hence is easily distinguishable. Moreover, you can check in your TCL script whether you have used "$ns use-newtrace" command. If yes, then the trace file is of new format else it is of old format. To know more details regarding event types and agents in AWK scripts see my another blog named "Few more AWK Scripts for NS2". You can download those AWK Scripts and analyze the same to know about event types.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello Sir, I am getting following error when i am trying to analyse my trace file which has new format wth the AWK script given in your blog "throughput_newtrace.awk".
Kindly help me to resolve the error.


^ unexpected newline or end of string

awk: myflood.tr:1035: r -t 7.708162820 -Hs 12 -Hd -2 -Ni 12 -Nx 283.31 -Ny 457.83 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw --- -Ma 0 -Md ffffffff -Ms 3 -Mt 800 -Is 3.255 -Id -1.255 -It AODV -Il 48 -If 0 -Ii 0 -Iv 29 -P aodv -Pt 0x2 -Ph 2 -Pb 1 -Pd 9 -Pds 0 -Ps 7 -Pss 4 -Pc REQUEST
awk: myflood.tr:1035:

Hello Sir,

I am using your multi interface script in that how to modify the script to see two simultaneous transmission from a node as they have two interfaces in two different channel I want the node to start the transmission at the same time to the two different destination nodes is that possible ? IF yes please let me know how to accomplish it.

I am doing like this

set tcp [new Agent/TCP]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns_ attach-agent $node_(0) $tcp
$ns_ attach-agent $node_(4) $sink

$ns_ attach-agent $node_(0) $tcp
$ns_ attach-agent $node_(3) $sink
$ns_ connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns_ at 50.0 "$ftp start"

In th trace file I do see two reply packets coming one from node 4 and node 3 but I

expected them to be received at the same time.Whereas there is a huge delay in the seconds set of transmission.from the trace file I see that the seconds set starts only when the first transmission is complete.The use of multi interface to aid the simultaneous transmission So I am wondering what is the cause for the delay
Waiting for your response

Sena

@Abhishek - The error is because your TR file is not complete. Verify this in NAM whether the simulation is running for the time that you have specified in the TCL Script. e.g.: if you have given simulation stop time as 100..is it stopping at 100 or it is terminating before itself.

@Sena - You need to configure 2 TCP flows - tcp0 and tcp1 and attach FTP on each of them. Start both the flows at the same time. You will be able to see simultaneous transmission of packets.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello Sir, Thanks for replying, I have checked my NAM, in which i have used 500 ms in my TCL script and while running NAM it is running till 499.96 something and every-time it runs until 499.9 something only, is it OK??

While a analysing .tr file I again get same error "Unexpected newline or end of string"

Kindly help in this issue.

hi mohit,
the link that you have given to mohits den where all the awk scripts are available, not all of them are functioning. The awk scripts for all performance parameters in wireless and the one above that doesnt seem to be working. Please help me its urgent.
Thanks in advance

@Abhishek - In that case there must be a broken line i.e. it does not have all the columns. Try deleting that line and re-run AWK script on that trace file.

@Ravi - Those files are being modified and will be uploaded soon on this blog!

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

hello mohit,
I am using your packet delivery ratio awk script, can i use it to calculate normalised routing load , as i think it is total router packet i.e, "f" divided by the received packets in the packet delivery ratio output. Please can you advise me on this.its urgent
thanks in advance

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

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

@Ravi - Do not take the count of "f". Instead calculate the total number of routing packets SENT. "f" will give you only a count of packets which are forwarded.

Hope it helps.

Regards,
Mohit P. Tahiliani

hi mohit,
can you please tell me what is the routing packet of DSDV so that i can calculate the routing load, please its urgent. FOR aodv and DSR its aodv and dsr but what is it for DSDV. Thanks in advance

@Ravi - For DSDV its "message". It will be printed in trace file as "aodv" and "dsr" are printed.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi Mohit,
Ali is here I am doing work on a university project for TCP performance evaluation using ns-2 I need your help.please tell me how to install patches
(contributed codes) for different TCP versions i.e, SACK,ELN and SNOOP.
next step is run topology and get data from the trace file and plot the graph.
please suggest me how to do the above steps in my project context.
Thnks

Sir i am trying to implement centralized DNS in MANET using NS2. How to implement multicast DNS for a wireless scenario in NS2. pls help me

@Ali - For that project you need to use the NS-2 Suite provided in the following paper:

http://www.cs.helsinki.fi/u/gurtov/papers/mtp.pdf

which is available in ns-allinone-2.xx/ns-2.xx/tcl/ex/wireless-scripts directory.

Please go through the README file given in that directory to get details of how to plot graphs.

@Suresh - Multicast routing protocol called PUMA is available in default package of ns-allinone-2.35 in ns-2.35/tcl/ex directory. I have not worked with Centralized DNS in NS-2 and hence cannot give any suggestions about it :)

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello sir,
I'm trying to do my PG project on Wireless Network Security... I'd like to simulate the security algorithms using NS2.. Pl throw me some light on what to refer and it would be really helpful if you could lend me some directions on how to proceed with my idea of implementing security attacks and modelling them... Also i'd like to know whether i've to learn C++ coding also if i wish to write codes in NS2... Pl help me find some direction sir..
Thanks

hello sir,
i am a student of telecom and networking
i am doing my final project on ns2 i.e analysis of queuing techniques in wireless networks. i found a module of 802.16 on the following website
http://www.lrc.ic.unicamp.br/wimax_ns2/
when i copied all in the files into ns2 and added the info into the make file, when i do ./configure, it gives me an error saying no .configure file found.
can u help me fix this..

do u know any way through which i can see the packets flow in wireless scenario???

Hello
What is the reason for keeping packetSize>512? when i used smaller packetSize_ for TCP (like 128) and changed this condition, the code doesnt work anymore...can you provide reason for this? Thanks!

@Deepak - Yes you need to learn C++ if you want to modify the working of existing protocols in NS-2 or wish to write a new protocol in NS-2. For implementing Wireless security related scenarios please follow the links given below:

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

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

@Legend Killer - Make sure you are giving ./configure in ns-allinone-2.xx/ns-2.xx directory.

You can visualize packets flowing using NAM utility of NS-2 for wired as well as wireless networks.

@Faran - Packet size is kept more than 512 as per our application requirement. You may modify it as per your requirements. However note that we are also ripping off the header data. If your application does not require such constraint you may remove that entire "if" condition itself.

Hope it helps.

Regards,
Mohit P. Tahiliani

Dear Mohit ,

I want to calculate the number of loss packet in a trace file .
I have a script gawk , it needs some modification to be run ( parametr )
.This is the agwk script :
****
BEGIN {

start_time = 0;

count = 0;

}

{

action = $1;

time = $2;

node_id = $3;

layer = $4;

flags = $5;

seqno = $6;

type = $7;

size = $8;

a = $9;

b = $10;

c = $11;

d = $12;

energy = $14;

for(seqno = 0; seqno < 68; seqno++) {

if(node_id = "_4_" && action == "D" && layer == "IFQ" && type == "cbr") {

count++;

start_time = time;

printf("%f\t%d\n",start_time,count);

}

}

}

END {

}
******
this is the out put of trace file for droped packet :
****
d -t 10.021045480 -Hs 1 -Hd 4194305 -Ni 1 -Nx 60.00 -Ny 50.00 -Nz 1.50 -Ne -1.000000 -Nl MAC -Nw CID -Ma 0 -Md 0 -Ms 8 -Mt 0 -Is 0.1 -Id 4194305.1 -It cbr -Il 256 -If 0 -Ii 1 -Iv 30 -Pn cbr -Pi 0 -Pf 0 -Po 0
****

Please can you tell me what I will change to make the agwk run .
Thanks in advance !

Hi Mohit sir,
Iam shakeel. i have installed redhat v4 and fedora for my project. i am getting error as 'no rule to make target Version,needed by gen/version.c stop'ns failed, when iam installing ns2.30. iam not finding solution. please help me.

@Hajjaji - Your trace format is new trace format. But the Script which you have pasted is designed to work with old trace format. Hence this Script will not work on your trace file. You need to change this script to work with new trace format. Moreover, is seqno < 68 required? If not, you may change it as well. Also when you give a condition layer == "IFQ" it means you are calculating packet drops only due to congestion. If you wish to calculate packet drops in general, you may remove that condition.

@Shakeel - Make sure you have installed all necessary packages such as gcc, g++, x11 libraries, etc.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello Mohit,
I have installed sesons FHMIP1.3.1 extension in ns2.31.I am able to run the simulation properly for mipv6,hmipv6,fmipv6,fhmipv6 (by following same instrucion set provided in simula.tcl).Now i want to compare the results in terms of handover latency?
how to calculate the handover latecy (i.e. the last packet send from PAR and the first packet recived from the NAR) using awk.Can you please guide me on this?

Thanx,
Sangram
sangram@inforeshatech.com

Hello Mohit ,

Please can you tell me what script AWK should me use to calculate the loss paquet and Mean delay ( I change it )
This is a part of my trace file :
###################################################
r -t 10.041140480 -Hs 1 -Hd -2 -Ni 1 -Nx 60.00 -Ny 50.00 -Nz 1.50 -Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.4 -Id 4194307.0 -It cbr -Il 1500 -If 0 -Ii 4 -Iv 31 -Pn cbr -Pi 0 -Pf 0 -Po 0
f -t 10.041140480 -Hs 1 -Hd 4194307 -Ni 1 -Nx 60.00 -Ny 50.00 -Nz 1.50 -Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.4 -Id 4194307.0 -It cbr -Il 1500 -If 0 -Ii 4 -Iv 30 -Pn cbr -Pi 0 -Pf 0 -Po 0
s -t 10.043753185 -Hs 1 -Hd -2 -Ni 1 -Nx 60.00 -Ny 50.00 -Nz 1.50 -Ne -1.000000 -Nl MAC -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0
s -t 10.043753185 -Hs 1 -Hd -2 -Ni 1 -Nx 60.00 -Ny 50.00 -Nz 1.50 -Ne -1.000000 -Nl MAC -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0
s -t 10.043753185 -Hs 1 -Hd -2 -Ni 1 -Nx 60.00 -Ny 50.00 -Nz 1.50 -Ne -1.000000 -Nl MAC -Nw --- -Ma 0 -Md 0 -Ms ffff0608 -Mt 0 -P arp -Po REQUEST -Pms 0 -Ps 4194304 -Pmd 0 -Pd 4194307
r -t 10.043958933 -Hs 2 -Hd -2 -Ni 2 -Nx 70.00 -Ny 50.00 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0
r -t 10.043958933 -Hs 3 -Hd -2 -Ni 3 -Nx 70.00 -Ny 50.00 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0
r -t 10.043958933 -Hs 4 -Hd -2 -Ni 4 -Nx 70.00 -Ny 50.00 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0
r -t 10.043958934 -Hs 2 -Hd -2 -Ni 2 -Nx 70.00 -Ny 50.00 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0
r -t 10.043958934 -Hs 3 -Hd -2 -Ni 3 -Nx 70.00 -Ny 50.00 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0
r -t 10.043958934 -Hs 4 -Hd -2 -Ni 4 -Nx 70.00 -Ny 50.00 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0
r -t 10.043958935 -Hs 2 -Hd -2 -Ni 2 -Nx 70.00 -Ny 50.00 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw --- -Ma 0 -Md 0 -Ms ffff0608 -Mt 0 -P arp -Po REQUEST -Pms 0 -Ps 4194304 -Pmd 0 -Pd 4194307
+ 10.06 0 1 cbr 256 ------- 0 0.0.0.5 1.0.3.1 0 6
- 10.06 0 1 cbr 256 ------- 0 0.0.0.5 1.0.3.1 0 6
r 10.06102 0 1 cbr 256 ------- 0 0.0.0.5 1.0.3.1 0 6
r -t 10.061020480 -Hs 1 -Hd -2 -Ni 1 -Nx 60.00 -Ny 50.00 -Nz 1.50 -Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.5 -Id 4194307.1 -It cbr -Il 256 -If 0 -Ii 6 -Iv 31 -Pn cbr -Pi 0 -Pf 0 -Po 0
f -t 10.061020480 -Hs 1 -Hd 4194307 -Ni 1 -Nx 60.00 -Ny 50.00 -Nz 1.50 -Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.5 -Id 4194307.1 -It cbr -Il 256 -If 0 -Ii 6 -Iv 30 -Pn cbr -Pi 0 -Pf 0 -Po 0
d -t 10.061045480 -Hs 1 -Hd 4194307 -Ni 1 -Nx 60.00 -Ny 50.00 -Nz 1.50 -Ne -1.000000 -Nl MAC -Nw CID -Ma 0 -Md 0 -Ms 8 -Mt 0 -Is 0.5 -Id 4194307.1 -It cbr -Il 256 -If 0 -Ii 6 -Iv 30 -Pn cbr -Pi 0 -Pf 0 -Po 0
############################
What script AWK I should use ?? I make run many scripts but without any result !!
Please help me !!

@Sangram - You can calculate handover latency by tracing Binding Update and Binding Acknowledgment packets in the trace file. E.g. MIPv6 patch prints "bu" in trace file for Binding update packets.

@Hajjiji - You need to modify the AWK Scripts available on this blog so as to make them work on New Trace Format.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi Mohit,sequel to Sangram's question can you please further explain on how to analyse the results(trace) using an awk script bcos I checked the trace files as you suggested but could not locate the BUs.I am on a project (FHMIP and AAA) and I have also installed the FHMIP patch.I however would be implementing AAA server to secure the Handover Signalling messages between the MN and the Access Routers.Please do you have any readily available script/code for this or links with a similar implementation.

Look forward to your response,thank you very much in anticipation.

Sir,please help with this FHMIP problem,I also want to compare the latencies of mip,hmip,fmip and dont know how with awk script.Cannot understand the trace files and did not see the BU you talked about in the trace

how to identify one trace file is new format or old format.how to know throughput value is correct or not.how to know the tracefile is correct or not.

s -t 5.000000000 -Hs 0 -Hd -2 -Ni 0 -Nx 453.00 -Ny 265.00 -Nz 0.00 -Ne -1.000000 -Nl AGT -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.0 -Id 2.0 -It cbr -Il 1000 -If 0 -Ii 0 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
r -t 5.000000000 -Hs 0 -Hd -2 -Ni 0 -Nx 453.00 -Ny 265.00 -Nz 0.00 -Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.0 -Id 2.0 -It cbr -Il 1000 -If 0 -Ii 0 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
s -t 5.000000000 -Hs 0 -Hd -2 -Ni 0 -Nx 453.00 -Ny 265.00 -Nz 0.00 -Ne -1.000000 -Nl AGT -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.1 -Id 4.0 -It cbr -Il 1000 -If 0 -Ii 1 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
r -t 5.000000000 -Hs 0 -Hd -2 -Ni 0 -Nx 453.00 -Ny 265.00 -Nz 0.00 -Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.1 -Id 4.0 -It cbr -Il 1000 -If 0 -Ii 1 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
s -t 5.000000000 -Hs 0 -Hd -2 -Ni 0 -Nx 453.00 -Ny 265.00 -Nz 0.00 -Ne -1.000000 -Nl AGT -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.2 -Id 8.0 -It cbr -Il 1000 -If 0 -Ii 2 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
r -t 5.000000000 -Hs 0 -Hd -2 -Ni 0 -Nx 453.00 -Ny 265.00 -Nz 0.00 -Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.2 -Id 8.0 -It cbr -Il 1000 -If 0 -Ii 2 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
s -t 5.000000000 -Hs 1 -Hd -2 -Ni 1 -Nx 291.00 -Ny 171.00 -Nz 0.00 -Ne -1.000000 -Nl AGT -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 1.0 -Id 9.0 -It cbr -Il 1000 -If 0 -Ii 3 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
r -t 5.000000000 -Hs 1 -Hd -2 -Ni 1 -Nx 291.00 -Ny 171.00 -Nz 0.00 -Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 1.0 -Id 9.0 -It cbr -Il 1000 -If 0 -Ii 3 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
s -t 5.000000000 -Hs 3 -Hd -2 -Ni 3 -Nx 29.00 -Ny 488.00 -Nz 0.00 -Ne -1.000000 -Nl AGT -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 3.0 -Id 6.0 -It cbr -Il 1000 -If 0 -Ii 4 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
r -t 5.000000000 -Hs 3 -Hd -2 -Ni 3 -Nx 29.00 -Ny 488.00 -Nz 0.00 -Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 3.0 -Id 6.0 -It cbr -Il 1000 -If 0 -Ii 4 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
s -t 5.000000000 -Hs 3 -Hd -2 -Ni 3 -Nx 29.00 -Ny 488.00 -Nz 0.00 -Ne -1.000000 -Nl AGT -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 3.1 -Id 7.0 -It cbr -Il 1000 -If 0 -Ii 5 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
r -t 5.000000000 -Hs 3 -Hd -2 -Ni 3 -Nx 29.00 -Ny 488.00 -Nz 0.00 -Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 3.1 -Id 7.0 -It cbr -Il 1000 -If 0 -Ii 5 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
s -t 5.000000000 -Hs 3 -Hd -2 -Ni 3 -Nx 29.00 -Ny 488.00 -Nz 0.00 -Ne -1.000000 -Nl AGT -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 3.2 -Id 8.1 -It cbr -Il 1000 -If 0 -Ii 6 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
r -t 5.000000000 -Hs 3 -Hd -2 -Ni 3 -Nx 29.00 -Ny 488.00 -Nz 0.00 -Ne -1.000000 -Nl RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 3.2 -Id 8.1 -It cbr -Il 1000 -If 0 -Ii 6 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0
s -t 5.000000000 -Hs 4 -Hd -2 -Ni 4 -Nx 496.00 -Ny 347.00 -Nz 0.00 -Ne -1.000000 -Nl AGT -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 4.1 -Id 6.1 -It cbr -Il 1000 -If 0 -Ii 7 -Iv 32 -Pn cbr -Pi 0 -Pf 0 -Po 0

s 5.000000000 _0_ RTR --- 0 AODV 48 [0 0 0 0] ------- [0:255 -1:255 30 0] [0x2 1 2 [4 0] [0 6]] (REQUEST)
s 5.000000000 _0_ RTR --- 0 AODV 48 [0 0 0 0] ------- [0:255 -1:255 30 0] [0x2 1 3 [8 0] [0 8]] (REQUEST)
s 5.000000000 _0_ RTR --- 0 AODV 48 [0 0 0 0] ------- [0:255 -1:255 30 0] [0x2 1 3 [8 0] [0 8]] (REQUEST)
s 5.000000000 _0_ RTR --- 0 AODV 48 [0 0 0 0] ------- [0:255 -1:255 30 0] [0x2 1 3 [8 0] [0 8]] (REQUEST)
s 5.000000000 _0_ RTR --- 0 AODV 48 [0 0 0 0] ------- [0:255 -1:255 30 0] [0x2 1 3 [8 0] [0 8]] (REQUEST)
s 5.000000000 _1_ RTR --- 0 AODV 48 [0 0 0 0] ------- [1:255 -1:255 30 0] [0x2 1 1 [9 0] [1 4]] (REQUEST)
s 5.000000000 _1_ RTR --- 0 AODV 48 [0 0 0 0] ------- [1:255 -1:255 30 0] [0x2 1 1 [9 0] [1 4]] (REQUEST)
s 5.000000000 _1_ RTR --- 0 AODV 48 [0 0 0 0] ------- [1:255 -1:255 30 0] [0x2 1 1 [9 0] [1 4]] (REQUEST)
hi mohit the above is my tracefile format.
could you please suggest me how to know it is new format or old format?
and i need awk scripts for delay, packet delivery ratio for above format tracefile.

Hi sir,
I'm trying to simulate Blackhole attack in AODV protocol.Need to apply a new protocol at a particular black hole node (something like "blackhole aodv")and somewhere i read that in order to create a new routing protocol we need to duplicate the existing AODV folder as blackhole and modify all the .cc files in the folder except aodv_packet.h
It was also mentioned that we need to modify all the structures functions and classes in these C++ files. I couldn't get a clear idea on how to implement this idea.Can u pl throw me some more light on simulation of black hole attack and tell me if i'm proceeding in the right path or not?
Any materials that i need to refer into in order to simulate this?
Pl help me sir..
Thanks in advance.
Deepak.

Dear Mohit ,


I want to trace a histogram of Burst packet loss for my trace file .

So, I add a rtmodel such as : $ns rtmodel-at 11.0 down $n(2)
$ns rtmodel-at 15.0 up $n(2)
But,I find not a burst packet loss

Please , Can you tell me if it is possible to create burst packet loss with other method ?
Thanks in advance !

@Silvapearl - Binding update packet gets printed when you use MIPV6. I am not sure what is the name given for a similar packet in FHMIP patch. Moreover, almost all MIPv6 related patches generate wired-cum-wireless trace formats. Are you also getting a similar trace format? Paste a small part of your trace file here.

@Olly - MIPv6 uses packets called Binding Update packets. I am not sure of the name used by FHMIP developers for a similar packet. Refer the documentation to know the different packet names used by FHMIP developers. You will find those packets in trace file which will be useful to create AWK scripts for analysis.

@Sucharita - If you find the following line in the TCL Script, it means the trace file is generated in New trace format:

$ns use-newtrace

else the trace file generated is of old trace format.

The first half of the trace file posted by you is New Trace Format. You can find AWK Script to calculate throughput for new trace format on the following link:

http://mohittahiliani.blogspot.com/2010/03/awk-script-for-ns2-supporting-new-trace.html

The later half is old trace format. AWK Scripts provided in this post and on the following link are designed to work with old trace format:

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

@Deepak - You can find some help regarding Black hole in AODV on the following link:

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

wormhole, symbil/ID spoofing, DOS/DDOS, sinkhole, etc are provided in this patch.

Following is another useful link for creating malicious node in AODV:

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

@Hajjaji - You may try to create a bottleneck link with less bandwidth and high delay so as to simulate burst packet loss.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello Sir

Do you have anything about security in NS2? i need informations about how i add security like encryption or hashing to packets between 2 nodes.

Thx in advance
loukman.najdi@utt.fr

@Loukman - For security related stuff in NS-2 you can use the following links:

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

and

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

Hope it helps.

Regards,
Mohit P. Tahiliani

Dear Mohit,

I'm tring to create packet loss in wirelless link (wimax) using ns-allinone-2.34 using Marcov Model with this script :

proc ErrorModel {} {
set good [new ErrorModel/Uniform 0 pkt]
set bad [new ErrorModel/Uniform 23 pkt]
set m_states [list $good $bad]
set m_periods [list 0.5 0.5]
set m_transmx { {0.90 0.10} {0.85 0.15} }
set m_trunit pkt
set m_sttype pkt
set m_nstates 2
set m_nstart [lindex $m_states 11]
set err [new ErrorModel/MultiState $m_states
$m_periods $m_transmx $m_trunit $m_sttype $m_nstates $m_nstart]
$ns lossmodel $loss_module $sinkNode $bstation
return $err

But, in trace file , I have not a dropped packet(d),+,- packets

Please, can you tell what I will do .I need it in my project !


Thanks in advance !

Hi Mohith,

I am doing M.tech project and now i am at the documentation part. I almost completed it, but my faculty asking me to include the testing chapter, which includes unit, integration testing. How can we do that for ns2 projects as my project in on routing protocol aginst byzantine attack.

@Hajjiji - Error model in NS-2 has two options: either it will drop the erroneous packet or mark it. If marking is enabled, you wont be able to see the drop event in the trace file. Check which option have you enabled!

@Shilpa - Unit and integration testing??? Its not required! Check out the following link:

http://www.linuxquestions.org/questions/linux-software-2/testing-tools-for-ns2-project-873996/

Hope it helps.

Regards,
Mohit P. Tahiliani

hi,
Can I simulate 802.11n frame aggregation on ns-allinone-2.34? Is there any kind of patching is needed for the same.please guide me

Thanks N Regards,

Jyoti

@Jyoti - 802.11n is not available in the allinone package of NS-2. You may try applying the MIMO patches provided in this blog and configure 802.11n settings as we configure 802.11b and other versions of 802.11.

Hope it helps.

Regards,
Mohit P. Tahiliani

good post.. http://www.pradeepkumar.org

Sir,
This is shakeel. I have written a tcl script for a wireless scenario. i have cleared almost all errors but when i execute it with dsr routing protocol, the nam window is not opening and iam getting error as segmentation fault. please help me.Thank you.

@Shakeel - Change the interface queue (ifq) from

Queue/DropTail/PriQueue or Queue/DropTail

to

CMUPriQueue

Hope it helps.

Regards,
Mohit P. Tahiliani

hello

I'm newbie in NS2, and i want to modify the source code of AODV, to insert somme function of security, but there is many files in source code like OADV.cc AODV.h aodv_rtable.h, and each file contains many lines??!!
please help me whow, where and what i must change

thanks in advance

Hello Sir,

Is it possible to simulate a wireless sensor network in NS2 with respect to days or months and also to apply different amount of energy to different nodes? As for my application I am working on a Zigbee based WSN. Please guide me the needful.

Thank you

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

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

and the following link demonstrates how to create malicious node in NS-2:

elmurod.net/?p=196

@Nakul - NS-2 has its own virtual timer. It does not depend on our system clock. To simulate WSN for days/months you need to set up the simulation time appropriately in TCL Script.

Yes, it is possible to assign different energy to different nodes. Example is shown below:

$ns node-config -initialEnergy 100
set node_(0) [$ns node]
...

$ns node-config -initialEnergy 50
set node_(1) [$ns node]
...

Zigbee is available in the default package of NS-2 and sample TCL Scripts are available in the following directory:

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

Hope it helps.

Regards,
Mohit P. Tahiliani

I have output trace file format as

r -t 0.1000032 -s 0 -d 2 -p tcp -e 40 -c 1 -i 0 -a 1 -x {0.0 4.0 0 ------- null}
+ -t 0.1000032 -s 2 -d 3 -p tcp -e 40 -c 1 -i 0 -a 1 -x {0.0 4.0 0 ------- null}
- -t 0.1000032 -s 2 -d 3 -p tcp -e 40 -c 1 -i 0 -a 1 -x {0.0 4.0 0 ------- null}
h -t 0.1000032 -s 2 -d 3 -p tcp -e 40 -c 1 -i 0 -a 1 -x {0.0 4.0 -1 ------- null}
r -t 0.1000032 -s 1 -d 2 -p tcp -e 40 -c 2 -i 1 -a 2 -x {1.0 8.0 0 ------- null}
+ -t 0.1000032 -s 2 -d 3 -p tcp -e 40 -c 2 -i 1 -a 2 -x {1.0 8.0 0 ------- null}
r -t 0.1000032 -s 5 -d 7 -p tcp -e 40 -c 3 -i 2 -a 3 -x {5.0 9.0 0 ------- null}

How to identify the various fields. I need to find the end to end throughput and Average delay. How to find them? Can you kindly tell it?

i got a problem
in my trace file the remaining energy of a node is same for all node .
now how can i get each nodes energy separately or how it is possible to get each nodes energy in trace file

Hi,
I want to know if my explanations is true or no :

*********
set udp5 [new Agent/UDP]

$ns attach-agent $bstation $udp5

set sink6 [new Agent/TCPSink]

$ns attach-agent $wl_node_(2) $sink6

$ns connect $udp5 $sink6
=> This mean that : bstation is the transmitter , wl_node_(2) is the receiver . Wl_node take the packets .then they packet are loss !!
I can show this loss packet in Nam ??

thanks in advance !

@Magesh - Trace file formats are explained on the following link:

http://nsnam.isi.edu/nsnam/index.php/NS-2_Trace_Formats

@Zeeshan - When you use EnergyModel in TCL Script, it prints the values related to energy such as residual energy, idle energy, sleep energy, etc in the trace file.

Example of how to assign different energy to different nodes is shown below:

$ns node-config -initialEnergy 100
set node_(0) [$ns node]
...

$ns node-config -initialEnergy 50
set node_(1) [$ns node]
...

@Hajjaji - You are configuring sender with UDP and receiver with TCPSink? What is the application you are trying to simulate?

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi Mr Mohit ,

I'm trying to simulate a scenario between source node , and wirelless nodes . The wirelless nodes are attached to base station .

Please tell me what i will correct in my script that i have posted ??

hello
please how calculte detection time of an attack
thanks in advance

i m using 802.11 as mac protocol in my simulation
now i want to simulate same scrip with SMAC as mac protocol.
i already set the flags that are required in smac but for same tcl sript no packet is receiving and very few packets are sent by the nodes
i.e for 802.11 sent packets are 123140 and recived are 121569
but for smac sent packets are 400 and recived are 0
same tcl script same simulation time in both cases

Dear Sir,

I am getting my trace file output in new format. Is it possible for me to get the output in old format??
Also according to new trace format I am getting following lines in the file:

s 468.348992000 _0_ MAC --- 0 BCN 12 [0 ffffffff 0 0] [energy 99.012366 ei 0.000 es 0.000 et 0.659 er 0.328]

N -t 468.348992 -n 2 -e 99.013134

r 468.349568449 _2_ MAC --- 0 BCN 12 [0 ffffffff 0 0] [energy 99.013134 ei 0.000 es 0.000 et 0.656 er 0.330]

s 468.380160449 _2_ MAC --- 0 BCN 12 [0 ffffffff 2 0] [energy 99.013134 ei 0.000 es 0.000 et 0.656 er 0.330]

how to interpret these...??

@Hajjaji - I would recommend you to create that kind of a scenario by referring to Section X on the following link:

http://www.isi.edu/nsnam/ns/tutorial/

@Eliza - In your C++ code, use "Scheduler::instance.clock()" and assign its value to a variable. Whenever you detect an attack, print the value of this variable from C++.

@Zeeshan - Check ns-default.tcl to verify whether you have correctly set all the flags. Following link also may help you a bit:

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

@Nakul - Your output is already in old trace format. The lines that you have posted are of old trace format and not of new trace format.

Hope it helps.

Regards,
Mohit P. Tahiliani

thankx
now i got high energy consumption in idle mode while using smac....? y i m getting this...?
as far i know idle listening is avioded in smac and node goes to sleep...

sir,
Am nithya ...final year M.tech in anna university(chennai)
i would like to know how can i know when does a handover occur?can i know using trace file?

Hello Sir
I have developed a simple wireless code for 50 nodes.
I am getting the trace_out.tr and trace_out.nam

my trace file output is :

s 0.027064896 _43_ RTR --- 0 message 32 [0 0 0 0] ------- [43:255 -1:255 32 0]
r 0.028204896 _42_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _41_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _40_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _39_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _38_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _37_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _36_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _35_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _34_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _33_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _32_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _31_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _30_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _29_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]
r 0.028204896 _28_ RTR --- 0 message 32 [0 ffffffff 2b 800] ------- [43:255 -1:255 32 0]


r 0.033786872 _0_ RTR --- 1 message 32 [0 ffffffff 1 800] ------- [1:255 -1:255 32 0]
s 0.093438986 _12_ RTR --- 2 message 32 [0 0 0 0] ------- [12:255 -1:255 32 0]
r 0.094538986 _11_ RTR --- 2 message 32 [0 ffffffff c 800] ------- [12:255 -1:255 32 0]
r 0.094538986 _10_ RTR --- 2 message 32 [0 ffffffff c 800] ------- [12:255 -1:255 32 0]
r 0.094538986 _9_ RTR --- 2 message 32 [0 ffffffff c 800] ------- [12:255 -1:255 32 0]
r 0.094538986 _8_ RTR --- 2 message 32 [0 ffffffff c 800] ------- [12:255 -1:255 32 0]
r 0.094538986 _7_ RTR --- 2 message 32 [0 ffffffff c 800] ------- [12:255 -1:255 32 0]
r 0.094538986 _6_ RTR --- 2 message 32 [0 ffffffff c 800] ------- [12:255 -1:255 32 0]
r 0.094538986 _5_ RTR --- 2 message 32 [0 ffffffff c 800] ------- [12:255 -1:255 32 0]
r 0.094538986 _4_ RTR --- 2 message 32 [0 ffffffff c 800] ------- [12:255 -1:255 32 0]
r 0.094538986 _3_ RTR --- 2 message 32 [0 ffffffff c 800] ------- [12:255 -1:255 32 0]
r 0.094538986 _13_ RTR --- 2 message 32 [0 ffffffff c 800] ------- [12:255 -1:255 32 0]
and again more..
Now wish to draw the trace graph for the above trace file

I do have the
getthroughtput.awk and e2edelay.awk files.

I went as per the instrauction given in u blog.
but I got the error:
[root@suraj creating_50_nodes]# awk -f getgraph.awk manet.tcl
##################################################################################

awk: getgraph.awk:22: (FILENAME=manet.tcl FNR=111) fatal: division by zero attempted


further on

[root@suraj creating_50_nodes]# awk -f e2edelay.awk tracefd_out.tr > tracefd_out.xgr

it got sucessful.
the trace_out.xgr file was made whcih contains



GeneratedPackets = 25223
ReceivedPackets = 23787
Packet Delivery Ratio = 94.3068
Total Dropped Packets = 17
Average End-to-End Delay = 53.0102 ms


But I wish to have xgraph for the same please do help me.Its my project work.

Awaiting for u r reponse.

my nodes are not go to the sleep mode while using 802.15.4 why ?

@Zeeshan - High energy consumption not only depends on how you set the values in TCL script but also on the topology that you design. If the node is a bottleneck node, it might consume more energy than other nodes. Make sure you use standard topologies (refer to IEEE/ACM Transactions, Elsevier, Springer, etc) for your simulation.

Regarding 802.15.4 - You can find a pdf file in the following directory which will help you to set the parameters correctly:

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

and also the following link may be useful:

http://www.ee.washington.edu/research/funlab/802_15_4/

@Nithya - You can find that information from C++ code as well as from the trace file (provided the patch that you have applied prints appropriate information about handover in trace file - some patches do not print handover information in trace file - in that case you will have to depend on C++ code to get handover information).

@Suraj - The following link will help you to plot Xgraph using AWK Scripts:

http://mohittahiliani.blogspot.com/2010/08/xgraph-and-awk-scripts-in-ns-2_06.html

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello everyone...

I can get .tr file by .tcl file...
And by packet loss awk script I can generate .txt also.....
But problem is in .txt file. Packet sent and loss reading is zero.

my txt file include "number of packet sent:0 lost:0"

can anyone help me...

Mandar Jajal
L.D. Engg. College

Is packet_loss awk file different for different tcl file??

@Mandar - Use "pdf.awk" script provided on the following link to calculate packet loss. Same file can be used for all wireless TCL scripts:

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

Hope it helps.

Regards,
Mohit P. Tahiliani

sir, can you help me in implementing Secure AODV(saodv), My submission date is near.

Thanks Mohit....
One more question regarding to awk script..
Can I use same awk file for different protocols and for wireless or wired network??

Mandar
L.D. Engg. College

Hi,

Can you help me in creating a directional antenna .tcl script for adhoc network. I know how to do it for omnidirectional antenna but now i want to compare directional and omnidirectional antenna so i have to create a .tcl file for directional with 4 sectors.

@Vineet - SAODV patch is available on the following link:

http://sourceforge.net/projects/saodvns-2292/

@Mandar - Yes you can use the same AWK file for different protocols in wireless networks. For wired networks, you will have to use different AWK Scripts because trace file format for wired networks is different from that of trace file format for wireless.

@Rabin - Directional antenna is not available in the default allinone package of ns2. You need to apply a patch for it. It is available on the following link:

http://cbg.me/2009/02/adding-directional-antenna-and-multiple-interface-support-to-ns-233/

Hope it helps.

Regards,
Mohit P. Tahiliani

Hi sir Mohit,
Could you help me please?
i can't download all your links..I'm studying in China, so it's very difficult to access your website and download..could you please send me AWK Script for NS2; AWK script for throughput, AWK script for jitter AWK script for pdf (packet delivery fraction).im doing the research of comparison of AOMDV and AOMDV with those matrics.
thank you very much..
with all my respect i'm waiting your relpy to e-mail betybs84@yahoo.com
regards

sorry research of comparison of AODV and AOMDV..thank you

hello sir,
i am doing project on mobile agent based service and routing discovery in mobile adhoc network.Sir is there any patch of ns-2 for supporting mobile agent. if not then how can i implement it. Sir give me some sample piece of code. help Sir i am very grateful to u. Please guide me on this project sir.

hello sir,
I am doing project on FHMIPv6 can you give me a patch file for ns2 and procedure to patch..please sir help me...

Hi Sir,
I have to do a project about HMIPv6 and FHMIPv6. I have found their patch in ns2, but I can't find out.It is very important with my project. Can you give me link of their patch, please help me. Thanks you very much.
This is my email: khanhlt.bn@gmail.com

hi sir,
Can u please help us to do ns-2 program for smtp. please guide us with the concept.Thank you sir.This is my mail id: hemalatha955@gmail.com

hi sir,
This is priya.im doing my ME project in wireless mesh networks.im new for ns2.where to download patch fr wmn and how to Install it.can u please help me.

@Guna and Khanhlt - Hierarchial Mobile IP patch for ns-2.31 is available on the following link:

http://tagus.inesc-id.pt/~pestrela/ns2/mobility.html

Example scripts are provided with patches.

@Hema - Sorry no idea about that! Will post here if any material found.

@Rama - There are no patches available yet which are specific to WMNs. However you may start working with Multi-interface patches provided in this blog to get started.

Hope it helps.

Regards,
Mohit P. Tahiliani

sir,
i want to dynamically update trust for each node by checking how many number of packets dropped within a fixed time and route the next data packet through the less dropped node. please help me so that i can start my project with this idea

sir,
i want to dynamically update trust for each node by checking how many number of packets dropped within a fixed time and route the next data packet through the less dropped node. please help me so that i can start my project with this idea

Dear Mohit P. Tahiliani,

I would like to use an awk script to know the average end to end delay, routing overhead, and throughput for new trace format and I cannot find them.

When I found on the website the gave me errors or an answer with 0!

If that is possible to tell where I can get them please.

Thank you very much in advance.

Thamer Jahamneh

@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.

@Thamer - You can download the AWK Script to calculate routing overhead for new trace format from the following link:

http://www.mohittahiliani.blogspot.com/2011/08/awk-scripts-for-normalized-routing.html

and AWK Script to calculate throughput for new trace format from the following link:

http://www.mohittahiliani.blogspot.com/2010/03/awk-script-for-ns2-supporting-new-trace.html

I have not yet designed the AWK Script for end to end delay for new trace format. Will upload as soon as I do it.

Hope it helps.

Regards,
Mohit P. Tahiliani

Thank you very much for that. I would like to ask please if there is an awk script to calculate the route request packets please?

Regards

Thamer Jahamneh

hello sir...........i m doing final year project in secure wireless sensor network using ns2..........would you tell us??how to retrieve energy for sensor nodes using ns2...????and how to generate key for sensor nodes using ns2..????

Thank u very much as i got a starting point now.But the current problem is when i checked using grep command where comes the drop-target,i got many...i got about 30 files having this drop-target.I had gone through many of those files but couldnt see the definition of this drop-target,is it an error model or any function or any class or any variable?Did i need to create a new .cc file or edit any existing one to track through drop-target?if editing any existing one,which should be that?

hello sir...........
i already asked about coding for key generation in wireless sensor network........plz reply fast sir...its very urgent....

@Thamer - As of now such a script is not yet designed. However you can take the ones given on those links and modify them.

@Isvarya - For working with Energy model of NS-2, refer to a sample TCL Script given in the following directory:

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

NAME: wireless-newnode-energy.tcl

Trace format for such a TCL Script is provided on the following link:

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

A sample AWK Script to retrieve remaining energy of a node is provided on the following link:

http://www.mediafire.com/?z1c2cxdt1a31d

NAME: energy.awk (Modify as per your requirement/topology)

Following link deals with Security in Wireless Sensor Networks in NS-2:

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

@Arifa - It is better to use gdb (GNU Debugger) for debugging. Moreover you can use the following link as well:

http://www-rp.lip6.fr/ns-doc/ns226-doc/html/classDropTargetClass.htm

Hope it helps.

Regards,
Mohit P. Tahiliani

sir

how to draw X graph for AODV throughput, delay, jitter,packet loss,i already downloaded that awk scripts..but i don't know how to execute that codes..

Sir,

I want to implement raodv in ns2. pls can u tell me the sources and procedure.

Regards
shakeel

thank u sir..........

@Guna - Refer to this link:

http://mohittahiliani.blogspot.in/2010/08/xgraph-and-awk-scripts-in-ns-2_06.html

@Shakeel - You can download the source code for RAODV from the following link:

http://elmurod.net/?page_id=50

Hope it helps.

Regards,
Mohit P. Tahiliani

I want to implement DCCP in ns2 for MANETs....instead of tcp or udp..........i m not able to start ...........will u please help me?

This is my topic for dissertation...........plz help me to sort it out.......

@Mintu Singh - Following link will be helpful:

http://mohittahiliani.blogspot.in/2010/05/dccp-patches-for-ns-2.html

Moreover, DCCP is available in the latest version of ns-2 i.e. ns-allinone-2.35. Example TCL Script is available in the following directory:

ns-allinone-2.35/ns-2.35/tcl/ex

Name: dccp.tcl

Hope it helps.

Regards,
Mohit P. Tahiliani

hello sir

i have used the awk script in http://mohit.ueuo.com/AWK_Scripts/pdf.awk

but when i have executed the command awk -f PDR.awk file.tr > pdr.xgr
to see the XGraph i can't see it

please sir how can i see the xgraph, thanks in advance

@Eliza - AWK Script which you have used will not be helpful to plot graphs directly. Read the post on the following link:

http://mohittahiliani.blogspot.in/2010/08/xgraph-and-awk-scripts-in-ns-2_06.html

Hope it helps.

Regards,
Mohit P. Tahiliani

hello sir

i have read it, but i did not understand what i must modify exactly to plot graphs

thanks in advance

Thanks sir.
Sir, I am using ns-2.34, here i m not able to fnd (dccp.tcl).
please tell me how could i find it in ns-2.34 version.
I am not able to draw the topology also for manets so that i could compare its performance with existing udp and tcp..........

hiii

i have tried executing instantJitter.awk file for simple wireless example but am getting error


flow flowType src dst time jitter1 jitter2 jitter3

can u explain the code in awk script
..do u have any simple examples using 802.11s protocol

Hi Mohit

Can we find out that how many Hello packets are generated by using trace file.

Regards,
Subhash Sagar

hi, i am implementing a protocol in ns2. i need help on RSSI(Recieved Signal Strength Indication) calulation between nodes... can someone help me ?

Hello Sir..Actually I am working on a project named enhancing the efficiency QOS of wireless networks and for that I wanted the awk script file for AOMDV..The AWK files on ur links are only for aodv..plz provide it ASAP..thnx a lot

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...

hello sir
what is meant by sequence number and how to find it from the trace files

hey the link to energy.awk "http://www.megaupload.com/?f=0211SAG1" is not available...the domain has been removed...please rectify this asap...its urgent

Dipin kumar

Hello sir
My Topic is Improving the Efficincy of QOS in MANET I wrote the code for printing the routing table for aodv in ns2 ..but can't do it for aomdv..can u please provide me with the code
Thank You

I want to do generate a mesh networks.I tried installing ns2.33 in fedora 11.But am getting following error when running nam

"[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox {
%W yview scroll [expr {- (%D)}] units
}
bind Li...""


What is the reason for the error??
Am I able to use any other version to simulate a mesh network??

thanks

hiii

can u give me the code to plot a graph between load vs throughput

hi mohit,
i am working with mannasim. I am not able to analyse trace files generated. They seem to be having some other format.
Can you help?

hiii pdivya

am also working on mesh networks can u share the code with me

thanks
my email id
wcn802@gmail.com

sir, can u help in implementing saodv protocol....thank you in advance

hi mohith
am working on bandwidth estimation for ad-hoc networks with the help of NS2 simulator , can you please tell me how to get the .awk file to retrieve the out put of the simulator.
thanks regards
vinay.

hi sir could you please help me how to find throughput for bottleneck in ns2???
awk script for that..

my mail is mcarockz12@gmail.com

can u please help me how to add a new field to routing table in aodv? which file i have to edit?please provide me any tutorial regarding this

hi sir i need explanation for the below code....if u can please help to learn the code
BEGIN {

start_time = 0;

count = 0;

}

{

action = $1;

time = $2;

node_id = $3;

layer = $4;

flags = $5;

seqno = $6;

type = $7;

size = $8;

a = $9;

b = $10;

c = $11;

d = $12;

energy = $14;

for(seqno = 0; seqno < 68; seqno++) {

if(node_id = "_4_" && action == "D" && layer == "IFQ" && type == "cbr") {

count++;

start_time = time;

printf("%f\t%d\n",start_time,count);

}

}

}

END {

}

Sir i have posted one comment yesterday about awk.throughput for RBAR protocol. But today i can't see that post. please sir help me to get that.

thanks
Tohid

hi sir thanks for your previous helps. i want to calculate the energy-consumption,latency and throughput for senor-medium access control protocol in wireless sensor networks. i want awk scripts which i can convert directly into xgraph plot
Thanks&Regards
Meenakshi.B

@Eliza - You just need to take the print statement from END and put it in the loop so that values are printed each time the loop is executed.

@Mintu Singh - You can get dccp.tcl from the following directory:

ns-allinone-2.35/ns-2.35/tcl/ex

and a tutorial on designing MANET scenarios in ns-2 is given on the following link:

140.116.164.80/~smallko/ns2/adhoc_routing.htm

@Ram - That AWK Script will work only for new trace format. Probably you are running it on old trace format. Include the following line in your TCL Script to print the trace file in new trace format

$ns use-newtrace

802.11s is not available by default in ns-2. You need to apply a patch for that.

@Subhash Sagar- Yes you can count the number of Hello packets from the trace file but "Hello" messages are generally disabled in ns-2 by default. How to enable them for AODV is explained in the following link:

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

@Umair - You can get RSSI value from tworayground.cc if you are using TwoRayGround as the Propagation model or from freespace.cc if you using FreeSpace as the Propagation model.

@Vinayak - The provided AWK Scripts on this blog will work for AOMDV as well. There is no need to design separate AWK Scripts for AOMDV.

@Guna - The following link might help you:

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

@Shrey - Sequence number helps to uniquely identify a packet. In wireless old trace file, sequence number gets printed in the 7th column and in wired trace format, it gets printed in the last column.

@Dipin - The link has been updated.

@Vinayak - The following will be helpful:

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

@Pdivya - You need to make changes in tkBind.c file which is available in the following folder:

ns-allinone-2.33/tk-xx/generic (xx represents the version number)

In that file, search for

/* MappingNotify */ 0,

line and immediately after that line, include the following 3 lines

#ifdef GenericEvent
/ * GenericEvent */ 0,
#endif

After that, re-compile nam by following commands:

./configure
make clean
make
make install

@Ram - As of now, no such code is available. If I get it, I will post it here.

@Sukhi - Yes, Mannasim prints the trace file in a different format. You need to refer to its manual to find the exact field details.

@Vineet - SAODV is already available as a patch on ns-2.29. You can download it from the following link:

http://sourceforge.net/projects/saodvns-2292/develop

@Vinay - The procedure to use AWK Scripts and plotting graphs is explained on the link below:

http://mohittahiliani.blogspot.in/2010/08/xgraph-and-awk-scripts-in-ns-2_06.html

@Honey - Bottleneck throughput for which type of network? Wired or wireless? For wired you can use "avgstats.awk" available on the following link:

http://code.google.com/p/ns2cs386w/source/browse/trunk/trace2stats/avgStats.awk?spec=svn65&r=65

@Arifa - The following will help you to design a routing table for AODV:

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

@Sindhujakmk - It is basic AWK Script. $1 to $14 mean 14 columns of the trace file and the loop counts the number of packets dropped by node number 4.

@Tohid - Where did you post it?

@Meenakshi - AWK Scripts provided on the following link will work for your scenarios:

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

You will have to modify them to plot graphs.

Hope it helps.

Regards,
Mohit P. Tahiliani

@Shrey - A small correction. In wireless old trace format - sequence number gets printed in the 6th column - by mistake I wrote 7th in my previous answer.

Hope it helps.

Regards,
Mohit P. Tahiliani

Hello Mohit sir
sir i am working on wired cum wireless network using AODV+.. ..in trace file none of the packet is recived at AGT .. All are recieved at RTR . So packet delivrry ratio results 0.plz su
ggest me solution..

hiii

thanks for ur reply

i have simulated multi-hop network with 20 nodes but the same program is not executed for 40 nodes and also am not getting error .kindly help me

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