[Ns-developers] [ns3] byte-level tags

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Tue May 6 07:54:09 PDT 2008


hi tom,

On Tue, 2008-05-06 at 06:05 +0000, Tom Henderson wrote:

> We could decide to either tag packets or bytes.  Just based on the
> current API naming alone, I would expect that a packet tagging
> facility would tag the packet, and as the packet evolved (headers
> added and removed) the tag would persist, until removed.  If the
> packet were fragmented, then the tags could either be copied to each
> fragment or not, depending on policy.  If two packets were grafted
> together, and they had conflicting tags of the same type, there could
> be some policy decision (such as take the first one) on how to handle
> it.

Yes. What is annoying with such a scheme is that you have to define an
arbitrary policy to handle these cases and, so far, I have been unable
to come up with a policy which would satisfy all the use-cases we could
throw at it.

> Your proposal instead tags bytes but kind of keeps the initial
> appearance at the API (at least, as presently documented) that it is
> tagging packets.  Maybe it could be clearer in that regard, somehow.

I tried to come up with a couple of different method names to better
outline this but none of these felt much better than what we have now. I
suspect that the issue here is documentation so, we need to carefully
update the Packet documentation to outline the way tags work.

> I think your approach is consistent with your philosophy of not
> implementing policy in the core (in this case, the policy of which tag
> to keep when they conflict in a spliced packet) but delegating the
> policy to the user.  Your proposed API provides a function to just get
> the first matching tag but also allows the user wanting to see the
> exact byte ranges for tags to use the TagIterator, so I think it still
> supports the use case where the user wants to think about these in
> terms of having packet granularity, as sketched out above.

Yes. The crux of the issue is that there are cases where you want to tag
bytes and others where you want to tag packets. 

> I would be fine with either possible solution (tagged bytes, as you
> have now, or packets).

I think that the biggest advantage to tagging bytes under the hood is
that it defines very precisely what happens to tags when you copy a
packet, fragment it, and re-assemble it.

regards,
Mathieu



More information about the Ns-developers mailing list