Re: Max Packet Size in Kernel

From: Kevin Buhr (buhr_at_telus.net)
Date: 03/12/04


Date: Fri, 12 Mar 2004 20:16:42 GMT

Kasper Dupont <kasperd@daimi.au.dk> writes:
>
> cjfoste@asu.edu wrote:
>>
>> I have the problem where I can only send packets with a MAX of 256
>> bytes in my network device driver.

This is very intriguing. Can you explain why you have this problem,
exactly? Do you mean that you're developing a driver for a network
whose packets are limited to 256 bytes, or do you mean something else?

> It is called mtu and is a field in struct net_device.
> I don't know the details about programing a network
> driver, but I can see many existing drivers just
> initialize this field to 1500. You probably just need
> to initialize it to 256. However the IP standard has
> a minimum requirement for the mtu which AFAIR is 512,
> so setting MTU to 256 might be a violation of IP.

You're pretty much right (except the minimum size you're thinking of
is 576 bytes---a 512-byte payload plus 64 bytes of header). Also, the
exact requirement is that all hosts must be prepared to accept a
datagram of up to 576 octets, but it can be fragmented. The official
minimum MTU is only 68 bytes.

If Christopher is developing a driver and wants to make sure it never
gets a packet from the kernel that's bigger than 256 bytes, he
should---as you say---set the driver's mtu to 256. He should also
implement a "change_mtu" callback that rejects user requests to change
the MTU to a value outside the range 68 to 256.

-- 
Kevin <buhr@telus.net>


Relevant Pages

  • Re: How to troubleshoot why ath0 cant connect to a passwordless wireless network?
    ... I asked similar question here before, somebody asked me to downgrade atheros driver to one particular lower version. ... You seem to say your network is open. ... It can be used to identify where packets are lost in the hierarchy. ... When in doubt c&p real output; describing a problem often causes useful info to be left out. ...
    (freebsd-hackers)
  • Re: MTU size and 802.1x authentication
    ... but please note that NDISUIO IS the protocol driver in this case. ... NDISUIO) to handle fragmenting the packets by looking at the MTU, ... NDISUIO is rejecting any tx packets that exceed that MTU. ...
    (microsoft.public.development.device.drivers)
  • Re: MTU size and 802.1x authentication
    ... But I would expect the protocol driver (not ... NDISUIO) to handle fragmenting the packets by looking at the MTU, ... NDISUIO is rejecting any tx packets that exceed that MTU. ... The EAP-TLS protocol has fragmentation login built into it. ...
    (microsoft.public.development.device.drivers)
  • Re: ADSL internet sharing problem
    ... > the new MTU value on the right network interface on PC B, ... > to the latest driver program from the manufacturer's web site. ... one thing i did notice was when in network connections and clicking status ...
    (microsoft.public.windowsxp.network_web)
  • RE: Question about SCP stalling over VPN
    ... always allowing Path-MTU discovery to work by allowing ICMP un-reachable (subtype fragmentation required) packets to flow freely from all points in your network and over the VPN. ... Note that you need to do one of these policies consistently on both sides of your network. ... anything relating to MTU or packet size in the configuration, ...
    (SSH)