LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Floating point exception after run TCL script ns2 (https://www.linuxquestions.org/questions/linux-newbie-8/floating-point-exception-after-run-tcl-script-ns2-4175433822/)

deVacto 10-24-2012 06:19 AM

Floating point exception after run TCL script ns2
 
hi guys, sorry if i make this question in the wrong section
i got project lte in ns2, after i compile tcl script i got
----------
Code:

All the UEs are empty in DLS1Queue!
All the UEs are empty in DLS1Queue!
Floating point exception

----------
so i dont get the output, this is my tcl script

-------------
Code:

set ns [new Simulator -multicast on]

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

#set number 10
set numberClass0 2
set numberClass1 3
set numberClass2 9
set numberClass3 1
set number [expr {$numberClass0 + $numberClass1 + $numberClass2 + $numberClass3}]
# qos_ means whether classfication/scheduling mechanism is used
Queue/LTEQueue set qos_ true
#Queue/LTEQueue set qos_ false
# flow_control_ is used in the model phase
Queue/LTEQueue set flow_control_ false

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

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 $f
close $nf
#exec nam out.nam &
exit 0
}

$ns run

-------------------
thx to eyana this script i got, when i on the qos
i got the eror
Code:

All the UEs are empty in DLS1Queue!
All the UEs are empty in DLS1Queue!
Floating point exception

the code is Queue/LTEQueue set qos_ true
i got those error, but when i off it i got the output
i want to compare qos when it off and on

tq, for reading my problem
i hope anyone know to solve it :)

knudfl 10-24-2012 07:33 AM

Using the Slackware 13.37 package lte-ns-2.33-S1337.i486.txz :
$ ns-lte eyana.tcl : No errors, nam opens.
http://www.linuxquestions.org/questi...6&d=1332803695
Ref. http://www.linuxquestions.org/questi...33-a-936417/#5

The code from post #1 :
$ ns-lte lte-deVacto.tcl : No "Floating point exception".
Continues with a lot of "All the UEs are empty in DLS1Queue!"
.. for one minute.
The files out.nam (101 MB), out.tr (43 MB) are created.

Note : Not yet tested on a 32bits Slackware, will do that in a couple of days.


.

deVacto 10-24-2012 10:38 AM

#2
tq knudfl it worked with ns-lte :D i dont know why :D
but nam and my .tr got different size from yours, but i think it not problem right?
and can u explain to me why in DLS1Queue all UEs are empty, how to fill it?? or it is not problem?

tq very much again :D

knudfl 10-24-2012 11:33 AM

Quote:

.. but nam and my .tr got different size from yours,
but i think it not problem, right ?
The sizes could be be different because I used another OS.
( PCLinuxOS-2012.08 ). Doesn't matter.

"the UEs are empty in DLS1Queue" : I don't know, what's about.
? May be you can edit your code, and get it right ?

.

knudfl 10-28-2012 01:22 PM

Ref. post # 2

Your code works OK in Slackware 13.37, 32bits.

$ ns-lte lte-deVacto.tcl
The files out.nam (101.3 MB), out.tr (43.4 MB) are created.
The exact same size as the first test, post # 2.

.

deVacto 10-28-2012 06:18 PM

$5
you mean in this post http://www.linuxquestions.org/questi...3/#post4816260
but in my case it not work, when i change "set numberClass0 x" the x size is other than 0 it got that error
how to fix it?

why posting in this thread ?

knudfl 10-28-2012 09:49 PM

Post # 5 is a follow up on post # 2.



The tcl file name in your other thread is ltez.tcl,
and I don't know, why it isn't working.



.

deVacto 10-28-2012 11:56 PM

#7
so you got the same error and dont know why too?
ok tq for your help again knudfl :)

if anyone know the problem in my thread in post #6,
please let me know :)


All times are GMT -5. The time now is 11:56 AM.