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

Re: [ns] Reg: error given by the prog.



Preethi

I'm sending a script that uses a CBR application (example1b.tcl of Marc
Greis' tutorial).

Carlos


On Tue, 24 Oct 2000, Lloyd Wood wrote:

> On Tue, 24 Oct 2000, Puneet Agarwal wrote:
> 
> > It seems that there is some problem with new "Application/Traffic/CBR",
> > on my machine (ns-2.1b6 on Linux), when I replaced it with old "Agent/CBR", your
> > program worked.
> 
> This is because you can can't attach an application directly to a
> node. Connect the CBR application to a UDP agent and attach that to a
> node, and you're all set. Agent/CBR is old and dates from before the
> the agent/application separation.
> 
> L.
> 
> > so change
> > 
> > "set cbr0 [new Application/Traffic/CBR]"
> > 
> > back to
> > 
> > "set cbr0 [new Agent/CBR]"
> > 
> > Puneet
> > 
> > ----- Original Message -----
> > From: "preethi sam" <[email protected]>
> > To: <[email protected]>
> > Sent: Tuesday, October 24, 2000 1:57 PM
> > Subject: [ns] Reg: error given by the prog.
> > 
> > 
> > Hi ,
> >   this is a simple prog that creates a topology having 2 nodes sharing  a
> > duplex link between them but it gives the foll error:
> > 
> > (_o34 cmd line 1)
> >     invoked from within
> > "_o34 cmd reset"
> >     invoked from within
> > "catch "$self cmd $args" ret"
> >     (procedure "_o34" line 2)
> >     (SplitObject unknown line 2)
> >     invoked from within
> > "$a reset"
> >     (procedure "_o10" line 5)
> >     (Node do-reset line 5)
> >     invoked from within
> > "$self do-reset$nodetype_"
> >     (procedure "_o10" line 4)
> >     (Node reset line 4)
> >     invoked from within
> > "$Node_($nn) reset"
> >     (procedure "_o3" line 11)
> >     (Simulator run line 11)
> >     invoked from within
> > "$ns run"
> >     (file "simnode.tcl" line 32)
> > 
> > 
> > /* program */
> > 
> > set ns [new Simulator]
> > ns-random 0
> > set nf [open outtry.tr w]
> > $ns trace-all $nf
> > 
> > set n0 [$ns node]
> > set n1 [$ns node]
> > 
> > $ns duplex-link $n0 $n1 1Mb 10ms DropTail
> > 
> > set cbr0 [new Application/Traffic/CBR]
> > $ns attach-agent $n0 $cbr0
> > $cbr0 set packetSize_ 500
> > $cbr0 set interval_ 0.005
> > 
> > set null0 [new Agent/Null]
> > $ns attach-agent $n1 $null0
> > 
> > $ns connect $cbr0 $null0
> > 
> > $ns at 0.5 "$cbr0 start"
> > $ns at 4.5 "$cbr0 stop"
> > 
> > proc finish {} {
> >   global ns nf
> >   $ns flush-trace
> >   close $nf
> >   exit 0
> > }
> > 
> > $ns at 5.0 "finish"
> > $ns run
> > 
> > 
> > please let me know what the error means...
> > 
> > Preethi.
> > 
> > _________________________________________________________________________
> > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> > 
> > Share information about yourself, create your own public profile at
> > http://profiles.msn.com.
> > 
> > 
> 
> <[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>
> 
> 
#Create a simulator object

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 trace file

        close $nf

	#Execute nam on the trace file

        exec nam out.nam &

        exit 0

}



#Create two nodes

set n0 [$ns node]

set n1 [$ns node]



#Create a duplex link between the nodes

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





#Create a UDP agent and attach it to node n0

set udp0 [new Agent/UDP]

$ns attach-agent $n0 $udp0



#Create a CBR application and attach it to udp agent

set cbr0 [new Application/Traffic/CBR]

$cbr0 set packet_size_ 500

$cbr0 set rate_ 800Kb

$cbr0 attach-agent $udp0



#Create a Null agent (a traffic sink) and attach it to node n1

set null0 [new Agent/Null]

$ns attach-agent $n1 $null0



#Connect the traffic source with the traffic sink

$ns connect $udp0 $null0  



#Schedule events for the CBR agent

$ns at 0.5 "$cbr0 start"

$ns at 4.5 "$cbr0 stop"

#Call the finish procedure after 5 seconds of simulation time

$ns at 5.0 "finish"



#Run the simulation

$ns run