[Click] Packet alignment

Eddie Kohler ekohler at gmail.com
Wed Jul 31 14:05:58 EDT 2013


Another solution is of course to generate the correct amount of
headroom (say 48B) so that UDPIPEncap is naturally aligned!


On Wed, Jul 31, 2013 at 2:05 PM, Eddie Kohler <ekohler at gmail.com> wrote:
> (Not sure but:) Basically, if Click sees an element it doesn't
> understand, it assumes the element either doesn't generate packets, or
> that it generates packets with correct alignment requirements.
>
> Probably it would be better to default to "arbitrary alignment" rather
> than "correct alignment," but that might be difficult.
>
> Eddie
>
>
> On Wed, Jul 31, 2013 at 12:41 PM, Cliff Frey <clfrey at cisco.com> wrote:
>> You need to add your custom element to the "class_factory" function of
>> tools/click-align/click-align.cc to indicate the alignment of the packets
>> generated by your element.  Then click-align will add the necessary Align
>> elements for you.
>>
>> Cliff
>>
>>
>> On Tue, Jul 30, 2013 at 6:43 AM, Sascha Alexander Jopen <
>> jopen at informatik.uni-bonn.de> wrote:
>>
>>> Hey,
>>>
>>> I have a question regarding the click packet data alignment.
>>>
>>> I have an element which generates packets with 46 bytes of headroom
>>> followed by some data. The whole packet gets aligned in memory, but
>>> data() points to a memory section which is 2 bytes off the alignment on
>>> a 32bit machine. This packet will eventually be pushed into an
>>> UDPIPEncap element. On some architectures (where
>>> HAVE_INDIFFERENT_ALIGNMENT is not defined) a 4-byte alignment is
>>> expected (see line 94 udpipencap.cc). However, click-align does not
>>> insert an Align element on those architectures. If i do this manually,
>>> everything is fine. How can i make click-align insert the Align element?
>>>
>>> Thanks in advance,
>>> Sascha
>>>
>>> --
>>> Dipl.-Inform. Sascha Jopen
>>>
>>> University of Bonn                     Tel.:   +49-228-73-54219
>>> Institute of Computer Science 4        Fax:    +49-228-73-4571
>>> Friedrich-Ebert-Allee 144              E-mail: jopen at cs.uni-bonn.de
>>> D-53113 Bonn, Germany
>>> _______________________________________________
>>> click mailing list
>>> click at amsterdam.lcs.mit.edu
>>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>>
>> _______________________________________________
>> click mailing list
>> click at amsterdam.lcs.mit.edu
>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list