$ns use-newtraceto generate the new trace and the detailed explanation could be found in Ns Manual. A very good reference about the trace is the ns-2 wiki page. See: http://nsnam.isi.edu/nsnam/index.php/NS-2_Trace_Formats
void |
s 20.000000000 _0_ AGT --- 6 cbr 512 [0 0 0 0] ------- [0:0 1:0 32 0] [0] 0 0
r 20.000000000 _0_ RTR --- 6 cbr 512 [0 0 0 0] ------- [0:0 1:0 32 0] [0] 0 0
s 20.000000000 _0_ RTR --- 6 cbr 532 [0 0 0 0] ------- [0:0 1:0 32 1] [0] 0 0
s 20.000275000 _0_ MAC --- 6 cbr 584 [13a 1 0 800] ------- [0:0 1:0 32 1] [0] 0 0
r 20.004947063 _1_ MAC --- 6 cbr 532 [13a 1 0 800] ------- [0:0 1:0 32 1] [0] 1 0
s 20.004957063 _1_ MAC --- 0 ACK 38 [0 0 0 0]
r 20.004972063 _1_ AGT --- 6 cbr 532 [13a 1 0 800] ------- [0:0 1:0 32 1] [0] 1 0
r 20.005261125 _0_ MAC --- 0 ACK 38 [0 0 0 0]
BEGIN {counter1 = 0; counter2 = 0; counter3 = 0;
counter4 = 0;} $1~/r/ && $2>50 && $2< 100 && /_12_/ && /AGT/ { counter1 += ($8- 20) size = $8 - 20 } $1~/r/ && $2>50 && $2 <100 && /_13_/ && /AGT/ { counter2 += ($8- 20) size = $8 - 20 } $1~/r/ && $2>50 && $2<100 && /_14_/ && /AGT/ { counter3 += ($8- 20) size = $8 - 20 } $1~/r/ && $2>50 && $2<100 && /_15_/ && /AGT/ { counter4 += ($8- 20) size = $8 - 20 } throughout END { print (size , counter1*8/(50), counter2*8/50, counter3*8/(50), counter4*8/50, (counter1+counter2+counter3+counter4)*8/50 ) >> "wu.dat"} |
$2>100 && $2 < 150 && (/_6_/
|| /_2_/) && /AGT/ { print $1,
$2, $6 > "dst2.tr" } $2>100 && $2 <150 && (/_0_/ || /_9_/) && /AGT/ { print $1, $2, $6 > "dst9.tr" } $2>100 && $2 <150 && (/_12_/ || /_3_/) && /AGT/ { print $1, $2, $6 > "dst3.tr" } $2>100 && $2 <150 && (/_10_/ || /_4_/) && /AGT/ { print $1, $2, $6 > "dst4.tr" } $2>100 && $2 <150 && (/_11_/ || /_8_/) && /AGT/ { print $1, $2, $6 > "dst8.tr" } |
$ gcc delay.c -o delaycal $ ./delaycal dst2.tr wu0.dat wu1.dat |