[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem to simulation ...



Thank you very much for numerous answers receipts, but the problem
persists....
In the sense that the simulator produces a "core dumped" when it effects the
creation of the exponential source without reporting nothing around the
error....

Special Thanks  to [email protected]

The code has been modified as you has told, however now it produces me a "core
dumped", I think that the problem is the following istruction :

            $exp_ON_OFF_1 attach-agents $source

I know that really this istruction doesn't connect the source node to the
exponential generator because i didn't define an agent but to simulate my
model well I don't have to use a specific protocol being the transmission
media sure therefore without ack and timeout...

The Code is:

set ns [new Simulator ]

puts "Defining Tracing File for nam..."

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

puts "Creating Nodes..."

set source [$ns node]
set switcher [$ns node]
set sink [$ns node]

puts "Connecting sink to Null Agent..."

set null_sink [new Agent/Null]
$ns attach-agent $sink $null_sink

puts "Creating Link..."

$ns simplex-link $source $switcher 10000Mb 2ms DropTail
$ns simplex-link $switcher $sink 10000Mb 2ms DropTail

puts "Queue limit=50 packets..."

$ns queue-limit $switcher $sink 50

puts "Creating ON/OFF generator..."

set exp_ON_OFF_1 [new Application/Traffic/Exponential]

;# exponencial generator lambda=0.1

$exp_ON_OFF_1 attach-agent $source     ;# <---  is this the problem ????
$exp_ON_OFF_1 set packet_size_ 1505  ;#  for source (like ATM)
$exp_ON_OFF_1 set burst_time_ 1.204us
$exp_ON_OFF_1 set idle_time_ 0,999998796s
$exp_ON_OFF_1 set rate 15.5M

puts "Simulating the net model..."

$ns at 0.0 "$exp_ON_OFF_1 start"
$ns at 5.0 "finish"

proc finish {}
    {
     global ns f nf
     $ns flush-trace
     close $f
     close $nf

     puts "Running Visualizator nam..."
     exec nam out.nam &
     exit 0
    }

$ns run


I think that the error is (I'm not sure):

;# exponencial generator lambda=0.1

$exp_ON_OFF_1 attach-agent $source     ;# <---  is this the problem ????
$exp_ON_OFF_1 set packet_size_ 1505  ;#  for source (like ATM)
$exp_ON_OFF_1 set burst_time_ 1.204us
$exp_ON_OFF_1 set idle_time_ 0,999998796s
$exp_ON_OFF_1 set rate 15.5M

If it is as can I attach the exponencial generator to source node without
using an agent of protocol???




[email protected] wrote:

> You can change to this.
>
>        # The Script first.tcl is :
>
>  set ns [new Simulator ]
>
>  puts "Defining Tracing File for nam..."
>
>  set f [open out.tr w]
>  $ns trace-all $f
>  set nf [open out.nam w]
>  $ns namtrace-all $nf
>
>  puts "Creating Nodes..."
>
>  set source [$ns node]
>  set switcher [$ns node]
>  set sink [$ns node]
>
>  puts "Connecting sink to Null Agent..."
>
>  set null_sink [new Agent/Null]
>  $ns attach-agent $sink $null_sink
>
>  puts "Creating Link..."
>
>
> # $ns simplex-link source switcher 10000Mb 2ms DropTail
> # $ns simplex-link switcher sink 10000Mb 2ms DropTail
> #-------> change to the following two lines.
>
>  $ns simplex-link $source $switcher 10000Mb 2ms DropTail
>  $ns simplex-link $switcher $sink 10000Mb 2ms DropTail
>
>  puts "Queue limit=50 packets..."
>
> # $ns queue-limit switch sink 50
> #-------->change to the following.
>
>  $ns queue-limit $switcher $sink 50
>  puts "Creating ON/OFF generator..."
>
>  set exp_ON_OFF_1 [new Application/Traffic/Exponential]
>
>  ;# exponencial generator lambda=0.1
>
>  $exp_ON_OFF_1 attach-agent $source
>  $exp_ON_OFF_1 set packet_size_ 1505  ;#  for source (like ATM)
>  $exp_ON_OFF_1 set burst_time_ 1.204us
>  $exp_ON_OFF_1 set idle_time_ 0,999998796s
>  $exp_ON_OFF_1 set rate 15.5M
>
>  puts "Simulating the net model..."
>
>  $ns at 0.0 "$exp_ON_OFF_1 start"
>  $ns at 5.0 "finish"
>
>  proc finish {}
>      {
>       global ns f nf
>       $ns flush-trace
>       close $f
>       close $nf
>
>       puts "Running Visualizator nam..."
>       exec nam out.nam &
>       exit 0
>      }
>
>  $ns run
>
> Wish it is helpful.
>
> > Thaks for ours answered.......
> > My problems continue to persist...
> > Someone knows me to say where the problem is in this script, and where I
> > have to look for the matter of this problem on ns2 facilities and
> > documentacion
> >
> > The Script first.tcl is :
> >
> > set ns [new Simulator ]
> >
> > puts "Defining Tracing File for nam..."
> >
> > set f [open out.tr w]
> > $ns trace-all $f
> > set nf [open out.nam w]
> > $ns namtrace-all $nf
> >
> > puts "Creating Nodes..."
> >
> > set source [$ns node]
> > set switcher [$ns node]
> > set sink [$ns node]
> >
> > puts "Connecting sink to Null Agent..."
> >
> > set null_sink [new Agent/Null]
> > $ns attach-agent $sink $null_sink
> >
> > puts "Creating Link..."
> >
> > $ns simplex-link source switcher 10000Mb 2ms DropTail
> > $ns simplex-link switcher sink 10000Mb 2ms DropTail
> >
> > puts "Queue limit=50 packets..."
> >
> > $ns queue-limit switch sink 50
> >
> > puts "Creating ON/OFF generator..."
> >
> > set exp_ON_OFF_1 [new Application/Traffic/Exponential]
> >
> > ;# exponencial generator lambda=0.1
> >
> > $exp_ON_OFF_1 attach-agent $source
> > $exp_ON_OFF_1 set packet_size_ 1505  ;#  for source (like ATM)
> > $exp_ON_OFF_1 set burst_time_ 1.204us
> > $exp_ON_OFF_1 set idle_time_ 0,999998796s
> > $exp_ON_OFF_1 set rate 15.5M
> >
> > puts "Simulating the net model..."
> >
> > $ns at 0.0 "$exp_ON_OFF_1 start"
> > $ns at 5.0 "finish"
> >
> > proc finish {}
> >     {
> >      global ns f nf
> >      $ns flush-trace
> >      close $f
> >      close $nf
> >
> >      puts "Running Visualizator nam..."
> >      exec nam out.nam &
> >      exit 0
> >     }
> >
> > $ns run
> >
> >
> > The Error Codes are :
> >
> > rogent> ns first.tcl
> > Defining Tracing File for nam...
> > Creating Nodes...
> > Connecting sink to Null Agent...
> > Creating Link...
> > couldn't read file "id": no such file or directory
> >     while executing
> > "source.orig id"
> >     ("uplevel" body line 1)
> >     invoked from within
> > "uplevel source.orig $fileName"
> >     (procedure "source" line 12)
> >     invoked from within
> > "$n1 id"
> >     (procedure "_o3" line 3)
> >     (Simulator simplex-link line 3)
> >     invoked from within
> > "$ns simplex-link source switcher 10000Mb 2ms DropTail"
> >     (file "first.tcl" line 23)
> >
> >
> >
> > Thanks
> >
> > Vincenzo Mazzotta
> > ([email protected])
> >
>
> ___________________________________________________________________
> ��ӭʹ������4M�ռ����ѵ������� http://freemail.netease.com
> ��ӭ����������<<��ѵ��ӿ���>> http://www.163.com/mail
begin:vcard 
n:Mazzotta;Vincenzo
tel;cell:+34-600831910
tel;home:+34-93-4430581
x-mozilla-html:FALSE
org:FIB - UPC (Catalunya Politecnic University) - Spain;Computer Arquitecture (AC)
adr:;;Calle Sancho Marraco 4 , 3� 2�;Barcelona;BCN;08004;Spain
version:2.1
email;internet:[email protected]
title:Carrer Final Project (Doble Tiulation)
fn:Vincenzo Mazzotta
end:vcard