LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 10-21-2018, 06:01 AM   #1
mms
LQ Newbie
 
Registered: Sep 2018
Posts: 6

Rep: Reputation: Disabled
Using AODV in LAR protocol in NS2


Hi,
I am using the LAR code for NS2.35.
In box.tcl, I'm trying to understand why it use the AODV in the routing protocol, and I asked Dr. Tracy Camp to explain how LAR protocol is using AODV in the .tcl but she told me this work was 15-20 years ago.
Can you help me please, Thank you.
Attached Files
File Type: txt box.tcl.txt (7.2 KB, 58 views)
 
Old 10-21-2018, 09:01 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The main protocol used for LAR simulations is e.g. AODV.
The "Location-Based routing" is done with the "Agent/LAR" settings.
Other main protocol example, DSDV : See dsdv__Lar.tcl → → lar+dream-examples-0918.tar.gz
https://drive.google.com/file/d/1NDK...ew?usp=sharing

Example, LAR settings (from "box-Helen.tcl") :
Code:
# the format now for the lar send is
#
# "$nodeId sendData <dest ID> <size> <method>"
#
# this will be used to test in a static configuration, and will
# change once the mobility portion is figured out.
#Schedule events

puts "Scheduling the send events"
for {set k $val(dataStart)} {$k < $val(dataStop)} {set k [expr $k + 0.25] } \
{
$ns_ at $k "$g(0) sendData 49 64 B"
$ns_ at [expr $k + .0001] "$g(1) sendData 48 64 B"
$ns_ at [expr $k + .0002] "$g(2) sendData 47 64 B"

}

# this is done to make the simulator continue running and "settle" things out
for {set i 0} {$i < $val(nn)} {incr i} {
$ns_ at $val(signalStop) "$g($i) larDone"
}
And "Lar.tcl"
Code:
.
#Create lar agents and attach them to the nodes 
puts "creating lar agents and attaching them to nodes..." 
for {set i 0} {$i < $val(nn)} {incr i} {
  set g($i) [new Agent/LAR]
  $node_($i) attach $g($i) 254

  # need to tell the lar agents about their link layers
  set ll($i) [$node_($i) set ll_(0)]
  $ns_ at 0.0 "$g($i) set-ll $ll($i)"

  # need to tell the lar agents which nodes they're on also
  $ns_ at 0.0 "$g($i) set-node $node_($i)"
}
.
.
The usable LAR code is "LAR-dream__ns235.patch"
https://drive.google.com/file/d/0B7S...ew?usp=sharing

-

Last edited by knudfl; 10-21-2018 at 09:08 AM.
 
Old 10-21-2018, 09:49 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Overview : "Protocols Used in NS2"
http://networksimulationtools.com/pr...s-used-in-ns2/
 
Old 10-22-2018, 02:53 AM   #4
mms
LQ Newbie
 
Registered: Sep 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
Can you please explain for me how it is work the Agent/LAR?
 
Old 10-22-2018, 04:51 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #4.

May be you can figure it out from the code ...

Agent/LAR :
Code:
lar/lar.cc:39:    LARClass() : TclClass("Agent/LAR") {}
lar/lar.cc:57:  //LARClass() : TclClass("Agent/LAR") {}
sendData :
Code:
lar.cc:345:    if (strcmp(argv[1], "sendData") == 0)
lar.cc:392:    } // if (strcmp(argv[1], "sendData") == 0)
larDone :
Code:
lar.cc:248:    if (strcmp(argv[1], "larDone") == 0)
 
Old 10-28-2019, 11:55 AM   #6
tyo.bisma
LQ Newbie
 
Registered: Aug 2018
Posts: 7

Rep: Reputation: Disabled
good day, sir

may i know, is this only works on ns2 using ubuntu 12.04? because it's failed to run on me, i'm using ubuntu 16.04.

thank you
 
Old 10-28-2019, 04:16 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post #6, @tyo.bisma : Welcome to LQ.

Works OK with the 2014 ns-2.35 update = ns-allinone-2.35_gcc5.tar.gz .
Probably not with the old year 2011 ns-allinone-2.35.tar.gz

Ubuntu 16.04 - amd64 :
Code:
tar xvf ns-allinone-2.35_gcc5.tar.gz 
https://drive.google.com/file/d/0B7S...ew?usp=sharing
cd ns-allinone-2.35/
patch -p0 < LAR-dream__ns235.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
./install
cd ns-2.35/
cp ns ns235-lar
sudo cp ns235-lar /usr/local/bin/

--------- Simulation -------
ns235-lar box-Helen.tcl
Etc. etc. from lar+dream-examples-09.19.tar.gz
https://drive.google.com/file/d/1rhw...ew?usp=sharing
 
Old 10-30-2019, 01:50 AM   #8
tyo.bisma
LQ Newbie
 
Registered: Aug 2018
Posts: 7

Rep: Reputation: Disabled
sir, do i need to uninstall the existing ns2, or can i just install the new one?
because i've tried to uninstall ns2 but when i check using command 'ns' the message still '%'
if i overwrite or stack up ne ns2, will it works OK?
 
Old 10-30-2019, 02:35 AM   #9
tyo.bisma
LQ Newbie
 
Registered: Aug 2018
Posts: 7

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Post #6, @tyo.bisma : Welcome to LQ.

Works OK with the 2014 ns-2.35 update = ns-allinone-2.35_gcc5.tar.gz .
Probably not with the old year 2011 ns-allinone-2.35.tar.gz

Ubuntu 16.04 - amd64 :
Code:
tar xvf ns-allinone-2.35_gcc5.tar.gz 
https://drive.google.com/file/d/0B7S...ew?usp=sharing
cd ns-allinone-2.35/
patch -p0 < LAR-dream__ns235.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
./install
cd ns-2.35/
cp ns ns235-lar
sudo cp ns235-lar /usr/local/bin/

--------- Simulation -------
ns235-lar box-Helen.tcl
Etc. etc. from lar+dream-examples-09.19.tar.gz
https://drive.google.com/file/d/1rhw...ew?usp=sharing
sir, i did exactly as the following instruction. and i'ts still failed to work.
this is the message:

bisma@ubuntu:~/Downloads/lar+dream-examples-0919$ ns box-Helen.tcl
setting initial variables...
setting other default settings...
removing unecessary packet headers...
num_nodes is set 20
creating channel...
setting global node values...
creating the nodes...
INITIALIZE THE LIST xListHead
Loading the mobility file...
creating lar agents and attaching them to nodes...
invalid command name "Agent/LAR"
while executing
"Agent/LAR create _o69 "
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new Agent/LAR"
("for" body line 2)
invoked from within
"for {set i 0} {$i < $val(nn)} {incr i} {
set g($i) [new Agent/LAR]
$node_($i) attach $g($i) 254

# need to tell the lar agents about their link layers..."
(file "box-Helen.tcl" line 174)

please give me direction, sir. thank you
 
Old 10-30-2019, 03:27 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #9.
Quote:
i did exactly as the following instruction
Not really. The command is not 'ns', but 'ns235-lar' to use the LAR patched version.

You can have a hundred ns-allinone-2.35 installed at the same time.
With all the different 'ns-[name]' in /usr/local/bin/.
See ns2-INFO https://drive.google.com/file/d/1FCj...ew?usp=sharing

My example https://drive.google.com/file/d/1_4X...ew?usp=sharing

-
 
Old 11-04-2019, 01:21 AM   #11
tyo.bisma
LQ Newbie
 
Registered: Aug 2018
Posts: 7

Rep: Reputation: Disabled
sir, i tried use command "ns235-lar". it failed with the message "command not found"
then i tried use command "ns ns235-lar". and this occured:
bisma@ubuntu:~/Downloads/ns-allinone-2.35/ns-2.35$ ns ns235-lar
invalid command name "ELF>à~^@Ðk¢@8"
while executing
"ELF>à~^@Ðk¢@8 @(%@@@..."
(file "ns235-lar" line 1)

whats wrong with it?
 
Old 11-04-2019, 03:37 AM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post #9 says "I did exactly as the following instruction".

If you follow post #7 strictly, you will end up with `/usr/local/bin/ns235-lar´.
If you did something else, don't expect to build ns-2.35 + Lar.

Start from scratch in a new directory like :
/home/name/ns2/LAR/3/



Quote:
bisma@ubuntu:~/Downloads/ns-allinone-2.35/ns-2.35$ ns ns235-lar
Better read post #7 again.
And you actually don't have to type false commands, when you can copy-paste each command from post #7.

1 tar xvf ns-allinone-2.35_gcc5.tar.gz
2 cd ns-allinone-2.35/
3 patch -p0 < LAR-dream__ns235.patch
4 ./install
5 cd ns-2.35/
6 cp ns ns235-lar
7 sudo cp ns235-lar /usr/local/bin/

--------- Simulation -------
8 ns235-lar box-Helen.tcl
 
Old 11-04-2019, 10:48 PM   #13
tyo.bisma
LQ Newbie
 
Registered: Aug 2018
Posts: 7

Rep: Reputation: Disabled
ahh.. yes, sir. my wrongdoing. it works OK now, thank you.
and sir, i want to use gui so that i can make a documentation out of it.
i read that its about wrong gcc version. i use ubuntu 16.04 with NS2.35, does my gcc version's the right one?

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609

and the result only appeared on terminal, is it that way or my installation process that was wrong?
is there a way so i could know how the traffic works etc. etc. ??
 
Old 11-05-2019, 03:12 AM   #14
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #13.

GCC : You can have all available gcc versions installed at the same time.
Default is gcc-5 / g++-5, which is OK for ns-2.35 .
Extra gcc https://drive.google.com/drive/folde...Jm?usp=sharing

GUI : If you mean NAM, use a simulation with a nam trace.

Plot from "out.tr" http://mohittahiliani.blogspot.dk/20...-tool-for.html
. https://github.com/WiNG-NITK/APP-Tool

-
 
Old 12-18-2019, 09:48 AM   #15
tyo.bisma
LQ Newbie
 
Registered: Aug 2018
Posts: 7

Rep: Reputation: Disabled
thank you, sir. although it take much time for me, it works.
sir, could it be possible if 1 (node 0) node stationary (stand still) while other nodes mobile(or moving)?
 
  


Reply

Tags
lar, ns2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grayhole attack in ns2 using aodv protocol absharma Linux - Newbie 19 12-29-2016 02:26 PM
Error when adding LAR protocol in NS2 Helen jameel Linux - Software 28 04-03-2016 08:15 PM
sendData in "location aided routing" (LAR protocol) in NS2 sims2801 Linux - Software 1 12-16-2014 08:40 AM
NS2: MFR and LAR routing protocol anisabutsi Linux - Software 1 06-04-2013 12:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 01:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration