[Ns-developers] DelayBox - ns-3

Matt Crinklaw matt.crinklaw at gmail.com
Mon Apr 7 18:22:14 PDT 2008


>
>  Erm, it occured to me that I did not explain how you can leave this to
>  the application generating traffic. Here is a rough outline:
>
>  1) make sure that you application has a trace source triggered for each
>  packet sent down the socket
>
>  2) define a 'flow tagging' callback
>
>  static void
>  MyFlowTaggingFunction (uint32_t flowid, std::string context, Ptr<const
>  Packet> packet, ...)
>  {
>   FlowIdTag tag;
>   tag.Set (flowid);
>   packet->AddTag (tag);
>  }
>
>  You could also implement a more fancy flow tagging callback which tags
>  the packet with a flowid calculated from the nodeid/applicationid/socket
>  itself to save you from having to specify a single flowid by hand for
>  each of the flows you are interested in.
>
>  3) connect flow tagging callback to the application trace source.
>
>  uint32_t flowid = yourmagicnumber;
>
>  Config::Connect ("/NodeList/XX/ApplicationList/XX/MyTraceSource",
>  MakeBoundCallback (&MyFlowTaggingFunction, flowid));
>
>  If this is felt like a generic-enough facility, it should be easy to add
>  the FlowIdTag class to src/node or src/common.
>
>  The code in src/contrib/delay-jitter-estimator.h|cc does something very
>  similar to what is shown here.
>
>  Mathieu
>
>

Seems straightforward enough.
Just to be sure:
1. The application writer will be responsible for creating a source
and invoking that source on every packet they send to the socket.
2. The application wrtier is also responsible for connecting their
source to whatever sinks I provide to tag the packets.

-Matt


More information about the Ns-developers mailing list