Bug 2156 - Duplicate packets when using two level aggregation
Duplicate packets when using two level aggregation
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
ns-3-dev
All All
: P3 major
Assigned To: sebastien.deronne
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-11 09:43 UTC by Hany
Modified: 2015-07-23 15:58 UTC (History)
1 user (show)

See Also:


Attachments
Bug Files (1.89 KB, application/gzip)
2015-07-11 09:46 UTC, Hany
Details
new fix (1.45 KB, patch)
2015-07-22 15:45 UTC, sebastien.deronne
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hany 2015-07-11 09:43:11 UTC
When using two level aggregation, the sender does not remove the packets that he has peeked to insert in the second MPDU Sub-frame and later MSDU Sub-frames. So due to this issue, duplicate packets are transmitted and injected in MPDU sub-frames. To check this problem, I modified the OnOffApplication to include an increasing integer as payload instead of dummy zeros payload. In the PCAP file you can. In the second MPDU Sub-frame you can compare the payload of the first and second MSDU Sub-frames which will be exactly the same.

Please find the following attached file which inlcudes:

1. PCAP capture file which includes the bug.

2. Patch file (applications.patch) to verify this problem (It includes the extension of OnOffApplication)
Run simple-two-level-aggregation example with the following parameters and enable pcap generation:
./waf --run "simple-two-level-aggregation --nMsdus=5 --nMpdus=5"

3. Patch file (wifi.patch) which contains the fix to this problem. It includes a fix to mac-low file.

These files were generated using latest ns3-dev available now.
Comment 1 Hany 2015-07-11 09:46:25 UTC
Created attachment 2093 [details]
Bug Files
Comment 2 sebastien.deronne 2015-07-19 14:11:52 UTC
I actually do not see any duplicates in the traces.
Checking back the code, it seems ok, we correctly call the remove function once a packet has been successfully added to the A-MSDU.
Furthermore, your fix may result in removed packets because we reached maximum allowed size for the current transmission, which is not correct.
Comment 3 Hany 2015-07-19 17:32:44 UTC
Hi Sebastien,

Check my attached trace. You can see the duplication in Packet No. 2 in the first A-MSDU Subframe and second subframe. The payload is exactly the same. This is because we were not removing the packets once they were added to A-MSDU. The problem appears in two level aggregation only.
Comment 4 Hany 2015-07-19 17:39:18 UTC
The first packet in the two level aggregation does not have this problem. The problem appears in the second packet i.e. A-MPDU Subframe to the last one. They all have the first and the seconds packets duplicated. Without my patch. The receiver always receive duplicate packets. Try to run the two level aggregation example using high PHY data rate e.g. OFDM 150 Mbps with channel bonding.
Comment 5 sebastien.deronne 2015-07-20 05:51:12 UTC
Right, I see now indeed that it does not occur in the first MPDU, but only from MPDU 2 till the last one. Issue is thus related to MacLow::PerformMsduAggregation.

But I do not think your changes are ok, they may still remove packets just because we reached the maximum size for the A-MPDU. I will have a deeper look at what is going wrong in the coming days.
Comment 6 sebastien.deronne 2015-07-22 15:13:54 UTC
I found the root cause of the bug in the code, and I confirm the fix is not correct: it dequeues the packet without having any clue whether aggregation will be successful or not.

I am investigating how to properly fix it.
Comment 7 sebastien.deronne 2015-07-22 15:45:01 UTC
Created attachment 2099 [details]
new fix

I made a fix for this bug.

It indeeds relies on the dequeue function (before the first MSDU aggregation is performed, it can thus be done in the PerformMsduAggregation itself).
If the MSDU aggregation failed, then the packet needs to be restored in front of the queue.

Since the fix is quite obvious and the issue is an important one, I will not wait too long before delivering it.
Comment 8 sebastien.deronne 2015-07-23 14:31:25 UTC
Hany confirmed by mail that the patch is successfully working.
Comment 9 sebastien.deronne 2015-07-23 15:58:11 UTC
fixed in changeset 11535:e9812cb35cef