May I use the packet annotation?

Eddie Kohler kohler at icir.org
Thu Jun 26 23:49:40 EDT 2003


Hi Jiangbo,

> In Eddie Kohler's Thesis, it is said that " Annotations are
> stored in the packet header in a fixed static order; there is
> currently no way to dynamically add a new kind of annotation"
> 
> Is this mean no one can use the packet annotation except the 
> click developers? I just want to make sure.

Well, sure, you can add a new annotation. See include/click/packet_anno.hh
for examples of how we refer to annotations. But you would want to make
sure that your annotaiton wouldn't conflict with annotations used by other
elements you cared about. For example, the AGGREGATE and FWD_RATE annos use
the same 4 bytes of anno space, because we decided that IPRateMonitor
(which uses FWD_RATE) is unlikely to run at the same time as trace
processing elements (which use AGGREGATE).

I agree that annotations are sometimes very useful, but you can get a long
way with just a few of them (like AGGREGATE, for example).

> We may add another information element, called AnnoInfo. And let
> this element manage the freely avaliable annotations.
> 
> for example:
> Annoinfo(myanno1,2)  // I need a 2 bytes annotation.
> Annoinfo(myanno2,2)
> 
> ...->MyElt1(myanno1)->MyElt2(myanno2)->MyElt3(myanno1)->MyElt4(myanno2)->...
> In this case myanno1 and myanno2 should use the different 2 bytes
>  in the packet annotation.
> 
> ...->MyElt1(myanno1)->MyElt2(myanno1)->MyElt3(myanno2)->MyElt4(myanno2)->...
> In this case myanno1 and myanno2 may use the same 2 bytes.

... as long as there is no "myanno1" user in the "..."s.

> Is this doable? Acctually this may increase the difficulty of writing a 
> router configuration. 

I like this idea! Have you implemented it? 

An alternate way of thinking about this would be to build a tool, like
click-align, that would calculate which annotations are in use and do the
assignment. Then the user wouldn't have to name things explicitly. Have
each element refer to statically-named annotations; the tool knows which
elements care about which annotations. Then the tool would do the
annotation assignment, and add an AnnoInfo() element to the configuration
with an assignment of annotations to bytes. The tool could take into
account the existing static annotations, and report conflicts. I would do
it this way. Happy to provide advice.

Eddie




More information about the click mailing list