[Click] Re: May I use the packet annotation?

Jiangbo Li jiangbo at netlab.uky.edu
Tue Jul 1 00:19:06 EDT 2003


hi,Eddie,
 
> > 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).

I am developing an elements package. These elements will be placed at both
the beginning and the end of the packet traveling path. So I need a
annotation which will not be used by other elements.

I looked through the packet_anno.hh, It seems that the 2nd byte was not
used by any other elements. But, I am afraid that this byte will be used
by other element in the future. That's why I need a dynamical way to use
the annotation.

> > 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? 

Not yet. I still have some questions on how to implement an information
element.  I read the code of AddressInfo. The construction method of this 
element has the following format,
      AddressInfo::AddressInfo(): _map(-1)
what does ":_map(-1)" mean? Does it mean AddressInfo will only have one 
instance.


> 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.

I think what you said is a better solution.
 
Thank you very much.

Jiangbo



More information about the click mailing list