[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Disable ipv4 fragmentation



> > > I'm working with sockets in a debian with a version of kernel 2.6.x, and 
> > > I'd like to disable the fragmentation of the ipv4 introduce.
> > > I have read that there was the option of modified the file 
> > > /proc/sys/net/ipv4/ip_always_defrag but it doesn't exist.
> > > So I'm totally lost and I need to disable that fragmentation or change the 
> > > size to the maximum of 65535.
> > > Anyone can help me?
> > 
> > What do you expect the system to do with oversized packets instead of
> > fragmenting them?  Discard them?
> > 
> > Fragmentation is used any time a given packet is too large to fit inside a
> > single frame of the underlying transport, as determined by the network
> > interface's MTU.

On 25.04.07 11:00, Josselin Mouette wrote:
> Practically speaking, packets coming from a Linux host are never
> fragmented because Linux sets the DF bit. Which means, oversized packets
> are actually rejected so that the endpoint shortens its packet size to
> fit the smallest MTU on the whole path.

linux does not always set DF bit. It does this on first packet of an
connection. If DF bit is set, any router which finds out that the packet is
too big and should be fragmented sends back ICMP "fragmentation needed"
reply. Sending host then sends smaller packet which will pass further to the
destination or another router which needs to fragment it... This process is
calles 'path MTU discovery' and is designed to send packets with optimal
sizes that should not be fragmented. The process is repeated from time to
time to ansure that if path changes and bigger packets wil be allowed, they
would be used.

You can turn off this feature, but it has nothing to do with packets your
router is routing, only on packets it sends.

I don't see why someone would want to disable packets fragmentation, but I
think this requirement comes from wrong understanding of how network works.

> As a result, your packets are limited by the various MTU sizes. On
> Ethernet links, the MTU is set to 1500 by default but you can increase
> it (using the "mtu" keyword in /etc/network/interfaces) up to 9000 on
> most hardware, and 15000 with some rare hardware.

You are probably talking about gigabit ethernet. I don't think that classic
ethernet allows paccket bigger than 1500B (unless vlans are used, but such
packets are only ~8B bigger and it's just their header)

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Windows found: (R)emove, (E)rase, (D)elete



Reply to: