Fragmentation is a mechanism to split a big chunk into two or more small chunks. In WLAN, Max Frame size is 2346 bytes and they are typically fragmented at smaller frame (e.g, 1516 bytes).
Fragmentation is a trade. Smaller frames survive a noisy channel better, but every extra frame brings its own header and its own acknowledgement. Let's look at both sides, then at the fields that let the receiver rebuild the frame, and finally at how to choose the threshold.
- Why we need this kind of fragmentation ?
- Then wouldn't there be any downside - disadvantage - of the fragmentation ?
- How does the receiver put the fragments back together ?
- How should the fragmentation threshold be set ?
Why we need this kind of fragmentation ?
There can be many different reasons depending on situation. In WLAN, if the packet size is too big, it would increase the probablity of collision. So reducing the probability of collision can be a good motivation for fragmentation.
Collision is one reason, and bit errors are the other. A frame arrives intact only if every one of its bits arrives intact. With a bit error rate p, a frame of L bits survives with a probability of (1 - p)L. So the survival probability falls quickly as the frame grows. When a fragment is lost, the sender repeats only that fragment. Without fragmentation, the sender has to repeat the whole frame.
The table below puts numbers on this. It sends a 2304-byte payload as 1, 2, 4 or 8 fragments. Each fragment carries 28 bytes of overhead, the 24-byte MAC header and the 4-byte FCS. Each cell gives the expected number of bytes on the air until the whole payload is delivered, which is the fragment size divided by its survival probability, summed over the fragments. The model counts bytes only. It leaves out the ACK, the SIFS gaps and the PHY preamble, so it is kind to fragmentation.
Fragments |
Payload per fragment, bytes |
Expected bytes, BER 10-6 |
Expected bytes, BER 10-5 |
Expected bytes, BER 10-4 |
1 |
2304 |
2376 |
2810 |
15066 |
2 |
1152 |
2382 |
2594 |
6066 |
4 |
576 |
2428 |
2536 |
3917 |
8 |
288 |
2534 |
2593 |
3255 |
You can read three regimes from the table. On a clean channel with a BER of 10-6, one big frame is best, and every split only adds headers. At 10-5, a few fragments already win, and 4 fragments send about 10 percent fewer bytes than 1 frame. At 10-4, the unsplit frame survives only 15.5 percent of the time, and 8 fragments need about a fifth of the bytes. So fragmentation pays off only when the channel is poor.
A shorter frame survives more often : the survival probability is (1 - p)L, so it falls with every extra bit.A lost fragment costs less than a lost frame : only the lost fragment is sent again.The benefit depends on the channel : on a clean channel, fragmentation only adds overhead.
Then wouldn't there be any downside - disadvantage - of the fragmentation ?
There IS downside. As I explained in CSMA/CA, for each frame the device has to go through the process of collision avoidance which introduce a lot of overhead. Fragmentation increase the number of frames and increased number of frame cause increased overhead.
The cost per fragment is smaller than a whole new contention, though. The sender contends for the medium once, with DIFS and the random backoff of CSMA/CA. It then sends the fragments as a burst. Each fragment is followed by an ACK after SIFS, and the next fragment follows that ACK after another SIFS. Because SIFS is the shortest gap, no other station can take the medium in the middle of the burst.
The Duration field protects the burst as well. Each fragment and each ACK reserves the medium up to the end of the next fragment and its ACK, so other stations set their NAV that far ahead. The overhead that remains is per fragment: a MAC header, an FCS, a PHY preamble, an ACK and two SIFS gaps. If a fragment is lost, the sender has to contend again with a new backoff before it sends that fragment again.
One contention per burst : the fragments of one frame follow each other after SIFS, without a new backoff.Each fragment still costs a header and an ACK : this is the overhead that makes fragmentation a loss on a clean channel.A lost fragment breaks the burst : the sender goes back to backoff before it repeats that fragment.
How does the receiver put the fragments back together ?
The receiver needs to know three things: which fragments belong to the same frame, in what order they come, and which one is the last. The MAC header answers all three with fields that every data frame carries anyway.
The Sequence Control field holds a 12-bit sequence number and a 4-bit fragment number. All fragments of one frame share the same sequence number. The fragment number counts 0, 1, 2 and so on, and 4 bits allow at most 16 fragments per frame. The More Fragments bit in the Frame Control field is set in every fragment except the last one. So the receiver collects the fragments with the same sequence number in order, and it passes the frame up when a fragment arrives with More Fragments cleared. Wireshark shows these as wlan.seq, wlan.frag and wlan.fc.frag.
Only individually addressed frames are fragmented. A broadcast or multicast frame has no ACK, so the sender could not tell which fragment was lost, and it is always sent whole.
Same sequence number, increasing fragment number : this ties the fragments together and sets their order.More Fragments marks the end : the last fragment is the one with the bit cleared.Unicast only : fragmentation needs an ACK for each fragment.
How should the fragmentation threshold be set ?
The threshold is a size in bytes. A frame larger than the threshold is split, and a smaller frame is sent whole. Most access points ship with the threshold at 2346, the maximum frame size, which means that fragmentation is off.
In most case, user can configure the fragmentation size for an Access point by the AP configuration consol.
A lower value makes sense only when the table above says so: a channel with many retries, interference that hits long frames, or hidden stations that collide with long transmissions. Lower the threshold in steps, and watch the retry count and the throughput together. If the throughput falls while the retries stay the same, the channel was not the problem, and the threshold should go back up. The RTS threshold is a separate setting. It protects long frames against hidden stations with an RTS/CTS exchange, instead of splitting them.
Newer amendments reach the same goal in another way. With aggregation and Block Ack, the receiver acknowledges each MPDU inside the aggregate separately. So a lost MPDU is sent again alone, which gives the benefit of fragmentation without splitting the frame. 802.11ax adds dynamic fragmentation on top of this, but the plain threshold described here is still the setting you find in most AP consoles.
2346 means off : no frame is larger than the threshold, so nothing is split.Lower it only for a poor channel : check the retries and the throughput after each step.Block Ack does much of the same job : a lost MPDU in an aggregate is repeated alone.