Bug 2136 - The usage of tid in wifi and wave module shall be "if (tid > 7)" rather than "if (tid >= 7)"
The usage of tid in wifi and wave module shall be "if (tid > 7)" rather than ...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
ns-3-dev
PC Linux
: P5 minor
Assigned To: sebastien.deronne
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-07 08:40 UTC by Junling Bu
Modified: 2015-06-07 10:46 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Junling Bu 2015-06-07 08:40:38 UTC
Hi,

In adhoc-wifi-mac.cc, ap-wifi-mac.cc, sta-wifi-mac.cc of wifi moudle and ocb-wifi-mac.cc of wave moudule, there is a method called "Enqueue".
Its implementation has a part about tid:

       // Fill in the QoS control field in the MAC header
      tid = QosUtilsGetTidForPacket (packet);
      // Any value greater than 7 is invalid and likely indicates that
      // the packet had no QoS tag, so we revert to zero, which'll
      // mean that AC_BE is used.
      if (tid >= 7)
        {
          tid = 0;
        }
      hdr.SetQosTid (tid);

Here if tid is greater than 7, then tid will be assigned default valud 0.
However I think we should use "if (tid > 7)" rather than "if (tid >= 7)".
Because if tid from a packet is 7, the correspnding AcIndex is AC_VO.
If tid is chaned to 0 by original code there, the correspnding AcIndex is AC_BE.
So imaging that, there is a packet which is important and wants to use AC_VO MAC queue, but is wrongly inserted into AC_VO MAC queue :(

I found this issue in the old ns-3 version, but seems still there in current devel version.
I still use an old ns-3 version thus I have not created the patch.
Hope the maintainer can review this issue and complete the patch.

Thanks.

Junling
Comment 1 sebastien.deronne 2015-06-07 08:44:12 UTC
Thanks for reporting, I will have a check.
In which version have you noticed the issue?
Comment 2 sebastien.deronne 2015-06-07 09:08:47 UTC
I confirm the bug still exists in ns-3-dev.
It should indeed be greater than 7 and not equal and greater.

Since it is an obvious fix, I will commit it asap, I do not think there is much comments to bring on this.
Comment 3 sebastien.deronne 2015-06-07 10:46:43 UTC
fixed in changeset 11426:e2441f5f2c55