[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Multicast trace file : HELP !!!!
Hi All
I am trying to get average packet duration for all multicast packets
received from source. It is really hard to figure out the seqno &
packet_id as all intermediate nodes start the seqno as '0' again and
does anyone have a script or idea to capture the results ...
It becomes more complicated when multiple sources send data.
I have included the "script" i use below.
I am not sure if it is completely perfect !!
Thanks for the time !!
Any help is highly appreciated ..
- vijayan
========================================================================
- SCRIPT TO CAPTURE AVERAGE PACKET DURATION FOR MULTICAST DATA PACKETS
- Disclaimer : not sure if it is correct !!!!
=========================================================================
BEGIN {
highest_packet_id = 0;
for ( packet_id = 0; packet_id <= 800; packet_id++ ) {
for ( node = 0; node <= 50 ; node ++ ) {
end_time[node, packet_id] = 0;
}
}
}
{
action = $1;
time = $2;
node_1 = $3;
node_2 = $4;
agent = $5;
flow_id = $6;
junk = $7
source = $8
node_1_address = $9;
node_2_address = $10;
seq_no = $11;
packet_id = $12;
pid = (packet_id+1) / 2;
if ( pid > hpid ) hpid = pid;
if ( action != "d" ) {
if ( action == "r" ) {
if ( $5 == "encap" ) start_time[pid] = time;
if ( $5 == "cbr" ) end_time[node_2, seq_no] = time;
}
} else {
end_time[node_2, seq_no] = -1;
}
}
END {
for ( packet_id = 0; packet_id <= hpid; packet_id++ ) {
packet_duration = 0;
start = start_time[packet_id];
for ( node = 0; node <= 50 ; node ++ ) {
if ( end_time[node,packet_id] == 0 ) continue;
end = end_time[node, packet_id];
packet_duration += end - start;
}
# there are 20 receivers
if ( start < end ) printf("%d %f %f\n", packet_id, start,packet_duration/20);
}
}
================================================================================