LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Error in simulating OLSR on ns-2.34 (https://www.linuxquestions.org/questions/linux-newbie-8/error-in-simulating-olsr-on-ns-2-34-a-4175453886/)

linuxuday 03-13-2013 05:30 AM

Error in simulating OLSR on ns-2.34
 
Hi all,

I am new to linux environemnt and learning ns2 for my thesis.

So far I have installed ns-2.34 on fedora17 and patched olsr. This forum helped me a lot while installing as I had stumbled at many steps.

Now I could simulate AODV and DSR properly however if I just change AODV to OLSR in the tcl file, it is resulting in following error.

Please help, I'm not getting where to look for the error.
Looking forward for your help.

Code:

num_nodes is set 10
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl

    (_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 < $val(nn) } {incr i} {
        set node_($i) [$ns_ node]       
        $node_($i) random-motion 0                ;# disable random motion
}"
    (file "olsr_test.tcl" line 118)


knudfl 03-13-2013 06:26 AM

Welcome to LQ.

Which patch did you use ? The full file name, please.

And what is "olsr_test.tcl" ? ( You can attach the file as olsr_test.tcl.txt ).


-

linuxuday 03-13-2013 09:24 AM

3 Attachment(s)
Hi,
Thanks for your time..

Name of the patch is, "um-olsr-2.34_v0.8.8.patch"

And olsr_test.tcl is the wireless1.tcl file which I have updated for olsr.
I have used the same tcl file to simulate AODV and DSR which did run correctly but giving error for OLSR.
The tcl file, mobility file (mob_10) and traffic file(traffic_10) are attached. Mobility file and traffic were generated by me using setdest and cbegen.tcl which were inbuilt in NS2.34

Please also let me know if we get OLSR inbuilt in any NS2 version ?

Looking forward for your suggestion.

Thanks.

knudfl 03-13-2013 10:04 AM

# 3 : olsr_test2.tcl (Your edited olsr_test.tcl), lines 52, 53 :
Code:

set val(cp)                "./traffic_10"        ;#<-- traffic file
set val(sc)                "./mob_10"        ;#<-- mobility file

I.e. all three files {olsr_test2.tcl traffic_10 mob_10} are in the same directory.

Code:

$ ns-umolsr olsr_test2.tcl
num_nodes is set 10
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...

File output result : olsr_out.nam, olsr_out.tr .
$ nam olsr_out.nam : OK.
.. And "olsr_test2.tcl" still says OLSR in line 49, so I don't know why you fail.


('ns-umolsr' : I have 30 executable ns-*** so they must all have different names.)

-

linuxuday 03-13-2013 10:45 AM

#4
I did the changes on line 52 and 53 as you suggested but it shows same error :(

I see in the code which you posted, you have used "ns-umolsr" to run the tcl file.
I didn't get you. I use "ns" command from "ns-2.34" folder. Does that mean I have not patched OLSR correctly? or is there other version/distro of ns2 having capability to run olsr ?

Also, I didn't get the last line of you reply.
i.e "('ns-umolsr' : I have 30 executable ns-*** so they must all have different names.)"

Please explain. Everything seems right in the tcl file as you said but still it is not running.
Thanks.

knudfl 03-13-2013 11:01 AM

# 5
Quote:

Does that mean I have not patched OLSR correctly ?
Probably.


Quote:

I use "ns" command from "ns-2.34"
.
Also, I didn't get the last line of you reply.
Well, I am also using an 'ns' created on ns-2.34 .
But with 30 times 'ns' in /usr/local/bin/ :
Only one can be named ns, so all my ns are renamed to ns-<name>.

The executable "ns-umolsr" works OK on Fedora 17 - 32bits (i686).
(Could be made into an fc17 package, like "um-olsr-ns-2.34-1.fc17.i686.rpm" ~4.6 MB.)

-

linuxuday 03-13-2013 11:42 AM

I'm running Fedora17 64bit.
I'm not sure this package "um-olsr-ns-2.34-1.fc17.i686.rpm" would work on Fedora17 64 bit.
I will try this anyway.

Please provide link for 64 bit version um-olsr-ns-2.34 rpm if thats is available.

Thanks..

knudfl 03-13-2013 01:17 PM

OK, easy to build on the 64bits Fedora 17 :
cd ns-allinone-2.34/ && export CC=gcc34 CXX=g++34 && ./install

$ cd umolsr-ex/ ; $ ns-umolsr olsr_test2.tcl : OK.

Package um-olsr-ns-2.34-1.fc17.x86_64.rpm
https://docs.google.com/file/d/0B7S2...it?usp=sharing

cd Downloads/ ; # yum install um-olsr-ns-2.34-1.fc17.x86_64.rpm


-

linuxuday 03-14-2013 04:35 AM

Hello 'knudfl',

Thanks for all the information. Really appreciate it.

I removed NS-2.34, did a clean install and used this patch "um-olsr_ns-2.34_v1.0.patch".
And it is working perfectly.


All times are GMT -5. The time now is 08:54 PM.