[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Question on Interface between CBQClass Object and Agent such as UDP or TCP
Hi Everybody,
I will be grateful if somebody can help me out there.
I am missing a point on CBQClass object. I think there should be a Tcl code
fragment in any CBQ tcl script, that define an explicit interface between
the CBQClass object and a node agent such as UDP or TCP. Also I think I am
missing the aspect Tcl code or method that explicitly define how a CBQClass
object such as audioclass can be attached to a traffic source such as CBR.
I have gone through the mailing list, I have not been able to get information
to clear my confusion. I have a copy of the test-suite-cbq.tcl, it did not
state how CBQClass objects can be attached or bind to a node agent such as
UDP or TCP.
Consder a simple scenerio:
A topology of 4 nodes,(0-3) with CBQLink between node n2 and n3
n0 .
.
.
.
n1. . . . . . . .n2 . . . . . . . n3
If I define two CBQClass application that share the link as shown in the
following scenerio;
set cbqlink [$ns link $n2 $n3]
set topclass [new CBQClass]
$topclass setparams none 0 1 aut0 8 2 0
set audioclass [new CBQClass]
set q0 [new Queue/DropTail]
$q0 set limit_ 40
$audioclass install-queue $q0
$audioclass setparams $topclass true 0.4 auto 1 1 0
set videoclass [new CBQClss]
set q1 [new Queue/DropTail]
$q1 set limit_ 60
$videoclass install-queue $q1
$videoclass setparams $toclass true 0.6 auto 1 1 0
$cbqlink insert $topclass
$cbqlink insert $audioclass
$cbqlink insert $videoclass
$cbqlink bind $audioclass 1
$cbqlink bind $videoclass 2
#Create agents; I know the code below will not work. My problem is how to
attach or link the audioclass or the videoclass to an agent such as UDP or CBR
Or if I define cbr0 as [new Application/Traffic/CBR] or
ftp as [new Application/FTP], how do I attach or link a CBQClass object to
them.
set udp0 [new Agent/UDP]
$ns attach-agent $n0 $udp0
$audioclass attach-agent $udp0
$audioclass set packetSize_ 500
$audioclass set interval_ 0.005
$udp0 set fid_ 1
set null0 [new Agent/Null]
$ns attach-agent $n3 $null0
$ns connect $udp0 $null0
set udp1 [new Agent/UDP]
$ns attach-agent $n1 $udp1
$videoclass attach-agent $udp1
$videoclass set packetsize_ 500
$videoclass set interval_ 0.005
$udp1 set fid_ 2
set null1 [new Agent/Null]
$ns attach-agent $n3 $null1
$ns connect $udp1 $null1
I do not completely understand the function of the code $udp0 set fid_ 1 or
the $udp1 set fid_ 2 above. Is it meant to add color to identify each of
the flow or to bind the CBQClass to the node agents?
I will be very grateful if you can help me to get answers to my questions.
Thank you very much for your help.
Titus Awotula, MSc AMIEE
Dept. of Electronic & Electrical Engineering
Loughborough University
Loughborough.
Leicestershire LE11 3TU
Tel: Office (01509) 228117
Home (01509) 558102
Fax: (01509) 227014