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

RE: [ns] Is there any problem with my NS?



What's the class info of your classifier_, Classifier/Port or
Classifier/Address?

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of
Xiaojun Cao
Sent: Friday, July 27, 2001 3:04 PM
To: [email protected]
Subject: [ns] Is there any problem with my NS?


Hi,
I just want to make sure how classifier work. I test following short
tcl script? Could somebody help me explain why the offset and shift is
0, and the mask? Is there any problem with my NS2.1b8 over Redhat 7.1?

Thanks in advance?

yours
X. Cao



**********The output is as following:classifier _o12
0 offset
0 shift
2147483647 mask
1 slots
slot 0: _o37 (Classifier/Port)
-1 default
classifier _o15
0 offset
0 shift
2147483647 mask
1 slots
slot 1: _o39 (Classifier/Port)
-1 default

************test.tcl
set ns [new Simulator]

#Open the NAM trace file
set nf [open out.nam w]
$ns namtrace-all $nf

#Define a 'finish' procedure
proc finish {} {
         global ns nf
         $ns flush-trace
         #Close the NAM trace file
         close $nf
         #Execute NAM on the trace file
         exec nam out.nam &
         exit 0
}

#Create three nodes
set n0 [$ns node]
set n1 [$ns node]

$ns duplex-link $n0 $n1 2Mb 10ms DropTail

#Setup a UDP connection
set udp [new Agent/UDP]
$ns attach-agent $n0 $udp
set null [new Agent/Null]
$ns attach-agent $n1 $null
$ns connect $udp $null
$udp set fid_ 2

#Setup a CBR over UDP connection
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
$cbr set type_ CBR
$cbr set packet_size_ 1000
$cbr set rate_ 1mb
$cbr set random_ false

set c0 [$n0 set classifier_]
set c1 [$n1 set classifier_]

#Schedule events for the CBR agents
$ns at 0.1 "$cbr start"
$ns at 4.5 "$cbr stop"

$ns at 4.999 "$c0 dump"
$ns at 4.999 "$c1 dump"

#Call the finish procedure after 5 seconds of simulation time
$ns at 5.0 "finish"

#Print CBR packet size and interval
puts "CBR packet size = [$cbr set packetSize_]"
puts "CBR rate = [$cbr set rate_]"

#Run the simulation
$ns run

**********The output is as following:classifier _o12
	0 offset
	0 shift
	2147483647 mask
	1 slots
		slot 0: _o37 (Classifier/Port)
	-1 default
classifier _o15
	0 offset
	0 shift
	2147483647 mask
	1 slots
		slot 1: _o39 (Classifier/Port)
	-1 default