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

[ns] Different fid_ with the same TCP agent



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]

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

set n0 [$ns node]
set n1 [$ns node]

$ns duplex-link $n0 $n1 1Mb 0.008 DropTail

set src [new Agent/TCP]
set sink [new Agent/TCPSink]
$src set packetSize_ 576
$ns attach-agent $n0 $src
$ns attach-agent $n1 $sink
$ns connect $src $sink

#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"

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

$ns run

#########################

The result I've got in the trace file (out.tr) is that both files have been sent with fid_2. Could anyone tell me how to send the first file with fid_ 1 and the second with fid_ 2 using just one agent?

Thank you in advance

abel

---
Abel Mayal de la Torre

 
BT Advanced Communications Technology Centre
B29 BT Adastral Park
Martlesham Heath
Ipswich
Suffolk
IP5 3RE
UK
 
Tph: 01473 647615
E-Mail: [email protected]