TCP parameters

Bill Moran wmoran at
Thu Nov 16 16:17:59 PST 2006

On Thu, 16 Nov 2006 15:17:26 +0000
Dieter <freebsd at> wrote:

> In the process of debugging a not-working-so-well TCP
> application, I've been asked to provide:
> > cat /proc/sys/net/ipv4/tcp_window_scaling
> > cat /proc/sys/net/ipv4/tcp_wmem
> Which of course results in "No such file or directory".
> I suspect these are from Linux.  Are there equivalent
> parameters in FreeBSD 6.x ?

Window scaling is enabled by default.  I'd assumed that there would be a
sysctl to disable it, but I can't seem to find one.

It looks as if tcp_wmem is the equivalent of recvspace, although the
description in that document is somewhat befuddling.

> The other end (non-FreeBSD non-open-source) is sending
> real-time data, and apparently is not able to keep up,
> its memory fills up, and it starts dropping packets.  I
> suspect the problem is a combination of too much latency
> (FreeBSD not sending ACKs fast enough) and not enough window
> size.

Can you get some tcpdumps of the traffic?  If the problem is what you
suspect, it should be evident in a packet dump.

> net.inet.tcp.recvspace and .sendspace  seem relevant,
> anything else?  I'm not a TCP wizard, so please feel free
> to point out things that should be obvious.  :-)

Those are maximum values, perhaps your application is not actually
allocating that much?  Calling getsockopt() on SO_SNDBUF and SO_RCVBUF
will tell you, and setsockopt() can be used to change them.

> I doubt that the BSD network stack has anything to do with this,
> but perhaps there is something that could be tweaked to help out.
> I'm hoping that updating the Ethernet device drivers (bge, nve)
> will result in less latency.

Latency isn't the only factor.  If your window size is enough, a little
extra latency shouldn't hurt.  Of course, if the thing is unable to
maintain the required throughput, that'll kill you every time.

> Then there is userland:
> Anyone want to code review a very simple 80 line TCP-to-stdout utility?

Sure, post it ... I'll have a look.

More information about the freebsd-questions mailing list