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

Re: [ns] URGENT HELP NEEDED



you have an extra parenthesis (see !!!!!!!!! below)

-neeraj

>
>HI
>I NEED URGENT (VERY URGENT) HELP IN THE FOLLOWING:-
>I AM TRYING TO SIMULATE A DEFICIT ROUND ROBIN SCHEDULER.
>IT IS GIVING THE FOLLOWING ERROR:-
>***Error
>Format not correct
>should be
>{Simulator instproc get-link { node1 node2 }
>...
>}
>
>The code is below:-
>--------------------------------
>
>
>#default Mask parameter
>set MASK 0
>set ns [new Simulator]
>#receiver
>set r0 [$ns node]
>#router
>set g0 [$ns node]
>
>$ns duplex-link $g0 $r0 10.0Mb 0.01ms DRR
>
># trace the bottleneck queue
>$ns trace-queue $g0 $r0 $f
>
>Simulator instproc get-link { node1 node2 } {
>     $self instvar link_
>     set id1 [$node1 id]
>     set id2 [$node2 id]
>     return $link_($id1:$id2)
>}
>
>#setting parameters for the DRR queue
>set l [$ns get-link $g0 $r0]
>set l [$ns $link_ $g0 $r0]
>
>set q [$l queue]
>
>$q mask $MASK
>$q blimit 25000
>$q quantum 500
>$q buckets 2^15
>
># create TCP source
>  set tcp [new Agent/TCP/Reno]
>  $ns attach-agent $g0 $tcp($i)
>  set ftp [new Application/FTP]
>  $ftp attach-agent $tcp
>}                                 !!!!!!!!!!!!!
>
># create receiver
>  set sink [new Agent/TCPSink]
>  $ns attach-agent $r0 $sink
>
>----------------------------------------
>
>My doubt is the following:-
>Is this the correct way to write get-link?
>should it be modified?
>
>I WOULD THOROUGHLY APPRECIATE IF SOMEONE COULD SEND
>ME A COMPLETE SIMULATION CODE FOR DRR F0R A SIMPLE
>SETUP OF 4 NODES SHOWN BELOW:-
>NODE0
>      \
>       ------ NODE2 -----NODE3
>      /
>NODE1
>WHERE NODE2 IS THE ROUTER, NODES NODE0 AND NODE1 ARE SENDERS (SENDING VOIP
>TRAFFIC)
>AND NODE3 IS THE SINK.
>I TRIED (CODE ABOVE) BUT IT IS NOT WORKING. IT IS GIVING ERROR IN GET-LINK
>PROCEDURE.
>
>please SOMEBODY help me
>Thanx
>ravi
>
>
>
>

_________________________________________________________________________
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.