OLSR MPR NS2

175 views
Skip to first unread message

Hameurlaine Hicham

unread,
Oct 10, 2023, 4:43:33 PM10/10/23
to Network Simulator 2 (NS2)
hello, I hope you are doing well
so, I am working to simulate different versions of OLSR using ns2
Please, can anyone show me how to modify the hello and tc message and how to modify the way to etablish the selection of MPR. thank s a lot. 

knudfl

unread,
Oct 11, 2023, 3:59:46 AM10/11/23
to Network Simulator 2 (NS2)
Do you mean "Multiple Path Optimized Link State Routing"  (MP-OLSR) ?


Suggest : Setup a new ns-allinone-2.35 for the new modification .......
" You can have as many ns-allinone-2.xx as you want, installed at the same time "

Build example ..........
tar xvf ns-allinone-2.35_gcc5.tar.gz
https://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing&resourcekey=0-EyPhoScBFDb7ul0VFk6FZQ
cd ns-allinone-2.35/
patch -p0 < mpolsr_umolsr-v1_ns235.patch
        ### Ubuntu
export CC=gcc41 CXX=g++41 & ./install
        ### Fedora, RHEL, CentOS
export CC=gcc44 CXX=g++44 & ./install
cd ns-2.35/
cp ns ns235-mpolsr
sudo cp ns235-mpolsr /usr/local/bin/
---------  Simulation  ----------
ns235-mpolsr 50-MPolsr__Ber_wireless.tcl
mpolsr-ex-3.tar.gz
https://drive.google.com/file/d/1IZqJkvPh0HCfSqVeY8Y-aaxsvTF9Hv0d/view?usp=sharing
_____________________

cd Downloads/
sudo apt install ./gcc41-c++_4.1.2-16_amd64.deb

Hameurlaine Hicham

unread,
Oct 14, 2023, 5:39:16 PM10/14/23
to Network Simulator 2 (NS2)
thank s a lot, but i want to modify the content of the hello message and the tc message of olsr, how to do that please?

Hameurlaine Hicham

unread,
Oct 22, 2023, 5:23:31 PM10/22/23
to Network Simulator 2 (NS2)
@knudfl please

knudfl

unread,
Oct 23, 2023, 3:22:40 AM10/23/23
to Network Simulator 2 (NS2)
" modify the content of the hello message and the tc message of olsr "
......  Sorry,  I don't have that kind of knowledge. And no C++ coding.
( I make patches from existing code, and sometimes modify examples.
And I provide information from the internet.    That's it.)

Hameurlaine Hicham

unread,
Oct 29, 2023, 4:40:21 AM10/29/23
to Network Simulator 2 (NS2)
@ knudfl can you provide any modified version of olsr (ns2 or ns3), and i will try to modify it please

knudfl

unread,
Oct 29, 2023, 5:02:26 AM10/29/23
to Network Simulator 2 (NS2)
I guess that mpolsr already was mentioned, mpolsr_umolsr-v1_ns235.patch
https://drive.google.com/drive/folders/1Km6qg6GlA9URwtIIVOUrTrsf7jO-sFVJ?usp=sharing
mpolsr-ex-3.tar.gz
---------
"OLSR Cross-Layer" is metioned in Cross-Layer-all.tar.gz
......... No online link for 'Exchanging Cross-layer information in NS2 via the Physical Layer.html' any more.
I.e. generally n2 information is gradually disappearing from the net as ns2 has been unsupported for many years: ns2 is considered "not used anymore".

ns3 :  You can ask ns3 questions at "ns3 users"  https://groups.google.com/g/ns-3-users
(Alternatively  https://stackoverflow.com/questions/
 .  https://stackoverflow.com/search?q=ns3  )
( I can build ns3, but I am not answering ns3 question. Plenty of knowledgeable people at ns-3-users .

Hameurlaine Hicham

unread,
Oct 29, 2023, 5:25:21 AM10/29/23
to Network Simulator 2 (NS2)
thanks a lot, what about including energy model fot olsr?

knudfl

unread,
Oct 29, 2023, 7:39:02 AM10/29/23
to Network Simulator 2 (NS2)
OLSR  energyModel :
$ cd olsr-examples-10.23/
$ grep -n energyMod *
10-udp-olsr-Aska123.tcl:76:                     -energyModel $opt(energymodel) \
2Energy-OLSR-Soumia.tcl:88:                   -energyModel $val(energymodel) \
2-with.olsr.data__20.tcl:50:-energyModel $opt(energymodel) \
3wireless3-udp-Aska123_OLSR.tcl:99:                     -energyModel $opt(energymodel) \
5olsr-diff-e__wireless-qeaodv.tcl:71:-energyModel $opt(energymodel) \
Energymodel_script-olsr-sa.tcl:126:-energyModel $val(energymodel) \
Energy-OLSR-Soumia.tcl:67:                   -energyModel $val(energymodel) \
olsr-20.tcl:50:-energyModel $opt(energymodel) \
RI-olsr-ex.tcl:105:                 -energyModel $opt(energymodel)\
wireless3-udp-Aska123_OLSR.tcl:74:
                     -energyModel $opt(energymodel) \

...... About (new olsr ex) 5olsr-diff-e__wireless-qeaodv.tcl :
# 5 Nodes with different energy levels / OLSR Routing Protocol Example


.....  Some of the EnergyModel-examples can run with an OLSR protocol.

knudfl

unread,
Oct 29, 2023, 9:59:23 AM10/29/23
to Network Simulator 2 (NS2)
New olsr examples in Energy-Model/ex-EnergyModel-10/olsr/ → EnergyModel-examples-10.tar.xz
https://drive.google.com/file/d/1NKAqrFNpYdM1Twf_Zgdsnd_Nq9AXEFh_/view?usp=drive_link

Hameurlaine Hicham

unread,
Oct 29, 2023, 2:45:07 PM10/29/23
to Network Simulator 2 (NS2)
@knudfl , please, to introduce the energy parameter, should I use only the tcl file with the um-olsr ? 
I don't have to install a new patch?

knudfl

unread,
Oct 29, 2023, 3:45:06 PM10/29/23
to Network Simulator 2 (NS2)
EnergyModel is default in all ns2 versions.  No patching for energyModel.
Energy examples AODV DSDV DSR can run with a stock ns-2.35 → $ ns235-orig file.tcl

Energy examples OLSR can run with umolsr or the diox olsr ns-2.34 .
There can be differences ..... Easy to test that yourself.
( umolsr → UM → University of Madrid)

My tests
$ ns234-olsr-diox 0Vanet-tes-olsr.tcl > 0-diox.txt 281kB
$ ns235-olsr-64 0Vanet-tes-olsr.tcl > 0-umolsr.txt 184kB : Big difference
..... ns235-olsr-64 is patched with umolsr-ns235_v1.0-2014.patch
-
$ ns234-olsr-diox 2OLSR-Soumia.tcl > 2-diox.txt 1.9 kB
$ ns235-olsr-64 2OLSR-Soumia.tcl > 2-umolsr.txt 291B : Warnings only difference
..... i.e. the old diox version spits out a lot of warnings because those settings are not listed in tcl/lib/ns-default.tcl
But that doesn't explain the big difference between the two 0Vanet-tes-olsr.tcl runs.
It's for you to decide which olsr version to use.

Hameurlaine Hicham

unread,
Oct 29, 2023, 3:46:30 PM10/29/23
to ns-u...@googlegroups.com
Gracias 

--
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/MCkiYLAAxg4/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/5eac6ae4-5a9a-4b57-a48f-9df8ac272539n%40googlegroups.com.

Hameurlaine Hicham

unread,
Oct 29, 2023, 5:52:36 PM10/29/23
to Network Simulator 2 (NS2)
@knudfl please can I know which parameters are taken into account in this default energymodel ?

knudfl

unread,
Oct 29, 2023, 8:18:50 PM10/29/23
to Network Simulator 2 (NS2)
There are no default settings in tcl/lib/ns-[files].tcl
CHANGES.html:2839:energy-model.{h,cc}: Defines the new EnergyModel (Jul 29, 1999)
....... please see mobile/{energi-model.cc,energy-model.h}
Message has been deleted
Message has been deleted

knudfl

unread,
Oct 30, 2023, 5:37:23 AM10/30/23
to Network Simulator 2 (NS2)
Also ref. https://www.linuxquestions.org/questions/linux-newbie-8/willingnes-parameter-change-in-the-protocol-olsr-ns2-4175532733/
..... Please do not expect LQ members responding to a 9 year old post.

?? "The concept of using energy metrics for route selection in OLSR routing protocol" ?
Simply use Google ..........
Google        The concept of using energy metrics for route selection in OLSR routing protocol
1. The first hit https://www.researchgate.net/publication/267962392_Optimization_of_Energy_Consumption_for_OLSR_Routing_Protocol_in_MANET
........  PDF's can contain useful code → buy pdf https://www.researchgate.net/publication/267962392_Optimization_of_Energy_Consumption_for_OLSR_Routing_Protocol_in_MANET/fulltext/54b50bc60cf26833efd05cdd/Optimization-of-Energy-Consumption-for-OLSR-Routing-Protocol-in-MANET.pdf?_tp=eyJjb250ZXh0Ijp7ImZpcnN0UGFnZSI6InB1YmxpY2F0aW9uIiwicGFnZSI6InB1YmxpY2F0aW9uIn19
..... in full version.
2. https://ieeexplore.ieee.org/document/4753611
3. etc. etc. , 80,000 hits

Hameurlaine Hicham

unread,
Oct 30, 2023, 8:16:42 AM10/30/23
to Network Simulator 2 (NS2)
@knudfl thanks so much

Hameurlaine Hicham

unread,
Nov 6, 2023, 1:55:16 PM11/6/23
to Network Simulator 2 (NS2)
@knudfl
what is the difference between -p0 and -p1 in the installation of the patch?
in the installation of um olsr, should I copy the folder of olsr or only the patch?
best regards

knudfl

unread,
Nov 6, 2023, 2:44:18 PM11/6/23
to Network Simulator 2 (NS2)
patch -p0 < name.patch            
            option -p0 : The folder to patch is in the current directory.
Note : All ns2 patches created by me 
 i.e. where line 1 in the patch says `diff -Naur ns-2.xx-orig/..  ns-2.xx/..´ or `diff -Naur orig-ns-2.xx/..  ns-2.xx/..´
... are applied with patch -p0 < name.patch in ns-allinone- , i.e. in the folder with the ns-2.xx/ to be patched.

Reason :  Creating the patch is done with simplest command.
And is applied with patch -p0 < name.patch = the simplest command.
------------

Ref. Google      patch example strip num
Also please run  $ patch --help
-----------

Build example ........  OLSR (UMOLSR), ns-2.35:
    tar xvf ns-allinone-2.35_gcc5.tar.gz        ( 2014   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
.................... i.e. "the folder of olsr"= olsr/ is included in the patch: Please watch ns-2.35 before and after applying the patch.

--------------
New observations about possible bug in olsr 
...... Something for you to check.

Hameurlaine Hicham

unread,
Nov 7, 2023, 4:56:57 PM11/7/23
to Network Simulator 2 (NS2)
@knudfl Thanks a lot,
please help me to get the project of any modified version of olsr, 
I want to know how can I modify the mpr selection method by including other
 parameters such as energy, congestion,.....
or suggest any method to get these projects, please.
best regards 

Hameurlaine Hicham

unread,
Nov 17, 2023, 10:51:07 AM11/17/23
to Network Simulator 2 (NS2)
@knudfl, please i have modified olsr.cc, then I type make, and when I execute the tcl file, 
I can't find the expected result, nothing new.
can you help? 

knudfl

unread,
Nov 17, 2023, 12:05:28 PM11/17/23
to Network Simulator 2 (NS2)
"modified olsr.cc" : First, I do not write C++ code.
But I know that certain functions will require a "Tcl Hook" in the file.cc .

And some functions require entries to tcl/lib/ns-files.tcl
E.g. olsr has modifications to { ns-agent.tcl ns-default.tcl ns-lib.tcl ns-packet.tcl }

....  And if you have changes involving queue or the trace file, modifications may also be done in queue/files.cc , trace/files.cc

Hameurlaine Hicham

unread,
Jan 7, 2024, 4:06:00 AM1/7/24
to Network Simulator 2 (NS2)
@knudfl, please can you help to install etx olsr patch?

knudfl

unread,
Jan 7, 2024, 8:23:47 AM1/7/24
to Network Simulator 2 (NS2)
Please see my answer of  `Nov 6, 2023, 8:44´ .... about umolsr-ns235_v1.0-2014.patch :
Includes the "etx olsr patch" , but diox says there is a bug with UMOLSR :

Solutions :
1. The "github olsr-diox-ns234": compile with e.g. g++-4.8
unzip ns-allinone-2.34.zip
cd ns-2.34-allinone/

export CC=gcc-4.8 CXX=g++-4.8 && ./install

2.
Use the Weverton Cordeiro / diox code with ns-2.35
tar xvf ns-allinone-2.35_gcc5.tar.gz
cd ns-allinone-2.35/
patch -p0 < olsr-W.Cordeiro__ns235.patch
https://drive.google.com/file/d/1RiBWNbjPXzvhzDz8x5F5GQSTZ4STkMcF/view?usp=drive_link

export CC=gcc-4.8 CXX=g++-4.8 && ./install
cd ns-2.35/
cp ns ns235-etx
sudo cp ns235-etx /usr/local/bin/
#####  Simulation
$ ns235-etx script-olsr-etx.tcl
$ ns235-etx 11-script-olsr-etx-rwp11.tcl > 11.txt

-

Hameurlaine Hicham

unread,
Jan 7, 2024, 9:47:41 AM1/7/24
to Network Simulator 2 (NS2)
@knudfl thank's a lot
Reply all
Reply to author
Forward
0 new messages