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

[ns] question on CBQ



Dear all,
I just begin using the ns to simulate the CBQ and can't find the reason of errors in my script.Please give me some suggestions.
Please it is urgent.
Thanks in advance!


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

The error message is:
ns: _o71 unknown-flow 3 2 0:
    (_o71 cmd line 1)
    invoked from within
"_o71 cmd unknown-flow 3 2 0"
    invoked from within
"catch "$self cmd $args" ret"
    (procedure "_o71" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o71 unknown-flow 3 2 0"

This script works correctly after i delete the line "$ns rtproto DV ".why? why??




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