1. new-trace should be called prior to trace-all in the script (Is this
ns-2.29?)
2. -Pf is logged only when you use CBR
3. you can also use create-god instance and call its methods to retrieve the
number of hops - BUT the number that this instance is returning, is the
number that is calculated by the simulator not the actual numbers that are
the packet has been traversed. so your own third was could be a way to
compare it against the expect sim value.

regarding awk, checking lines with "r" is fine, but you can also read a
column to make it more easier.

be careful with the -P objects in the trace and refer to the documents to
see what type of agent you are using, as they generate different traces.

Sasan


On 3/3/06, hamdi benmessaoud <[EMAIL PROTECTED]> wrote:
>
>
> hi ALL  ,
> I want to calculate the number of hops in my network
> I get 3 replies from ns-users so I tried these 3 possibilities :
> 1)is to use $ns_ new-trace  and after I use the parmaeter Pf whitch
> calculate the number  of hops but when i add in my script
>   $ns_ new-trace  I get a lot of errors which I don't anderstand
> 2)so i searched in the the net and found that we must declare
>   $ns_ use-newtrace to use the new trace format  and after we must use the
> parmaeter Pf whitch calculate the number  of hops
> but when i use  $ns_ use-newtrace  i don't get this  "-Pf" in my trace
> files ???
> i found also that "-Pf" is get only with cbr or tcp  traffic , or in my
> case i don't use any one of them ,so it is the raison that i don't get the
> "-Pf"  in my trace files
> am I wrong ?
> 3) the third methode is to use the old format trace ,the 16 colon gives
> the TTL and  the number of hops = 32-TTL
> in my trace files i have this strange value of TTL :
>     1-when I use AODV in the lines whitch begin with "s" I found TTL = 30
> , it 's not
>       normal ,cause this means that nbre  hops=2 and the transmission
> don't begin
>     2-when using DSR i found some lines with TTL =254 or TTL <= 32
>      it's not normal
>     3-with DSDV all the TTL  are =32 it's not normal
>     4-there is lines begin with "r" and her TTL  is 32 or il must <32
> because a node have
>      been transfeered at least one hop
>      it's not normal
>
> also I want to calculate average of  number of hops  so i want to use awk
> to filter my trace file so in my sens i must keep only the lines which begin
> with "r"
> am i wrong ?
> 4)I found also that in new trace  format for DSR AND AODV  "-ph" gives
> number of hops
> is it write ?
>
>
> I must use the 3 protocols : DSR DSDV AODV in order to compare their
> performance
> so please can u help me
> whitch method among the 4 th listed ???????
> can you help me please i'm bloqued
>
> Thank a ton in advance
> Amel
>
>
>
>
> ---------------------------------
> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les
> tarifs exceptionnels pour appeler la France et l'international.Téléchargezla 
> version beta.
>



--
Plan for things to go wrong, Design for things to go right
S+

Reply via email to