Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 11-14-2015, 12:09 PM   #1
LQ Newbie
Registered: Nov 2015
Posts: 7

Rep: Reputation: Disabled
Evalvid ns2.35: error Floating point exception (core dumped)

I try to execute the script qos.tcl in ns2. gives me the error:Floating point exception (core dumped)

user@user-HP-Pavilion-g6-Notebook-PC:~/example$ ns qos.tcl
Floating point exception (core dumped)

Could you give me some suggestions?
Thanks in advance!

Best regards,

qos.tcl (script source)

set ns [new Simulator]

set max_fragmented_size 1000
set packetSize 1028

set s1 [$ns node]
set r1 [$ns node]
set r2 [$ns node]
set d1 [$ns node]

$ns duplex-link $s1 $r1 10Mb 1ms DropTail
$ns simplex-link $r1 $r2 0.18Mb 10ms dsRED/core
$ns simplex-link $r2 $r2 0.18Mb 10ms DropTail
$ns duplex-link $r2 $d1 10Mb 1ms DropTail

set qr1r2 [[$ns link $r1 $r2] queue]
$qr1r2 set limit_ 10
$qr1r2 set numQueues_ 1
$qr1r2 setNumPrec 3
$qr1r2 addPHBEntry 10 0 0
$qr1r2 addPHBEntry 11 0 1
$qr1r2 addPHBEntry 12 0 2
$qr1r2 configQ 0 0 4 8 0.025
$qr1r2 configQ 0 1 2 4 0.05
$qr1r2 configQ 0 2 1 2 0.10

set udp1 [new Agent/myUDP]
$ns attach-agent $s1 $udp1
$udp1 set packetSize_ $packetSize
$udp1 set_filename sd_qos
set null1 [new Agent/myEvalvid_Sink]
$ns attach-agent $d1 $null1
$ns connect $udp1 $null1
$null1 set_filename rd_qos

set original_file_name st
set trace_file_name video1.dat
set original_file_id [open $original_file_name r]
set trace_file_id [open $trace_file_name w]

set frame_count 0
set last_time 0

while {[eof $original_file_id] == 0} {
gets $original_file_id current_line

scan $current_line "%d%s%d%s%s%s%d%s" no_ frametype_ length_ tmp1_ tmp2_ tmp3_ tmp4_ tmp5_
#puts "$no_ $frametype_ $length_ $tmp1_ $tmp2_ $tmp3_ $tmp4_ $tmp5_"

# 30 frames/sec. if one want to generate 25 frames/sec, one can use set time [expr 1000*1000/25]
set time [expr 1000 * 1000/30]

if { $frametype_ == "I" } {
set type_v 1

if { $frametype_ == "P" } {
set type_v 2

if { $frametype_ == "B" } {
set type_v 3

if { $frametype_ == "H" } {
set type_v 1

puts $trace_file_id "$time $length_ $type_v $max_fragmented_size"
incr frame_count

close $original_file_id
close $trace_file_id
set end_sim_time [expr 1.0 * 1000/30 * ($frame_count + 1) / 1000]
puts "$end_sim_time"

set trace_file [new Tracefile]
$trace_file filename $trace_file_name
set video1 [new Application/Traffic/myEvalvid]
$video1 attach-agent $udp1
$video1 attach-tracefile $trace_file

proc finish {} {
global ns
exit 0

$ns at 0.0 "$video1 start"
$ns at $end_sim_time "$video1 stop"
$ns at [expr $end_sim_time + 1.0] "$null1 closefile"
$ns at [expr $end_sim_time + 1.0] "$qr1r2 printStats"
$ns at [expr $end_sim_time + 1.0] "finish"

$ns run

user@user-HP-Pavilion-g6-Notebook-PC:~/example$ ns qos.tcl
Floating point exception (core dumped)
Old 11-14-2015, 12:53 PM   #2
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,486

Rep: Reputation: 3635Reputation: 3635Reputation: 3635Reputation: 3635Reputation: 3635Reputation: 3635Reputation: 3635Reputation: 3635Reputation: 3635Reputation: 3635Reputation: 3635
Seems that some file(s) are missing :

Ref. line 38 : set original_file_name st
Ref. line 40 : set original_file_id [open $original_file_name r]
... The missing files can be attached as name.txt .
Attachments : The paper clip tool in the 'Advanced Editor'.
If big files : Please upload to 'Google Docs' (You get 15GB free storage.)

* Important : Code must be inside CODE Tags : [code]code text[/code]
* Please edit post #1 : The 'Edit' button in post #1.


Last edited by knudfl; 11-14-2015 at 12:55 PM.


myevalvid2, ns2

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 (core dumped) getting this error while running zishan.tcl Md Zishan Khan Linux - Networking 1 05-11-2015 04:20 PM
floating point exception (core dumped) aicaicai Linux - Newbie 2 05-10-2013 07:35 AM
Floating point exception error while executing tcl with ns2 ines8989 Linux - Software 0 04-09-2013 01:44 PM
firefox 2.0 Floating Point Exception (core dumped) error on Ubuntu 6.10 maximum Ubuntu 1 12-28-2006 11:40 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:29 AM.

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