Bug 2346

Summary: CompressionThreshold limit can be violated
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: sixlowpanAssignee: Tommaso Pecorella <tommaso.pecorella>
Status: RESOLVED FIXED    
Severity: minor CC: ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   

Description Tommaso Pecorella 2016-03-23 19:51:23 UTC
The CompressionThreshold parameter should be checked on the compressed packet, not on the original packet.

The intent of the parameter is to fix a minimum MAC payload, as some MAC types need a minimum payload size. E.g., ContikiMAC sets this to 16 bytes.
Obviously this limit should be smaller than the minimum IP packet (40 bytes).

The actual code checks the packet size *before* the compression, leading to a possible violation. As an example, the smallest IP packet (header only, 40 bytes) can be compressed to 6 bytes, which is smaller than the limit.

The solution is to check the packet *after* the compression.
Comment 1 Tommaso Pecorella 2016-03-24 15:55:58 UTC
pushed in changeset: 12071:a3c5fea29467