enery levels ns2 olsr

101 views
Skip to first unread message

Hameurlaine Hicham

unread,
Aug 21, 2023, 11:18:22 AM8/21/23
to Network Simulator 2 (NS2)
hi all, I want to get enery  consumption , when I use awk script, it returns empty NAN, 

knudfl

unread,
Aug 21, 2023, 11:42:07 AM8/21/23
to Network Simulator 2 (NS2)
What do you mean with "empty NAN" ??   
!! Your command is missing !!

Energy analysis : Which "[energy].awk" script is used ? ?     The command used must be shown.
1Ayu-energy_wireless.awk
avg_throughput-zigbee.awk
Av_res_en.awk
awk-802-15-4.awk
energy.awk
energy-da.awk
energyleft.txt
Energy-Souvik.awk
energy-tes.awk
energy_wireless.awk
en_wi.awk
finalnodeandenergy.awk
metrics.awk
performance-Pablo.awk
rd_nd_en.awk
statistics.awk
tess-Packets.awk
totalpacketsreceived.awk
tora-energy.awk
totalpacketssent.awk
wireless_802_15_4_static.awk

Hameurlaine Hicham

unread,
Aug 21, 2023, 3:25:25 PM8/21/23
to ns-u...@googlegroups.com
Nn, it can't found data in tr file. I think I didn't make energy model, 

--
You received this message because you are subscribed to a topic in the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-users/_Rbh6962Jto/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-users+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-users/cb2ebb89-9e7b-40d6-ace2-85cd174b4301n%40googlegroups.com.

knudfl

unread,
Aug 21, 2023, 3:59:06 PM8/21/23
to Network Simulator 2 (NS2)
The thing is, you cannot use a random awk script, the script must be an absolute match for the trace.tr
That's why we have ~20 different awk files for energy alone
-
A simulation.tcl has not to be "EnergyModel" to analyze the trace for energy.
Olsr example ddebbie90-scenario.tcl :
$ ns235-olsr-64 ddebbie90-scenario.tcl → →  dd-out.tr 1.2MB is created
$ awk -f Energy-Souvik.awk dd-out.tr
.
+===========+
average energy 10.54
+===========+
total energy 527

Hameurlaine Hicham

unread,
Aug 22, 2023, 10:31:13 AM8/22/23
to Network Simulator 2 (NS2)
thank you, please , what should I add to this command to change the max speed and the min speed 
./bm -f scenario1 RandomWaypoint -n 100 -d 900 -i 3600 -h 6.0 -m 3.0


knudfl

unread,
Aug 22, 2023, 1:01:00 PM8/22/23
to Network Simulator 2 (NS2)

$ ./bm -f scenario1 RandomWaypoint -n 100 -d 900 -i 3600 -l 1 -h 6
I.e.  -l is minspeed 1.0 ..... and -h 6.0 is maxspeed 6.0
I.e. i.e. the lower case L is low/minspeed, and the lower case H is high/maxspeed.

( Your option "-m 3" doesn't work with my Oracle Java , if you want "-m 3" , please explain desired function)
-
scenario1.params :
model=RandomWaypoint
ignore=3600.0
randomSeed=1692722724489
x=200.0
y=200.0
duration=900.0
nn=100
circular=false
J=2D
dim=4
minspeed=1.0
maxspeed=6.0

maxpause=60.0
-

knudfl

unread,
Aug 23, 2023, 4:37:03 AM8/23/23
to Network Simulator 2 (NS2)
Bonnmotion options command = ./bm -hm RandomWaypoint
-------------------------------------------------------------
$ ./bm -hm RandomWaypoint
BonnMotion 3.0.1
OS: Linux 6.3.5-pclos1
Java: Oracle Corporation 15.0.2
== RandomWaypoint ====================================================
Version:      v1.0
Description:  Application to construct RandomWaypoint (2D/3D) mobility scenarios
Affiliation:  University of Bonn - Institute of Computer Science 4 (http://net.cs.uni-bonn.de/)
Authors:      Florian Schmitt
Contacts:     bonnm...@lists.iai.uni-bonn.de

App:
       -D print stack trace
Scenario:
       -a <attractor parameters (if applicable for model)>
       -c [use circular shape (if applicable for model)]
       -d <scenario duration>
       -i <number of seconds to skip>
       -n <number of nodes>
       -x <width of simulation area>
       -y <height of simulation area>
       -z <depth of simulation area>
       -R <random seed>
       -J <2D, 3D> Dimension of movement output
RandomSpeedBase:
       -h <max. speed>
       -l <min. speed>
       -p <max. pause time>
RandomWaypoint:
       -o <dimension: 1: x only, 2: x or y, 3: x and y, 4: x or y or z, 5: x and y and z>

Hameurlaine Hicham

unread,
Aug 23, 2023, 4:39:32 AM8/23/23
to Network Simulator 2 (NS2)
@knudfl, Thank you,but When use the generated senario , I get this error with some of them not all. take a look please
num_nodes is set 20
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
ns: _o86 setdest 1008.3568158210091 443.94498768378975 35.977931654952144:
    (_o86 cmd line 1)
    invoked from within
"_o86 cmd setdest 1008.3568158210091 443.94498768378975 35.977931654952144"
    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 "_o86" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o86 setdest 1008.3568158210091 443.94498768378975 35.977931654952144"

knudfl

unread,
Aug 23, 2023, 5:06:31 AM8/23/23
to Network Simulator 2 (NS2)
»» _o86 setdest 1008.3568158210091......... ««

........ Could be you have a simulation saying   set val(x)       1000
Then please edit to  e.g.     set val(x)       1100
....... so "x 1008"  is within the set area.

Hameurlaine Hicham

unread,
Aug 23, 2023, 9:27:11 AM8/23/23
to Network Simulator 2 (NS2)
thank you SIr, so it was about the dimensions of the area?

knudfl

unread,
Aug 23, 2023, 9:34:38 AM8/23/23
to Network Simulator 2 (NS2)
"it was about the dimensions of the area" :  I can only guess, when you don't show the simulation.tcl file.
But the error is typical, and so is the suggested solution.

Hameurlaine Hicham

unread,
Aug 23, 2023, 9:41:48 AM8/23/23
to Network Simulator 2 (NS2)
I have changed the dimensions, and It works, thank you sir for your support, but i still can't generate the desaster area, because i did not understand all the parameter, can you help me please?

knudfl

unread,
Aug 23, 2023, 11:38:07 AM8/23/23
to Network Simulator 2 (NS2)
Please start with this:
DisasterArea command options ...............
$ ./bm -hm DisasterArea

Muhammad Rehan Basharat

unread,
Aug 25, 2023, 12:36:03 AM8/25/23
to ns-u...@googlegroups.com
Anyone knows why there is no RSU shown in NAM file. I also configure the RSU in code. Please tell me where we configure RSU in the code, means tell me about the exact location.
Thanks 

You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-users+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-users/5887dbc4-14b7-4259-abec-b29307b6cb79n%40googlegroups.com.
Message has been deleted

knudfl

unread,
Aug 25, 2023, 3:54:57 AM8/25/23
to Network Simulator 2 (NS2)
mbasharat...

Please start a new thread to ask about RSU.
https://groups.google.com/g/ns-users  →  New Conversation
RSU is off topic in hichamham´s thread.
vanet-RSU-ex.tar.xz
https://drive.google.com/file/d/1EWcvdSdUzqAti1e-S-iVyd1ZFa2HYwAJ/view?usp=sharing

Hameurlaine Hicham

unread,
Aug 30, 2023, 5:05:03 AM8/30/23
to Network Simulator 2 (NS2)
@ knudfl hello, please i have simulated many versions of olsr by changing the foolowing parameter but it gives the same pdr, can you help me to know why please?

olsr ETX
Agent/OLSR set mpr_algorithm_        2
Agent/OLSR set routing_algorithm_    2
Agent/OLSR set link_quality_         2
Agent/OLSR set link_delay_           false

olsr MD
Agent/OLSR set mpr_algorithm_        2
Agent/OLSR set routing_algorithm_    2
Agent/OLSR set link_quality_         2
Agent/OLSR set link_delay_           true

olsr ML
Agent/OLSR set mpr_algorithm_        2
Agent/OLSR set routing_algorithm_    2
Agent/OLSR set link_quality_         3
Agent/OLSR set link_delay_           false

olsr basic
Agent/OLSR set mpr_algorithm_        1
Agent/OLSR set routing_algorithm_    1
Agent/OLSR set link_quality_         1
Agent/OLSR set link_delay_           false

knudfl

unread,
Aug 30, 2023, 9:16:45 AM8/30/23
to Network Simulator 2 (NS2)
"Same pdr" with which [pdr].awk script  ??????

My random first test, using ns-2.35 patched with "umolsr-ns235_v1.0-2014.patch"
$ ns235-olsr-64 script-olsr-etx.tcl
$ ns235-olsr-64 script-olsr-md.tcl
$ ns235-olsr-64 script-olsr-ml.tcl
$ ns235-olsr-64 script-olsr.tcl

ETX
$ awk -f PDR.awk wtrace-etx.tr
cbr s:10669 r:6355, r/s Ratio:0.5957, f:7462

MD
$ awk -f PDR.awk wtrace-md.tr
cbr s:11963 r:6885, r/s Ratio:0.5755, f:8734

ML
$ awk -f PDR.awk wtrace-ml.tr
cbr s:10630 r:5665, r/s Ratio:0.5329, f:8723

basic
$ awk -f PDR.awk wtrace0.tr
cbr s:10892 r:6813, r/s Ratio:0.6255, f:8639
...... The script is PDR.awk from was chosen randomly ....
If you have another setup (ns-2.34 ?), then please do some tests with all the listed "PacketDeliveryRatio scripts"
**** PacketDeliveryRatio ****
analysis-technoclass.awk
parameter.awk
parameter-au.awk
Naveem-PDR.awk
PacketDeliveryRatio.awk
PDR_12.awk
PDR-2.awk
pdr.awk
PDR.awk
PDR__cbr+tcp.awk
PDR-Chauhan.awk
PDR-End2endDel-RoutingPackets.awk
pdr.pl
PDRPLD.awk
PDR-Zeb.awk
PDR_zhibinwu.awk
Performance-Metrics.pl
perl-all.pl
Pkt.awk
Througput-Zeb.awk

Hameurlaine Hicham

unread,
Aug 30, 2023, 9:37:36 AM8/30/23
to Network Simulator 2 (NS2)
@knudfl I need these tcl file and patch please

knudfl

unread,
Aug 30, 2023, 12:38:13 PM8/30/23
to Network Simulator 2 (NS2)
umolsr-ns235_v1.0-2014.patch
All ns2 patches
---------
----------
Build example OLSR + ns-2.35:
    tar xvf ns-allinone-2.35_gcc5.tar.gz        ( 2014..2017 update )
https://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing&resourcekey=0-EyPhoScBFDb7ul0VFk6FZQ
    cd ns-allinone-2.35/
    patch -p0 < umolsr-ns235_v1.0-2014.patch
https://drive.google.com/file/d/0B7S255p3kFXNeVZhWFVVZlJnUEU/view?usp=sharing
    export CC=gcc-4.8 CXX=g++-4.8 && ./install
    cd ns-2.35/
    cp ns ns235-olsr
    sudo cp ns235-olsr /usr/local/bin/
------  Simulation  --------
ns235-olsr script-olsr-etx.tcl

Hameurlaine Hicham

unread,
Aug 30, 2023, 1:56:57 PM8/30/23
to ns-u...@googlegroups.com

Muhammad Rehan Basharat

unread,
Aug 31, 2023, 3:04:49 PM8/31/23
to ns-u...@googlegroups.com
I designed the topology, but now how I will change the parameters in C++ file. If anyone know do let me know.
Thanks 

knudfl

unread,
Aug 31, 2023, 3:59:02 PM8/31/23
to Network Simulator 2 (NS2)
Parameters tuning of OLSR routing protocol with metaheuristic algorithm for VANET

Ref.  Google          ns2 olsr parameters

Hameurlaine Hicham

unread,
Sep 10, 2023, 10:03:44 AM9/10/23
to Network Simulator 2 (NS2)
knudfl please, My work is about getting the impact of speed, model mobility and dimension of the area to olsr, olsr ml, olsr md, olsr etx
 i did not use the same pattern of traffic, in these tcl files of olsr, olsr ml, olsr etx....,
there is a pattern of traffic (manually), but in my case I have generated the traffic by  cbrgen, 
and by changing the speed of node by bonnmotion , i get the same pdr; can you help please?
On Wednesday, August 30, 2023 at 2:16:45 PM UTC+1 knudfl wrote:
Reply all
Reply to author
Forward
0 new messages