[ns-users] Sending 'n' packets with OTcl

bsikdar@poisson.ecse.rpi.edu bsikdar@poisson.ecse.rpi.edu
Wed, 11 Aug 1999 13:58:25 -0400 (EDT)


> Does anyone have a snippet of code (or a pointer to documentation?) for
> sending just 'n' packets to a transport protocol (such as
> Agent/TCP/Reno for example)? I believe it can be done and would prefer

one way of doing that would be to attach an FTP agent to the TCP
source. the ftp source can then be controlled to send a desired
number of packets. for example

set src [new Agent/TCP/FullTcp]
set sink [new Agent/TCP/FullTcp]

$ns attach-agent $s1 $src
$ns attach-agent $k1 $sink
$ns connect $src $sink

set ftp1 [new Application/FTP]
$ftp1 attach-agent $src

$ns at 0.15 "$ftp1 produce 100"

the last line makes the ftp source send 100 packets. hope this helps.

						biplab sikdar
					rensselaer polytechnic institute