LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   NS2 (http://www.linuxquestions.org/questions/programming-9/ns2-4175449125/)

binteasim 02-08-2013 02:25 AM

NS2
 
I've lately successfully patched LTE as far as I think but I've two basic problems,first is that the trace file of a program that I'm running is empty secondly I get the following error when I run the code:

Code:

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

invalid command name "Session/RTP::debug_"
    while executing
"Session/RTP::debug_ set 1"
    ("for" body line 9)
    invoked from within
"for { set i 0} {$i < $number} {incr i} {
set udp($i) [new Agent/UDP]
$ns attach-agent $server $udp($i)
set null($i) [new Agent/Null]
$ns attach-agent ..."
    (file "/home/dba/Desktop/lte.tcl" line 54)

as per the instructions in the file tcl-object.tcl I've added the line "Session/RTP::debug_ set 0" in the ns-default file but it's not working and also there's no nam simulation that I can see.The program that I ran was:

Code:

set ns [new Simulator]

set nf [open lte.tr w]
$ns trace-all $nf
set nf [open lte.nam w]
$ns namtrace-all $nf

set number 10

set eNB [$ns node]
set aGW [$ns node]
set server [$ns node]


 
for { set i 0} {$i < $number} {incr i} {

set UE($i) [$ns node]
}


for { set i 0} {$i < $number} {incr i} {
$ns simplex-link $UE($i) $eNB 500Mb 2ms LTEQueue/ULAirQueue
$ns simplex-link $eNB $UE($i) 1Gb 2ms LTEQueue/DLAirQueue

}


$ns simplex-link $eNB $aGW 5Gb 10ms LTEQueue/ULS1Queue
$ns simplex-link $aGW $eNB 5Gb 10ms LTEQueue/DLS1Queue

$ns duplex-link $aGW $server 10Gb 100ms DropTail

set mproto DM
set mrthandle [$ns mrtproto $mproto {}]
set group [Node allocaddr]

for { set i 0 } { $i < $number } {incr i} {
set s0($i) [new Session/RTP]
set s1($i) [new Session/RTP]

$s0($i) session_bw 12.2kb/s
$s1($i) session_bw 12.2kb/s
$s0($i) attach-node $UE($i)
$s1($i) attach-node $server
$ns at 0.7 "$s0($i) join-group $group"
$ns at 0.8 "$s0($i) start"
$ns at 0.9 "$s0($i) transmit 12.2kb/s"
$ns at 1.0 "$s1($i) join-group $group"
$ns at 1.1 "$s1($i) start"
$ns at 1.2 "$s1($i) transmit 12.2kb/s"
}

for { set i 0} {$i < $number} {incr i} {
set udp($i) [new Agent/UDP]
$ns attach-agent $server $udp($i)
set null($i) [new Agent/Null]
$ns attach-agent $UE($i) $null($i)
$ns connect $udp($i) $null($i)
$udp($i) set class_ 1

Session/RTP::debug_ set 1
set cbr($i) [new Application/Traffic/CBR]
$cbr($i) attach-agent $udp($i)
$cbr($i) set packetSize_ 1000
$cbr($i) set rate_ 0.01Mb
$cbr($i) set random_ false
$ns at 1.4 "$cbr($i) start"
}

# step 3.3 define the interactive traffic
$ns rtproto Session
set log [open "http.log" w]

# Care must be taken to make sure that every client sees the same set of pages as the servers to which they are attached.
set pgp [new PagePool/Math]
set tmp [new RandomVariable/Constant] ;# Size generator
$tmp set val_ 10240 ;# average page size
$pgp ranvar-size $tmp
set tmp [new RandomVariable/Exponential] ;# Age generator
$tmp set avg_ 4 ;# average page age
$pgp ranvar-age $tmp

set s [new Http/Server $ns $server]
$s set-page-generator $pgp
$s log $log

set cache [new Http/Cache $ns $aGW]
$cache log $log

for { set i 0} {$i<$number} {incr i} {
set c($i) [new Http/Client $ns $UE($i)]
set ctmp($i) [new RandomVariable/Exponential] ;# Poisson process
$ctmp($i) set avg_ 1 ;# average request interval
$c($i) set-interval-generator $ctmp($i)
$c($i) set-page-generator $pgp
$c($i) log $log
}

$ns at 0.4 "start-connection"
proc start-connection {} {
global ns s cache c number

$cache connect $s
for { set i 0} {$i<$number} {incr i} {
$c($i) connect $cache
$c($i) start-session $cache $s
}
}

for { set i 0} {$i < $number} {incr i} {
set tcp($i) [new Agent/TCP]
$ns attach-agent $server $tcp($i)
set sink($i) [new Agent/TCPSink]
$ns attach-agent $UE($i) $sink($i)
$ns connect $tcp($i) $sink($i)
$tcp($i) set class_ 3
$tcp($i) set packetSize_ 0.5M

set ftp($i) [new Application/FTP]
$ftp($i) attach-agent $tcp($i)
$ns at 3.4 "$ftp($i) start"
}

$ns at 30 "finish"
proc finish {} {
global ns f nf
$ns flush-trace
close $nf
close $nf
exec nam lte.nam &
exit 0
}

$ns run


knudfl 02-08-2013 05:10 AM

Quote:

per the instructions in the file tcl-object.tcl I've added the line
"Session/RTP::debug_ set 0" in the ns-default file
Which instructions ?
I guess you mean ns-2.33/tcl/lib/ns-default.tcl ?

Warnings : Can be ignored.

Errors : Please comment out line 66 with a hash mark ( # ) :
# Session/RTP::debug_ set 1
.... then you may be able to fix any other errors.


The perfect working script for 'ns lte' is still "eyana.tcl", by @eyana
http://www.linuxquestions.org/questi...33-a-936417/#5
$ ns eyana.tcl : Nam opens OK.

-

binteasim 02-08-2013 08:45 AM

NS2
 
Sir I did run eyana.tcl it gave me the following:


Code:

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

warning: no class variable Session/RTP::debug_

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

ns: finish: couldn't execute "nam": no such file or directory
    while executing
"exec nam out.nam &"
    (procedure "finish" line 6)
    invoked from within
"finish"


knudfl 02-08-2013 08:51 AM

# 3
Quote:

couldn't execute "nam": no such file or directory
Well, then better install 'nam'.
https://docs.google.com/uc?id=0B7S25...=CLPiyxo&hl=en
> tar xvf nam-1.14.i586.tar.gz && sudo cp nam-1.14/nam /usr/local/bin/

binteasim 02-08-2013 09:08 AM

NS2
 
I did sir that's why I don't understand why is it giving this error.I installed ns-allinone-2.33 which has nam 1.13,I don't remeber any error during installation of nam.Do you still advise to install nam 1.14?

knudfl 02-08-2013 09:32 AM

# 5.

A nam build will most often fail. And the failing build is ignored,
like the other applications not required for the 'ns' build.
You will only be stopped at "./install" when tcl tk otcl tclcl ns-2.* fails.

Nam is an "extra application". Actually any nam version can be used.

Nam version 1.13 and 1.14 are identical, so far concerns Linux.
( 1.14 has an edit for 'Sun OS'. Ref. the file nam-1.14/CHANGES.html )

-

binteasim 02-08-2013 10:23 AM

NS2
 
OK Sir I'll install nam again and see what happens,I have one more question from you, you once had written somewhere that if one has to install more than 1 versions of NS2 he should not add it to path.You told me the procedure for installing more than one versions of NS2 in post#4 in the following link:

http://www.linuxquestions.org/questi...s2-4175445269/

I did follow those instructions but due to certain errors I had to reinstall NS2.Currently I have an LTE patched ns-2.33 which is added to path, In case I have to install more versions do I have to delete all lines from the .bashrc file under the heading of PATH or LD_LIBRARY_PATH as well.My bashrc has the following code,just in case:


Code:

# LD_LIBRARY_PATH
OTCL_LIB=/home/dba/Desktop/ns-allinone-2.33/otcl-1.13
NS2_LIB=/home/dba/Desktop/ns-allinone-2.33/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
TRGRAPH_LIB='/home/dba/ tracegraph202_2/bin/glnx86'
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB:$TRGRAPH_LIB


# TCL_LIBRARY
TCL_LIB=/home/dba/Desktop/ns-allinone-2.33/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/dba/Desktop/ns-allinone-2.33/bin:/home/dba/Desktop/ns-allinone-2.33/tcl8.4.18/unix:/dba/Downloads/ns2/ns-allinone-2.34/tk8.4.18/unix
NS=/home/dba/Desktop/ns-allinone-2.33/ns-2.34/
NAM=/home/dba/Desktop/ns-allinone-2.33/nam-1.14/
TRGRAPH='/home/dba/ tracegraph202_2/bin/glnx86'
PATH=$PATH:$XGRAPH:$NS:$NAM:$TRGRAPH


knudfl 02-08-2013 11:47 AM

# 7
Quote:

In case I have to install more versions do I have to delete all lines from the .bashrc file
No entries are required to .bashrc or .bash_profile. Never.
Also when you have one only ns-allinone-2.xx install.
So you can just delete the added lines.

The ns executable is hard coded to know the path for its libraries.
And the "ns-allinone-2.xx xgraph" never works.
( Get xgraph : sudo apt-get install xgraph ).


Executable 'ns's : Copy all 'ns' to a different name, 'ns-lte' etc.,
and then copy all the new renamed "ns-*" to /usr/local/bin/ .
All LTE examples work OK with $ ns-lte example.tcl .


There is also an LTE Ubuntu package, post # 10 here
http://www.linuxquestions.org/questi...4175435660/#10


P.S.: Where did you get the Tracegraph files ? :
http://www.linuxquestions.org/questi...ph-4175447000/
I found no links for Tracegraph or 'mglinstaller'.

-

binteasim 02-08-2013 12:42 PM

NS2
 
Sir I followed your instructions and eyana.tcl is working thankfully (although along with the warnings I told you about).The other two files I have are not working as yet but I'll see to them InshaAllah.
Following two links can be used for downloading tracegraph:

http://www.angelfire.com/al4/esorkor/
http://ns-2.blogspot.com/2008/10/tra...ator-ns-2.html

I got it from the first link I beleive and read the instructions from the second.There's a visual trace analyzer available for NS2 also, if tracegraph doesn't work fine I beleive I should move to that(provided it works).Visual trace analyzer can be downloaded from the following link:

http://nsvisualtraceanalyzer.wordpre...yzer-download/

binteasim 02-09-2013 11:58 AM

NS2
 
Sir as per post #13 in the following link the command that someone has used for patching eurane is
Code:

zcat ns-eurane-1.12diff.gz|patch -p1
, should I follow the same or should I go for
Code:

patch -p0 < ns-2.30_eurane-1.12.diff
http://www.linuxquestions.org/questi...ta-etc-869957/

knudfl 02-09-2013 12:29 PM

# 10

The patch for ns-2.30 is 'ns-2.30_eurane-1.12.diff(.gz)'
http://eurane.ti-wmc.nl/eurane/

So it's : $ patch -p1 < ns-2.30_eurane-1.12.diff
Or : $ zcat ns-2.30_eurane-1.12.diff | patch -p1


'Eurane' examples.tcl : LQ Search → Tag = eurane
http://www.linuxquestions.org/questi...ns2-943529/#12

-

binteasim 02-10-2013 04:25 AM

NS2
 
Thankyou Sir, it's patched except I have one problem and that is in case I run certain examples one of which is http://eurane.ti-wmc.nl/eurane/test_tcp.tcl.txt it gives me an error : can't open file idealtrace. I did search for the solution and in the link http://lists.ti-wmc.nl/pipermail/ns-...er/000081.html it is mentioned that idealtrace should be the same directory as tcl, now does that mean I have to save idealtrace in tcl folder or I have to save it in the ns-allinone-2.30 folder where tcl8.4.13 is present.

knudfl 02-10-2013 05:03 AM

# 12

"the same directory as tcl" : Here it means the current directory.
I think all the "eurane examples" will do fine in any location.
( Like /home/dba/eurane-examples/ )

test_tcp.tcl.txt, line 109, 110, 111 :
$bs setErrorTrace 0 "idealtrace"
$bs setErrorTrace 1 "idealtrace"
$bs loadSnrBlerMatrix "SNRBLERMatrix"
→ → that's current directory for 'idealtrace' and 'SNRBLERMatrix'
( http://eurane.ti-wmc.nl/eurane/SNRBLERMatrix.gz )

If the file had said e.g.: $bs setErrorTrace 0 ../idealtrace
.. or : $bs setErrorTrace 0 umts/idealtrace
.. then a specific "test_tcp.tcl location" would have been required.
( But then again, lines 109-111 would have been easy to edit.)

-

binteasim 02-10-2013 07:33 AM

NS2
 
I put the whole path which went something like $bs setErrorTrace 0 "/home/dba/X/idealtrace" etc. and it worked.Thankyou Sir!
Do you know if nam simulates umts because if I add any of the lines such as "set nf [open out.nam w]" and in the finish proc "exec nam out.nam" it says

Code:

nam cannot recognize the trace file lo.nam
Please make sure that the file is not empty and it is a nam trace


knudfl 02-10-2013 11:04 AM

# 14

I found a eurane example hs-dsch.tcl that creates a "hs-dsch.nam" file, 10 kB.
https://github.com/metrue/ns2-umts
> https://github.com/metrue/ns2-umts/b...er/hs-dsch.tcl
( README : "This is an ns2 + eurane on umts simulation project".)

$ nam hs-dsch.nam : No activity.

But may be hs-dsch.tcl will show how to get a nam result in the other examples.


Other info : http://eurane.ti-wmc.nl/eurane/EURAN...ls_itpp.tar.gz
> EURANE_multi_cells_itpp/simulation_scripts/ReadmeFirst.txt
> EURANE_multi_cells_itpp/code/ ns-eurane-113-itpp.diff Readme.txt
I will report back, if any interesting simulations in 'eurane.multi.cells.itpp'.

-


All times are GMT -5. The time now is 09:57 PM.