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

[ns] intserv: Agent/SA doesn't work properly



Dear all,

I'm still having problems with the intserv model in ns: the Agent/SA doesn't
seem to work properly.
When I use an Agent/UDP, everything works fine, but when I replace it with
Agent/SA, some problems arise:
- in nam I don't see anything happen (no packets are flowing)
- when I look at the tracefile, I see that all packets have seq. number -1
- according to the output trace file, packets enter the queue, leave the queue
and are received all at the same (simulated) time
(The only good (?!) point is that I don't see any error messages.)

The only difference in my script between the UDP and the SA case is that I
changed the agent class, and the fact that I use "$a start" (to start an SA
agent named a).

I welcome any help/comments!

Kind regards,
Chris

source /usr/local/ns-allinone-2.1b6/ns-2.1b6/tcl/lib/ns-intserv.tcl

set ns [new Simulator]
$ns color 1 Blue
$ns color 0 Green
$ns color 2 Red

set nf [open out.nam w]
$ns namtrace-all $nf

set tf [open out.tr w]
$ns trace-all $tf

puts "\n - creating topology"
# create simple topology: bbone link + 2 sources & destinations
set n0 [$ns node]
set n1 [$ns node]
$ns duplex-intserv-link $n0 $n1 64k 10ms SimpleIntServ SALink MS TimeWindow CL

# create traffic
puts " - creating traffic"
set traf [new Application/Traffic/CBR]
$traf set packetSize_ 128
$traf set rate_ 64k

# create real-time agent
puts " - creating transport agent"
set a [new [lindex $argv 0]]
$a set fid_ 1 ;# non-zero => real-time
$a set rate_ 64k
$a set bucket_ 1024
$traf attach-agent $a

# create tbf
set tbf [new TBF]
$tbf set rate_ 64k
$tbf set bucket_ 1024
$tbf set qlen_ 10

$ns attach-tbf-agent $n0 $a $tbf

# create receiver
puts " - creating receiver"
set rcv [new Agent/SAack]
$ns attach-agent $n1 $rcv
$ns connect $a $rcv

if {[lindex argv 1]=="Agent/SA" } { $ns at 0.0 "$a start" }
$ns at 1.0 "$traf start"
$ns at 2.0 "$traf stop"
$ns at 3.0 "finish"

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

$ns run