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

Re: [ns] Different fid_ with the same TCP agent



Abel Mayal wrote:
Hi all,

I am trying to send files with different fid_ numbers from the same TCP agent, but it doesn't work. Here I include a basic example I'm running:

##############################
set ns [new Simulator]

#I SENT THE FIRST FILE WITH fid_ 1
$src set fid_ 1
$sink set fid_ 1
set ftp [new Application/FTP]
$ftp attach-agent $src
$ns at 0.0 "$ftp produce 3"

#I SENT THE SECOND FILE WITH fid_ 2
$src set fid_ 2
$sink set fid_ 2
$ns connect $src $sink
set ftp1 [new Application/FTP]
$ftp1 attach-agent $src
$ns at 0.1 "$ftp1 produce 3"
$ns at 0.5 "finish"


Since you're not scheduling those calls, all your set fid_ occur before the simulation starts. Try to change the time when the second assignment takes place:

$ns at 0.1 "$src set fid_ 2"
$ns at 0.1 "$sink set fid_ 2"

-- Felix Hernandez