LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-10-2013, 12:44 PM   #1
ines8989
Member
 
Registered: Mar 2013
Posts: 62

Rep: Reputation: Disabled
Floating point exception error while executing tcl with ns2


Hi
I want to execute the tcl file to simulate dccp dccp and tcp but i have this result :
iness@iness-VirtualBox ~/ns-allinone-2.35/bin/dccp $ ns dccp.tcl
Floating point exception

My tcl file is bellow :
-------------------------------------------
set ns [new Simulator]
set testTime 102.0

#if {$argc < 3} {
#puts stderr "ns dccp.tcl \[x (bottleneck in Mbit/s)\] \[ 2|3 (ccid)\] \[Sack|Newreno (TCP version)\]"
#exit 1
#}

set C [lindex $argv 0]
set ccid [lindex $argv 1]
set tcpver [lindex $argv 2]

# Create a nam trace datafile.
set namfile [open out.nam w]
$ns namtrace-all $namfile

#open the trace file
set tracefile1 [open out_dccp.tr w]
$ns trace-all $tracefile1

# Set up the network topology shown at the top of this file:
set s1 [$ns node]
set s2 [$ns node]
set e1 [$ns node]
set e2 [$ns node]
set dest1 [$ns node]
set dest2 [$ns node]

$ns duplex-link $s1 $e1 10Mb 0ms DropTail
$ns duplex-link $s2 $e1 10Mb 0ms DropTail

$ns duplex-link $e1 $e2 $C.Mb 15ms DropTail

$ns duplex-link $e2 $dest1 10Mb 0ms DropTail
$ns duplex-link $e2 $dest2 10Mb 0ms DropTail

# DCCP
if {$ccid == 3} {
set dccp1 [new Agent/DCCP/TFRC]
set dccp2 [new Agent/DCCP/TFRC]
} else {
set dccp1 [new Agent/DCCP/TCPlike]
set dccp2 [new Agent/DCCP/TCPlike]
}
$dccp1 set fid_ 2
$dccp2 set fid_ 2
$ns attach-agent $s2 $dccp1
$ns attach-agent $dest2 $dccp2
set ftp2 [new Application/FTP]
$ftp2 attach-agent $dccp1
$ns connect $dccp1 $dccp2

# TCP
if {$tcpver == "Sack"} {
set tcp1 [new Agent/TCP/FullTcp/Sack]
set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp1
set sink [new Agent/TCP/FullTcp/Sack]
$ns attach-agent $s1 $tcp1
$ns attach-agent $dest1 $sink
#$tcp1 set window_ $win
#$sink set window_ $win
$tcp1 set fid_ 1
$sink set fid_ 1
$ns connect $tcp1 $sink
# set up TCP-level connections
$sink listen ; # will figure out who its peer is
} else {
set agent(1) [new Agent/TCP/Newreno]
$ns attach-agent $s1 $agent(1)
set ftp1 [new Application/FTP]
$ftp1 attach-agent $agent(1)
set agent(2) [new Agent/TCPSink]
$ns attach-agent $dest1 $agent(2)
$ns connect $agent(1) $agent(2)
}

proc finish {} {
global ns namfile tracefile1 C ccid tcpver
$ns flush-trace
close $tracefile1
exec $file $C $ccid $tcpver
#Execute nam on the trace file
exec nam out.nam &
exit 0
}

proc init {} {
global dccp1 dccp2

$dccp1 reset
$dccp2 reset
}

$ns at 0.1 "init"
$ns at 0.2 "$dccp2 listen"
$ns at 0.3 "$ftp1 start"
$ns at 20.0 "$ftp2 start"
$ns at [expr $testTime - 20] "$ftp2 stop"
$ns at $testTime "$ftp1 stop"
$ns at [expr $testTime + 1.0] "finish"

$ns run

Please tell me what's the problem . Thanks for you
 
Old 04-22-2013, 10:26 AM   #2
Nutria
Member
 
Registered: Nov 2007
Location: New Orleans, LA, USA
Distribution: Xubuntu
Posts: 67

Rep: Reputation: 6
Quote:
Originally Posted by ines8989 View Post
Hi
I want to execute the tcl file to simulate dccp dccp and tcp but i have this result :
iness@iness-VirtualBox ~/ns-allinone-2.35/bin/dccp $ ns dccp.tcl
Floating point exception

[snip]
$ns run

Please tell me what's the problem . Thanks for you
So much that you didn't tell us...
  1. What distro?
  2. What version of the distro?
  3. What is ns-allinone?
  4. Where did you get it?
  5. Did you compile it yourself from source?
  6. If so, What gcc version?
  7. What hardware?
 
Old 04-22-2013, 05:31 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Moved: This thread is more suitable in the Linux Software forum and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


Reply

Tags
dccp, ns2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Floating point exception error while executing tcl with ns2 ines8989 Linux - Software 0 04-09-2013 01:44 PM
[SOLVED] FLoating Point Exception Problem when running RTP_v2.tcl in NS@.33 in Ubuntu 11.10 Wayne Frederick Linux - Newbie 2 03-07-2013 08:57 AM
[SOLVED] Floating point exception after run TCL script ns2 deVacto Linux - Newbie 7 10-28-2012 11:56 PM
Floating point exception in running maodv in ns2.34 glitter Linux - Newbie 0 08-21-2011 01:29 AM
Floating point exception error mathb Linux - Newbie 5 05-27-2011 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration