LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 06-02-2014, 12:45 AM   #1
kanugeete
LQ Newbie
 
Registered: Jun 2014
Posts: 2

Rep: Reputation: Disabled
Tcl file is not taking input


Hello, I am total new bee for linux and ns2. I have successfully added the patch um-olsr-2.34_v0.8.8.patch , And also the um-olsr examples.
However, When I run olsr_example.tcl every time I get the output

num_nodes is set 5
INITIALIZE THE LIST xListHead
*** NOTE: no connection pattern specified.
*** NOTE: no scenario file specified.
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...

I tried to give input to it like ns olsr_example.tcl set-mode 3
Some code i added to OLSR.cc.
For example the code below:

else if(strcmp(argv[1], "set-mode")==0)
{
int mode = atoi(argv[2]);
if(mode==0)
is_on=0;
else
is_on=1;
return TCL_OK;
}
Link to olsr_example.tcl http://masimum.inf.um.es/fjrm/wp-upl...sr_example.tcl
Please tell me where I am wrong.

Last edited by kanugeete; 06-02-2014 at 01:36 AM.
 
Old 06-02-2014, 09:45 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
Welcome to LQ.

OLSR examples, "umolsr-examples-04.2014.tar.gz" →
https://drive.google.com/file/d/0B7S...it?usp=sharing


Quote:
$ ns olsr_example.tcl set-mode 3
Yes, you can usually do that.
And : The output you show in post #1 in the normal one.

* So what's your issues ? ?

-
 
Old 06-02-2014, 04:47 PM   #3
uthaathu
LQ Newbie
 
Registered: Jun 2014
Posts: 6

Rep: Reputation: Disabled
hello sir

ive already done the simultaion and it worked for 150 node. when i changed the node to 185, it got "segmentation fault" error. then ichanged the max node in olsr_pkt.h to be 185. the error has gone but the simulation never finish. it takes 18 hours since i running it and now its still running and the simulation not finish yet.

can anybody tell me why this happened?
is it the way to increase spedd of simulation? because it takes too long time. thks for the reply
 
Old 06-02-2014, 09:53 PM   #4
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
# 3 .

NS2 limitations : Some simulations have a maximum of 14 nodes, some 100+.

http://www.cs.binghamton.edu/~kliu/r...2code/#speedup
"The implementation of the Packet data structure of NS2 does not math the realities.
The packet in ns2 simulation keeps all packet headers for any protocols implemented in NS2.
For example, a DSR routing packet may keep DSDV, AODV, or even a PING application header.
For this reason, till today, a packet used in ns2 simulation, would have a header size around 40~64KB.
And NO packet would be deleted to release the memory it holds until the end of the simulation.
So for a typical simulation with 100 nodes in ns2 around 1M packets exchanged (of course,
you may reuse the packets already being freed through Packet::free(Packet*).
To learn the implementation of it, please check file common/packet{.h,.cc} ),
you may hold 10% of it, 100K packets, and you may use a memory at least 100K*64KB -> 6.4GB,
which definitely would crash your computer (even it is a super server)."

http://network-simulator-ns-2.7690.n...36.html#a26937
"NS2 does not have automatic garbage collection, thus warrants a manual
freeing of allocated memory once an object is no longer needed."


* OLSR is also available with ns3 http://www.nsnam.org/
* OLSR, OMNeT++ http://inet.omnetpp.org/doc/INET/doxy/files.html

-
 
Old 06-03-2014, 05:43 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
# 3 : Some more information.

Ref. http://ramakrishnamundugar.blogspot....or-solved.html :
→ ""The segmentation is due to memory allocation related issue.
As an example you are trying to store 11th value in as array of 10 values.""


Ref. http://network-simulator-ns-2.7690.n...80.html#a26929 :
Quote:
Code:
#$ns_ at $val(stop) "stop"
$ns_ at [expr $val(stop) + 0.1] "puts \"NS EXITING...\" ; $ns_ halt"

proc stop {} {
    global ns_ tracefd namtrace opt
    $ns_ flush-trace
    close $tracefd
    close $namtrace
}
... commented the line that was calling this stop function and the crash was gone.
-

Last edited by knudfl; 06-03-2014 at 05:46 AM.
 
Old 06-03-2014, 05:44 AM   #6
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
Sorry ....... Browser hiccup




-

Last edited by knudfl; 06-03-2014 at 05:46 AM.
 
Old 06-03-2014, 10:56 AM   #7
uthaathu
LQ Newbie
 
Registered: Jun 2014
Posts: 6

Rep: Reputation: Disabled
# 4

even i used the node made by SUMO,the ns2 cannot run for more 100 node..?
Quote:
NS2 limitations : Some simulations have a maximum of 14 nodes, some 100+.

http://www.cs.binghamton.edu/~kliu/r...2code/#speedup
http://www.mediafire.com/view/m08gtm...way_(copy).txt

i followed the instruction.indeed it made the simulation finish,but i got "segmentation fault" error..
can you look at my tcl? so you can see whats wrong with it.thks.



# 5

i used it.and it still error.


thanks a lot
 
Old 06-03-2014, 11:52 AM   #8
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
# 7 .

"100+" means 100 or more than 100.

I have seen suggestions with 500 nodes. (Not olsr.)
It all depends on the conditions.
All values / numbers / parameters must be considered.
At certain conditions, some simulations have a maximum
of e.g. 14 nodes.

So what are you doing wrong ?
? May be you added something impossible code to OLSR.cc ?
A failed build of ns-2.34 + olsr ? ?

*** You haven't told which OS you are using :
a) $ uname -m ( Will reply with `architecture´ : i686 or x86_64.)
b) OS name and version, please.
*** Which compilers gcc/g++ did you use for the build ?

Also : There are olsr packages, that you can install.
Examples
1) um-olsr-ns-2.34-ubuntu10_i386.deb for all Ubuntu 10.xx .. 14.06 -i686
https://drive.google.com/file/d/0B7S...it?usp=sharing
2) um-olsr-ns-2.34-1.fc17.x86_64.rpm
https://drive.google.com/file/d/0B7S...it?usp=sharing
3) um-olsr-ns-2.35-ubuntu12_amd64.deb
https://drive.google.com/file/d/0B7S...it?usp=sharing
4) umolsr+zrp-ns-2.33-ubuntu12_amd64.deb
https://drive.google.com/file/d/0B7S...it?usp=sharing

-
 
Old 06-03-2014, 11:58 AM   #9
uthaathu
LQ Newbie
 
Registered: Jun 2014
Posts: 6

Rep: Reputation: Disabled
i use ubuntu 10.04 and gcc-4.3. i used SUMO 0.12.3 and MOVE
i dont know what iam doing wrong, please look at my tcl, so i know which part that have been wrong ?

thanks a lot
 
Old 06-04-2014, 06:59 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
# 9 .

OK, Ubuntu 10.04 <unknown version>, <unknown architecture>.
! Please show the the output from these commands :
a) $ uname -m
b) $ cat /etc/issue

* Do not use gcc-4.3 :
$ sudo apt-get install g++-4.1
... then start from scratch in a new folder with
$ tar xvf ns-allinone-2.34.tar.gz
... and when you have added {um-olsr-1.0.tgz, um-olsr_ns-2.34_v1.0.patch}
http://sourceforge.net/projects/um-olsr/
... use this command to build "ns-allinone-2.34 + olsr" :
$ export CC=gcc-4.1 CXX=g++-4.1 && ./install

* umolsr-examples-04.2014.tar.gz :
https://drive.google.com/file/d/0B7S...it?usp=sharing

-
 
Old 06-05-2014, 03:29 AM   #11
uthaathu
LQ Newbie
 
Registered: Jun 2014
Posts: 6

Rep: Reputation: Disabled
a: uname -m
i686
b: cat /etc/issue
ubuntu 10.04.4 LTS \n \l


my tcl script node 185 still segmentation fault.

thanks a lot

Last edited by uthaathu; 06-05-2014 at 03:30 AM.
 
Old 06-05-2014, 11:47 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
# 11 .

Didn't you answer that yourself :
The maximum number of nodes is 150 in OLSR ?
 
Old 06-05-2014, 03:25 PM   #13
uthaathu
LQ Newbie
 
Registered: Jun 2014
Posts: 6

Rep: Reputation: Disabled
so the maximum node in OLSR just 150 ?

thanks a lot
 
  


Reply

Tags
ns2, olsr, segmentation fault 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
Taking output from lspci and using as input dannycalgarysci Linux - Software 1 03-25-2011 03:50 PM
bash scripting... taking user input and adding it to a particular area of a file... dagummit Programming 7 01-13-2010 12:07 AM
Taking input from microphone in python on linux ( ubuntu ) linuxabhinav Programming 1 04-24-2008 10:22 AM
[ruby with emacs] taking user input lilili Programming 2 01-18-2007 12:17 PM
123 file input is not taking for i in $(cat ./123) procfs Programming 3 07-20-2006 04:10 AM

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

All times are GMT -5. The time now is 07:30 AM.

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