Skip to main content

AWK Scripts for NS2 - NS2 Tutorial # 8

AWK Scripts for ns2
This is one of the important in ns2 as we are going to analyse the performance metrics of the network

In this session, we are going to see the following metrics.

1. Average Throughput
2. instant Throughput
3. Packet Delivery Ratio
4. Residual Energy of the nodes.

A - Aho
W - Weinberger
K - Keninghan

Easy to implement and process.




In ns2, new trace format, there could be as many as 52 columns. Each column specify some parameters. Viewers are requested to go through these parameters through the documentation.

in aAWK,
$1 refers 1st column
$2 refers 2nd column and so on...

awk can be run using either of these commands

$] awk -f filename.awk

$] gawk -f filename.awk

Average throughput is done

you can download this source code in

Instant Throughput

with two values to plot the characteristics.

Residual Energy of the individual nodes AND ALSO THE AVERAGE RESIDUAL ENERGY OF ALL NODES.

We have seen four awk scripts

1. Average throughput
2. Instant throughput
3. Packet delivery ratio
4. Residual energy of a node.

Hope you enjoy my lecture. It takes more time to learn and record.
Please share and subscribe to my channel

Thanks for watching, stay tuned...

Subscribe to My Youtube Channel - Engineering Clinic


Popular posts from this blog

Electrical Machine Design (equations)

FactorsDC Machine Transformers Induction Machines Synchronous MachinesOutput EquationPa=CoD2Ln, where Pa=P/h for generators, Pa=P for motorsFor Single Phase
Q=2.22 f Bm Ai Kw Aw d10-3
For Three Phase
Q=3.33 f Bm Ai Kw Aw d 10-3Q=CoD2 L ns
KVA Input Q=
HP * 0.746 / Cos f * hQ=CoD2 L ns
KVA Input Q=
HP * 0.746 / Cos f * h
For Turbo alternators
Q=1.11Bavac KwsVa2 L 10-3/nsOutput CoefficientCo=Bav ac* 10-3where Bav-magnetic loading and ac - electric loadingDNACo=11 Kws Bav ac 10-3Co=11 Kws Bav ac 10-3 Choice of Magnetic LoadingFlux Density in Teeth Frequency of Flux Reversals Size of machineDNAMagnetizing current, Flux Density, Iron lossIron loss, Stability, Voltage Rating, Parallel Operation, Transient ShortCircuit current Choice of Electric LoadingTemperature rise,
speed of machine, Voltage, Armature reaction, CommutationDNAOverload Capacity, Copper losses, Temperature rise, Leakage ReactanceCopper loss, Synchronous reactance, Temperature rise, Stray Load losses,
Voltage rating Flux …

How to Access MOODLE in Intranet and Internet

When Moodle is accessed either in Intranet or internet, there will not be any issue. But occasions when the MOODLE Site has to be accessed both in the intranet and in the Internet, here is a simple trick
Server Used: IBM Blade Servers
Operating system: Windows Server 2008
Moodle Version: 2.4
WAMP Server is used.
Number of Users: 3000 (Students) + 200 (Faculty)
Open the config.php from ~/moodle/config.php
include these lines
$CFG->wwwroot = 'http://'.$server_id.'/vitcc';
$CFG->dataroot  = 'C:\\wamp\\moodledata';
before the following line
$CFG->directorypermissions = 07xx;
Restart the WAMP Server and you can Check MOODLE Site both in Internet and Intranet.

The above Image tells the intranet Link and the internet link can be opened outside the campus network

Virtual Host in Bitnami Lampstack

IF you have a website that runs with an IP address and you decide to move it to a domain, then here is the clear step.  Also this post will be helpful to you if you are running a same website by two different IP Address (One in campus and another outside the campus)

Your IP Address (Example): (Internal IP)
Your IP Address (Example): (External IP)

You want to move it to: (instead of

Step 1:
Open the file /opt/lampstack-5.5.31-0/apache/conf/bitnami/bitnami.conf
In the above file, Change these lines  (The bold lines are the changed ones)

<VirtualHost _default_:80>
DocumentRoot “/opt/lampstack-5.5.31-0/apache2/htdocs/site”
<Directory “/opt/lampstack-5.5.31-0/apache2/htdocs”>
Options Indexes FollowSymLinks
AllowOverride All
<IfVersion < 2.3 >
Order allow,deny
Allow from all
<IfVersion >= 2.3 >
Require all granted
<VirtualHost _def…