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

Re: Re: [ns] how to dump routing talbe?



Hi,
I believe that a simpler way to write the nodes'
routing tables of that simulation would be to
"redirect" the result of the simulation into a file
from the command line:
when you run ns, instead of typeing 

                   ns vec.tcl

you could type

                   ns vec.tcl > log.txt

This has the effect of putting in the file "log.txt"
everything that was printed on the screen with the
other method.
Cheers,
                       Andrea.

--- [email protected] ha scritto: > thanks to help
me solve this problem. but i have
> encountered another problem. in 
> your attachment,you use "$ns dump-routelogic-nh" in
> procedure "mydump{}". however
> , this mothed will not dump to a file,but to the
> screen. i have checked the tcl-s
> ource file "ns-route.tcl" under "ns/tcl/lib"
> directory, and found that i its code
> ,"Simulator instproc dump-routelogic-nh {}",it is
> writen as follows:
> 
>                 set nh [$routingTable_ lookup $i $j]
>                 if { $nh >= 0 } {
>                     puts -nonewline "$nh\t"
>                 }
> 
> i think i could dump these infomation to a file with
> this tcl-script:
>                puts -nonewline $filehandle "$nh\t"
> where "$filehandle" is the return by "open" 
> my quesiton is :  can i write such a procedure of
> myself ,make it work ,and get 
> the routing table in a file , also without
> re-compiling the whole ns under linux(
> i won't to re-compile ns).
> my working environment is : "linux5.2 kernel2.0.36,
> ns-allinone-2.1b7a"
> thanks in advance.
> yours zhangkehuan
>  
> 
> > Hi, 
> > i couldn't find out what is the problem with your
> > script, anyway i have attached to this reply a
> script
> > that works for me (better than nothing...).
> > Cheers,
> >                Andrea.
> > 
> > --- [email protected] ha scritto: >
> hello,everyone .
> > > in one of my tcl script,i want to dump the
> routing
> > > table to a specified file,but there is a error
> when
> > > it runs, and no tables are written. the error
> > > message is as follows:
> > > 
> > > using backward compatible Agent/CBR; use
> > > Application/Traffic/CBR instead
> > > ns: _o10 dump-routes file28:
> > >     (_o10 cmd line 1)
> > >     invoked from within
> > > "_o10 cmd dump-routes file28"
> > >     invoked from within
> > > "catch "$self cmd $args" ret"
> > >     (procedure "_o10" line 2)
> > >     (SplitObject unknown line 2)
> > >     invoked from within
> > > "_o10 dump-routes file28"
> > > 
> > > i can do nothing with these,so please help me.
> > > thank you in advance. and the orignal source is
> also
> > > send as attachment.
> > > 
> > > 
> > > 
> > > 
> > > ===============================================
> > > Ϊ�������Ϊ����裬���㴫���������� 
> > > 
> > >     ---- 163.net�ؿ�վ��http://ecard.163.net��
> > > 
> > > 163�����ʾ�ȫ�·��ף��������޵ĵ��Ӻؿ�վ��
> > > ===============================================
> > > 
> > > 
> > 
> > > ATTACHMENT part 2 application/octet-stream 
> > 
> > 
> > 
> >
>
______________________________________________________________________
> > Do You Yahoo!?
> > Il tuo indirizzo gratis e per sempre @yahoo.it su
> http://mail.yahoo.it
> 
> 
> 
> 


______________________________________________________________________
Do You Yahoo!?
Il tuo indirizzo gratis e per sempre @yahoo.it su http://mail.yahoo.it