[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: About packet delays
On Fri, 30 Jul 1999, Proyecto SPRR wrote:
> Well, my problem is measuring de end-to-end delay
> of some packets. I'm using an Application/Traffic/CBR
> and I need to measure the maximum, minimum and average
> delay of all the packets...
>
> !!! SOMEONE CAN HELP ME !!!
Ideally yourself. All the delay information you require is recorded in
the trace-all tracefiles that are usually generated; it's just a
question of getting it out after the fact and after the simulation has
run. Although the docs are skimpy on this - can't expect them to guess
what results you might want - there are enough awk scripts lying
around in the ns tree to give hints. A broader hint is below, since
getting packet delays seems to be a common request.
> My idea, if there isn't a "standard" way of doing
> it,
parsing tracefiles.
> is to create a new kind of agent (probably very
> similar to the Agent/LossMonitor) who computes this
> information (but using what info?)
All the times are in the tracefiles; the following awk script might
give you the idea for getting hold of packet delays, although it's
only really useful for small single unicast flows without
modification. Caveat lector.
You could write an agent instead, I suppose...
L.
what would it take to get the otcl shell to handle cursor keys
properly a la tcsh for line editing and history? ^[[A etc is such a
bind on Solaris.
<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>
BEGIN {
# simple awk script to generate end-to-end packet lifetime statistics
# in a form suitable for plotting with xgraph.
# Lloyd Wood, July 1999.
# http://www.ee.surrey.ac.uk/Personal/L.Wood/ns/
highest_packet_id = 0;
}
{
action = $1;
time = $2;
node_1 = $3;
node_2 = $4;
src = $5;
flow_id = $8;
node_1_address = $9;
node_2_address = $10;
seq_no = $11;
packet_id = $12;
if ( packet_id > highest_packet_id ) highest_packet_id = packet_id;
# getting start time is not a problem, provided you're not starting
# traffic at 0.0.
# could test for sending node_1_address or flow_id here.
if ( start_time[packet_id] == 0 ) start_time[packet_id] = time;
# only useful for small unicast where packet_id doesn't wrap.
# checking receive means avoiding recording drops
if ( action != "d" ) {
if ( action == "r" ) {
# could test for receiving node_2_address or flow_id here.
end_time[packet_id] = time;
}
} else {
end_time[packet_id] = -1;
}
}
END {
for ( packet_id = 0; packet_id <= highest_packet_id; packet_id++ ) {
start = start_time[packet_id];
end = end_time[packet_id];
packet_duration = end - start;
if ( start < end ) printf("%d %f\n", start, packet_duration);
}
}