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

[ns] X-Mailer: Infom@il (correo con interfaz WEB)



Hi all,

I'm having some problems when trying to test RED queue management.When compoling the following code I get the following error:

"trace type too long - allocate more space to traceType in red.h and recompile."

It looks like, surprisingly, I'm setting too many parameters of the RED queue in just 1 line of code. My questions are:

1) Is it really impossible to pass more than 1 argument to RED in one line?

2) Supposing, that is not possible, I've tried to set the variables thresh_, maxthresh_, and limterm_ "globally", for all RED queues by:

Queue/RED set thresh_ 2
Queue/RED set maxthresh_ 4
Queue/RED set linterm_ 1

There is no problem when compiling but then, when using NAM, I see that the queue grows over 4 packets, REd doesn't seem to be working. In fact I get the same output file if I use Droptail instead of RED. How istaht possible? Those 3 lines of code have no effect?

3) Finally, if I need to modify red.h what is exactly what I have to do afterwars for the changes to take effect. Do I have to do a 'make'? Where? Are there any parameters I should use?

My code:

#Create a simulator object
set ns [new Simulator]

$ns color 1 Red
$ns color 2 Blue

Queue/RED set thresh_ 2
Queue/RED set maxthresh_ 4
Queue/RED set linterm_ 1

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



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

#Create two nodes
set n0 [$ns node]
set n1 [$ns node]
set nagr [$ns node]
set nfin [$ns node]


#Create a duplex link between the nodes
$ns duplex-link $n0 $nagr 200kb 100ms DropTail
$ns duplex-link $n1 $nagr 200kb 100ms DropTail
$ns duplex-link $nagr $nfin 250kb 100ms RED thresh_ 2 maxthresh_ 4 linterm_ 1
$ns queue-limit $nagr $nfin 10
$ns duplex-link-op $nagr $nfin queuePos 0.3

#Create a TCP agent and attach it to node n0
set tcp0 [new Agent/TCP]
$tcp0 set window_ 50
$tcp0 set class_ 1
$tcp0 set packetSize_ 500
$ns attach-agent $n0 $tcp0
set tcp1 [new Agent/TCP]
$tcp1 set window_ 50
$tcp1 set class_ 2
$tcp1 set packetSize_ 500
$ns attach-agent $n1 $tcp1

# Create a FTP traffic source and attach it to udp0
set ftp0 [new Application/FTP]
$ftp0 attach-agent $tcp0
set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp1

#Create a Null agent (a traffic sink) and attach it to node n1
set sink0 [new Agent/TCPSink]
$ns attach-agent $nfin $sink0
set sink1 [new Agent/TCPSink]
$ns attach-agent $nfin $sink1


#Connect the traffic source with the traffic sink
$ns connect $tcp0 $sink0  
$ns connect $tcp1 $sink1  


#Schedule events for the CBR agent
$ns at 0.5 "$ftp0 start"
$ns at 0.6 "$ftp1 start"
$ns at 4.0 "$ftp0 stop"
$ns at 4.5 "$ftp1 stop"
#Call the finish procedure after 5 seconds of simulation time
$ns at 5.0 "finish"

#Run the simulation
$ns run


Thanks a lot and best regards. Any help will be greatly appreciated.

Jorge Manrique