LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 03-31-2015, 08:45 AM   #1
whatamazing
LQ Newbie
 
Registered: Mar 2015
Posts: 13

Rep: Reputation: Disabled
after install some new protocol in ns2.35, it appears some mistake when i run the tcl file


i install ns2.35 with cygwin and i followed the guide of the site below
http://www.comp.sd.tmu.ac.jp/kazuyas...s2_greedy.html
when i install the greedy protocol successful and turn to test it , the result was show as below:

$ ns greedy.tcl
num_nodes is set 7
INITIALIZE THE LIST xListHead
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaz_ = 1.5 , distCST_ = 550.0
SORTING LISTS...DONE!


after that ,when i open the nam file ,it has nothing but the topology, i mean , it doesn't contain any communicate process. i don't know why.
and when i use the greedy protocol the tcl file i write ,it does't work either.

could anyone help me?
thx a lot!
by the way , i am new to ns2 and English is not my mother language.
thank you for your time.

Last edited by whatamazing; 04-01-2015 at 02:28 AM.
 
Old 04-02-2015, 03:51 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.
Quote:
the nam file, it has nothing but the topology
Right. That's the way the file `greedy.tcl' works.
More complex ?
Then you will have to edit greedy.tcl, or write a new file.tcl .

Or even better : Use another "greedy protocol" like the versatile GPSR-hls.
GPSR : "Greedy Perimeter Stateless Routing"

GPSR info, see posts #2 and #3 here ...
http://www.linuxquestions.org/questi...-4175528835/#2

Examples : gpsr-hls-examples-03.15.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing


-
 
1 members found this post helpful.
Old 04-02-2015, 09:14 PM   #3
whatamazing
LQ Newbie
 
Registered: Mar 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Welcome to LQ.

Right. That's the way the file `greedy.tcl' works.
More complex ?

-
first of all,thanks for your help, i will follow the gpsr later.
But i still fell confused with something.
Would please explain what is the protocol works in ns2?
my point is that : when i simulate the aodv sample successful, and then only change the protocol to greedy and simulator it again ,the xwin tells me Invalid flow.
if you want see the tcl file, just tell me.
i don't know what if i described clearly.
anyway, thank you vary much .
 
Old 04-02-2015, 10:37 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #3.

A random file.tcl cannot be used with : set val(rp) GREEDY

Please have another look at greedy.tcl : Three files are used >>>
1) greedy.tcl
2) nbr.tcl : A configuration file.
3) topo2.txt : A traffic / scene file.

-
 
Old 04-07-2015, 07:34 AM   #5
whatamazing
LQ Newbie
 
Registered: Mar 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Re #3.

A random file.tcl cannot be used with : set val(rp) GREEDY

Please have another look at greedy.tcl : Three files are used >>>
1) greedy.tcl
2) nbr.tcl : A configuration file.
3) topo2.txt : A traffic / scene file.

-
thanks for your help, now i can run greedy protocol successfully.
but when i turn to the gpsr i found i have the same problem with someone you ever help.
http://www.linuxquestions.org/questi...-a-4175528835/
but i still fell confused, should i install some new ns2.35 ?

in the link
http://network-simulator-ns-2.7690.n...g-td29371.html
i can't follow the code because i do not use linux

$ cp ns ns-gpsr-hls
$ sudo cp ns-gpsr-hls /usr/local/bin/

so i just cope the hls-example file to /usr/local/
after that when i run ssoumayaa.tcl ,the xwin hints me that Segmentation fault(core dumped)
was that(directly cope) cause the error?
 
Old 04-07-2015, 07:50 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #5.

Segmentation fault : Probably caused by a 64bits Cygwin.
Ns2 is for a 32bits OS. Suggest : Install 'VirtualBox' in Windows 7.
And then install a genuine 32bits 'Linux OS' into VirtualBox.

Re http://network-simulator-ns-2.7690.n...g-td29371.html
* In /home/<name>/ :
$ tar xvf ns-allinone-2.35_gcc482.tar.gz (ns-2.35 patched for gcc-4.6.. -4.9.2)
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ cd ns-allinone-2.35/
$ patch -p0 < GPSR-hls_ns235.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ ./install
$ cd ns-2.35/
$ cp ns ns-gpsr-hls
$ sudo cp ns-gpsr-hls /usr/local/bin/
... Then you can do: $ ns-gpsr-hls ssoumayaa.tcl
... from the examples, gpsr-hls-examples-05.14.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing

The examples can be kept in / used from any folder in /home/<name>/.


-

Last edited by knudfl; 04-07-2015 at 07:57 AM.
 
Old 04-07-2015, 08:25 AM   #7
whatamazing
LQ Newbie
 
Registered: Mar 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
... Then you can do: $ ns-gpsr-hls ssoumayaa.tcl
... from the examples, gpsr-hls-examples-05.14.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
The examples can be kept in / used from any folder in /home/<name>/.

-
thanks a lot!
because my windows is 32bits, so the cygwin i installed is 32bits too.
maybe i miss something else.
should i modified some files in the ns2.35 as well as i install the greedy protocol ?

it seems that the patch has deleted the modifying which i made for greedy protocol. maybe it is the problem laid?

Last edited by whatamazing; 04-07-2015 at 10:31 PM.
 
Old 04-08-2015, 06:54 AM   #8
whatamazing
LQ Newbie
 
Registered: Mar 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Re #5.

Segmentation fault : Probably caused by a 64bits Cygwin.
Ns2 is for a 32bits OS. Suggest : Install 'VirtualBox' in Windows 7.
And then install a genuine 32bits 'Linux OS' into VirtualBox.

-
i have tried to edit some code in the file ,and the result was shown below.

does it means that what i have done is work?
Attached Thumbnails
Click image for larger version

Name:	catch.JPG
Views:	41
Size:	25.9 KB
ID:	18037  

Last edited by whatamazing; 04-08-2015 at 06:56 AM.
 
Old 04-08-2015, 07:05 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #8.

No images for text, please.


HOWTO create a file "result.txt" (Or whatever file name you want) :
$ ns ssoumayaa.tcl 2>&1 | tee result.txt


-
 
Old 04-08-2015, 07:37 AM   #10
whatamazing
LQ Newbie
 
Registered: Mar 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Re #8.

No images for text, please.


HOWTO create a file "result.txt" (Or whatever file name you want) :
$ ns ssoumayaa.tcl 2>&1 | tee result.txt


-
OK.because the xwin doesn't support direct cope(as far as i know), so i just pic it.never again.
maybe you misunderstand what i mean.
in my opinion , the xwin do not throw any erro and the nam file has create successfully.
even though i don't know what situation does the nam file described, but at least it runs.
and does all above means that the ssoumayaa.tcl run correct ?
or is the ssoumayaa runs success in an other way, doesn't like what i post?
thanks a lot. knudfl!
 
Old 04-08-2015, 08:28 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #10.

An OK simulation $ ns ssoumayaa.tcl
.. will create the files fangzhen1.nam ~110kb, fangzhen1.tr ~175kB.
And the terminal text is :
Code:
[knudfl@localhost test__hls-utils]$ ns235-gpsr-hls ssoumayaa.tcl

num_nodes is set 2
INITIALIZE THE LIST xListHead
Starting Simulation...
radiorange 250, x 2000 y 500
length : 3.000000 , cellperline 12 , heigth 1.000000
maxlevel 3
radiorange 250, x 2000 y 500
length : 3.000000 , cellperline 12 , heigth 1.000000
maxlevel 3
SORTING LISTS ...DONE!

Last edited by knudfl; 04-08-2015 at 08:29 AM.
 
Old 04-08-2015, 08:47 AM   #12
whatamazing
LQ Newbie
 
Registered: Mar 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Re #10.

An OK simulation $ ns ssoumayaa.tcl
.. will create the files fangzhen1.nam ~110kb, fangzhen1.tr ~175kB.
And the terminal text is :
it is same in my computer, that means i install the gpsr correct!
by the way , you are awesome and i still use cygwin.
well, would please tell me what's the tr file's formart so i can analyze it.
such as the delay, delay jitter , the rate of the package loss and the energy consumption. or something else.
 
Old 04-08-2015, 09:15 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #12.

NS-2 Trace Formats http://nsnam.isi.edu/nsnam/index.php/NS-2_Trace_Formats

Analyzing tools :
ns-2.3x/hls/utils/{evaluate.pl, evFromdirectory.pl, gls_evaluate.pl, runfromdirectory.pl}
* Also included in gpsr-hls-examples-05.14.tar.gz .
Using : $ perl <script>.pl fangzhen1.tr

More scripts for analyzing : awk-and-perl_scripts_12.2014.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing


-
 
Old 04-08-2015, 09:28 PM   #14
whatamazing
LQ Newbie
 
Registered: Mar 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Re #12.

NS-2 Trace Formats http://nsnam.isi.edu/nsnam/index.php/NS-2_Trace_Formats

Analyzing tools :
ns-2.3x/hls/utils/{evaluate.pl, evFromdirectory.pl, gls_evaluate.pl, runfromdirectory.pl}
* Also included in gpsr-hls-examples-05.14.tar.gz .
Using : $ perl <script>.pl fangzhen1.tr

More scripts for analyzing : awk-and-perl_scripts_12.2014.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing


-
thank you for your time.
for example , i'd like to use evaluate.pl to evaluste the tr file
do you mean using: $ perl evaluate.pl fangzhen1.tr ?
but this did't work for me unless i use : perl evaluate.pl -f fangzhen1.tr
for instead.
dose the evaluate.pl test the move speed , and the evFromdirectory.pl and runfromdirectory.pl is the recursive of evaluate.pl ? i can't get it.
it is my first time to use perl, so i just google something.
thanks.
 
Old 04-14-2015, 09:49 AM   #15
whatamazing
LQ Newbie
 
Registered: Mar 2015
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
when i use the hls-gpsr,and i find that the node can't communicate each other .because i can't see the packet seed or receive which i write in the tcl code.
then i turn to KeLiu-gpsr, after install successfully, i found i can even hardly create nodes.
when i use the code
Code:
for {set i 0} {$i < $opt(nn) } {incr i} {
    gpsr-create-mobile-node $i
    set node_($i) [$ns_ node]
}
it will throw some mistake because of "set node_($i) [$ns_ node]"
would you please give me some advice?
 
  


Reply

Tags
gpsr, greedy, 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
[SOLVED] to run TCL script on ns2 for udp lite protocol sakibamu Linux - Software 2 01-03-2014 01:30 AM
NS2: regarding error during run .tcl file bhupendrapatel Linux - Software 4 05-03-2013 09:32 AM
[SOLVED] Floating point exception after run TCL script ns2 deVacto Linux - Newbie 7 10-28-2012 11:56 PM
how to link tcl file and C++ files together and run in ns2? tootz Linux - Software 3 07-25-2012 03:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 11:45 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