LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-05-2014, 09:24 AM   #1
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Rep: Reputation: 0
Smile Does olsr protocol can run successfully on ubuntu 12.04


Dear KNUDFL,

I have seen your valuable replies to other members, for their problems.You have been very cooperative and your efforts are really appreciable that, i couldn't stop myself to consult you, for your valuable suggestions.

I am an aspiring Research Scholar, seeking help to run OLSR protocol successfully on Ubuntu 12.04 on simulator ns2.35.

I have worked with DSDV protocol on ns-2.3.
YET, I don't have UBUNTU 12.04 installed on my laptop, that why asking you, if OLSR can run successfully on this version or which version i should choose to be installed specifically for OLSR protocol and other protocols like DSDV, AODV, DSR, etc.

can you suggest other free simulators on which we can successfully run OLSR protocol?

In my research work, I have chosen OLSR as the main protocol to work upon.So, please suggest,can we easily modify the OLSR protocol code after it run successfully on ns2.

thanks & Regards
 
Old 01-06-2014, 11:29 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,176

Rep: Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401
Quote:
Originally Posted by shelja.fet@mriu.edu.in View Post
Dear KNUDFL,
I have seen your valuable replies to other members, for their problems.You have been very cooperative and your efforts are really appreciable that, i couldn't stop myself to consult you, for your valuable suggestions.

I am an aspiring Research Scholar, seeking help to run OLSR protocol successfully on Ubuntu 12.04 on simulator ns2.35.

I have worked with DSDV protocol on ns-2.3. YET, I don't have UBUNTU 12.04 installed on my laptop, that why asking you, if OLSR can run successfully on this version or which version i should choose to be installed specifically for OLSR protocol and other protocols like DSDV, AODV, DSR, etc.

can you suggest other free simulators on which we can successfully run OLSR protocol?

In my research work, I have chosen OLSR as the main protocol to work upon.So, please suggest,can we easily modify the OLSR protocol code after it run successfully on ns2.
If you are an 'aspiring research scholar', shouldn't you be able to actually do basic research? Putting "olsr ns2 patch" into Google pulls up lots...many things even on this site, that link to the patches/documentation for OLSR on NS2.....

http://www.linuxquestions.org/questi...-a-4175469745/
https://groups.google.com/forum/#!to...rs/JJVNvTnAdXY
http://www.linuxquestions.org/questi...-codes-888590/
http://www.linuxquestions.org/questi...or-4175418287/
 
2 members found this post helpful.
Old 01-06-2014, 02:34 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,702

Rep: Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291
OLSR info, ns2 http://www.linuxquestions.org/questions/tags/olsr/

OLSR ns3 https://www.google.com/webhp?hl=all#hl=en&q=ns3+olsr , 32,000 hits.
The first hit http://www.nsnam.org/doxygen/group__olsr.html

OLSR OMNeT++ https://www.google.com/webhp?hl=all#...sr+omnet%2B%2B
... 37,000 hits.

-
 
2 members found this post helpful.
Old 01-06-2014, 09:00 PM   #4
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
thanks for your cooperation, will revert back, if I face other problems.
 
Old 01-06-2014, 09:38 PM   #5
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
Dear TBOne,

thanks for your suggestion, I'll try to follow. Actually i have just completed my course work and stepped into this Area as a Research Scholar 6 months back.
 
Old 01-07-2014, 08:19 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,176

Rep: Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401
Quote:
Originally Posted by shelja.fet@mriu.edu.in View Post
Dear TBOne,
thanks for your suggestion, I'll try to follow. Actually i have just completed my course work and stepped into this Area as a Research Scholar 6 months back.
Ok...so you've completed your courses and have been doing research for six months. Which means that you should be able to do basic research, right??
 
Old 01-08-2014, 12:26 AM   #7
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
No, I am registered as a Research Scholar 6 months back and in first 6 months, completed course work with Literature survey. I am a fresher and started with experimental part now, that's why I have chosen this forum.
 
Old 01-08-2014, 09:34 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,176

Rep: Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401Reputation: 4401
Quote:
Originally Posted by shelja.fet@mriu.edu.in View Post
No, I am registered as a Research Scholar 6 months back and in first 6 months, completed course work with Literature survey. I am a fresher and started with experimental part now, that's why I have chosen this forum.
Ok, fine...whatever the case may be, that does not stop you from trying to look things up on your own. You found this forum with an Internet search...why did you not do a similar search to find answers to your question?
 
Old 01-08-2014, 09:42 PM   #9
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
Ya, you are right, i have already done the similar search for my question....and found some documents but through internet search only i came across this forum and found it more relevant to my question, that's why posted my question and its for members who are new to linux as per to quote on the site: "Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?"
 
Old 01-26-2014, 09:31 AM   #10
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
Patched olsr in ns-2.35 but failed to install olsr in ns-2.35, on ubuntu 12.04

TBOne, thanks for valuable links.

Hi Knudfl,

Thanks, with your valuable tips to other similar threads, I have successfully patched olsr in ns-2.35 but failed to install olsr patch in ns-2.35, ubuntu 12.04. Please suggest what went wrong or what else I should do.

I have downloaded OLSR patch from http://sourceforge.net/projects/um-olsr/.
The downloaded file name is "um-olsr-1.0.tgz"

I have copied "um-olsr-1.0.tgz" in to "/home/ns-olsr/ns-allinone-2.35/ns-2.35" and then I did the following steps:
Code:
$ cd /home/ns-olsr/ns-allinone-2.35/ns-2.35 
$ tar zxvf um-olsr-1.0.tgz 
$ ln -s ./um-olsr ./olsr 
$ patch -p1 < olsr/um-olsr_ns-2.35_v1.0.patch
after patching, got the following confirmation messages on terminal:
Code:
 
patching file Makefile.in 
patching file common/packet.h 
patching file queue/priqueue.cc 
patching file tcl/lib/ns-agent.tcl 
patching file tcl/lib/ns-default.tcl 
patching file tcl/lib/ns-lib.tcl 
patching file tcl/lib/ns-packet.tcl 
patching file trace/cmu-trace.cc 
patching file trace/cmu-trace.h
after running olsr_example2.tcl file, i am getting:
Code:
s@s-Vostro-1440:~/ns-olsr/ns-allinone-2.35/ns-2.35/indep-utils/cmu-scen-gen/setdest/exampleolsr$ ns olsr_example2.tcl 
invalid command name "Agent/OLSR" 
    while executing 
"Agent/OLSR set use_mac_    true" 
    (file "olsr_example2.tcl" line 44)
Quote:
So, As per your suggestion to "AJ" in the thread titled "OLSR and ZRP patch" on google groups ->" UM-OLSR : If you are using the same ns-allinone-2.35 : After the patching, please do, in ns-2.35/ " :
$ export CC=gcc-4.4 CXX=g++-4.4 && ./configure && make clean && make "
i successfully run:
Code:
 
$ sudo apt-get install g++-4.4 
$ export CC=gcc-4.4 CXX=g++-4.4 && ./configure
but getting following message ,when i do $ make clean && make
Code:
s@s-Vostro-1440:~/ns-olsr/ns-allinone-2.35/ns-2.35$ make clean 
Makefile:1: *** missing separator.  Stop. 
s@s-Vostro-1440:~/ns-olsr/ns-allinone-2.35/ns-2.35$ make 
Makefile:1: *** missing separator.  Stop.
Again, after running olsr_example2.tcl file, i am getting the same message:
Code:
s@s-Vostro-1440:~/ns-olsr/ns-allinone-2.35/ns-2.35/indep-utils/cmu-scen-gen/setdest/exampleolsr$ ns olsr_example2.tcl 
invalid command name "Agent/OLSR" 
    while executing 
"Agent/OLSR set use_mac_    true" 
    (file "olsr_example2.tcl" line 44)
So,as per the suggestion of "sukrutha-LQ Newbie" in the similar thread titled "OLSR Patch" in post-13, after patching olsr in already installed ns2.35, i again run ./install in ns-allinone-2.35 and ./validate in ns-2.35,

but,After I run ./install command in ns-allinone-2.35,i get the following messages:
Code:
config.status: creating autoconf.h 
config.status: autoconf.h is unchanged 
Makefile:1: *** missing separator.  Stop. 
Ns make failed!
and after I run ./validate in ns-2.35,i get the following messages:
Code:
Some test failed. 
Sun Jan 26 10:39:40 IST 2014 
Sun Jan 26 10:39:42 IST 2014 
*** ./test-all-wireless-infra
Then, I have also tried replacing the following files ns-2.35 for OLSR, found in different olsr patch -"olsr.tar.gz", downloaded from-(http://dl.dropboxusercontent.com):
Code:
 
~ns-2.35/Makefile.in 
~ns-2.35/common/packet.h 
~ns-2.35/queue/priqueue.cc 
~ns-2.35/tcl/lib/ns-agent.tcl 
~ns-2.35/tcl/lib/ns-default.tcl 
~ns-2.35/tcl/lib/ns-lib.tcl 
~ns-2.35/tcl/lib/ns-packet.tcl 
~ns-2.35/trace/cmu-trace.cc 
~ns-2.35/trace/cmu-trace.h
Quote:
again after i run ./install command in ns-allinone-2.35, i get the following messages:
Code:
config.status: creating autoconf.h 
config.status: autoconf.h is unchanged 
Makefile:1: *** missing separator.  Stop. 
Ns make failed!
Quote:
after i run, ./validate in ns-2.35, get the following message:
Code:
Some test failed. 
Sun Jan 26 10:39:40 IST 2014 
Sun Jan 26 10:39:42 IST 2014 
*** ./test-all-wireless-infra 

validate overall report: some tests failed: 
     ./test-all-simple ./test-all-tcp ./test-all-testReno ./test-all-newreno ./test-all-sack ./test-all-tcpOptions ./test-all-tcpReset ./test-all-simple-full ./test-all-full ./test-all-testReno-full ./test-all-testReno-bayfull ./test-all-sack-full ./test-all-tcp-init-win ./test-all-tcpVariants ./test-all-LimTransmit ./test-all-aimd ./test-all-greis ./test-all-rfc793edu ./test-all-rfc2581 ./test-all-rbp ./test-all-sctp ./test-all-tcpLinux ./test-all-tcpHighspeed ./test-all-frto ./test-all-friendly ./test-all-realaudio ./test-all-ecn ./test-all-ecn-ack ./test-all-ecn-full ./test-all-quickstart ./test-all-diffusion3 ./test-all-smac ./test-all-manual-routing ./test-all-lan ./test-all-red ./test-all-adaptive......
and when i put "#" before statement-"Agent/OLSR set use_mac_ true" in olsr_exampl2.tcl file, and run ns command $ ns olsr_example2.tcl , two blank files are created- “olsr_example.nam” and “olsr_example.tr” and i get the following message :
Code:
s@s-Vostro-1440:~/ns-olsr/ns-allinone-2.35/ns-2.35/indep-utils/cmu-scen-gen/setdest/exampleolsr$ ns olsr_example2.tcl 
num_nodes is set 5 

    (_o14 cmd line 1) 
    invoked from within 
"_o14 cmd addr" 
    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 "_o14" line 2) 
    (SplitObject unknown line 2) 
    invoked from within 
"_o14 addr" 
    ("eval" body line 1) 
    invoked from within 
"eval $node addr $args" 
    ("default" arm line 2) 
    invoked from within 
"switch -exact $routingAgent_ { 
DSDV { 
set ragent [$self create-dsdv-agent $node] 
} 
DSR { 
$self at 0.0 "$node start-dsr" 
} 
AODV { 
set ragent [$self cre..." 
    (procedure "_o3" line 14) 
    (Simulator create-wireless-node line 14) 
    invoked from within 
"_o3 create-wireless-node" 
    ("eval" body line 1) 
    invoked from within 
"eval $self create-wireless-node $args" 
    (procedure "_o3" line 23) 
    (Simulator node line 23) 
    invoked from within 
"$ns_ node" 
    ("for" body line 2) 
    invoked from within 
"for {set i 0} {$i < $opt(nn)} {incr i} { 
    set node_($i) [$ns_ node] 
}" 
    (file "olsr_example2.tcl" line 94)

what i should do next, to successfully run olsr on ns-2.35

thanks & Regards

Last edited by shelja.fet@mriu.edu.in; 01-31-2014 at 12:59 AM. Reason: adding code tags to improve readability
 
Old 01-26-2014, 02:51 PM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,702

Rep: Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291
#10 : Please edit post #10 to use code tags.
That's the # button in the 'Advanced Editor'
http://www.linuxquestions.org/questi....php?do=bbcode
http://www.linuxquestions.org/questi...gs-4175464257/


Quote:
invalid command name "Agent/OLSR"
That's a failed build.


Quote:
Makefile:1: *** missing separator. Stop.
That's a corrupt Makefile : Your olsr build will fail.


Reconfiguring in ns-2.35 (make distclean && ./configure && make) can fail.
"ns-allinone-2.35" is not as reliable as the ealier versions. (2.26 .. 2.34).

Better use a proof method :
Start from scratch (tar xvf ns-allinone-2.35.tar.gz) ,,,
or do a 'make distclean' in ns-allinone-2.35/ns-2.35/ .
When the um-olsr/ olsr/ is in place, and the patching has been done,
change to the topdirectory "ns-allinone-2.35/" and use :
$ export CC=gcc-4.4 CXX=g++-4.4 && ./install : No errors here, Ubuntu 12.04 32bits.

P.S. : The example(s) must be run from ns-allinone-2.35/ns-2.35/.
$ ./ns olsr_example2.tcl : OK here .. olsr_example.nam, olsr_example.tr are created.

-

Last edited by knudfl; 01-26-2014 at 02:56 PM.
 
1 members found this post helpful.
Old 01-28-2014, 10:58 AM   #12
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
Hi Knudfl,

thanks for your time and suggestions.
As per your suggestion:
Quote:
Better use a proof method :
Start from scratch (tar xvf ns-allinone-2.35.tar.gz) ,,,
or do a 'make distclean' in ns-allinone-2.35/ns-2.35/ .
When the um-olsr/ olsr/ is in place, and the patching has been done,
change to the topdirectory "ns-allinone-2.35/" and use :
$ export CC=gcc-4.4 CXX=g++-4.4 && ./install : No errors here, Ubuntu 12.04 32bits.
first i have tried 'make distclean' in ns-2.35 but got the same message
Quote:
Makefile:1: *** missing separator. Stop.
So, i created altogether new copy of already installed ns-2.35 and started from scratch.this time,I have taken different olsr patch "olsr.tar.gz" from https://dl.dropboxusercontent.com/u/...28/olsr.tar.gz.This time also, patching was successful and two different folder created in "ns-2.35" one named 'ns-modified-files' containing following files
Quote:
~ns-2.35/Makefile.in
~ns-2.35/common/packet.h
~ns-2.35/queue/priqueue.cc
~ns-2.35/tcl/lib/ns-agent.tcl
~ns-2.35/tcl/lib/ns-default.tcl
~ns-2.35/tcl/lib/ns-lib.tcl
~ns-2.35/tcl/lib/ns-packet.tcl
~ns-2.35/trace/cmu-trace.cc
~ns-2.35/trace/cmu-trace.h
but this time i have not replaced original files in already intsalled ns-2.35, with these corresponding files present in this folder at specified locations and another folder created, named 'olsr' containing files as in patch 'um-olsr-1.0.tgz'.
Following commands in the directory "ns-allinone-2.35" was also a success:
Code:
 $ export CC=gcc-4.4 CXX=g++-4.4 && ./install
and ./validate was also a success in "ns-2.35"
but when i run " $ ns olsr_example2.tcl" in ns-2.35, i am getting again the same message:
Code:
s@s-Vostro-1440:~/ns/ns-allinone-2.35/ns-2.35/exampleolsr$ ns olsr_example2.tcl 
invalid command name "Agent/OLSR" 
    while executing 
"Agent/OLSR set use_mac_    true" 
    (file "olsr_example2.tcl" line 44)
this time the following commands were also a success:
$ ./configure
$ ./make
Code:
s@s-Vostro-1440:~/ns/ns-allinone-2.35/ns-2.35$ make 
/home/s/ns/ns-allinone-2.35/bin/tclsh8.5 bin/tcl-expand.tcl tcl/lib/ns-lib.tcl tcl/lib/ns-diffusion.tcl tcl/delaybox/delaybox.tcl tcl/packmime/packmime.tcl tcl/tmix/tmix.tcl tcl/tmix/tmix_delaybox.tcl | ../tclcl-1.20/tcl2c++ et_ns_lib > gen/ns_tcl.cc 
g++ -c -Wall -Wno-write-strings  -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR  -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_14 -DHAVE_OTCL_H -DHAVE_LIBTK8_5 -DHAVE_TK_H -DHAVE_LIBTCL8_5 -DHAVE_TCLINT_H -DHAVE_TCL_H  -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE -Drng_test  -I. -I. -I/home/s/ns/ns-allinone-2.35/tclcl-1.20 -I/home/s/ns/ns-allinone-2.35/otcl -I/home/s/ns/ns-.................
$ ./make distclean
Code:
s@s-Vostro-1440:~/ns/ns-allinone-2.35/ns-2.35$ make distclean 
for i in indep-utils/cmu-scen-gen/setdest indep-utils/webtrace-conv/dec indep-utils/webtrace-conv/epa indep-utils/webtrace-conv/nlanr indep-utils/webtrace-conv/ucb; do ( cd $i; make clean; rm -f Makefile; ) done 
make[1]: Entering directory `/home/s/ns/ns-allinone-2.35/ns-2.35/indep-utils/cmu-scen-gen/setdest' 
make[1]: Leaving directory `/home/s/ns/ns-allinone-2.35/ns-2.35/indep-utils/cmu-scen-gen/setdest' 
...............................................................
but when again i run
$ ns olsr_example2.tcl
the problem persist:
Code:
s@s-Vostro-1440:~/ns/ns-allinone-2.35/ns-2.35/exampleolsr$ ns olsr_example2.tcl 
invalid command name "Agent/OLSR" 
    while executing 
"Agent/OLSR set use_mac_    true" 
    (file "olsr_example2.tcl" line 44)
overall all the commands were successful other than running 'olsr_example2.tcl'
here is the code for 'olsr_example2.tcl':
Code:
# ======================================================================
# Define options
# ======================================================================
set opt(chan)           Channel/WirelessChannel  ;# channel type
set opt(prop)           Propagation/TwoRayGround ;# radio-propagation model
set opt(netif)          Phy/WirelessPhy          ;# network interface type
set opt(mac)            Mac/802_11               ;# MAC type
set opt(ifq)            Queue/DropTail/PriQueue  ;# interface queue type
set opt(ll)             LL                       ;# link layer type
set opt(ant)            Antenna/OmniAntenna      ;# antenna model
set opt(ifqlen)         50                       ;# max packet in ifq
set opt(nn)             5                        ;# number of mobilenodes
set opt(adhocRouting)   OLSR                     ;# routing protocol

set opt(cp)             tcl/mobility/scene/cbr-3-test   ;# (PATH to) connection pattern file
set opt(sc)             tcl/mobility/scene/scen-3-test  ;# (PATH to) node movement file. 

set opt(x)              400                      ;# x coordinate of topology
set opt(y)              600                      ;# y coordinate of topology
set opt(seed)           0.0                      ;# seed for random number gen.
set opt(stop)           45                       ;# time to stop simulation

set opt(cbr-start)      30.0
# ============================================================================

#
# check for random seed
#
if {$opt(seed) > 0} {
    puts "Seeding Random number generator with $opt(seed)\n"
    ns-random $opt(seed)
}

#
# create simulator instance
#
set ns_ [new Simulator]

#
# control OLSR behaviour from this script -
# commented lines are not needed because
# those are default values
#
Agent/OLSR set use_mac_    true
#Agent/OLSR set debug_      false
#Agent/OLSR set willingness 3
#Agent/OLSR set hello_ival_ 2
#Agent/OLSR set tc_ival_    5

#
# open traces
#
set tracefd  [open olsr_example2.tr w]
set namtrace [open olsr_example2.nam w]
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y)

#
# create topography object
#
set topo [new Topography]

#
# define topology
#
$topo load_flatgrid $opt(x) $opt(y)

#
# create God
#
create-god $opt(nn)

#
# configure mobile nodes
#

set chan_1_ [new $opt(chan)]

$ns_ node-config -adhocRouting $opt(adhocRouting) \
                 -llType $opt(ll) \
                 -macType $opt(mac) \
                 -ifqType $opt(ifq) \
                 -ifqLen $opt(ifqlen) \
                 -antType $opt(ant) \
                 -propType $opt(prop) \
                 -phyType $opt(netif) \
                 -channel $chan_1_ \
                 -topoInstance $topo \
                 -wiredRouting OFF \
                 -agentTrace ON \
                 -routerTrace ON \
                 -macTrace OFF

for {set i 0} {$i < $opt(nn)} {incr i} {
    set node_($i) [$ns_ node]
}

#
# positions
#
$node_(0) set X_ 350.0
$node_(0) set Y_ 200.0
$node_(0) set Z_ 0.0

$node_(1) set X_ 200.0
$node_(1) set Y_ 350.0
$node_(1) set Z_ 0.0

$node_(2) set X_ 200.0
$node_(2) set Y_ 550.0
$node_(2) set Z_ 0.0

$node_(3) set X_ 50.0
$node_(3) set Y_ 200.0
$node_(3) set Z_ 0.0

$node_(4) set X_ 200.0
$node_(4) set Y_ 50.0
$node_(4) set Z_ 0.0

#
# setup UDP connection
#
set udp [new Agent/UDP]
set null [new Agent/Null]
$ns_ attach-agent $node_(0) $udp
$ns_ attach-agent $node_(2) $null
$ns_ connect $udp $null
set cbr [new Application/Traffic/CBR]
$cbr set packetSize_ 512
$cbr set rate_ 20Kb
$cbr attach-agent $udp
$ns_ at $opt(cbr-start) "$cbr start"

#
# print (in the trace file) routing table and other
# internal data structures on a per-node basis
#
$ns_ at 10.0 "[$node_(0) agent 255] print_rtable"
$ns_ at 15.0 "[$node_(0) agent 255] print_linkset"
$ns_ at 20.0 "[$node_(0) agent 255] print_nbset"
$ns_ at 25.0 "[$node_(0) agent 255] print_nb2hopset"
$ns_ at 30.0 "[$node_(0) agent 255] print_mprset"
$ns_ at 35.0 "[$node_(0) agent 255] print_mprselset"
$ns_ at 40.0 "[$node_(0) agent 255] print_topologyset"

#
# source connection-pattern and node-movement scripts
#
if { $opt(cp) == "" } {
    puts "*** NOTE: no connection pattern specified."
    set opt(cp) "none"
} else {
    puts "Loading connection pattern..."
    source $opt(cp)
}
if { $opt(sc) == "" } {
    puts "*** NOTE: no scenario file specified."
    set opt(sc) "none"
} else {
    puts "Loading scenario file..."
    source $opt(sc)
    puts "Load complete..."
}

#
# define initial node position in nam
#
for {set i 0} {$i < $opt(nn)} {incr i} {
    $ns_ initial_node_pos $node_($i) 20
}     

#
# tell all nodes when the simulation ends
#
for {set i 0} {$i < $opt(nn) } {incr i} {
    $ns_ at $opt(stop).0 "$node_($i) reset";
}

$ns_ at $opt(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt"
$ns_ at $opt(stop).0001 "stop"

proc stop {} {
    global ns_ tracefd namtrace
    $ns_ flush-trace
    close $tracefd
    close $namtrace
}

#
# begin simulation
#
puts "Starting Simulation..."

$ns_ run
Kindly help, what to do....

thanks and Regards

Last edited by shelja.fet@mriu.edu.in; 01-31-2014 at 12:57 AM.
 
Old 01-29-2014, 02:56 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,702

Rep: Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291
# 12 .
Quote:
overall all the commands were successful
Which commands were successful ? ?
 
Old 01-29-2014, 03:34 AM   #14
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
Hi, thanks for responding.
Quote:
As per the Post #10:
patching was successful and the following commands were successful:
Code:
$ sudo apt-get install g++-4.4 
$ export CC=gcc-4.4 CXX=g++-4.4 && ./configure
but no success in the following:
Code:
& ./install && ./validate
$ ./make && ./make distclean && ns olsr_example2.tcl
Quote:
As per the post #12:
after patching, the following commands run successfully:
Code:
$ export CC=gcc-4.4 CXX=g++-4.4 && ./install && ./validate
$ ./configure && ./make && ./make distclean
but unsuccessful, while executing "$ ns olsr_eample2.tcl" in ns-2.35 and get the same message as in post #10
Code:
s@s-Vostro-1440:~/ns/ns-allinone-2.35/ns-2.35/exampleolsr$ ns olsr_example2.tcl 
invalid command name "Agent/OLSR" 
    while executing 
"Agent/OLSR set use_mac_    true" 
    (file "olsr_example2.tcl" line 44)
Regards
 
Old 01-30-2014, 11:36 AM   #15
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
Hi,

After patching olsr in ns-2.35,
manual replacement of following files in ns-2.35 is required or not?
Code:
~ns-2.35/Makefile.in
~ns-2.35/common/packet.h
~ns-2.35/queue/priqueue.cc
~ns-2.35/tcl/lib/ns-agent.tcl
~ns-2.35/tcl/lib/ns-default.tcl
~ns-2.35/tcl/lib/ns-lib.tcl
~ns-2.35/tcl/lib/ns-packet.tcl
~ns-2.35/trace/cmu-trace.cc
~ns-2.35/trace/cmu-trace.h
Quote:
above files are additionally available with olsr patch -"olsr.tar.gz", in a separate folder "ns-modified-files" for ns-2.35 on https://dl.dropboxusercontent.com/u/...28/olsr.tar.gz
ap per this olsr patch-"olsr.tar.gz",After patching, i have replaced the files at specified locations. but still the prblem remains the same. Unable to run "olsr_example2.tcl" file:
Code:
s@s-Vostro-1440:~/ns/ns-allinone-2.35/ns-2.35/exampleolsr$ ns olsr_example2.tcl 
invalid command name "Agent/OLSR" 
    while executing 
"Agent/OLSR set use_mac_    true" 
    (file "olsr_example2.tcl" line 44)
please suggest, if now, i should try installing olsr on some previous version of ns....

thanks and Regards

Last edited by shelja.fet@mriu.edu.in; 01-31-2014 at 02:52 AM.
 
  


Reply

Tags
ns2, olsr, olsr-235


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Get Error after run tcl file for OLSR....anyone please help AUJU Linux - Newbie 21 10-28-2015 06:42 AM
[Link] How to run IDM successfully on Linux (Ubuntu) m4heshd Linux - Software 5 07-19-2012 01:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration