####################################################################
# setup UDP connections
set udp1 [new Agent/UDP]
$udp1 set fid_ 2222
set lm [new Agent/LossMonitor]
$ns_ attach-agent $node_(0) $udp1
$ns_ attach-agent $node_(1) $lm
$ns_ connect $udp1 $lm

# Mandatory
$node_(0) 2222 ftp rate_ $opt(rate)

set cbr1 [new Application/Traffic/CBR]
$cbr1 set rate_ $opt(rate)
$cbr1 attach-agent $udp1

$ns_ color 2222 blue
$ns_ at $opt(start) "$cbr1 start"
#$ns_ at 1.5 "$ns_ detach-agent $node_(0) $udp1"

