Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for {set i 1} {$i < 21} {incr i} {
- set udpAgent($i) [new Agent/UDP]
- $ns attach-agent $W1 $udpAgent($i)
- set udpSink($i) [new Agent/Null]
- $ns attach-agent $node($i) $udpSink($i)
- $ns connect $udpAgent($i) $udpSink($i)
- set cbr($i) [new Application/Traffic/CBR]
- $cbr($i) set packetSize_ 500
- $cbr($i) set interval_ 0.005
- $cbr($i) attach-agent $udpAgent($i)
- }
- #code for the end
- for {set i 1} {$i < 21} {incr i} {
- $ns at 5.0 "$cbr($i)
- }
Advertisement
Add Comment
Please, Sign In to add comment