Subject: UDP packet sizes.
To: None <netbsd-help@NetBSD.ORG>
From: His Highness, Lord Lund. <lundman@cranberry.co.uk>
List: netbsd-help
Date: 12/16/1996 16:18:32
i386/NetBSD-1.2/P-120/64M/ep0-UTP/wd[123]


Ok, here the problem:

I've got 3 machine involved, 2 running Win95 (HostA and HostB) and a 3rd
running NetBSD (HostC).

Now, if I start a Quake server on HostA, and connect with a Quake client 
on HostB using UDP protocol all is well. The game plays fine.

But some of the packets that the Quake server sends on HostA are rather 
large (I'm unsure quite how large tho). if I run tcpdump on HostC these 
large packets are listed as 1032 bytes. If I run a similar tcpdump 
program on one of the Win95 machine, or yet another Win05 machine, these 
large packets show up as 1074 bytes (and there is more data in them, not 
just header inclusion).

I went and wrote a simple UDP relay program on HostC which takes packets 
from HostA and sends them to HostB and vice verse. However, with the 
large packets again, I can only receive 1032bytes. (They are in ascii so 
its easy to see they are truncated, and the Win95 tcpdump displays more 
as well).


My program is a simple select() / recvfrom() / sendto() program, all 
calls try to use buffer size of 2048.


So, to try to retrieve more of the packets I've tried:

- Calling subsequent calls to recvfrom() but this just blocks, until the 
server retransmits the large packets, and again I only get 1032.

- Setting the buffer sizes on my socket using setsockopt( SO_SNDBUF, 
SO_RCVBUF to 2048, this didn't make any difference either.

- Also tried, in desperation I suppose, to set low water marks, no 
difference.

- Checked MTU size on the ethernet device (ep0) and it's set to 1500.

- Tried receiving packets with small buffers, I get a total of 1032 bytes.


I've started looking through the kernel source in hopes of possibly find 
where it makes the decision to truncate the large packets to see what I'm 
meant to do in my program , or if that is not possible, to increase it 
for my own uses.

While I was poking around, I noticed that the getsockopt call with 
SO_SNDBUF/SO_RCVBUF call in the kernel just returns the low/high water 
mark, and not the buffer size. Is this correct?


So basically, I still can't receive these large UDP packets, so any reply 
would be appreciated!

Lund

ps. If you want to look at the relay program, I can send that too.