Search This Blog

AWK Scripts for Normalized Routing Load/ Normalized Routing Overhead

Labels: , , , , ,


Normalized Routing Load (or Normalized Routing Overhead) is defined as the total number of routing packet transmitted per data packet.

It is calculated by dividing the total number of routing packets sent (includes forwarded routing packets as well) by the total number of data packets received.

AWK Script to calculate Normalized Routing Load for Old trace format can be downloaded from the link given below:

AWK Script for Normalized Routing Load - Old Trace Format:


AWK Script to calculate Normalized Routing Load for New trace format can be downloaded from the link given below:

AWK Script for Normalized Routing Load - New Trace Format:


If there are any problems encountered in downloading above files, please visit the link given below:

These scripts work for AODV, DSDV, DSR and OLSR. To use these scripts for other routing protocols, just add the name of that routing protocol in appropriate loop within this script.

Note: Please report any bugs if encountered.

Hope it helps.

Mohit P. Tahiliani

Related Blogs: 
4. AWK Scripts for NS2 

Comments (46)

Hi Mohit,
I am getting division by zero fatal error while running dsr trace file. I have tried everything to edit the awk but no avail.
And both of these old and new trace formats are same. Could you please send me the new awk in
Also i need end2end delay awk for new trace format.
Hope you'd help me out resolve these issues. Thanks a lot! I really appreciate all the help in writing a blog to a learner like me! God bless!

@Vivek - Both these AWK Scripts use the same logic but are different in the sense that one works on old trace format and the other one works on new trace format and hence the column numbers vary.

You can compare both the files with respect to the column numbers used in if loops.

Hope it helps.

Mohit P. Tahiliani

Hi Mohit Sir ,
I am working on MANET . For my project I have to modify the DSR routing protocol.
Actually, my change is only in one case. When a data packet comes from some node ,
1) I need to check the source and destination address of the
2) Based on that I need to modify a variable( this variable will
be local for the specific node ) .
3) Based on the value of the variable the node will decide
whether to forward the packet or not.
4) before deciding the node may need to get value of the
same variable on the neighbor nodes.

I am new to NS-2. I have worked with tcl , but not at the c++ level.
So, I am in a dilemma here. Kindly help me in this regard. Please specify the details of the files and the variables needed to be changed as much as possible. If you can address the above stated four problems seperately , it shall be more beneficial, I believe . It shall be very kind of you if you can send me some good and useful study materials/links for understanding/solving the problem "quickly" . My email address is :

Thank You.

Warm regards,

@Nayan - The following link provides all the details of DSR implementation in NS-2. It answers almost 46 frequently asked questions related to DSR:

Hope it helps.

Mohit P. Tahiliani

i have a problem regarding awk scripts.
when i am running the awk script to calculate end to end delay,the result is shown as Average End-to-End Delay = -nan ms
what does this mean.??

@Pp - e2edelay.awk works for TCP traffic. If you have configured UDP traffic in your TCL Script, replace "tcp" by "cbr" everywhere in e2edelay.awk.

Hope it helps.

Mohit P. Tahiliani

Hi Mohit Sir
I have tried ur normalized routing overhead, it works perfect for adhoc networks. thank alot for providing this awk code for all.
Actually I want to calculate control overhead for infrastructure based networks, specially when mobile node attempts handover. i have gone through its trace file. there is no RTR column in that case.
when a mobile node attempts handover, its exchange CTS/RTS message, Can I calculate these,
can you tell me why data throughput decrease with every handover in infrastucture based networks.

hello sir

i have downloaded the awk script for throughput, but i have not understood somethings like starttime=400 (why 400) and packet_size > 512, because my packet size is 512

thanks in advance

hello sir

i had a few questions
1) does ns 2.29 support 802.11 infrastructure mode?
2) how to implement various scheduling algorithms for uplink/downlink in 802.11
3) where can i get an explanation for the working for WIRR (weighted interleaved round robin) packet scheduling algorithm which is one of the available algorithm in ns2

sir i m suman help me in multipath routing protocols on ns2
i want to solve my problms about mp-dsr smr nd msr
please help me
my email id

hello sir,
how to find transmission region from transmission power(pt)?
please help me

hello sir

I am using NS2.34. I want to implement multipath in DSR Protocol. Kindly help me. My mail id is

Thanks Ankita

hello sir,i have copied the files of awk of throughput and delay in my ns 2 folder..and have given awk -f Packet_delay.awk syntax,but i am getting fatal there any thing i need to match or change the file?plz give me ur email is,i shall forward u my files..plz go through them.


@Virgo - When a handover occurs, not only RTS/CTS messages are exchanged, but messages such as Binding Update, etc are also exchanged. You can track them in the trace file. The major reason for throughput degradation with every handover is that the packets gets dropped during the handover procedure (if any buffering mechanism is not used).

@Eliza - Starttime can have any value, however, it must be set sufficiently high so that the exact starttime of the simulation can be captured. starttime is useful for calculation of throughput. Packet size > 512 must be used if packet size in TCL has been set above 512. If you have a packet size less than 512 in TCL, you must change this value in AWK Script as well.

@Girish - Yes ns-2.29 supports 802.11.
You can get a sample TCL Script for that in the following directory:
and you may find a sample TCL Script for WIRR in the following directory:

@Suman - See Question 13 on the following link:

@Yash - See the following link:

@Ankita - See Question 13 on the following link:

@Deepu - Make sure you are executing the right AWK script for the corresponding trace file format.

Hope it helps.

Mohit P. Tahiliani

Hi Mohit and all,

After one suggestion and analysing AOMDV code, I try to print the routing table for a aomdv node using the folowing comand in tcl file. But i hadn´t sucess. Do you have some suggestion for my question?

$ns at 10.0 "[node_(1) agent 255] dump-table"

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

Thanks in advance
Elisabete Reis

@E. Reis - Are you sure of the syntax

"[node_(1) agent 255] dump-table"

Verify once again whether this syntax is correct or not.

Hope it helps.

Mohit P. Tahiliani

peace upon u 'Mohit' :)

first of all thank you for sharing your valuable scripts..

when i tried to use for example "e2edelay.awk " script..i always have this result "Average End-to-End Delay = xxx.xx ms" in my log file..
the question is: how can i use this result and how can i create for example a "end to end delay vs time" graph??

@Dalia - May be because you have configured UDP traffic in the TCL Script. Replace

$7 == "tcp"


$7 == "tcp" || $7 == "cbr"

and re-run the AWK Script.

Hope it helps.

Mohit P. Tahiliani

I am doing work on wormhole attack detection,
first i want to implement attack so i want that malicious node forward the packet to other route instead of destination
so plz help me


@Avuri - The following link provides the code for blackhole, Byzantine wormhole and a few other attacks:

Hope it helps.

Mohit P. Tahiliani

Hello sir,
Your scripts are very helpful for analyzing protocols. 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??

Please help...

hello sir,
I am working on MANET routing protocol. At the implementation phase i face some problem like how to access physical layer from the network layer in aodv , calculating received signal strength at the network layer and how to calculate route discovery frequency at the network layer.
My thesis is at complete if you help me to solve the above problem.
Please help me sir.


hello sir, please let me know about .dat files,
1. How it create or update runtime values which are used for plotting the graph?
2. What is mean of pause time, how to define in the tcl or .xgr file to get it on the graph as x axis.
3.I want to plot graph of e2edelay vs maxspeed & pause time and routecost Vs same....howt to normalized routing load is same as routecost parameter?
Please help me sir.

hi sir
can you send me the ns2 script for comparing various routing protocols in MANET based on various performance parameters.

k k

hello sir,
I am working on enhanced AODV AODV is improved by two techniques,
1. piggyback 2. neighbor stability technique(NCR ratio).
I have some doubts regarding
1. how to enable hello packet? & By using which command it will get broadcasting of hello packets ones at the start of network ? & then how hello interval is set?
2.for neighbor stability technique I have arithmetic expressions so,how & where it defines.
can u please help me out for the same
Thanks & regards,

sir kindly post the steps of getting throughput of aomdv protocol in ns2 . i need to change the parameters and get results, throughput, delay etc. eg. after getting (gedit) aomdv from ex folder,i pasted the awk for throughput provided by you in the same folder (ex). now for simulation i need to change the no. of nodes (that i have done).what are the next steps i need to follow to see throughput. please respond.

Is there any tcl script for node disjoint multipath routing protocol?

I m working on MANET
For implementation and analysis , i need awk files to generate graph using Gm not finding required awk files

2. Average End to end delay
3. Path Optimality
4. Route selection time
7. control overhead
8. trust decay
9. convergence tine(delay)
10. cost
11. probability authentication

sir, can u help by sending me some links or anything so that these awk files are available to me..

hi sir,

i am doing my master's degree. and my project is under mobile wireless sensor network. i need help to write code in ns2 for
1. exchange 2 or 3 specific information when 2 nodes meet each other
2. store them as history in each node (exchanged info)
3. find out the same record exist 2 times in the nodes.
plz do the needful.

Hello Sir, For implementation of Bandwidth aggregation in ns2, I am finding how to assign ISP bandwidth? As in ns2 we can assign b/w for a link.
Need to show, if we adopt bandwidth aggregation (From different IPS providers), performance can be increased and no need to go for extra infrastructure, can be implemented in existing network for both ISPs.

hi sir...
I have an error in ns2. when i am adding a new function in .cc file and declare that function in .h file. After this i compile the file by using Make command . it executed successfully. But When i call that function in TCL then it gives following error..
(_o133 cmd line 1)
invoked from within
"_o133 cmd bandwidth cwnd_ rtt_"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o133" line 2)
(SplitObject unknown line 2)
invoked from within
"$tcp1 bandwidth cwnd_ rtt_"
(file "tcp_vegas.tcl" line 124)

please provide me some solution regarding this...

Thank you

sir, i am Saharsh sinha form sikkim manipal institute of technology. i am working on performance analysis oftcp reno and tcp SACK in NS2.35. i need your help with the codes for implementation of New reno.
i would be highly obliged.
looking forward to your reply.

hello Sir, myself Banani from India, i want to modify routing table mechanism of AODV. how could i do that? and what are files (other than tcl script) necessary for doing that. Pls help me in this regard.
my mail id-

Sir kindly if you know any method to implement blackhole attack in OSR protocol . kindly explain

my email id id :

Hello sir, could you please help me how to calculate normalized MAC load of AODV and DSR protocol.
mailing address :

Hello sir,
I am working in Adhoc network.will you help me how to construct neighbour table & routing table in ns2?

@Ravi - You can learn about the routing table management from the following link:

Similarly, you can create a neighbor table also.

Hope it helps.

Mohit P. Tahiliani

Can you please help me with the awk script for AntHocNet protocol. These scripts are not working for this protocol.I want awk script for Packet delivery ratio,avg. end2end delay,dropped TCP packets and normalised routing load.
Please help me with this as soon as possible.
Thank you.

@Radhika - I recommend you to use APP Tool for analysis.

Here is the link:

Hope it helps.

Mohit P. Tahiliani

hello sir;
this is yatin. i am trying to improvise qos in manet by modifying aodv with node energy parameter.also considering link expiry time (LET)to set criteria of link quality. based on this 2 parameter link quality has been measured. i am trying to develop tcl script but getting error in ns2.35.. please help me for this

thanks & regards

@Yatin - You can take some help from the following link:

Hope it helps.

Mohit P. Tahiliani

sir i am working in manet. so i need awk scripts for
1. route selection time
2. trust compromise
3. secuirty

@Pln Murthy - As of now I do not have AWK scripts for those parameters.

You may try looking at other forums of ns-2 for the same.

Mohit P. Tahiliani

Hello sir, I am working with vanet and I need awk script for routing overhead....if you have then please mail me on :

@Krima - AWK Scripts provided in the post will also work for VANETs. There is no need for separate AWK scripts.

Hope it helps.

Mohit P. Tahiliani

Guest Book...!!!