Skip to contentSkip to conversation

softmac mtu

DISCUSSION Matthieu CASTET 10 participants 19 messages Sep 23, 2006 – Sep 28, 2006 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

why softmac (and maybe device using linux 80211 stack) can't increase their mtu above 1500 ?

IRRC 802.11 allow to send bigger frame. Moreover some driver like airo allow to use mtu biger than 2000.

thanks,

Matthieu

#1 lore raw
Quoted 7 lines · Matthieu CASTET

Hi,

why softmac (and maybe device using linux 80211 stack) can't increase their mtu above 1500 ?

IRRC 802.11 allow to send bigger frame. Moreover some driver like airo allow to use mtu biger than 2000.

The maximum value for MTU is set in include/linux/if_ether.h for all ethernet-type communications, not in softmac or ieee80211. I doubt that one could easily change the number. It may be that the 802.11 standard allows bigger frames, but it looks to me as if Linux does not.

Larry

maintainer
#2 lore raw

From: Larry Finger <[email protected]>
Date: Sat, 23 Sep 2006 16:40:15 -0500

Quoted 5 lines

The maximum value for MTU is set in include/linux/if_ether.h for all ethernet-type communications, not in softmac or ieee80211. I doubt that one could easily change the number. It may be that the 802.11 standard allows bigger frames, but it looks to me as if Linux does not.

Not correct. Linux is perfectly fine with setting 9000 byte MTU on ethernet devices that support it, and in fact just about every gigabit ethernet driver supports it.

That macro you see in if_ether.h is just the value of the base MTU limit, so larger MTU settings are easily allowable on a per-device basis.

#3 lore raw
Quoted 10 lines · David Miller

From: Larry Finger <[email protected]>
Date: Sat, 23 Sep 2006 16:40:15 -0500

Quoted 5 lines

The maximum value for MTU is set in include/linux/if_ether.h for all ethernet-type communications, not in softmac or ieee80211. I doubt that one could easily change the number. It may be that the 802.11 standard allows bigger frames, but it looks to me as if Linux does not.

Quoted 7 lines

Not correct. Linux is perfectly fine with setting 9000 byte MTU on ethernet devices that support it, and in fact just about every gigabit ethernet driver supports it.

That macro you see in if_ether.h is just the value of the base MTU limit, so larger MTU settings are easily allowable on a per-device basis.

Where/how does the device allow it? When I tried 'ifconfig eth0 mtu 2000' on my VIA Technologies, Inc. VT6102 [Rhine-II] wired controller, I got a 'SIOCSIFMTU: Invalid argument' message, which is the same message I get on my BCM4306 wireless card.

Larry

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 20 lines · Arnaldo Carvalho de Melo
Quoted 19 lines · Larry Finger
Quoted 17 lines · David Miller

From: Larry Finger <[email protected]>
Date: Sat, 23 Sep 2006 16:40:15 -0500

Quoted 5 lines

The maximum value for MTU is set in include/linux/if_ether.h for all ethernet-type communications, not in softmac or ieee80211. I doubt that one could easily change the number. It may be that the 802.11 standard allows bigger frames, but it looks to me as if Linux does not.

Not correct. Linux is perfectly fine with setting 9000 byte MTU on ethernet devices that support it, and in fact just about every gigabit ethernet driver supports it.

That macro you see in if_ether.h is just the value of the base MTU limit, so larger MTU settings are easily allowable on a per-device basis.

Quoted 6 lines
Quoted 3 lines

Where/how does the device allow it? When I tried 'ifconfig eth0 mtu 2000' on my VIA Technologies, Inc. VT6102 [Rhine-II] wired controller, I got a 'SIOCSIFMTU: Invalid argument' message, which is the same message I get on my BCM4306 wireless card.

David didn't said 1500 all the way to 9000, he said that some drivers support 9000, some don't, lemme check for ya which one does...

drivers/net/8139cp.c: max is 4096
drivers/net/acenic.c: 9000

just do a:

vi $(find drivers/net | xargs grep -l change_mtu)

and check the rest :-)

- Arnaldo

maintainer
#6 lore raw
In reply to Larry Finger

From: Larry Finger <[email protected]>
Date: Sat, 23 Sep 2006 16:59:48 -0500

Quoted 4 lines

Where/how does the device allow it? When I tried 'ifconfig eth0 mtu 2000' on my VIA Technologies, Inc. VT6102 [Rhine-II] wired controller, I got a 'SIOCSIFMTU: Invalid argument' message, which is the same message I get on my BCM4306 wireless card.

It allows it in the device specific ->change_mtu() method. Tigon3, for example, overrides this with it's own function called tg3_change_mtu() which checks if the particular model of the chip supports jumbo MTU and if so allows such a setting.

The VIA driver simply doesn't override that function, and uses the default ethernet one because either that ethernet chip doesn't support the larger MTU or the author simply hasn't gotten around to implementing the override.

#7 lore raw
In reply to Matthieu CASTET

So why a special mtu handler is not implemented in 802.11 stack :
- 802.11 stack doesn't support bigger packet
- 802.11 stack doesn't support very bigger packet (with 802.11 fragmentation)
- 802.11 writers were lazy

Matthieu

#8 lore raw
Quoted 5 lines · Matthieu CASTET

So why a special mtu handler is not implemented in 802.11 stack :
- 802.11 stack doesn't support bigger packet
- 802.11 stack doesn't support very bigger packet (with 802.11 fragmentation)
- 802.11 writers were lazy

I suspect the latter...patches welcome! :-)

Signature · 2 lines
John W. Linville
[email protected]
#9 lore raw
Quoted 8 lines · John W. Linville
Quoted 5 lines · Matthieu CASTET

So why a special mtu handler is not implemented in 802.11 stack :
- 802.11 stack doesn't support bigger packet
- 802.11 stack doesn't support very bigger packet (with 802.11 fragmentation)
- 802.11 writers were lazy

I suspect the latter...patches welcome! :-)

d80211 supports larger MTU.

Jiri

Signature · 2 lines
Jiri Benc
SUSE Labs
#10 lore raw

Hi,

Selon Jiri Benc <[email protected]>:

Quoted 8 lines · John W. Linville
Quoted 7 lines · Matthieu CASTET
Quoted 5 lines

So why a special mtu handler is not implemented in 802.11 stack :
- 802.11 stack doesn't support bigger packet
- 802.11 stack doesn't support very bigger packet (with 802.11 fragmentation)
- 802.11 writers were lazy

Quoted 4 lines
Quoted 1 line

I suspect the latter...patches welcome! :-)

d80211 supports larger MTU.

I have a patch for 802.11 linux stack.
It works for mtu like 2000 but if the packet is fragmented (with mtu = 3000 for example) my usb dongle (zd1211) crash (doesn't work anymore until I replug it). I need to investigate a bit.

Also I wonder what should be the max mtu.

Matthieu

#11 lore raw
Quoted 1 line · On Wed, 2006-09-27 at 15:57 +0200, [email protected] wrote:

Also I wonder what should be the max mtu.

2304, I think, as that's
synonym sMaxMsduLng Integer = 2304; /* max octets in an MSDU */

But maybe I'm interpreting the spec wrongly?

johannes

#12 lore raw
Quoted 9 lines · Johannes Berg
Quoted 1 line · On Wed, 2006-09-27 at 15:57 +0200, [email protected] wrote:

Also I wonder what should be the max mtu.

2304, I think, as that's
synonym sMaxMsduLng Integer = 2304; /* max octets in an MSDU */

Yes but if it is bigger the frame get framented at the 802.11 layer : in theory we could put mtu (IP max packet size) a big as we want [1]. Also if I understand it correctly if encryption is used there is less space for IP data ?

If people want to play with it, I attach the current version of my (trivial) patch.

Matthieu

[1]
if mtu > 2304, (struct ieee80211_txb*)->nr_frags is bigger than one ;)

net/ieee80211/ieee80211_module.c +9 -0
Index: linux/net/ieee80211/ieee80211_module.c
===================================================================
@@ -118,6 +118,14 @@
 			      &ieee->network_free_list);
 }
 
+static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
+{
+	if ((new_mtu < 68) || (new_mtu > 2400))
+		return -EINVAL;
+	dev->mtu = new_mtu;
+	return 0;
+}
+
 struct net_device *alloc_ieee80211(int sizeof_priv)
 {
 	struct ieee80211_device *ieee;
@@ -133,6 +141,7 @@
 	}
 	ieee = netdev_priv(dev);
 	dev->hard_start_xmit = ieee80211_xmit;
+	dev->change_mtu = ieee80211_change_mtu;
 
 	ieee->dev = dev;
 
#13 lore raw
Quoted 6 lines · matthieu castet
Quoted 3 lines

2304, I think, as that's
synonym sMaxMsduLng Integer = 2304; /* max octets in an MSDU */

Yes but if it is bigger the frame get framented at the 802.11 layer : in theory we could put mtu (IP max packet size) a big as we want [1].

No, you're confusing MPDU and MSDU. Or I am :) Please try to read the spec as well.

johannes

#14 lore raw
Quoted 7 lines · Johannes Berg
Quoted 4 lines · matthieu castet
Quoted 3 lines

2304, I think, as that's
synonym sMaxMsduLng Integer = 2304; /* max octets in an MSDU */

Quoted 6 lines
Quoted 1 line

Yes but if it is bigger the frame get framented at the 802.11 layer : in theory we could put mtu (IP max packet size) a big as we want [1].

No, you're confusing MPDU and MSDU. Or I am :) Please try to read the spec as well.

Right,

Thanks for the clarification.

Matthieu

#15 lore raw
In reply to Johannes Berg
Quoted 8 lines · Johannes Berg
Quoted 1 line · On Wed, 2006-09-27 at 15:57 +0200, [email protected] wrote:

Also I wonder what should be the max mtu.

2304, I think, as that's
synonym sMaxMsduLng Integer = 2304; /* max octets in an MSDU */

But maybe I'm interpreting the spec wrongly?

Yes, I think so. ;)

I am pretty sure this is the maximum _fragment_ size. But each packet (which max size is defined by the MTU) can be fragmented. I don't know if there's a limit on the max number of frags.

Signature · 1 line
Greetings Michael.
#16 lore raw
Quoted 7 lines · Michael Buesch
Quoted 6 lines · Johannes Berg
Quoted 1 line · On Wed, 2006-09-27 at 15:57 +0200, [email protected] wrote:

Also I wonder what should be the max mtu.

2304, I think, as that's
synonym sMaxMsduLng Integer = 2304; /* max octets in an MSDU */

Quoted 8 lines
Quoted 1 line

But maybe I'm interpreting the spec wrongly?

Yes, I think so. ;)

I am pretty sure this is the maximum _fragment_ size. But each packet (which max size is defined by the MTU) can be fragmented. I don't know if there's a limit on the max number of frags.

No it's not. How about reading the standard.. ;-) Take a look at how MSDU and MPDU are defined.. MSDU can be fragmented into smaller MPDUs, but the limit here is indeed for MSDU, not MPDU. In other words, fragmentation in IEEE 802.11 is different from fragmentation in IP and it is also used for different purpose.

Signature · 1 line
Jouni Malinen                                            PGP id EFC895FA
#17 lore raw
In reply to Michael Buesch
Quoted 1 line · Michael Buesch

I am pretty sure this is the maximum _fragment_ size.

But then why does it talk of MPDU and MSDU?

from 802.11:

synonym sMaxMsduLng Integer = 2304; /* max octets in an MSDU */

synonym sMaxMpduLng Integer = /* max octets in an MPDU */
(sMaxMsduLng + sMacHdrLng + sWdsAddLng + sWepAddLng + sCrcLng);

synonym sMinFragLng Integer = 256; /* min value for aMpduMaxLength */
synonym sMaxFragNum Integer = /* maximum fragment number */
(sMaxMsduLng / (sMinFragLng - sMacHdrLng - sCrcLng));

The last calculation implies that each frame can only be up to sMaxMsduLng octets long even when fragmented.

also cf. 9.1.4:

9.1.4 Fragmentation/defragmentation overview

The process of partitioning a MAC service data unit (MSDU) or a MAC management protocol data unit (MMPDU) into smaller MAC level frames, MAC protocol data units (MPDUs), is called fragmentation. Fragmentation creates MPDUs smaller than the original MSDU or MMPDU length to increase reliability, by increasing the probability of successful transmission of the MSDU or MMPDU in cases where channel characteristics limit reception reliability for longer frames.

IOW, I read it as an MSDU is the data that is supposed to be transmitted over the link and that can be at most 2304 bytes long, and then it may be fragmented or not and is then copied into (an) MPDU(s).

Quoted 3 lines

But each packet (which max size is defined by the MTU) can be fragmented. I don't know if there's a limit on the max number of frags.

There's only a 4 bit fragment counter ;) However, see above.

johannes

#18 lore raw
Quoted 5 lines · Johannes Berg
Quoted 1 line · Michael Buesch

I am pretty sure this is the maximum _fragment_ size.

But then why does it talk of MPDU and MSDU?

Maybe because your understanding is closer to what the standard says.. ;-)

Quoted 3 lines

IOW, I read it as an MSDU is the data that is supposed to be transmitted over the link and that can be at most 2304 bytes long, and then it may be fragmented or not and is then copied into (an) MPDU(s).

Yes.

Quoted 5 lines
Quoted 3 lines

But each packet (which max size is defined by the MTU) can be fragmented. I don't know if there's a limit on the max number of frags.

There's only a 4 bit fragment counter ;) However, see above.

And 4 bits is quite enough for sending the maximum number of fragments which is currently about 10 (256 octet min frag len and 2304 max MSDU len with some extra needed to cover the extra header in each fragment).

Signature · 1 line
Jouni Malinen                                            PGP id EFC895FA
#19 lore raw
In reply to [email protected]
Quoted 4 lines · [email protected] wrote:

I have a patch for 802.11 linux stack.
It works for mtu like 2000 but if the packet is fragmented (with mtu = 3000 for example) my usb dongle (zd1211) crash (doesn't work anymore until I replug it). I need to investigate a bit.

zd1211rw requires explicit support for large frames due to the USB protocol in use. This is supported by the vendor driver but not zd1211rw just yet.

Daniel