LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (https://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   after install some new protocol in ns2.35, it appears some mistake when i run the tcl file (https://www.linuxquestions.org/questions/linux-wireless-networking-41/after-install-some-new-protocol-in-ns2-35-it-appears-some-mistake-when-i-run-the-tcl-file-4175538323/)

whatamazing 03-31-2015 08:45 AM

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.

knudfl 04-02-2015 03:51 PM

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


-

whatamazing 04-02-2015 09:14 PM

Quote:

Originally Posted by knudfl (Post 5341640)
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 .

knudfl 04-02-2015 10:37 PM

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.

-

whatamazing 04-07-2015 07:34 AM

Quote:

Originally Posted by knudfl (Post 5341765)
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?

knudfl 04-07-2015 07:50 AM

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>/.


-

whatamazing 04-07-2015 08:25 AM

Quote:

Originally Posted by knudfl (Post 5343822)
... 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?

whatamazing 04-08-2015 06:54 AM

1 Attachment(s)
Quote:

Originally Posted by knudfl (Post 5343822)
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?

knudfl 04-08-2015 07:05 AM

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


-

whatamazing 04-08-2015 07:37 AM

Quote:

Originally Posted by knudfl (Post 5344317)
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!

knudfl 04-08-2015 08:28 AM

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!


whatamazing 04-08-2015 08:47 AM

Quote:

Originally Posted by knudfl (Post 5344369)
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.

knudfl 04-08-2015 09:15 AM

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


-

whatamazing 04-08-2015 09:28 PM

Quote:

Originally Posted by knudfl (Post 5344400)
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.

whatamazing 04-14-2015 09:49 AM

Quote:

Originally Posted by knudfl (Post 5344400)

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?


All times are GMT -5. The time now is 09:59 AM.