LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   z-mac installation on ns2.34 (https://www.linuxquestions.org/questions/linux-software-2/z-mac-installation-on-ns2-34-a-944856/)

knudfl 05-15-2012 03:04 PM

# 42
A way to find out, how to do the simulation ... start with these commands:
cd ns-allinone-2.26/ns-2.26/drandTcl/
( Or whereever you have the drandTcl/ folder )
./ns-drand simple-wireless.tcl 2 wirelessOpt.tcl
And / or : ./ns-drand simple-wireless.tcl 3 wirelessOpt.tcl
( 'ns-drand' is a backup copy of ns from the DRAND patched ns-2.26 )
Code:

[knudfl@localhost drandTcl]$ ./ns-drand simple-wireless.tcl 3 wirelessOpt.tcl
num_nodes is set 3
warning: no class variable Agent/DRAND::randomSeed_
        see tcl-object.tcl in tclcl for info about this warning.

Starting Simulation...
*******************************************************
OneHopNodeID(Hello) : 2 1 255 255 255 255 255 255 255 255
TwoHopNodeID(Hello) : 255 255 255 255 255 255 255 255 255 255
0 OneHopCount(Hello) : 2
0 TwoHopCount(Hello) : 0
*******************************************************
*******************************************************
OneHopNodeID(Hello) : 2 0 255 255 255 255 255 255 255 255
TwoHopNodeID(Hello) : 255 255 255 255 255 255 255 255 255 255
1 OneHopCount(Hello) : 2
1 TwoHopCount(Hello) : 0
*******************************************************
*******************************************************
OneHopNodeID(Hello) : 0 1 255 255 255 255 255 255 255 255
TwoHopNodeID(Hello) : 255 255 255 255 255 255 255 255 255 255
2 OneHopCount(Hello) : 2
2 TwoHopCount(Hello) : 0
*******************************************************
0 SLOTINFO 0
0 1HOPNBRINFO 2 1
0 2HOPNBRINFO
MESSAGE sID 0 mCt 4 rReq 1 rGra 0 mTime 0.409841 oneHopCount 2
MESSAGE sID 0 reqCt 2 graCt 0 rejCt 2 relCt 0 twoCt 0
MESSAGE sID 0 Round 0 maxC 0 twoHopMaxC 0 slotNum 0 roundDelay 0.409841 grantDelay 0.206357
2 SLOTINFO 1
2 1HOPNBRINFO 0 1
2 2HOPNBRINFO
MESSAGE sID 2 mCt 6 rReq 0 rGra 0 mTime 0.422742 oneHopCount 2
MESSAGE sID 2 reqCt 2 graCt 1 rejCt 1 relCt 1 twoCt 1
MESSAGE sID 2 Round 1 maxC 0 twoHopMaxC 0 slotNum 1 roundDelay 0.005010 grantDelay 0.003471
1 SLOTINFO 2
1 1HOPNBRINFO 2 0
1 2HOPNBRINFO
MESSAGE sID 1 mCt 8 rReq 0 rGra 0 mTime 0.440861 oneHopCount 2
MESSAGE sID 1 reqCt 2 graCt 2 rejCt 1 relCt 1 twoCt 2
MESSAGE sID 1 Round 2 maxC 0 twoHopMaxC 0 slotNum 2 roundDelay 0.010743 grantDelay 0.006579


An empty file simple.tr is created, but now you have somthing, that you can work on.

.

knudfl 05-15-2012 04:30 PM

A better result with more nodes : A trace file with content.
$ ./ns-drand simple-wireless.tcl 12 wirelessOpt.tcl
$ ./ns-drand simple-wireless.tcl 20 wirelessOpt.tcl
.. So with more nodes you can get a result to analyze.

.

arica 05-15-2012 10:32 PM

thanks @knudfl....but i am getting this..
....
..
root@priyanka-Aspire-5745:/usr/local/ns-allinone-2.26/ns-2.26/drandTcl# ./ns-drand simple-wireless.tcl 3 wirelessOpt.tcl
bash: ./ns-drand: No such file or directory

arica 05-15-2012 11:00 PM

and if with ns...

root@priyanka-Aspire-5745:/usr/local/ns-allinone-2.26/ns-2.26/drandTcl# ns simple-wireless.tcl 3 wirelessOpt.tcl
num_nodes is set 3
ns: Mac/802_11 set ether_hdr_len_: can't read "ether_hdr_len_": no such variable
(Object set line 1)
invoked from within
"Mac/802_11 set ether_hdr_len_"

arica 05-15-2012 11:05 PM

after insatlling and then ./validate...its showing...
...........................................
Running test wireless1:
../../ns test-suite-WLtutorial.tcl wireless1 QUIET
num_nodes is set 3
ns: Mac/802_11 set ether_hdr_len_: can't read "ether_hdr_len_": no such variable
(Object set line 1)
invoked from within
"Mac/802_11 set ether_hdr_len_"
Test output differs from reference output
Diagnose with: diff test-output-WLtutorial/wireless1.test test-output-WLtutorial/wireless1
Or see URL "http://www.isi.edu/nsnam/ns/ns-problems.html".
Running test wireless2:
../../ns test-suite-WLtutorial.tcl wireless2 QUIET
num_nodes is set 4
ns: Mac/802_11 set ether_hdr_len_: can't read "ether_hdr_len_": no such variable
(Object set line 1)

invoked from within
"Mac/802_11 set ether_hdr_len_"
Test output differs from reference output
Diagnose with: diff test-output-WLtutorial/wireless2.test test-output-WLtutorial/wireless2
Or see URL "http://www.isi.edu/nsnam/ns/ns-problems.html".
Running test wireless3:
../../ns test-suite-WLtutorial.tcl wireless3 QUIET
num_nodes is set 3
ns: Mac/802_11 set ether_hdr_len_: can't read "ether_hdr_len_": no such variable
(Object set line 1)
invoked from within
"Mac/802_11 set ether_hdr_len_"
Test output differs from reference output
Diagnose with: diff test-output-WLtutorial/wireless3.test test-output-WLtutorial/wireless3
Or see URL "http://www.isi.edu/nsnam/ns/ns-problems.html".
Some test failed.
validate overall report: some tests failed:
./test-all-wireless-gridkeeper ./test-all-wireless-lan-newnode ./test-all-wireless-lan-tora ./test-all-wireless-lan-aodv ./test-all-wireless-diffusion ./test-all-energy ./test-all-wireless-shadowing ./test-all-WLtutorial

to re-run a specific test, cd tcl/test; ../../ns test-all-TEST-NAME

knudfl 05-15-2012 11:13 PM

# 48
See post #46 : 'ns-drand' is a backup copy of ns from the DRAND patched ns-2.26.

Just make a copy of the right 'ns' to /usr/local/ns-allinone-2.26/ns-2.26/drandTcl/
... then you can use ./ns simple-wireless.tcl 12 wirelessOpt.tcl

Note 1.
The reason for a special name for each version of 'ns' is for recognition.
When you have different versions of ns, the most easy way to avoid them
from getting mixed up, is to give the executables new names.
And one period ( . or ./ ) means 'the current directory'.
So when you see a ./ns, it means that is must be in the working directory,
in this case drandTcl/
( ns-something can also be a symlink to ns-allinone-2.26/ns-2.26/ns )

Note 2.
Do not use a low figure like 3 for the number of nodes.
2..3 : No result in "simple.tr". 12..20 or whatever : A usable "simple.tr" file.

.

knudfl 05-15-2012 11:50 PM

# 49

Looks like an ns-2.26 modified for ZMAC ?

arica 05-16-2012 12:10 AM

again getting..
...
...
...
root@priyanka-Aspire-5745:/usr/local/ns-allinone-2.26/ns-2.26/drandTcl# ./ns-drand simple-wireless.tcl 12 wirelessOpt.tcl
num_nodes is set 12
ns: Mac/802_11 set ether_hdr_len_: can't read "ether_hdr_len_": no such variable
(Object set line 1)
invoked from within
"Mac/802_11 set ether_hdr_len_"....
,,,
#52...may be yes....because...for the....http://www4.ncsu.edu/~rhee/export/zm.../zmac/zmac.htm .......ns installation instructions had already been followed..moving to DRAND ....
so this is the source of this error????


would i again build DRAND only in???
trying..

arica 05-16-2012 12:25 AM

thank yoy very much.....both z-mac and DRand done!!!!!!!!!!!:-),,,after so much hard work....and yess @knudfl not without your help....

knudfl 05-16-2012 12:43 AM

# 53 :

Please edit the link : The link copy takes you to nowhere.



.

arica 05-16-2012 01:04 AM

again building drand only gives...
============================================================
* Build ns-2.26
============================================================
cd: 399: can't cd to ./ns-2.26
./install: 400: ./configure: not found
Ns configuration failed! Exiting ...
Please check http://www.isi.edu/nsnam/ns/ns-problems.html
for common problems and bug fixes.

..
..
needed help!!1

arica 05-16-2012 01:19 AM

again tried and get the..

..
..
root@priyanka-Aspire-5745:/usr/local/ns-allinone-2.26/ns-2.26 /drandTcl# ./ns-drand simple-wireless.tcl 15 wirelessOpt.tcl
num_nodes is set 15
warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Agent/DRAND::randomSeed_

see tcl-object.tcl in tclcl for info about this warning.

Starting Simulation...
(null) - invalid packet type (undefined).
...and empty simple.tr.....
help!!!

knudfl 05-16-2012 02:39 AM

Don't know what's happening.

The instruction are quite clear. DRAND Ubuntu 10.10 summary :
tar xvf ns-allinone-2.26.tar.gz && patch -p0 < ns-2.26-gcc410.patch
cd ns-allinone-2.26/ns-2.26/ && tar xvf drandNS2.tar.gz
Then copy ( cp -a <file> <destination> ) the new files
ns-packet.tcl packet.h mac-802_11.cc cmu-trace.cc to their destinations.
And the new Makefile.in : cp -a drand-Makefile.in.txt Makefile.in
cd ../ && export CC=gcc41 CXX=g++41 && ./install

Alternatively use a binary "ns-drand" :
ns-drand-226_usr_local.i686.tar.gz ( 1.1 MB ).
( Usable when a /usr/local/ns-allinone-2.26/ is present.)
https://docs.google.com/open?id=0B7S...lMxbG4tY2VPc1U

.

knudfl 05-16-2012 02:46 AM

# 50

... And my DRAND "validate" in Ubuntu 10.10 , 32bits OS.
Code:

validate overall report: some tests failed:
    ./test-all-red ./test-all-pi

This is an expected OK result.

.

arica 05-16-2012 03:23 AM

thanks @knudfl...yess your file works....:-)...thanks


All times are GMT -5. The time now is 11:06 PM.