#Data transmission between all nodes to Sink set now [$ns now] for {set i 1} {$i < $val(nn) } { incr i } { set udp [new Agent/UDP] $ns attach-agent $node_($i) $udp set cbr [new Application/Traffic/CBR] $cbr set packetSize_ 100 $cbr set interval_ 0.1 $cbr attach-agent $udp set null [new Agent/Null] $ns attach-agent $node_(0) $null $ns connect $udp $null $ns at [expr $now+$i*0.1] "$cbr start" $ns at [expr ($now+0.1)+$i*0.1] "$cbr stop" }