set VariableName [new Agent/UDP] E.g.: set udp1 [new Agent/UDP] |
set VariableName [new Agent/Null] E.g.: set sink1 [new Agent/Null] |
$ns connect SOURCE DESTINATION E.g.: $ns connect $udp1 $sink1 |
|
Create a constant bit rate traffic generator that transmits data at a rate of 0.39 Mbps and uses packet size of 1000 bytes. The source sends packets at regular intervals.
set cbr1 [new Application/Traffic/CBR] ;# create CBR application $cbr1 set rate_ 0.39mbps $cbr1 set packet_size_ 1000 $cbr1 set random_ false |
$CBR-Object attach-agent $UDP-Agent E.g.: $cbr1 attach-agent $udp1 |
$CBR-Object start E.g.: $ns at 0.0 "$cbr1 start" |
You do not need to start the UDP agent - it will send any packet that it receives from the CBR Object to the corresponding destination.
ns hw7.tcl Queue XY-BandWidth [UDP or noUDP] The following commands are used to run the 4 different experimenmts: 1. ns hw7.tcl DropTail 0.4mbps UDP 2a. ns hw7.tcl RED2 0.4mbps UDP 2b. ns hw7.tcl RED3 0.4mbps UDP 2c. ns hw7.tcl RED4 0.4mbps UDP 3. ns hw7.tcl DRR 0.4mbps UDP 4. ns hw7.tcl DropTail 0.2mbps noUDP 5. ns hw7.tcl DropTail 0.4mbps noUDP |
/home/cs558000/turnin hw7.tcl hw7 |