Bug 1524 - Fragmentation Threshold equals to Packet Size at MAC Layer (Data + IP + UDP) crash the reception
Fragmentation Threshold equals to Packet Size at MAC Layer (Data + IP + UDP) ...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
ns-3.15
PC Linux
: P5 normal
Assigned To: Nicola Baldo
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-06 13:46 UTC by Fabian Astudillo
Modified: 2012-12-05 14:48 UTC (History)
3 users (show)

See Also:


Attachments
WifiRemoteStationManager patch (1.05 KB, patch)
2012-11-06 13:46 UTC, Fabian Astudillo
Details | Diff
Modified patch for bug 1524 (fragmentation) (3.17 KB, patch)
2012-12-01 15:09 UTC, Daniel L.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Astudillo 2012-11-06 13:46:02 UTC
Created attachment 1462 [details]
WifiRemoteStationManager patch

Hello,

I do a little patch for wifi-remote-station-manager. The fragmentation does work when Packet Size (Data + IP + UDP) equals to Fragmentation Threshold. In fact, the implementation does not take into account that the maximum Fragment Size has to be the Fragmentation Threshold.

Example:

Packet Size (Data+IP+UDP) = 3000
Number of Fragments = 2
First Fragment Size S1= FragmentationThreshold(2346)
Second Fragment Size S2= 3000 % 2346 = 654

Thus, the first fragment packet has a size of FP1=(S1+26(WifiMacHeader)+4(WIFI_MAC_FCS_LENGTH)) 
and
the second fragment packet has a size of FP2=(S2+26(WifiMacHeader)+4(WIFI_MAC_FCS_LENGTH))

Like we can see FP1 > FragmentationThreshold

Now, what happens if Packet Size (Data+IP+UDP) = 2346
Number of Fragments = 2
(S1(2346)+26(WifiMacHeader)+4(WIFI_MAC_FCS_LENGTH)) and (S2(0)+26(WifiMacHeader)+4(WIFI_MAC_FCS_LENGTH))
Then, in the second segment is sent only the header. In fact, that breaks the fragmentation procedure and at application layer the client does not receive anything.
Comment 1 Daniel L. 2012-12-01 11:30:15 UTC
Hi Fabian,

I tested your patch and it worked fine for the case when packet size = Threshold. But it failed when packet size is smaller (I tried size = threshold - 1). Additional changes are needed to correctly create fragments from the packet.

Anyway, the fragmentation procedure is not working correctly. As you already mentioned that the final fragment size is still larger than the threshold. The other thing I noticed was that the length of each fragment can be an odd number, which is incorrect as the spec states that all fragments but the last shall have even length.
Comment 2 Daniel L. 2012-12-01 15:09:58 UTC
Created attachment 1480 [details]
Modified patch for bug 1524 (fragmentation)

Built on Fabian's patch. GetNFragments was modified so that it takes WifiMacHeader into account.

The final fragment size (MPDU) is now at most FragmentationThreshold.

This patch does _not_ addressed the issue of even length MPDU.
Comment 3 Daniel L. 2012-12-05 14:48:49 UTC
Fixed in changeset 9165:7b219a73b844