HI all,
Awk Programming is very easy to learn and simple to apply. Awk in NS-2 takes the trace file for analysis.
- Handles complex task such as Calculation, database Handling, Report Creation
- Each Filed is separated using Space(or Tab)
- Record is separated using New-line character.
- $1,$2,$3,$4 are used to access column.
- $awk '{print $1 $2 "---> Rs." $3 * $4}' invent.tr , here "invent.tr" be simple trace file act as input to awk to analyse . Quotes are used for printing purpose.
- To print Entire record "$0" -> $awk '{print $0}' invent.tr
- Invent.tr consist of values separated by space like 10 20 30 40 .
- Here $1 =10 , $2 =20 .........
Awk programming can be used to analyse the metrics of any network connection
- Throughput
- PDF (Packet Delivery ratio)
- Jitter
- end-to-end Delay
- NRL (Network routing Load)
The general form of an AWK program is shown below:
BEGIN {<initialization>}
<pattern1> {<actions>}
<pattern2> {<actions>}
.
.
.
END {<final actions>}
- >> awk -f filename.awk tracefilename.tr
Awk Script Downloads for NS2
- Throughput Click Here
- Jitter: Click Here
- Packet Delivery Ratio: Click Here
- Normalized Routing Load and More AWK files can be found Here : Click Here
- Energy Calculation: Click Here
Hi ,
ReplyDeletei can't download the awk scripts .I want trace graphes : throuput ...
pleaaase can you help me.
Thank's.
hi
ReplyDeletei need awk script for dropped packets and for delay
hi Hareem, Please use below link to Download ENd-2-End Delay
Deletehttp://www.mediafire.com/?z1c2cxdt1a31d
Regarding Dropped packets !! its same as to calculate received packets and send packets .in the Pdf awk script replace the letter "f" or "s" or "r" with "d"
f->forward packets
r->received packets
s->send
d->drop packets
Hello,
DeleteWhat do you mean by in the Pdf awk script replace the letter "f" or "s" or "r" with "d" ?? Should i replace each and every f,r & s with "d" ?
Can you please explain me how that works? Will it show me the number of packets dropped in the simulation/ad-hoc simulation?
A quick reply will be highly appreciated my friend :)
Thanks :)
Hello, I am getting e2e delay for DSDV more than aodv but being proactive its delay should be less. Please tell what can be a mistake in awk script. Please reply. I need it urgently.
ReplyDeleteHello sir,
ReplyDeleteYour blog is very helpful for beginners.
I am trying to use e2edelay.awk for ZRP but it is giving dropped packets 0. All other values are within range for other protocols but for why not for ZRP??
$ns use-newtrace ...> remove this line in ur TCL file or commnent it with #
Deleteif you are using new trace file then check the awk scrip whether its new trace file one or old trace file awk.
hey aditi have u implemented zrp? can u help me in implementing zrp.....pls? reply asap
DeleteIts for new trace format sir.
ReplyDelete# DROPPED PACKETS
if (( $1 == "d" ) && ( $35 == "cbr" ) && ( $3 > 0 ))
{
droppedPackets=droppedPackets+1;
}
N ZRP trace is
d -t 92.380779825 -Hs 28 -Hd 0 -Ni 28 -Nx 188.43 -Ny 519.74 -Nz 0.00 -Ne -1.000000 -Nl IFQ -Nw --- -Ma 0 -Md 0 -Ms 1c -Mt 800 -Is 28.255 -Id 0.255 -It ZRP -Il 564 -If 0 -Ii 63059 -Iv 5 -Zsrc 28 -Zdst 29 -Ztyp IERP_DATA -Zseq 688 -Zqid 0 -Zlbc 0
Please use the code of end-2-end delay for old trace format i posted ....
DeleteUsing above script also its giving dropped packet 0 for ZRP.
DeleteGeneratedPackets = 7902
ReceivedPackets = 2925
Packet Delivery Ratio = 37.0159
Total Dropped Packets = 0
Average End-to-End Delay = 64.4466 ms
Please help sir. Is it possible ZRP packet drop is 0 because pdf is coming less than AODV then how cud packet drop 0.
could u tell me the code to find packet drops at each node for aodv implemented wireless simulation using awk scripts??? pls help...its urgent
DeleteOhk sir.....Thnx a lot.
ReplyDeletehw to generate xgraph from a awk script?
ReplyDeleteonce you got the results , note it down wat u want to keep in the xgraph i.e. group size vs packet delievery ration for example. once u got all the results ,,please check the article on xgraph
DeleteHi yuvraj
ReplyDeleteHow to change sifs & CW values ?
Thx for this blog
Its comes under MAC protocol which specified in the TCL file..if you want to edit the file ,,,you need to see the mac 802.11 file and there you need to change the default values to your values.
Deletethanks for reply.
Deletei have used
Mac/802_11 set SlotTime_ 0.000010
Mac/802_11 set SIFS_ 0.000020
Mac/802_11 set CWMax_ 1023
in my tcl script & viaried SIFS values to check throughput.
But in ns directory:
ns-allinone-2.35-RC7/ns-2.35/mac
how can i vary sifs value in mac-802_11.cc or .h file.
Also how to differentiate between 802.11 a/b/g in ns directory.
Hello sir,
ReplyDeleteThanx alot for starting this blog
Sir I have installed DYMOUM patch in ns 2.34. It is running successfully.
But one column in trace format is showing undefined in palce of DYMOUM thats why routing packets and NRL is zero. Please help sir what is wrong.
s 45.800282856 _38_ RTR --- 3606 undefined 24 [0 0 0 0] ------- [38:255 -1:255 1 0] [ HELLO 0 0 4 ]
Its due to patching problems ....please re-check the steps u followed to edit some of the files. if i can't any solution they use undefined in the position of routing protocol in awk script and check whether u r getting accurate results .
ReplyDeleteThx sir,your codes are super....
ReplyDeleteBut in my code,I modified location of node & it start working fine..
Sir I want to implement pcf over dcf in manet, for Qos guarantees in real time data transmission over manet.
What changes in my tcl should I do to send video or voice packets?
& how to create & allocate multiple parallel channels for best effort & high priority data?
for that i think you need to use VOIP protocol. please check it once about VOIP protocol
DeleteYour replies are highly encouraging!
DeleteBut i am not getting any clue of how to generate video traffic through CBR application, & its relation with our tcl code.
Also what should be written in tcl code for creating two channels,one separate each for text data & other for video data over manet.
Thanks for your guidance sir!
http://www.sce.carleton.ca/~amatrawy/mpeg4/
DeleteThe above link will give the details to generate the Video Traffic
thanks for reply.
ReplyDeletei have used
Mac/802_11 set SlotTime_ 0.000010
Mac/802_11 set SIFS_ 0.000020
Mac/802_11 set CWMax_ 1023
in my tcl script & viaried SIFS values to check throughput.
But in ns directory:
ns-allinone-2.35-RC7/ns-2.35/mac
how can i vary sifs value in mac-802_11.cc or .h file.
Also how to differentiate between 802.11 a/b/g in ns directory.
Hello sir,
Deletethis effort of yours is great!
I have a query regarding setdest::
can we directly add pause time in tcl without recompiling,
if yes what will be the syntax &
If not then how can we set different pause time for different nodes in wireless topology.
Thanks in advance sir!
@puneet: you can set the default value in the function below, here the code is like the values u r passing from TCL get set...if you want the value to be fixed , you can simply give the value instead of &SIFSTime
DeletePHY_MIB::PHY_MIB(Mac802_11 *parent)
{
/*
* Bind the phy mib objects. Note that these will be bound
* to Mac/802_11 variables
*/
parent->bind("CWMin_", &CWMin);
parent->bind("CWMax_", &CWMax);
PHY_MIB::PHY_MIB(Mac802_11 *parent)
{
/*
* Bind the phy mib objects. Note that these will be bound
* to Mac/802_11 variables
*/
parent->bind("CWMin_", &CWMin);
parent->bind("CWMax_", &CWMax);
parent->bind("SlotTime_", &SlotTime);
parent->bind("SIFS_", &SIFSTime);
@suyash: Ns-2 used to create scenario files
Delete2. Creating node-movements for wireless scenarios.
The node-movement generator is available under ~ns/indep-utils/cmu-scen-gen/setdest directory and consists of setdest{.cc,.h} and Makefile. CMU's version of setdest used system dependent /dev/random and made calls to library functions initstate() for generating random numbers. That was replaced with a more portable random number generator (class RNG) available in ns. In order to compile the revised setdest.cc do the following:
1. Go to ns directory and run "configure" (you probably have done that already while building ns). This creates a makefile for setdest.
2.Go to indep-utils/cmu-scen-gen/setdest. Run "make" , which first creates a stand-alone object file for ~ns/rng.cc (the stand-alone version doesnot use Tclcl libs) and then creates the executable setdest.
3. Run setdest with arguments as shown below:
./setdest [-n num_of_nodes] [-p pausetime] [-s maxspeed] [-t simtime] \
[-x maxx] [-y maxy] > [outdir/movement-file]
Lets say we want to create a node-movement scenario consisting of 20 nodes moving with maximum speed of 10.0m/s with an average pause between movement being 2s. We want the simulation to stop after 200s and the topology boundary is defined as 500 X 500. So our command line will look like:
./setdest -n 20 -p 2.0 -s 10.0 -t 200 -x 500 -y 500 > scen-20-test
The output is written to stdout by default. We redirect the output to file scen-20-test. The file begins with the initial position of the nodes and goes on to define the node movements.
$ns_ at 2.000000000000 "$node_(0) setdest 90.441179033457 44.896095544010
1.373556960010"
This line from scen-20-test defines that node_(0) at time 2.0s starts to move toward destination (90.44, 44.89) at a speed of 1.37m/s. These command lines can be used to change direction and speed of movement of mobilenodes.
Directives for GOD are present as well in node-movement file. The General Operations Director (GOD) object is used to store global information about the state of the environment, network, or nodes that an omniscent observer would have, but that should not be made known to any participant in the simulation.
Currently, the god object is used only to store an array of the shortest number of hops required to reach from one node to an other. The god object does not calculate this on the fly during simulation runs, since it can be quite time consuming. The information is loaded into the god object from the movement pattern file where lines of the form
$ns_ at 899.642 "$god_ set-dist 23 46 2"
are used to load the god object with the knowledge that the shortest path between node 23 and node 46 changed to 2 hops at time 899.642.
The setdest program generates node-movement files using the random waypoint algorithm. These files already include the lines to load the god object with the appropriate information at the appropriate time.
In .cc file,I tried replacing "&SIFSTime" with values.
DeleteBut I got the same values of throughput,delay,pdr.
Recompile the ns2 by entering
Delete1)./configure
2)make
3) make install
Thanks Yuvraj sir!
ReplyDeleteBut can,t we directly use for pause time:
setdest .
because on reconfiguring like:
./setdest -n 50 -p 200 -s uniform -m 0.0 -M 50.0 -t 900.0 -x 1000 -y 1000 >scen-50
I got a file scen-50.
How to use this now?
As I try to use set val(cp) "scen-50" but has no effect on performance.
Please guide me with your knowledge.....
By directly means:
ReplyDeleteCan we directly include pause time in tcl script:
$ns at " $n() setdest "
Is their any provision for adding field in it for individual nodes?
$ns_ at 0.75 "$n2 setdest 379.0 349.0 20.0" ---> you can specify speed in the tcl file . Pause time is common for the entire simulator environment setup. thats why it declared only once in scenario file generation.
DeleteThanks Sir
DeleteBut on re configuring we get a text file.
I named that file scen-50.
How to use this file now in tcl?
As I try to use
set val(cp) "scen-50";
& secondly
set val(sc) "scen-50";
both commands reflected no effect on performance.
puts "Loading scenarios-05-25 file..."
Deletesource "scenarios/scen-50"
create one scenarios folder and keep scen-50 file in that folder and use above commands in ur tcl file
So if i have to vary pause time from 10 to 100 in steps of 10,
Deletei have to recompile using ./setdest command & create 10 different text files.
Then keep them in a folder 'scenario'.
That folder has to be kept in the same folder which also has the tcl file.
Tcl files will now include
puts "Loading scenario file..."
source "scenario/"
Please verify above steps.
Thanks for replying !
ReplyDeleteI tried replacing &SIFSTime with values.
But I got the same values of throughput,delay,pdr.
Where as throughput should have been maximum for 8 microsecond.
What should I do?
Also what can be done for removing hidden terminal problem using ns 2.35?
Hello Sir
ReplyDeleteFirst of all I thank you for helping us out.
I have generated scenario for 30 adhoc nodes,
Now I want to detect hidden terminal problem if any in the scenario & please suggest me the modification I need to carry out in my 50adhoc.tcl for removal of the hidden terminal problem.
Possible Solutions To avoid Hidden Terminal Problem
ReplyDelete-------------------------------------------------------
1) Increase the Transmission power in ut tcl file. set Rx_ "value" increase this power value.
2) Move the nodes in ur environment setup. moving nodes can sense the carriers easily there by reduce the problem
3) Use Omni Directional Antenna instead of Directional in ur tcl fine under antenna set up.
Thank you sir for helping out!
DeleteWithout recompiling the kernel
if I carry out the changes told by you in various tcl only,
& get different results for each tcl.
Will that be enough to be considered as research work?
Can I publish a paper or in other case submit masters thesis with those results?
Increase the group size like 5,10,20,30,40,50 nodes and check the PDF,JITTER,NRL,Throughput,Delay using awk scripts. once u got results draw the graph for group size vs PDF,Jitter,NRL.....
Deleteawk running with throughput=0 for some topology.
Deletewonder where lies the problem?
And is it legal to use your awk scripts for my thesis work?
I have read some IEEE papers having almost the same work which you told me.
But how can that be a research then?
Its just redoing of with varying parameters.
Anyways thx for taking your time for beginners like me!
Sir I am reading this :
ReplyDeletehttp://140.116.164.80/~jhlin5/ns2/ns2.htm
& link maentioned by you
http://www.sce.carleton.ca/~amatrawy/mpeg4/
Thanks for your kind help!
Thank you very much sir!
ReplyDeleteOne more question:
About hidden terminal problem type I;
If we created a topology of 500x500 of 100 nodes then most of the nodes will be in carrier sensing & transmitting range of each other.
Then the problem is bound to occur I suppose?
Am I right?
Sir, i am doing a project on wireless sensor network, in my project i need show energy graph. i hv no idea about awk script of energy consumption...throughput n all i can do..plz help me in energy awk script...thank you
ReplyDeleteFor enabling energy , please check my post on energy module in NS-2. once u enable the energy model in NS-2 , the energy will be shown in joules in trace file. intially u hav to set the energy in joules in TCL file.
DeleteFor graph , run the scenario for 200 sec. change the group size like 10,20,30,40,50 and check the final energy after stoping the simulation . thus u can draw a graph between energy consumption and group size
Hello sir,we are implementing a project for intrusion detection in MANETs.We need to extract 4 parameters namely packet loss,packet sent,packet received and energy consumption from trace files.Please can you help us out with awk script for extracting these parameters?
ReplyDeleteHello sir,i am implementing a project called Intrusion Detection in MANETs.We need to analyse 4 parameters namely:packet sent(PS),packet received(PR),packet loss(PL),energy consumption(EC).Sir please can you help us out with the awk script needed to extract those parameters?
ReplyDeleteHello,we are doing a project intrusion detection in MANETs using AODV protocol,we have carried out simulation.We need to extract 4 parameters :Packet loss,packet sent,packet received and energy consumption from trace files.Can you help us out with awk file?
ReplyDeleteHello,we are doing a project intrusion detection in MANETs using AODV protocol,we have carried out simulation.We need to extract 4 parameters :Packet loss,packet sent,packet received and energy consumption from trace files.Can you help us out with awk file?
ReplyDeleteHi Abhishek, you can download the awk scripts for each parameter.in PDF awk script ,you can get all packet loss,packet sent,packet received,energy consump in tht only. please see my post on awk script usuage.
DeleteSorry sir i did not find it.Can you please send that link
Deletehttp://www.mediafire.com/?lb8ihh6n2v5vwim
Deletehi Abhishek and Beegalayuvraj Sir, i am also working on intrusion detection system in MANETs based on DSR routing protocol . my topic is EAACK - A Secure Intrusion Detection system " IEEE 2013. I am new to NS-2 , learnt some basics and went through NS-2 Manual , but i am confused from where to start and end. i have strong desire to learn this and do my project on my own , i need some basic guideline regarding this.... PlZ PLZ help me.
Deletecan you plz provide the awk for calculating energy consumption
ReplyDeletehttp://www.mediafire.com/?lb8ihh6n2v5vwim
DeleteThank you sir for the reply...but i tried using this awk file.it is not showing any output..Can u plz tell me where am i going wrong..or do i need to change something in this.
DeleteCheck out the trace file foramt u r using . there are two types 1) new trace file which contains many columns in the trace file around (34) . 2) old trace file foramt around 10 . in awk if they are using in between $20 to $30 like this .it means its awk script for new trace file format. you can disable it by commenting $ns_ new trace line in ur tcl file.
DeleteSir it is using old trace file format,still it is not working.
Deletes 14.544278800 _6_ AGT --- 1 cbr 28 [0 0 0 0] ------- [6:0 5:1 32 0] [0] 0 1
r 15.953406826 _5_ AGT --- 1 cbr 28 [220 5 6 800] ------- [6:0 5:1 32 5] [0] 1 1
this is the type of trace file it is using. Can u help.
hi rahul, change it new trace file format. do u see any energy related trace in this old trace format ? no . enable the new trace file format in ur TCL file and apply awk . it will definitely work. check the command it will look like this ...... $ns_ newtrace.....add new trace format command in TCL
DeletePlease can you help me writting .sh scripts to simulate ad hoc routing protocoles ?
ReplyDeleteBetter to simulate with TCL file instead << .sh file >> . thoguh u write .sh file , you should call the TCL file only. TCL file will produce trace file from which results can be analyzed.
DeleteTCL ->TRACE FILE-> apply AWK scripts-> Results ->apply Xgraph -> graph as conclusion
sir how can we install zigbee protocol in ns2 kindly tell me about that .
ReplyDeletehttp://en.pudn.com/downloads157/sourcecode/others/detail700528_en.html
DeleteDownload the protocol here and follow steps given in that .
How to remove division by zero attempted error in ns2? I am getting this error when i ma trying to run awk script for the olsr protocol. Hoping for a reply soon.
ReplyDeleteCheck out the trace file foramt u r using . there are two types 1) new trace file which contains many columns in the trace file around (34) . 2) old trace file foramt around 10 . in awk if they are using in between $20 to $30 like this .it means its awk script for new trace file format. you can disable it by commenting $ns_ new trace line in ur tcl file.
Deletesir I have tried both old and new format but awk script for enery does not work belo I have past old format but I have also try new one but it is not working there is no result kindly tell me the solution thanx .
ReplyDeletes 0.100000000 _0_ AGT --- 0 tcp 40 [0 0 0 0] [energy 10.000000 ei 0.000 es 0.000 et 0.000 er 0.000] ------- [0:0 2:0 32 0] [0 0] 0 0
r 0.100000000 _0_ RTR --- 0 tcp 40 [0 0 0 0] [energy 10.000000 ei 0.000 es 0.000 et 0.000 er 0.000] ------- [0:0 2:0 32 0] [0 0] 0 0
s 0.100000000 _0_ RTR --- 0 AODV 48 [0 0 0 0] [energy 10.000000 ei 0.000 es 0.000 et 0.000 er 0.000] ------- [0:255 -1:255 30 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
N -t 0.100115 -n 1 -e 9.899365
N -t 0.100115 -n 6 -e 9.899365
N -t 0.100115 -n 18 -e 9.899365
N -t 0.100115 -n 14 -e 9.899365
N -t 0.100115 -n 15 -e 9.899365
N -t 0.100115 -n 12 -e 9.899365
N -t 0.100115 -n 9 -e 9.899365
N -t 0.100115 -n 13 -e 9.899365
N -t 0.100115 -n 8 -e 9.899365
N -t 0.100115 -n 17 -e 9.899365
N -t 0.100115 -n 16 -e 9.899365
N -t 0.100115 -n 7 -e 9.899365
N -t 0.100115 -n 11 -e 9.899365
N -t 0.100115 -n 20 -e 9.899365
N -t 0.100115 -n 22 -e 9.899365
awk: ne2edelay.awk:91: (FILENAME=mdart.trc FNR=528564) fatal: division by zero attempted
ReplyDeleteerror is shown if i try to run awk file for e2edelay
i am working on ns2.35... wireles sensor networks..jitter and e2edelay file is not working,,,also kind help me to check the node enrgy.. as my work is on enrgy efficiency
DeletePlease check ur trace file format and awk file u r using. the awk script is miss matching with ur trace file...use old trace file and try to execute. it will work 100 %
Deletemay i mail u d whole code? nd d queries i need to ask?
DeleteHi, Great site and very useful.
ReplyDeleteI need an awk file for showing out of sequence packets arriving at a node. Have you got one or, if not, can you point me to where I might find one. Any help greatly appreciated,
John.
That's for ns2.35,
ReplyDeleteThanks,
John
HI john , take Packet delivery node awk script and apply on ur trace file. check if its working or not. if its working , you just need to calculate for individual nodes. if u see the trace file . it will display the node number. in the condition , plz give the $(column num)==node number and calulate . increase the node numbers and calculate.
Deletejeena here
ReplyDeletethis is my code
#-------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
#remove-all-packet-headers ;# removes all except common
#add-packet-header ;# needed headers
Mac/802_11 set CWMin_ 31
Mac/802_11 set CWMax_ 1023
Mac/802_11 set SlotTime_ 0.000020 ;# 20us
Mac/802_11 set SIFS_ 0.000010 ;# 10us
Mac/802_11 set PreambleLength_ 144 ;# 144 bit
Mac/802_11 set ShortPreambleLength_ 72 ;# 72 bit
Mac/802_11 set PreambleDataRate_ 1.0e6 ;# 1Mbps
Mac/802_11 set PLCPHeaderLength_ 48 ;# 48 bits
Mac/802_11 set PLCPDataRate_ 1.0e6 ;# 1Mbps
Mac/802_11 set ShortPLCPDataRate_ 2.0e6 ;# 2Mbps
Mac/802_11 set RTSThreshold_ 3000 ;# bytes
Mac/802_11 set ShortRetryLimit_ 7 ;# retransmissions
Mac/802_11 set LongRetryLimit_ 4 ;# retransmissions
Mac/802_11 set newchipset_ false ;# use new chipset, allowing a more recent packet to be correctly received in place of the first sensed packet
Mac/802_11 set dataRate_ 11Mb ;# 802.11 data transmission rate
Mac/802_11 set basicRate_ 1Mb ;# 802.11 basic transmission rate
Mac/802_11 set aarf_ false ;# 802.11 Auto Rate Fallback
jeena..
ReplyDelete#------------------------------------------------------------------------------
# Defining options
# ------------------------------------------------------------------------------
set val(chan) Channel/WirelessChannel ;# channel type
set val(ant) Antenna/OmniAntenna ;# antenna type
set val(propagation) Shado ;# propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(ll) LL ;# link layer type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ifqlen) 50 ;# max packet in ifq
set val(mac) Mac/802_11 ;# MAC type
set val(rp) MDART;# routing protocol
set val(n) 100.0 ;# node number
set val(density) 4096 ;# node density [node/km^2] i.e. 4096
set val(end) 200.0 ;# simulation time [s]
set val(mobility) Static ;# mobility model
set val(minSpeed) 0.5 ;# movement minimum speed [m/s]
set val(maxSpeed) 1.5 ;# movement maximum speed [m/s]
set val(minPause) 0.1 ;# movement minimum pause time [s]
set val(maxPause) 0.5 ;# movement maximum pause time [s]
set val(movementStart) 100.0 ;# movement start time [s]
set val(traffic) Node-UDP ;# data pattern
set val(dataStart) 100.0 ;# data start time [s]
set val(dataStop) [expr $val(end) - 60.0] ;# data stop time [s]
set val(seed) 1 ;# general pseudo-random sequence generator
set val(macFailed) true ;# ATR protocol: ns2 MAC failed callback
set val(etxMetric) true ;# ATR protocol: ETX route metric
set val(throughput) 5.0 ;# CBR rate (<= 5.4Mb/s)
set val(flow) 100 ;# number of concurrent data flow for FLOW-**P data pattern
set val(nodes) $val(n) ;# number of concurrent transmitting nodes for NODE-**P data pattern
set opt(energymodel) EnergyModel ;
set opt(initialenergy) 100;
# ------------------------------------------------------------------------------
Delete# Topology definition
# ------------------------------------------------------------------------------
#
set val(dim) [expr $val(n) / $val(density)]
set val(x) [expr [expr sqrt($val(dim))] * 1000]
set val(y) [expr [expr sqrt($val(dim))] * 1000]
# ------------------------------------------------------------------------------
# Pseudo-random sequence generator
# ------------------------------------------------------------------------------
# General pseudo-random sequence generator
set genSeed [new RNG]
$genSeed seed $val(seed)
set randomSeed [new RandomVariable/Uniform]
$randomSeed use-rng $genSeed
$randomSeed set min_ 1.0
$randomSeed set max_ 100.0
# Mobility model: x node position [m]
set genNodeX [new RNG]
$genNodeX seed [expr [$randomSeed value]]
set randomNodeX [new RandomVariable/Uniform]
$randomNodeX use-rng $genNodeX
$randomNodeX set min_ 1.0
$randomNodeX set max_ [expr $val(x) - 1.0]
# Mobility model: y node position [m]
set posNodeY [new RNG]
$posNodeY seed [expr [$randomSeed value]]
set randomNodeY [new RandomVariable/Uniform]
$randomNodeY use-rng $posNodeY
$randomNodeY set min_ 1.0
$randomNodeY set max_ [expr $val(y) - 1.0]
# Mobility model: node speed [m/s]
set genNodeSpeed [new RNG]
$genNodeSpeed seed [expr [$randomSeed value]]
set randomNodeSpeed [new RandomVariable/Uniform]
$randomNodeSpeed use-rng $genNodeSpeed
$randomNodeSpeed set min_ $val(minSpeed)
$randomNodeSpeed set max_ $val(maxSpeed)
# Mobility model: node movement pause [s]
set genNodePause [new RNG]
$genNodePause seed [expr [$randomSeed value]]
set randomNodePause [new RandomVariable/Uniform]
$randomNodePause use-rng $genNodePause
$randomNodePause set min_ $val(minPause)
$randomNodePause set max_ $val(maxPause)
# Data pattern: node
set genNode [new RNG]
$genNode seed [expr [$randomSeed value]]
set randomNode [new RandomVariable/Uniform]
$randomNode use-rng $genNode
$randomNode set min_ 0
$randomNode set max_ [expr $val(n) - 1]
# Data pattern "Random": flow start time [s]
set genStartData [new RNG]
$genStartData seed [expr [$randomSeed value]]
set randomStartData [new RandomVariable/Uniform]
$randomStartData use-rng $genStartData
$randomStartData set min_ $val(dataStart)
$randomStartData set max_ $val(dataStop)
# Data pattern "Full: flow start time [s]
set genStartDataFull [new RNG]
$genStartDataFull seed [expr [$randomSeed value]]
set randomStartDataFull [new RandomVariable/Uniform]
$randomStartDataFull use-rng $genStartDataFull
$randomStartDataFull set min_ 0
$randomStartDataFull set max_ [expr ($val(n) * ($val(n) - 1)) - 1]
# Data pattern: flow end time [s]
set genEndData [new RNG]
$genEndData seed [expr [$randomSeed value]]
set randomEndData [new RandomVariable/Uniform]
$randomEndData use-rng $genEndData
$randomEndData set min_ 0.0
$randomEndData set max_ [expr $val(end) - $val(dataStart) - 20]
# ------------------------------------------------------------------------------
ReplyDelete# General definition
# ------------------------------------------------------------------------------
;#Instantiate the simulator
set ns [new Simulator]
;#Define topology
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
;#Create channel
set chan [new $val(chan)]
$prop topography $topo
;#Create God
create-god $val(n)
;#Global node setting
$ns node-config -sensorNode ON -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propInstance $prop \
-phyType $val(netif) \
-channel $chan \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace OFF \
-energyModel $opt(energymodel) \
-rxPower 0.3 \
-txPower 0.6 \
-initialEnergy $opt(initialenergy)
# ------------------------------------------------------------------------------
Delete# Trace file definition
# ------------------------------------------------------------------------------
#New format for wireless traces
#$ns use-newtrace
#Create trace object for ns, nam, monitor and Inspect
set nsTrc [open mdart.trc w]
$ns trace-all $nsTrc
set namTrc [open nam.trc w]
$ns namtrace-all-wireless $namTrc $val(x) $val(y)
set scenarioTrc [open scenario.trc w]
proc fileTrace {} {
global ns nsTrc namTrc
global ns nsTrc scenarioTrc
$ns flush-trace
close $nsTrc
close $scenarioTrc
close $namTrc
}
# ------------------------------------------------------------------------------
Delete# Nodes definition
# ------------------------------------------------------------------------------
;# Create the specified number of nodes [$val(n)] and "attach" them to the channel.
for {set i 0} {$i < $val(n) } {incr i} {
set node($i) [$ns node]
$node($i) random-motion 1 ;# disable random motion 0
}
# ------------------------------------------------------------------------------
# Nodes mobility
# ------------------------------------------------------------------------------
#parameters for trace Inspect
puts $scenarioTrc "# nodes: $val(n), max time: $val(end)"
puts $scenarioTrc "# nominal range: 250"
if {$val(mobility) == "Static"} {
for {set i 0} {$i < $val(n)} {incr i} {
set X [expr [$randomNodeX value] ]
$node($i) set X_ $X
set Y [expr [$randomNodeY value] ]
$node($i) set Y_ $Y
$node($i) set Z_ 0.0
$ns initial_node_pos $node($i) 20
puts $scenarioTrc "\$node_($i) set X_ $X"
puts $scenarioTrc "\$node_($i) set Y_ $Y"
puts $scenarioTrc "\$node_($i) set Z_ 0.0"
}
}
# ------------------------------------------------------------------------------
# Data load
# ------------------------------------------------------------------------------
if {$val(traffic) == "Node-UDP"} {
for {set i 0} {$i < $val(nodes)} {incr i} {
set udp($i) [new Agent/UDP]
$ns attach-agent $node($i) $udp($i)
set dest [expr round([$randomNode value])]
while {$dest == $i} {
set dest [expr round([$randomNode value])]
}
set monitor($dest) [new Agent/LossMonitor]
$ns attach-agent $node($dest) $monitor($dest)
$ns connect $udp($i) $monitor($dest)
set cbr($i) [new Application/Traffic/CBR]
$cbr($i) attach-agent $udp($i)
$cbr($i) set packetSize_ 1000
$cbr($i) set random_ false
$cbr($i) set rate_ [expr $val(throughput) / [expr $val(n) * sqrt($val(n))]]Mb
# $cbr($i) set rate_ [expr $val(throughput)]Mb
$ns at [expr $val(dataStart) + [$randomSeed value]] "$cbr($i) start"
$ns at $val(dataStop) "$cbr($i) stop"
# $ns at [expr [$randomStartData value]] "$cbr($i) start"
# set endData [expr [$randomStartData value] + [$randomEndData value]]
# if {$endData > $val(dataStop)} {
# set endData $val(dataStop)
# }
# $ns at $endData "$cbr($i) stop"
}
}
# ------------------------------------------------------------------------------
# Tracing
# ------------------------------------------------------------------------------
# printing simulation time
proc timeTrace { tracePause} {
global ns
set now [$ns now]
$ns at [expr $now + $tracePause] "timeTrace $tracePause"
puts "$now simulation seconds"
}
$ns at 10.0 "timeTrace 10.0"
#$ns at 500 "[$node(0) agent 255] storeInfo id1 tex#t1"
#$ns at 500 "[$node(0) agent 255] storeInfo id2 text2"
#$ns at 520 "[$node(0) agent 255] requestInfo id1"
# ------------------------------------------------------------------------------
# Starting & ending
# ------------------------------------------------------------------------------
for {set i 0} {$i < $val(n) } {incr i} {
$ns at $val(end) "$node($i) reset";
}
$ns at $val(end) "fileTrace"
$ns at $val(end) "$ns halt"
$ns run
hi dis is jeena,,,d awk files for e2edelay and jitter are not working for dis code...kindly help me as soon as possible...plz plz pl zpl zplz any one help me
ReplyDeleteHI jeena, r u getting trace file for the above TCL script. plz let me knw if u got trace file .so that i can help u with awk scripts
Deleteyes i m getin d trace file. pdf nd throughut r workin properly. jitter awk file runs but jus gives heading of jittr 1 jittr 2 jittr3 jittr4 rest whole file is blank
Deletee2edelay show fatal division by zero error,,,kindly help me by tomorw evng please! i hav to sumbit my work on monday
Deletealso i need to check the residual enrgy of d nodes aftr simulation process...kindly tel me how to do dat as wel thank u so much for ur help
in trace file defition, previously there was no # in front of use new trace format, so i got d answers for pdf nd thruput..i had put dis # aftr reading ur blog stil i cudnt get d answers
Deletehttp://mailman.isi.edu/pipermail/ns-users/2007-August/060804.html
DeleteYou can find useful results here
For Jitter
Delete-----------------------
#New format for wireless traces
$ns use-newtrace ---->keep this line instead #$ns use-newtrace
For End2end Delay
----------------------------------
#old format for wireless traces
#$ns use-newtrace ---->keep this line instead $ns use-newtrace
100% it will work.
i want to implement zrp m using ns2.35 can anyone help me regarding this....one more problem is there while executing dsr getting segmentation fault even for 5 nodes....how can i handle this
ReplyDeleteDsr does not work properly in Ns-2 . I tried it many times. If it not working try this ..
Deletehttps://github.com/erimatnor/dsr-uu
no it isnt workin
Deleteshall i download ns2.33
ReplyDeletehye,
ReplyDeletemy awk jiiter script show blank result like that on terminal
# flow flowType src dst time jitter1 jitter2 jitter3 jitter4
plz tell me what changes i have done in my tcl script to find results?
For Jitter
Delete-----------------------
#New format for wireless traces
$ns use-newtrace ---->keep this line instead #$ns use-newtrace
For End2end Delay
----------------------------------
#old format for wireless traces
#$ns use-newtrace ---->keep this line instead $ns use-newtrace
100% it will work.
thanks a lot sir.but cann't download the average jitter file for wireless. i have average jitter file for wired network.
Deletesir. $ns use-newtrace line is placed in tracefile adhoc.tcl, how can i findout jitter value plz tell me whole procedure sir i cann't understand.
Deletebetter i will make it as a post....please check for my latest post
Deletesir m doing all the things which u tell me earlier, but again result is same .i m adding $ns use-newtrace .and new trace file generated but result again # flow flowType src dst time jitter1 jitter2 jitter3 jitter4. plz help me for doing my project in which jitter is most important.
Deletehello sir,pls help me .i want to calculate end to end delay at every instant by the using of awk script.but i have only for avg delay.plz can u give a link for downloading,or suggest me how modify for at instant....plzzzzzzzz
ReplyDeletethnk you
DeleteDelay at each instant or node
----------------------------------------------------
Add this code at the end of ur script in END { } section
for(i=0; i<=seqno; i++) {
print "Delay at each node+i :" dealy[i] ;
hai friend,
ReplyDeletehow can i include the attacker in protocol.I want to find out the sybil,selected forward attacks.i m a beginner. pls give a idea yar
Priyanka: can u tell me which protocol , u want to add attacker. Please see my post on black hole attack . Similarly u can add attacker for ur s
ReplyDeletethanks for ur reply yuvraj..but how can i detect the attackers?
Deletethe protocol is AODV yuvraj..
Deleteyou have to add the attacker . check my post "BLACK HOLE attack". once u added then its easy to detect the attackers using ur TCL code. you need to modify ur c++ files in ns-2 for adding attacker
Deletehi yuvraj,thanks for this reply.Can u pls tell, how to detect the attackers from tcl file?
Deletehello :)
ReplyDeletethis is a part of the tracefile which i m not able to analyze :(
s 0.000401693 0 0.00 0.00 -99 0 0 AGT --- 0 DSRCApp 11 [0 0 0 0] ------- [0:0 -1:0 32 0]
s 0.003588245 11 10.00 10.00 -99 0 0 AGT --- 1 DSRCApp 11 [0 0 0 0] ------- [11:0 -1:0 32 0]
s 0.004169000 0 0.00 0.00 -99 0 0 MAC --- 0 DSRCApp 39 [0 ffffffff 0 0] ------- [0:0 -1:0 32 0]
s 0.004169000 0 0.00 0.00 -99 0 0 PHY --- 0 DSRCApp 39 ------- [0:0 -1:0 32 0]
D 0.004321017 5 0.00 5.00 -99 0 0 PHY DND 0 DSRCApp 39 ------- [0:0 -1:0 32 0]
D 0.004321033 10 0.00 10.00 -99 0 0 PHY DND 0 DSRCApp 39 ------- [0:0 -1:0 32 0]
1-can u help me analyze it so we write a pdr.awk for it
2-i downloaded urs but i guess i should modify it to work on my tracefile
please help
Hi , the trace file u got was old trace file format. check the awk file, whether u can see something like $14 ,$20 ...if its like this then add $ns new-trace to ur tcl file and run.
DeletePlease see my latest post :
http://byuvraj.blogspot.in/2013/05/awk-script-not-running-for-ns-2.html
in the trace file of the vanet , they are the following layer : AGT-MAC-PHY
ReplyDeleteto calculate the pdf, i m concerned with the AGT layer only, right ?
so if i run ur awk :
$0 ~/^s.* AGT/ {sendLine ++ ; }
$0 ~/^r.* AGT/ {recvLine ++ ;}
i get:
cbr s:1001 r:15188, r/s Ratio:15.1728, f:0
s > r ==> totally wrong, right ?
where do u think is my problem?
thank you so much
you r helping me too much :)
correct you should concern with AGT because its the APPlication layer which means the peer node will receive the packet successfully. MAC,PHY are middle layers were the format differs.
DeleteYou should replace cbr with DSRCApp in your awk file.
one more thing, on the net the format of the trace is :
ReplyDeletes 76.000000000 _98_ AGT --- 1812 cbr 32 [0 0 0 0] ------- [98:0 0:0 32 0]
where 98 is the node ID.
while in mine, it is :
s 0.000067388 0 0.00 0.00 -99 0 0 AGT --- 0 DSRCApp 100 [0 0 0 0] ------- [0:0 -1:0 32 0]
what is this 0 0.00 0.00 -99 0 0 instead of _x_ ?
i m thinking of not caluclating the nb of received based on AGT but based on this weird nb also. what is ur opinion?
here is a part of my trace file:
s 0.000067388 0 0.00 0.00 -99 0 0 AGT --- 0 DSRCApp 100 [0 0 0 0] ------- [0:0 -1:0 32 0]
s 0.002840405 2 20.00 0.00 -99 0 0 AGT --- 1 DSRCApp 100 [0 0 0 0] ------- [2:0 -1:0 32 0]
s 0.004039000 2 20.00 0.00 -99 0 0 MAC --- 1 DSRCApp 128 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
s 0.004039000 2 20.00 0.00 -99 0 0 PHY --- 1 DSRCApp 128 ------- [2:0 -1:0 32 0]
r 0.004255017 7 20.00 5.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255033 1 10.00 0.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255033 12 20.00 10.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255033 3 30.00 0.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255037 6 10.00 5.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255037 8 30.00 5.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255047 11 10.00 10.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255047 13 30.00 10.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255050 17 20.00 15.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255060 16 10.00 15.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255060 18 30.00 15.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255067 0 0.00 0.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255067 4 40.00 0.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255069 5 0.00 5.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255069 9 40.00 5.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
r 0.004255075 10 0.00 10.00 -99 0 0 MAC --- 1 DSRCApp 100 [0 ffffffff 2 0] ------- [2:0 -1:0 32 0]
Thank you
Please ping me in fb . its better to chat .so that i can solve ur prob. here its became crowdy
Deletethank you dear, you r too good to be true :)
DeleteHi sir!
ReplyDeleteI am unable to get awk for e-e delay in new trace format.
Can you provide me the link to download.
I am actually tangled in between the two format.
Thanks in advance!
Please read this post
Deletehttp://byuvraj.blogspot.in/2013/05/awk-script-not-running-for-ns-2.html
hi yuvraj,
ReplyDeletehow to detect the attackers from tcl file
hi
ReplyDeletei want to calculate average remaining energy of the network after every 15 sec during 500 sec simulation, using awk script. i can calculate the remaining network energy by taking the average of all nodes final energy at the end of simulation. i'll be grateful if you can guide how to do that.
regards,
najma
Hope u enabled the energy in ur tcl fle. give ur energy as 1000 joules or how much u want . please look in to trace file and check the column of send time and coulmn and energy coulmn . use both in ur awk script and calculate the time .
Deletewhat is the significance of jitter1 jitter2 jitter3 jitter4 o/p after running awk?
ReplyDeletethanks alot
sir...i am in need of generating graph between packet delivery ratio and node speed for AODV...please publish the ns2 tcl code
ReplyDeleteuse my aodv tcl code in aodv downloads post
DeletePlease use new trace file format %ns use new-trace
ReplyDeletehi, please sir can you help me how to modify the axis in xgraph i want to make the throughput in function of number of nodes but i don't understand the blog of xgraph can you please give some examples and thks in advance :)
ReplyDeleteXgraph can be generated two ways. one directly from tcl or manually. what i explained was manually. here the data wat ever u collected need to be kept in text file and generate graph using xgraph command. ( cmd----> xgraph file1.txt ) . in this file give the x-axis(nodes) and y-axis(throughput) data in two columns like
Deletenodes(x-axis) throughput(y-axis)
------- ---------------
5 300.0
10 500.0
15 630
Dear Sir,
ReplyDeleteI want to find route acquisition delay from old trace file generated for AODV.
Please help me to resolve it.
Hi,
ReplyDeletei used your e2edelay.awk file to find delay, it was supposed the result to be in the range of 0.5 ms and my results were like 500 ms. i generated the same scenario i found in an article and i wanted to check the values in it. i just wonder if you have any idea where the problem might be??
It depends on other parameters too. check out ur simulation timing, distance between the nodes, antenna model u r using, if the nodes are clubbed together then the delay will be less , check out the trace file format also
DeleteThis comment has been removed by a blog administrator.
ReplyDeleteHello sir
ReplyDeleteI use CBRP protocol and create trace file. and use awk to calculate dropped packet, but it show
cbr s:39 r:39, r/s Ratio:1.0000, f:54 , d:0
count of dropped packet=0
also in trace file i have
s 29.031284241 _9_ RTR --- 904 cbr 545 [0 0 0 0] ------- [9:2 11:0 32 17] [0] 0 2
s 29.031312149 _31_ RTR --- 900 message 45 [0 0 0 0] ------- [31:-1 -1:255 3 0]
r 29.036906439 _17_ RTR --- 904 cbr 545 [13a 11 9 800] ------- [9:2 11:0 32 17] [0] 1 2
cbrp 29.036906439 _17_ --- 904 [9 -> 11] [9 |17 11 ]
f 29.036906439 _17_ RTR --- 904 cbr 545 [13a 11 9 800] ------- [9:2 11:0 31 11] [0] 1 2
r 29.038145553 _28_ RTR --- 900 message 45 [0 ffffffff 1f 800] ------- [31:-1 -1:255 3 0]
it's really?
Please increase the simulation time to 200 or 900 and check the result. what you get is correct only.
DeleteI increase the simulation time to 200,300,400,500,600
Deletebut dropped packet=0 still
Hello,
ReplyDeleteIn the Throughput file, it says the starting time is 400. Does this mean the AWK file will only calculate the throughput starting from time 400 till the end?
Can't I make the starting time to be 0? What will happen then?
Please let me know. Thanks :)
No !! Please check your trace file. It starts from 0.0 only . some times it may be 2 or 3 not 400. please check the awk u r using and trace file format (new or old).
DeleteHi yuvraj,
ReplyDeleteWe have assignment on NS2 submit in next week which need manet simulation using DSR & AODV. Sir ask us to use random waypoint mobility and to draw some graphs based on "inter-contact time" and "contact time" of nodes.
But I'm not sure how to obtain "inter-contact time" and "contact time". Can I get it from NS2 trace file? (If so how can we get it from trace file?)
Can you kindly help me on this problem?
Thanks & Regards,
Chandana
http://nrl.iis.sinica.edu.tw/Download/
DeletePlease look in to it and check whether its help u or not .
hi sir,
ReplyDeletei am working on maodv protocol in ns2.35, it is successfully installed and tcl script running fine, on running tcl script i have got trace file of size 458 mb (something) and nam file of size 92 mb, but the problem is that their no graphs are generating like delivery ratio, end2end delay on analyzing it shows data received 0, router dropped 25, data dropped 0.i m using trace graph. so please sir give me solution for that ASAP.
thank you.
Hi akash , Please check whether u r using maodv tcl script or not . check the multicast adress sum thing like this 0xE00000. check out the sender and receiver nodes properly. once everything clear ,go for checking the simulation environment.
Deletesimulation time,traffic, transport layer protocol (UDP for multicast ).
hello sir
ReplyDeleteam working with AODV in ns2.34.
i need to plot THROUGHPUT vs LOAD.
can i get the awk script for load &is routing load and network load same ..
kindly reply me ASAP
thanks®ards
HI ram , yes load is nothing but network routing load . please check for nrl.awk (network routing load). its easy to analyze and get results. once u got results . use Xgraph to plot the graph.
Deletethanks for ur reply
Deletei got the graph using gnuplot. when am trying to plot with xgraph i got a error saying
PROBLEMS FOUND WITH INPUT DATA.what to do ??
can u define what is STATIONS can i get awk script ????
Sir,
ReplyDeletewhen using awk script for trace file analysis man says tat particular
awk is applicable to new trace format or old trace format..
sir, wat is difference between old and new trace format?
how to identify which trace format my ns2 is generating? iam using ns-2.27 using cygwin
how to convert old trace format to new trace format and vice versa?
please reply sir
Thanks
Hi priya,
ReplyDelete$ns new-trace --> if u keep this line in ur tcl file . it will create new trace file format with consists of 30 columns. (x,y,z) positions will be shown. if dont keep any line like or #ns new-trace --> it means old trace format which is very easy to analyze by awk scripts. still if u did not get ping me on fb . i ll chat and answer ur queries
Hi,
ReplyDeletehow i can change the the shape and color of nodes in wireless network
I also want the .awk file of energy and hopcount
ReplyDeleteNodes with Color
Delete------------------
$n0 color blue
$n1 color red
Nodes with shape
--------------------
$n0 shape box
$n1 shape circle
This comment has been removed by the author.
Deletehiii sir
ReplyDeletei downloaded aodv_50.tcl file ,throughput awk file and tried to calculate throughput
am getting below error .what to do?
[root@localhost ns-allinone-2.34]# awk -f gth.awk AODV_50.tr
Average Throughput[kbps] = -0.00 StartTime=400.00 StopTime=0.00
Please check the trace file you are using .. Disable the new trace format and check whether u r using awk script for old trace file format or not.
DeleteComment the new-trace like below in ur tcl
# $ns new-trace
hiii
ReplyDeleteam trying to plot graph THROUGHPUT vs LOAD.am using throughput.awk,nrl_ot.awk trying to put into 1 awk script .but am getting NRL=0...as am not to define $7 in old trace format.
i mean that $1=event,what is $7=??
it is the type example AODV ....
DeleteHi,
ReplyDeleteNodes with Color
------------------
$n0 color blue
$n1 color red
Nodes with shape
--------------------
$n0 shape box
$n1 shape circle
this command is not working
Here n0,n1 means the node names...please chenge the node names according to ur node creation .
Deletesir, not working after changing the name.......
ReplyDeleteDont put them in one file. Better do it seperately. please refer here for trace file formats
Deletehttp://nsnam.isi.edu/nsnam/index.php/NS-2_Trace_Formats
thank you so much sir...sir but tell me how i put in separate file and link both of them...
Deletechannel.cc:SendUp -Calc HighestAnteenaZ_ distCST_
ReplyDeleteHighestAnteenaZ_ = 1.5 , distCST_ 550.0
sir what is the meaning of these lines
highestAntennaZ_ ===> highest antenna position
DeletedistCST_====> maximum receiving distance.
consider the distance between the sender ans reciever is maximum . in this case , the distance between nodes may vary thus long distance nodes will discard the packets due to low transmission range. Transmission power(P_t)and packet Receving power(P_r) are calculated using propogation models in Ns-2. two way model,random point,shadowing models etc..u can also set the threshold physical layer using
Phy/WirelessPhy set RXThresh_
here 550.0 make sense in terms of range the nodes communicate
More info :
https://wiki.ti5.tu-harburg.de/wsn/ns2/class_propagation
thank you sir...this information is very usefull for me.....
Deletehow i can understand fully NS2.34 in detail....
Deletehiii
ReplyDeleteam trying to plot graph THROUGHPUT vs LOAD.am using throughput.awk,nrl_ot.awk trying to put into 1 awk script .but am getting NRL=0...as am not to define $7 in old trace format.
i mean that $1=event,what is $7=??
$7= for example AODV
Deleteit is the type
it is the traffic i.e aodv
Deletehello
ReplyDeletei got error saying PROBLEMS FOUND WITH INPUT DATA when am trying to plot with xgraph.what to do??
Please refer to my post on xgraph to have clear idea to plot the graph.
DeleteThis comment has been removed by a blog administrator.
ReplyDeleteI created a scenario with a defined number of nodes (=20)
ReplyDeletevehicular network
some nodes during a interval of time will broadcast a message (500bytes)
i need to know how many nodes receive the message and not how many packets are received.
i have no problem in awk or perl
any clue?
Thank you
hi
ReplyDeletei am getting this error
for both new as well as old trace format
please help me
GeneratedPackets = 7355
ReceivedPackets = 7333
Packet Delivery Ratio = 99.7009%
Total Dropped Packets = 0
Average End-to-End Delay = -nan ms
Please check your awk script. nan means not a number. may be if u using character to compute. please verify tht awk script u r suing
DeleteThis comment has been removed by the author.
DeleteHi! How can I set ns to simulate with 2 nodes. Only 1 node is the source and the other is a receiver node. I need to have the receiver node receive a total of 1350 packets. The length of the simulation time depends on the length of time the 1350 packets have been received. Therefore, I should not be setting the stop time. It depends on the simulation when the ns will stop.
ReplyDeletehi
ReplyDeleteCan you suggest me measures to minimise e2edelay in aodv protocol?
i tried by varying rxthresh but didnt worked out well.
thanks
hiii
ReplyDeletecan i get the difference between adhoc mode and client mode in 802.11s mesh networks.
Hi Sir.
ReplyDeletei want to extract nodes computational (not communication) energy consumption in ns.
how i can do this?
please help me
thanx
please initialize the energy with some x joules then run the program...
DeleteHi Yuvraj,
ReplyDeletePls give me the CA-AOMDV Patch file for ns2.34
HI priya, its just AOMDV protocol and some one modified bit code in it and named it as CA-AOMDV. its not separate protocol.
DeleteHello sir,
ReplyDeleteI want to plot a graph between end to end delay vs pause time for AODV and DSDV ...
sir I want a awk script for energy analysis of new wireless trace format.
ReplyDeletescript provided by you is not working , also it works only for node-id =4 .
I have to print node id and its reaming energy .
please help.
sir i want to deploy nodes exponentially.
ReplyDeletehow to generate nodes exponentially and display them in nam .
Thanks
how to find out route discovery frequency in AOMDV protocol. Please help.
ReplyDeletehow to find out packet drop in EAODV protocol. Please help.my id is mamtaparmar32@gmail.com
ReplyDeleteThis comment has been removed by the author.
ReplyDelete- 0.099976 2 3 exp 128 ------- 1 0.0 1.1 1 1
Delete+ 0.110976 0 2 exp 128 ------- 1 0.0 1.1 3 3
please tell me that above trace file format is a new or old?
do you any awk script to calculate end to en delay , jitter , throughput in wired network.
ReplyDeleteIf you have then please tell.
I really need that.
Thank you :) this is awesome !!!!
ReplyDeleteThanks it is great site
ReplyDeleteI would ask how I can run PAODV protocol in NS2.35
how can run GPSR in ns2.35
ReplyDeletei try to run instantJitter awk script...but it gives no output....why???
ReplyDeletehow can run GPSR in ns2.34
ReplyDeleteHi, Great site and very useful.
ReplyDeleteSir,
I need an awk script for showing out of routing path stretch between a source and a destination node (i.e., in terms of number of hops). Also, I need to examine each node in the simulation to figure out the ratio between the actual numbers of a node’s neighbors (i.e., neighbors in its transmission range) to those listed in the same node’s neieghbors-list. I’m working on GPSR routing protocol in NS2.
Have you got one or, if not, can you point me to where I might find one. Any help greatly appreciated,
Nashmi
Hi, Great site and very useful.
ReplyDeleteSir,
I need an awk script to figure out the ratio between the actual numbers of a node’s neighbors (i.e., neighbors in its transmission range) to those listed in the same node’s neieghbors-list. I’m working on GPSR routing protocol in NS2.
Have you got one or, if not, can you point me to where I might find one. Any help greatly appreciated,
Nashmi
Hi Sir,
ReplyDeleteMy email is nshmrstrmg@yahoo.com. Kindly, can you send me your email to explain my problem, please.
Thanks.
hi sir,
ReplyDeletei need awk script for packet loss.
Hello ,
ReplyDeletesomeone plz help me in ns2.35
whenever i use command awk-f pdf.awk ns.trc>aomdv.xg then it always show awk-f command not found, plz help anyone
hello,
ReplyDeletesomeone help me for awk script design possible without having protocol ?actually my protocol is LSGO routing protocol which is combination of Link state routing, Geographic opportunistic routing protocol and i have not source code of this protocol
Hi Krima,
DeleteAwk programming to use analyze the metrics of network. if you dont have routing protocol then how u can u calculate throughput,packet loss, end to end delay. U need a routing protocol to send some data between sender and receiver . Once you have a network then you can analyze the data using awk script . input for this is trace file which will be generated after ur execution of TCL script
sir can u mail me the code for cluster formation i manet
ReplyDeleteWhat exactly u want ?? Cluster Formation is abstract concept. wat routing protocol u want to use ? how u want to split the data ?
DeleteHi sir, I am doing about video streaming over IPv6. Can you help me on how to set IPv6 on each nodes in ns2 ?
ReplyDeletehi everone , I need your all help. I have project and i want to measure for 5 node then after 10node then 15node then 20node and last one 25node i want to measure througput and other things but i want to measure for all of it i want to set e.g 1000 generated packet.So how can i set generated packet 1000 ? Can someone help me ?
ReplyDelete