How to Run awk File in Ns2

Do you guys really looking forward to get helps based on running awk files in network simulator 2? That’s great!!! You have just rightly directed to the exact article.

awk Script for Ns2 Simulation

The below mentioned awk script code is deployed to perform the calculations based performance metrics such as packet delivery ratio based on the events in Ns2 trace file.

if($4 == “AGT” && $1 == “s” && seqno < $6) {

seqno = $6;

} else if(($4 == “RTR”) && ($1 == “r”)) {

receivedPackets++;

} else if ($1 == “D” && $7 == “tcp” && $8 > 512){

droppedPackets++;

}

In addition, we have highlighted the Ns2 code to call awk script in Ns2 tcl file for your ease.

exec awk -f PDR.awk Spectrum_Sensing.tr > pro_PDR.tr

Run awk File in Ns2

Then, we have to run the Ns2 based awk file in Ubuntu through changing the Ns2 main file location and executing the following commands.

sudo ./ns awk_based_Main.tcl

Run awk File in Ns2

Mostly significantly, we have highlighted the result that is acquired through running awk script based Ns2 file in Ubuntu.

As the matter of fact, each and every one of us are existed with some loop holes and by recognizing those holes we can be succeed and actually you can ping us to aid more.