[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:Re:[ns] question on CBQ



Hello,Carlos Alberto Kamienski: 
 Thank your reply very much!
 but i don't know how to modify the following script  to make it work correctly.i have tried but not succeed.
very sorry! i am a new to ns and i hope to learn more from you .
thanks in advance again!
dong min 


>> set ns [new Simulator]
>> $ns rtproto DV
>>
>> set nf [open cbq.nam w]
>> $ns namtrace-all $nf
>> set tf [open cbq.tra w]
>> $ns trace-all $tf
>>
>> #Create 4 nodes
>> set n1 [$ns node]
>> set n2 [$ns node]
>> set n3 [$ns node]
>> set n4 [$ns node]
>>
>> $ns color 1 red
>> $ns color 2 blue
>>
>> $ns duplex-link $n1 $n3 2Mb 100ms DropTail
>> $ns duplex-link $n2 $n3 2Mb 100ms DropTail
>> $ns duplex-link $n3 $n4 2.2Mb 100ms CBQ
>> set cbqlink [$ns link $n3 $n4]
>>
>> $ns duplex-link-op $n1 $n3 orient right-up
>> $ns duplex-link-op $n2 $n3 orient right
>> $ns duplex-link-op $n3 $n4 orient right
>> $ns duplex-link-op $n3 $n4 queuePos 0
>>
>> #Set  two leaf classes: lowerClass1 and lowerClass2
>> set topClass [new CBQClass]
>> set lowerClass1 [new CBQClass]
>> set lowerClass2 [new CBQClass]
>> $topClass setparams none 0 0.80 auto 0 2 0
>> $lowerClass1 setparams $topClass true 0.35 auto 1 1 0
>> $lowerClass2 setparams $topClass true 0.35 auto 2 1 0
>>
>> set q1 [new Queue/DropTail]
>> $q1 set limit_ 10
>> set q2 [new Queue/DropTail]
>> $q2 set limit_ 10
>>
>> $lowerClass1 install-queue $q1
>> $lowerClass2 install-queue $q2
>>
>> $cbqlink insert $topClass
>> $cbqlink insert $lowerClass1
>> $cbqlink insert $lowerClass2
>> $cbqlink bind $lowerClass1 1
>> $cbqlink bind $lowerClass2 2
>>
>> #generate traffic from n1 , n2  to n4 via n3
>> set null1 [new Agent/Null]
>> $ns attach-agent $n4 $null1
>> set s1 [new Agent/UDP]
>> $ns attach-agent $n1 $s1
>> $ns connect $s1 $null1
>> set cbr1 [new Application/Traffic/CBR]
>> $cbr1 set packetSize_ 750
>> $cbr1 set interval_ 0.005
>> $cbr1 attach-agent $s1
>> $s1 set fid_ 1
>>
>> set s2 [new Agent/UDP]
>> $ns attach-agent $n2 $s2
>> $ns connect $s2 $null1
>> set cbr2 [new Application/Traffic/CBR]
>> $cbr2 set packetSize_ 750
>> $cbr2 set interval_ 0.005
>> $cbr2 attach-agent $s2
>> $s2 set fid_ 2
>>
>> $ns trace-queue $n3 $n4 $sender
>>
>> proc finish {} {
>> global ns nf tf
>> $ns flush-trace
>> close $nf
>> exit 0
>> }
>>
>> $ns at 0.1 "$cbr1 start"
>> $ns at 0.1 "$cbr2 start"
>> $ns at 2.0 "$cbr1 stop"
>> $ns at 2.0 "$cbr2 stop"
>>
>> $ns run


_____________________________________________
[�㲻���� ��������] ����ר�úţ�95963���û���/���룺263
�������ϣ��ͻ�����   http://shopping.263.net/category19.htm