End to end latency measurements

1,458 views
Skip to first unread message

fab

unread,
Dec 10, 2009, 6:54:01 AM12/10/09
to ns-3-users
Hi,

I found this post (http://groups.google.com/group/ns-3-users/
browse_thread/thread/3cc1ce3da81eb39d/a27277f63eabf6c3?lnk=gst&q=trace
+packets#a27277f63eabf6c3) with a pretty decent proposal how to
measure end to end delay using TimestampTags. As I was not able to
post in this thread I started this one. I followed the steps and had
to modify some small things (AddTag -> AddByteTag &
FindFirstMatchingTag -> FindFirstMatchingByteTag) but I get
segmentation faults once I implement the line (in the trace sink
within my project, not in onoff-application.cc)

p->FindFirstMatchingTag(timestamp);

I encapsulated this line in an if statement, but once the timestamp
object is accessed, my program crashes with the given error. I added
"ns3/onoff-application.h" to the headers and if I only write the
TimestampTag timestamp; line and do not access the object no error
occurs. It seems, he finds the class, but not the object.

Anyone got any hint to solve this, or an alternative to trace end to
end delay (at program runtitme, thus not a pcap analysis, etc)?

Thanks,
Fabian

Gustavo Carneiro

unread,
Dec 10, 2009, 9:20:23 AM12/10/09
to ns-3-...@googlegroups.com


2009/12/10 fab <fabian.bi...@gmail.com>
You could also use Flow Monitor.  See src/contrib/flow-monitor, examples/flow-monitor, and http://telecom.inescporto.pt/~gjc/flowmon-presentation.pdf

Regards,

--
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert

fab

unread,
Dec 10, 2009, 10:35:58 AM12/10/09
to ns-3-users
Hi Gustavo,

thank you very much for this fast and promising answer. I read about
the flow monitor, tried to implement it once but did not succeed.
Infact now I tried again with the information from your
presentation ... and did not succeed. Inserting around Simulator::Run
() your code snipped

flowmon_helper = ns3.FlowMonitorHelper();
monitor = flowmon_helper.InstallAll();
monitor.SetAttribute("DelayBinWidth",ns3.DoubleValue(0.001));
monitor.SetAttribute("JitterBinWidth",ns3.DoubleValue(0.001));
monitor.SetAttribute("PacketSizeBinWidth",ns3.DoubleValue(20));
ns3.Simulator.Run();
monitor.SerializeToXmlFile("results.xml",True,True);

gave me the error, flowmon_helper is not known. Adding the lines

FlowMonitorHelper flowmon_helper;
FlowMonitor monitor;

in the head of the given code, did not work neither... Could you
provide me with an more extensive example code how to implement the
flow monitor? Shall I replace the Simulator::Run() line with the
ns3.Simulator.Run() ? Am I missing something big time?

Thanks again,
Fabian



On 10 Dez., 15:20, Gustavo Carneiro <gjcarne...@gmail.com> wrote:
> 2009/12/10 fab <fabian.binterna...@gmail.com>
>
>
>
> > Hi,
>
> > I found this post (http://groups.google.com/group/ns-3-users/
> > browse_thread/thread/3cc1ce3da81eb39d/a27277f63eabf6c3?lnk=gst&q=trace
> > +packets#a27277f63eabf6c3) with a pretty decent proposal how to
> > measure end to end delay using TimestampTags. As I was not able to
> > post in this thread I started this one. I followed the steps and had
> > to modify some small things (AddTag -> AddByteTag &
> > FindFirstMatchingTag -> FindFirstMatchingByteTag) but I get
> > segmentation faults once I implement the line (in the trace sink
> > within my project, not in onoff-application.cc)
>
> >  p->FindFirstMatchingTag(timestamp);
>
> > I encapsulated this line in an if statement, but once the timestamp
> > object is accessed, my program crashes with the given error. I added
> > "ns3/onoff-application.h" to the headers and if I only write the
> > TimestampTag timestamp; line and do not access the object no error
> > occurs. It seems, he finds the class, but not the object.
>
> > Anyone got any hint to solve this, or an alternative to trace end to
> > end delay (at program runtitme, thus not a pcap analysis, etc)?
>
> You could also use Flow Monitor.  See src/contrib/flow-monitor,
> examples/flow-monitor, andhttp://telecom.inescporto.pt/~gjc/flowmon-presentation.pdf

Gustavo Carneiro

unread,
Dec 10, 2009, 11:13:26 AM12/10/09
to ns-3-...@googlegroups.com


2009/12/10 fab <fabian.bi...@gmail.com>

Hi Gustavo,

thank you very much for this fast and promising answer. I read about
the flow monitor, tried to implement it once but did not succeed.
Infact now I tried again with the information from your
presentation ... and did not succeed. Inserting around Simulator::Run
() your code snipped

       flowmon_helper = ns3.FlowMonitorHelper();
       monitor = flowmon_helper.InstallAll();
       monitor.SetAttribute("DelayBinWidth",ns3.DoubleValue(0.001));
       monitor.SetAttribute("JitterBinWidth",ns3.DoubleValue(0.001));
       monitor.SetAttribute("PacketSizeBinWidth",ns3.DoubleValue(20));
       ns3.Simulator.Run();
       monitor.SerializeToXmlFile("results.xml",True,True);

gave me the error, flowmon_helper is not known. Adding the lines

       FlowMonitorHelper flowmon_helper;
       FlowMonitor monitor;

in the head of the given code, did not work neither... Could you
provide me with an more extensive example code how to implement the
flow monitor? Shall I replace the Simulator::Run() line with the
ns3.Simulator.Run() ? Am I missing something big time?


You are missing something big.  It sounds like your are coding in C++, but the code you are copying is for Python.

There's also a C++ example modified to optionally use FlowMonitor.  See examples/routing/simple-global-routing.cc, near the end of the main function.  To run:

    ./waf --run simple-global-routing --command-template "%s --EnableMonitor=1"

You should then see a simple-global-routing.flowmon file with the results in XML format.

Regards,

fab

unread,
Dec 16, 2009, 11:15:32 AM12/16/09
to ns-3-users
Hey Gustavo,

thanks again, I managed to get the flowmonitor to work but it only
gives me results if I use an echoserver/client. According to your
presentation, this is wrong, right? As I understood, the flowmonitor
is layer agnostic...

In the meantime I also retried to implement the TimestampTag like
described in the first post. I copied timetag class declaration and
definition in the Onoff-application.h and it did no longer crash.

But all my changes to onoff-application.cc were not taken into
account. I tried to change the NS_LOG_LOGIC message
(OnOffApplication:SendPacket: sending packet at ..) into some other
stuff just to verify and he won't take it. Even after a ./waf clean
and complete recompile... The edited file is in /ns-3.6/src/. i can't
even anymore find the "correct", thus previous, line of NS_LOG_LOGIC
in the whole ns-3.6 directory, and still in the log file appears the
"sending packet at" messsage like before... (i also deleted libns3.so
and the log file before testing) I tried the same procedure with
another NS_LOG_LOGIC within yanserroratemodel.cc ... same problem
here.

Any ideas?

Thanks,
Fabian



On 10 Dez., 17:13, Gustavo Carneiro <gjcarne...@gmail.com> wrote:
> 2009/12/10 fab <fabian.binterna...@gmail.com>
>
>
>

Gustavo Carneiro

unread,
Dec 16, 2009, 11:33:35 AM12/16/09
to ns-3-...@googlegroups.com


2009/12/16 fab <fabian.bi...@gmail.com>

Hey Gustavo,

thanks again, I managed to get the flowmonitor to work but it only
gives me results if I use an echoserver/client. According to your
presentation, this is wrong, right? As I understood, the flowmonitor
is layer agnostic...

The flow monitor base architecture is layer agnostic.  But it requires classifier and a probe implementation for each layer you wish to measure.  Included in the distribution are probe and classifier for IPv4 UDP/TCP flows.  Other types of flows, such as L2 flows, require implementation of different classifier/probe.  This is generally very easy to implement, though.
 
--

You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.


Reply all
Reply to author
Forward
0 new messages