Bug 2361 - packet tag buffer size recently increased
packet tag buffer size recently increased
Status: RESOLVED DUPLICATE of bug 2221
Product: ns-3
Classification: Unclassified
Component: network
unspecified
All All
: P5 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-31 17:04 EDT by Tom Henderson
Modified: 2016-04-01 09:23 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2016-03-31 17:04:02 EDT
To accommodate wifi, Sebastien recently bumped the size of the tag buffer by one byte:

diff -r fc5b7dc0a98b src/network/model/packet-tag-list.h
--- a/src/network/model/packet-tag-list.h	Fri Sep 04 22:18:00 2015 +0200
+++ b/src/network/model/packet-tag-list.h	Thu Mar 31 13:59:55 2016 -0700
@@ -158,7 +158,7 @@
      */
     enum TagData_e
     {
-      MAX_SIZE = 20           /**< Size of serialization buffer #data */
+      MAX_SIZE = 21           /**< Size of serialization buffer #data */
   };
 
     uint8_t data[MAX_SIZE];   /**< Serialization buffer */


---

at least, the documentation is out of sync with this, so at a minimum it should be updated, but in discussions on bug 2308, questions were raised as to what was a reasonable value.

There is this code comment:

     * \internal
     * Ideally, TagData would be 32 bytes in size, so they require
     * no padding on 64-bit architectures.  (The architecture
     * affects the size because of the \c #next pointer.)
     * This would leave 18 bytes for \c #data.  However,
     * ns3:Ipv6PacketInfoTag needs 19 bytes!  The current
     * implementation allows 20 bytes, which gives TagData
     * a size of 30 bytes on 32-byte machines (which gets
     * padded with 2 bytes), and 34 bytes on 64-bit machines, which
     * gets padded to 40 bytes.

What is the implication of 21 or 22 byte limits on these two different architectures?

Or should we instead change the implementation according to Alex's proposal in bug 1383, and remove these limits?
Comment 1 Tom Henderson 2016-04-01 09:23:56 EDT
I forgot that I filed bug 2221 on this last year.

*** This bug has been marked as a duplicate of bug 2221 ***