[Ns-developers] ns-3::Buffer and bit-sized fields, is this crap possible ?

Tommaso Pecorella tpecorella at mac.com
Sun Nov 13 05:20:30 PST 2011


Hi all,

I am rewriting my 6LoWPAN stack so to submit for review, and I found a little issue. Nothing to die for, but still...

Excerpt from RFC4944:
      Traffic Class and Flow Label (bit 4):
         0: not compressed; full 8 bits for Traffic Class and 20 bits
            for Flow Label are sent
         1: Traffic Class and Flow Label are zero

Geeez, 20 bits ? How the hell do I serialize / deserialize 20 bits ? I don't, simple.

For 6LoWPAN is not a big issue, a good 'ol assert will do, I'm not supporting that case. On the other hand it might happen to have to support it, maybe for other obscure and ultra-compressed protocols. Please note that the above clause means that the 6LoWPAN HC1 header might have a length that is not byte aligned, so I can't recover the alignment with the following fields like, for example, happens in the standard IPv6 header.
I know it's totally insane to have a packet with non-byte boundaries, but still.

Now, the question is: shall we think to a way to support this without killing the Buffer implementation and its performance ?

Cheers,

Tommaso


--------------------------------------------------------------

$25: for you a pizza and some beers with friends, for someone 
     might change their lives. Think about it.

Kiva.org - Loans That Change Lives

--------------------------------------------------------------

Tommaso Pecorella - Ph.D.

Assistant professor
Dpt. Elettronica e Telecomunicazioni
Università di Firenze

CNIT - Università di Firenze Unit

via di S. Marta 3
50139, Firenze
ITALY

email: tommaso.pecorella at unifi.it
       tommaso.pecorella at cnit.it

phone : +39-055-4796412
mobile: +39-320-4379803
fax   : +39-055-494569








More information about the Ns-developers mailing list