[ns] Floating Point exception
Hi Guys: I am trying to run the following code using ns-2.35 in obuntu 10.04 and it says Floating Point Exception, any one with a better suggestion: #Open the NAM trace file set tf1 [open out.tr w] $ns trace-all $tf1 set nf1 [open out.nam w] $ns namtrace-all $nf1 # open the Trace file #Define a 'finish' procedure proc finish {} { global ns tf1 nf1 $ns flush-trace #Close the NAM trace file close $tf1 # close the trace file close $nf1 exit 0 } #Create Two nodes set n1 [$ns node] set n2 [$ns node] #Create link between the nodes $ns duplex-link $n1 $n2 1.5Mb 10ms DropTail #Setup a TCP connection set tcp [new Agent/TCP] $ns attach-agent $n1 $tcp set sink [new Agent/TCPSink] $ns attach-agent $n2 $sink $ns connect $tcp $sink $tcp set fid_ 1 $tcp set packetSize_ 500 #Setup a FTP over TCP connectioncd set ftp [new Application/FTP] $ftp attach-agent $tcp $ns at 1.0 $ftp start $ns at 50.0 $ftp stop puts Simulation Starts $ns run Regards
[ns] Floating Point exception
Hi All, When i am trying to run below code, i am getting floating point exception, Can someone please let me know the reason # Define options # == set val(chan) Channel/WirelessChannel;# channel type set val(prop) Propagation/TwoRayGround ;# radio-propagation model set val(netif) Phy/WirelessPhy/802_15_4 ;# network interface type set val(mac)Mac/802_15_4 ;# MAC type set val(ifq)Queue/DropTail/PriQueue;# interface queue type set val(ll) LL ;# link layer type set val(ant)Antenna/OmniAntenna;# antenna model set val(ifqlen) 50 ;# max packet in ifq set val(nn) 4 ;# number of mobilenodes set val(rp) AODV ;# routing protocol set val(x)1000;# X dimension of topography set val(y)1000;# Y dimension of topography set val(finish) 500;# time of simulation end set val(energymodel)EnergyModel;# Energy Model set val(initialenergy) 100;# value # == # Main Program # == # Initialize Global Variables set ns [new Simulator] set tracefd [open tracefile.tr w] #set log [open output.tr w] set namtrace [open out.nam w] $ns use-newtrace $ns trace-all $tracefd $ns namtrace-all-wireless $namtrace $val(x) $val(y) set dist(5m) 7.69113e-06 set dist(9m) 2.37381e-06 set dist(10m) 1.92278e-06 set dist(11m) 1.58908e-06 set dist(12m) 1.33527e-06 set dist(13m) 1.13774e-06 set dist(14m) 9.81011e-07 set dist(15m) 8.54570e-07 set dist(16m) 7.51087e-07 set dist(20m) 4.80696e-07 set dist(25m) 3.07645e-07 set dist(30m) 2.13643e-07 set dist(35m) 1.56962e-07 set dist(40m) 1.20174e-07 Phy/WirelessPhy set CSThresh_ $dist(20m) Phy/WirelessPhy set RXThresh_ $dist(20m) # Set up topography object set topo [new Topography] $topo load_flatgrid $val(x) $val(y) # Create God create-god $val(nn) #Create channel set channel1_ [new $val(chan)] # Configure nodes $ns node-config -adhocRouting $val(rp) \ -llType $val(ll) \ -macType $val(mac) \ -ifqType $val(ifq) \ -ifqLen $val(ifqlen) \ -antType $val(ant) \ -propType $val(prop) \ -phyType $val(netif) \ -channel $channel1_ \ -topoInstance $topo \ -agentTrace ON \ -routerTrace ON \ -macTrace OFF \ -movementTrace OFF \ -energyModel $val(energymodel) \ -initialEnergy $val(initialenergy) \ -rxPower 35.28e-3 \ -txPower 31.32e-3 \ -idlePower 712e-6 \ -sleepPower 144e-9 for {set i 0} {$i $val(nn) } {incr i} { set node_($i) [$ns node] } # Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes $node_(0) set X_ 250.0 $node_(0) set Y_ 250.0 $node_(0) set Z_ 0.0 $node_(1) set X_ 260.0 $node_(1) set Y_ 250.0 $node_(1) set Z_ 0.0 $node_(2) set X_ 270.0 $node_(2) set Y_ 250.0 $node_(2) set Z_ 0.0 $node_(3) set X_ 280.0 $node_(3) set Y_ 250.0 $node_(3) set Z_ 0.0 $ns at 5.0 $node_(1) setdest 270.0 250.0 0.83 $ns at 19.0 $node_(1) setdest 280.0 250.0 0.83 # Setup traffic flow between nodes # UDP connections from node_(1) and node_(0) set udp_(0) [new Agent/UDP] $ns attach-agent $node_(1) $udp_(0) set null_(0) [new Agent/Null] $ns attach-agent $node_(0) $null_(0) set cbr_(0) [new Application/Traffic/CBR] $cbr_(0) set type_ CBR $cbr_(0) set packetSize_ 32 $cbr_(0) set interval_ 0.2 $cbr_(0) attach-agent $udp_(0) $ns connect $udp_(0) $null_(0) $ns at 0.2 $cbr_(0) start $ns at 487 $cbr_(0) stop # Setup traffic flow between nodes # UDP connections from node_(2) and node_(1) set udp_(1) [new Agent/UDP] $ns attach-agent $node_(2) $udp_(1) set null_(1) [new Agent/Null] $ns attach-agent $node_(1) $null_(1) set cbr_(1) [new Application/Traffic/CBR] $cbr_(1) set type_ CBR $cbr_(1) set packetSize_ 32 $cbr_(1) set interval_ 0.2 $cbr_(1) attach-agent $udp_(1) $ns connect $udp_(1) $null_(1) $ns at 18 $cbr_(1) start #$ns at 487 $cbr_(1) stop # Define node initial position in nam for { set i 0 } { $i $val(nn) } { incr i } { $ns initial_node_pos $node_($i) 5 } # Telling nodes when the simulation ends for {set i 0 } {$i $val(nn) } {incr i} { $ns at $val(finish) $node_($i) reset; } # Ending nam and the simulation $ns at $val(finish) $ns nam-end-wireless $val(finish) $ns at $val(finish) finish $ns at 490 puts \ns EXITING...\ ; $ns halt puts Starting Simulation... # Define a 'finish' procedure proc finish {} {
[ns] Floating Point Exception
Hi All I am facing a floating point exception when I using a .h file I made given that I used it in other project and it worked fine. I also made a loop for 10 iterations and it also gave true results unitl I used it with ns-2 it gave floating point exception. the .h file is for RSA if any one could help even with a good rsa code. Regards,
[ns] floating point exception when embed some other library into NS2
hi everyone, I tried to embed the shogun library(-lshogun) into NS2,I am sure there is no problem with this library since i tried several example successfully with this library alone. i just added the library in the Makefile as follow, no additional codes are added into the ns2 project. LIB= \ -L/home/galaxy/ns-allinone-2.28/tclcl-1.16 -ltclcl -L/home/galaxy/ns-allinone-2.28/otcl-1.9 -lotcl -L/home/galaxy/ns-allinone-2.28/lib -ltk8.4 -L/home/galaxy/ns-allinone-2.28/lib -ltcl8.4 \ -lXext -lX11 \ -lnsl -ldl \ -lm -lshogun There is no errer when compile and link, but then error occur when run it in the shell: floating point exception. Could some one offer me some clues about how to fix this problem? thanks in advance!
[ns] floating point exception in CalendarScheduler
Hi, I am getting floating point exception when doing emulation tests with ns2 version 2.33 on a Fedora 8 x86 machine. After debugging, I traced the problem to the width_ field of CalendarScheduler class, which is extended by RealTimeScheduler that I use during emulation (nse). width_ field takes very large values like 7.8181674907623326e+307 on one test and 3.2030480282798705e+307 on another test, which causes overflow and therefore SIGFPE. Below are the debug outputs from two separate tests: test1: TapAgent(_o70): linked sock 7 as READABLE TapAgent(_o76): linked sock 10 as READABLE 17:57:31 Started ns2 for test_0042 Program received signal SIGFPE, Arithmetic exception. 0x0818a993 in CalendarScheduler::reinit (this=0xa0ed020, nbuck=8, bwidth=7.8181674907623326e+307, start=82.553562974804962) at common/scheduler.cc:859 859 diff1_ = diff0_ + bwidth; test2: TapAgent(_o70): linked sock 7 as READABLE TapAgent(_o76): linked sock 10 as READABLE 18:40:22 Started ns2 for test_0042 Program received signal SIGFPE, Arithmetic exception. 0x0818a21d in CalendarScheduler::insert2 (this=0x9e67020, e=0x9e902f8) at common/scheduler.cc:668 668 int i = CALENDAR_HASH(e-time_); (gdb) print e-time_ $1 = 100 (gdb) print width_ $2 = 3.2030480282798705e+307 Any comments? Thanks -- Burak
[ns] floating point exception
Hello, I got the error message Floating point exception (core dumped) when I run my simulator on the TCL file. Is there any why to determine where is the problem is the TCL code??! Any help would be appreciated -- Motaz K. Saad
Re: [ns] floating point exception
Thanks for reply. Yes, it is divide by zero error (the dumb file is below). I am trying to anticipate what I wrote in the tcl code that lead to divide by zero operation. ion: STATUS_FLOAT_DIVIDE_BY_ZERO at eip=00532A23 eax=00CF5B10 ebx=00CF7998 ecx=00CF5BA8 edx=00CF5B00 esi=0022B310 edi=0022B370 ebp=0022B0C8 esp=0022B0C4 program=C:\cygwin\home\motaz\ns-2\ns-allinone-2.32\ns-2.32\ns.exe, pid 3764, thread main cs=001B ds=0023 es=0023 fs=003B gs= ss=0023 Stack trace: Frame Function Args 0022B0C8 00532A23 (00CF5B00, , 412E8480, ) 0022B0E8 0053030F (00CF5A78, 007A4137, , 0209) 0022B108 004087C4 (00CF5A78, 0002, 0022B31C, 004087C4) 0022B128 0040C5E5 (00CF5A78, 0002, 0022B31C, 0040C5E5) 0022B158 00531A49 (00CF5A78, 0002, 0022B31C, 0022B1D8) 0022B178 0053326F (00CF5A78, 0002, 0022B31C, 0003) 0022B198 005B3086 (00CF5A78, 00A82090, 0005, 0022B310) 0022B348 005B67D2 (00CF2768, 00A82090, 0003, 0022B370) 0022B3D8 005C2537 (00CF2820, 00A82090, 0003, 00A844A4) 0022B428 005C353F (00A82090, 0003, 00A844A4, ) 0022B5F8 005EA2A5 (00A82090, 00D0F7D8, 0022B628, 005D20B7) 0022B628 005E997C (00A82090, 00D0D098, 0005, ) 0022B7F8 005EA37E (00A82090, 00B39C08, 0022B828, 005D8386) 0022B828 005E997C (00A82090, 00A8B528, 00A8AC18, 0001) 0022BB48 005D67E5 (00A965B8, 00A82090, 0005, 0022BB70) 0022BBD8 005D630D (00A965B8, 00A82090, 0005, 0022BC90) End of stack trace (more stack frames may be present) On Tue, May 6, 2008 at 6:27 PM, Bethel Mutanga [EMAIL PROTECTED] wrote: I dont think the error is coming from TRCL but its coming C++ code of your protocol... (if you have implemented your own protocol). I think its a rin time error coming from some calculations that are done during simulation. One example could be division by zero... On 5/6/08, Motaz K. Saad [EMAIL PROTECTED] wrote: Hello, I got the error message Floating point exception (core dumped) when I run my simulator on the TCL file. Is there any why to determine where is the problem is the TCL code??! Any help would be appreciated -- Motaz K. Saad -- Bethel Mutanga Centre for Mobile e-services Cell: +27722657439 Tel: +27359026706 --- My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there. -- Motaz K. Saad
[ns] Floating Point Exception when using Shadowing radio propagation model
Hi. I was trying to use the shadowing radio propagation model, but am getting a floating point exception. I got this both when running on a windows box (cygwin) and on an AIX box. gdb said Program received signal SIGFPE, Arithmetic exception, and when I use the same code with FreeSpace or TwoRay I have no problem. Has anyone else had this issue? How do you fix it? I'm attaching some code; if more code is necessary to look at, please let me know and I'll add the whole file. Thanks in advance. Theresa Nelson - [EMAIL PROTECTED] M.S. Computer Engineering Networks Network Security 1330 Torg Hall, IT Security Lab Virginia Tech set ns_ [new Simulator] Propagation/Shadowing set pathlossExp_ 2.0 ;# path loss exponent Propagation/Shadowing set std_db_ 4.0 ;# shadowing deviation (dB) Propagation/Shadowing set dist0_ 1.0;# reference distance (m) Propagation/Shadowing set seed_ 13 ;# seed for RNG $ns_ node-config -propType Propagation/Shadowing set opt(chan) Channel/WirelessChannel;# channel type set opt(prop) Propagation/Shadowing ;# radio-propagation model set opt(netif) Phy/WirelessPhy;# network interface type set opt(mac)Mac/802_11 ;# MAC type set opt(ifq)Queue/DropTail/PriQueue;# interface queue type set opt(ll) LL ;# link layer type set opt(ant)Antenna/OmniAntenna;# antenna model set opt(ifqlen) 50 ;# max packet in ifq set opt(nn) 50 ;# number of mobilenodes set opt(adhocRouting) NOAH ;# routing protocol set opt(cp) ;# cp file not used set opt(sc) ;# node movement file. set opt(x) 600;# x coordinate of topology set opt(y) 400;# y coordinate of topology set opt(seed) 0.0;# random seed set opt(stop) 45 ;# time to stop simulation set opt(ftp0-start) 0.0 set opt(ftp10-start)0.0 set opt(ftp20-start)0.0 set opt(ftp30-start)0.0 set opt(ftp40-start)0.0 set num_wired_nodes 39 set num_bs_nodes 18; ... $ns_ node-config -mobileIP ON \ -adhocRouting $opt(adhocRouting) \ -llType $opt(ll) \ -macType $opt(mac) \ -ifqType $opt(ifq) \ -ifqLen $opt(ifqlen) \ -antType $opt(ant) \ -propType $opt(prop) \ -phyType $opt(netif) \ -channelType $opt(chan) \ -topoInstance $topo \ -wiredRouting ON \ -agentTrace ON \ -routerTrace OFF \ -macTrace OFF
[ns] Floating point exception error
Hi friends, I have modified an existing MANET protocol, its compiled successfully but when I am running a tcl script after loading scenario file upto 70 nodes it gives Floating point exception error. I do not able to get the reason for the error. It's not a C++ code error becuase it's not giving a single warning and compiled successfully. Please guide thank you. -- Rupesh Kumar M.Tech(CSE)
Re: [ns] floating point exception error (Elahe Alipour)
I think you should check your code and find the part of calculation which having divide by zero value cause of floating point exception .
[ns] floating point exception error
Hi everyone, when I run my script, i received this error: floating point exception I understood that this error is related to calculating standard of deviation: set standard_deviation [expr sqrt($variance)] I traced variance and found that sometimes it's negative, but I can't understand why.logically it should be negative never. Can anybody help me with this problem? Thanks in advance. best regards, elahe. - Shape Yahoo! in your own image. Join our Network Research Panel today!
[ns] floating point exception
Hi everybody I cannot solve this error floating point exception. I tried with all versions but same error happened. Can anyone help me with this problem? Thank you -- Hossein
[ns] Floating point exception(Help me emergency)
hi dear friends I write new protocol for solving Coverage problem in sensor network this protocol run successfully in C++ with main function but when run in NS i received a Floating point exception please guide me I'm waiting for reply Thanks in advance -- Amin Irandoost
[ns] Floating point exception error
hi all ns list, when i run tcl scripts i have this error message Floating point exception! what does it mean what should i do? thanks
Re: [ns] Floating point exception error
This error can be caused by 'division by zero'. Have a look through your code for any possible divisions by zero (consider worst cases). Hope it helps! Vindya - Original Message - From: Bilel Romdhani [EMAIL PROTECTED] To: Ns-users@ISI.EDU Sent: Wednesday, October 18, 2006 2:48 PM Subject: [ns] Floating point exception error hi all ns list, when i run tcl scripts i have this error message Floating point exception! what does it mean what should i do? thanks
[ns] Floating point exception
Hi, I'm writing a new routing protocol for mobile ad hoc networks. This new protocol works properly when I tested on small networks ( 10 nodes). But the simulations stoped when I run on large networks (120 nodes) with the error floating point exception. What can be a cause of this error? Note that I'm using ns-2.28 on RedHat 9. Regards, Takuya - Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1cent;/min.
Re: [ns] Floating point exception
Takuya, Well it sounds very much like a floating point exception is being thrown somewhere in your code. Try finding where and fixing the code. hint gdb is a pretty good debugger with some fairly good GUI's available for it if you're that way inclined! /hint Matt On Tuesday 27 June 2006 13:35, Takuya Kimura wrote: Hi, I'm writing a new routing protocol for mobile ad hoc networks. This new protocol works properly when I tested on small networks ( 10 nodes). But the simulations stoped when I run on large networks (120 nodes) with the error floating point exception. What can be a cause of this error? Note that I'm using ns-2.28 on RedHat 9. Regards, Takuya - Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1cent;/min.
Re: [ns] Floating point exception in NS-2
I'm replying to myself, sorry. I forgot to add that I'm running this on Linux Ubuntu Breezy on a dual Xeon computer. Does someone know why the function below works fine in a basic C program but crashes in NS-2? Thanks in advance, Arkaitz On 4/25/06, Arkaitz Bitorika [EMAIL PROTECTED] wrote: Hello, I am using a Python numerical library (http://www.numpy.org/) embedded in NS, and while there's no problem on most of the functionality, I've found that there's a function that throws a Floating point exception whenever it's called from NS. This function is pasted below, it has no dependency on Python, it also throws the Floating point exception when called from a vanilla NS-2 installation: double pinf_init(void) { double mul = 1e10; double tmp = 0.0; double pinf; pinf = mul; for (;;) { pinf *= mul; if (pinf == tmp) break; tmp = pinf; } return pinf; } This function runs fine when called from an empty main() C++ program, but if called from NS-2 I get the Floating point exception. Any idea what may be causing this crash? Thanks, Arkaitz
[ns] Floating Point Exception in DiffServ application
Hi all I'm new to this mailing list and NS i've a problem, i'm trying to write a script to simulate a diffserv, but when i tried to run the sctipt i got floating point exception. my script is attached, i couldn't found the reason any help needed thanks best regards The output is as follows: [EMAIL PROTECTED] workspace]# ns ns-5.tcl Policy Table(2): Flow (1 to 5): TSW2CM policer, initial code point 10, CIR 100.0 bps. Flow (0 to 5): TSW2CM policer, initial code point 0, CIR 100.0 bps. Policer Table: TSW2CM policer code point 0 is policed to code point 0. TSW2CM policer code point 10 is policed to code point 11. TSW2CM policer code point 11 is policed to code point 0. Floating point exception [EMAIL PROTECTED] workspace]# The code is attached
Re: [ns] Floating Point Exception in DiffServ application
Hi Due to some changes made between ns v2.27 and v2.28, some DiffServ examples fail with this error. Make sure that you set the mean packet size. It must help. Sincerely, Sayenko Alexander Assistant Telecommunication laboratory, MIT department University of Jyvaskyla, Finland Hi all I'm new to this mailing list and NS i've a problem, i'm trying to write a script to simulate a diffserv, but when i tried to run the sctipt i got floating point exception. my script is attached, i couldn't found the reason any help needed thanks best regards The output is as follows: [EMAIL PROTECTED] workspace]# ns ns-5.tcl Policy Table(2): Flow (1 to 5): TSW2CM policer, initial code point 10, CIR 100.0 bps. Flow (0 to 5): TSW2CM policer, initial code point 0, CIR 100.0 bps. Policer Table: TSW2CM policer code point 0 is policed to code point 0. TSW2CM policer code point 10 is policed to code point 11. TSW2CM policer code point 11 is policed to code point 0. Floating point exception [EMAIL PROTECTED] workspace]# The code is attached
[ns] Floating point exception problem of Blueware 1.0 with ns2.29 on AMD-64bit PC (Suse 10.0)
Hi, Blueware 1.0 were successfully built in a subdirectory of ns-2.29 (ns-allinone-2.29/ns-2.29/blueware). But when I run the Blueware example file in the package, it complains floating point exception. (63.28): + _2_ FIRST MAS LINK ESTABLISHED 2 - 16 DELAY 0.039548 (64.28): + _16_ FIRST SLV LINK ESTABLISHED 16 - 2 DELAY 0.040173 (67.28): + _9_ FIRST MAS LINK ESTABLISHED 9 - 3 DELAY 0.042048 (68.28): + _3_ FIRST SLV LINK ESTABLISHED 3 - 9 DELAY 0.042673 Floating point exception Can anybody help me with this problem? Thanks in advance. Huabei