[comp.unix.ultrix] Changing ethernet and IP parameters

fnddr@acad3.alaska.edu (Rice Don D) (01/29/91)

In trying to work around a router problem, I need to change the default
networking parameters on this end (Ultrix 4.0, DS5000).  Unfortunately, it
looks like the only way to change any of these is by fooling with the
kernel configuration and building a new kernel.  Is there a better way to
modify packet lengths, window sizes, etc?

What I'm trying to do right now is reduce the MTU from 1500 to 576.  I've
located ETHERMTU in /sys/net/inet/if_ether.h and in /sys/io/netif/if_ether.h.
I changed its value from 1500 to 576 in both files, did "make clean", "make
depend", and "make" as per TFM, and booted from the new kernel, but netstat
and pfstat say that MTU is still 1500.  What else needs to be changed?

Thanks, 
Don Rice                                  Internet: ddr@flux.gi.alaska.edu
Geophysical Institute                     E-mail:   fnddr@alaska.bitnet
University of Alaska                      Phone:    (907) 474-7569
Fairbanks, AK 99775                       Loran:    64.86N 212.16E

mogul@wrl.dec.com (Jeffrey Mogul) (01/30/91)

In article <1991Jan29.030221.494@ims.alaska.edu> fnddr@acad3.alaska.edu writes:
>In trying to work around a router problem, I need to change the default
>networking parameters on this end (Ultrix 4.0, DS5000).  Unfortunately, it
>looks like the only way to change any of these is by fooling with the
>kernel configuration and building a new kernel.  Is there a better way to
>modify packet lengths, window sizes, etc?
>
>What I'm trying to do right now is reduce the MTU from 1500 to 576.  I've
>located ETHERMTU in /sys/net/inet/if_ether.h and in /sys/io/netif/if_ether.h.
>I changed its value from 1500 to 576 in both files, did "make clean", "make
>depend", and "make" as per TFM, and booted from the new kernel, but netstat
>and pfstat say that MTU is still 1500.  What else needs to be changed?

What you are trying to do with ETHERMTU cannot be done without kernel
sources.  Since you're at an educational site, this might not be too
expensive for you, but I assume that if you already had sources you
wouldn't have asked the question.  (If you do have a complete set of
sources, then your problem is probably pilot error and I can assist you
without bothering the rest of the group.)

It should be possible to write a program that grovels in /dev/kmem,
finds the appropriate interface structure pointer ("struct ifnet *"),
and modifies the if_mtu field.  You can do this without kernel sources,
if you know what you are doing.  It would have to be run after each
reboot, of course.  And, of course, as an employee of Digital I could
hardly guarantee that this would be safe!

Since you mention /etc/pfstat, if you are indeed using the packet filter
and you care about the value of the end_MTU field being right, then
your kmem-hacking program will have more work to do.

However, perhaps your problem could be solved in a less drastic way.
There are basically two kinds of IP protocols often send large (MTU-sized)
packets: TCP and NFS.  The TCP code in the kernel is supposed to use
an MSS of 576-something if the other host is "non-local".  Normally,
this means "not on the same subnet", but there is a kernel global variable
named "subnetsarelocal" that, if set, means "subnets of the same IP
network are to be considered local."  If you patch this value to 0,
I think (but I'm not sure) that TCP will never send a datagram larger
than 576 bytes across a gateway.

NFS, by default, tries to send 8kbyte UDP packets.  These, of course,
won't fit ETHERMTU, so the IP protocol fragments the packets into
ETHERMTU-sized chunks.  I'm famous for complaining about fragmentation,
but for now I'll keep quiet about this, except to point out that since
people have been burned by this behaviour, NFS can be told to use
smaller read and write buffer sizes.  See "man 8nfs mount"; the options
are "rsize" and "wsize".  I'm not sure if there is an absolute minimum
size for these, below which things stop working ... but if there is,
you'll probably learn soon enough.

-Jeff