|
Bugzilla – Full Text Bug Listing |
| Summary: | edca-txop-n fragmentation causes segfault | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Brian Swenson <bswenson3> |
| Component: | wifi | Assignee: | sebastien.deronne |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | nikkipui, ns-bugs, ruben, tomh |
| Priority: | P3 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
Example code
Prevent fragmentation of A-MSDU final patch |
||
Based on the example code, the sender (mac 01) constructed an A-MSDU and sent to (mac 03). The transmission failed and retransmission is needed. When Edca of (mac 01) got an access again, it tried to fragment the currentPacket that is already an A-MSDU. I think this is not a correct behavior (spec 9.11 "An A-MSDU shall be carried, without fragmentation, within a single QoS data MPDU.")
I think the problem is the line 407 of edca-txop-n.cc
if (NeedFragmentation () && ((m_currentHdr.IsQosData ()
&& !m_currentHdr.IsQosAmsdu ())
|| m_currentHdr.IsData ())...
Based on the above conditions, even if IsQosAmsdu is true (should not fragment), IsData is also true and all conditions for fragmentation are met. Edca then tries to fragment it.
I'm not sure what is the best solution, the line 407 can be changed to check for this condition or NeedFragmentation can check about IsQosAmsdu.
Created attachment 1508 [details]
Prevent fragmentation of A-MSDU
Changed the fragmentation conditions so that A-MSDU will not be fragmented.
*** Bug 1466 has been marked as a duplicate of this bug. *** Fixed 9715:90e0789f7951 Mirko pointed out that the condition should be changed:
I think here the main problem is about the name of function member "WifiMacHeader::IsData"…maybe it should return true if and only if the frame is a no-QoS data frame… However i think here we have two ways:
1: Change WifiMacHeader::IsData in order to return true only if type is data but QoS bit in the frame is 0;
2: Change the condition in something makes sense (like your condition without last check on m_currentHdr.IsQosAmsdu()):
if (NeedFragmentation () &&
((m_currentHdr.IsQosData () && !m_currentHdr.IsQosAmsdu ()) ||
(!m_currentHdr.IsQosData () && m_currentHdr.IsData ()))
I would go for the second solution to have less dependencies on what we have now. Created attachment 2489 [details]
final patch
Made patch with the proposed change
it's time to come asap to a conclusion for this bug final fix pushed in changeset 12186:af12f4529f31 |
Created attachment 1507 [details] Example code Originally reported in developers email list. When MaxAmsduSize is set larger than fragmentation size segmentation fault occurs. See attached code. Basically fragmentation occurs because of the size. Then EdcaTxopN::GotAck (double snr, WifiMode txMode) is called on the ack. It has an if condition: if (!NeedFragmentation () || IsLastFragment () || m_currentHdr.IsQosAmsdu ()) So when it crashes, NeedFragmentation is true, IsLastFragment is false, however IsQosAmsdu is true so that part of the code is executed. Line 592 sets m_currentPacket = 0; Shortly thereafter: EdcaTxopN::StartNext (void) is called which tries to get the next fragment. However since m_currentPacket is 0 it seg faults. To verify I commented out m_currentPacket = 0 and it no longer seg faults however I'm not sure if that is correct behavior.