Subject: TCP buffer space
To: None <tech-net@netbsd.org>
From: None <explorer@flame.org>
List: tech-net
Date: 12/24/1999 20:52:14
When is TCP buffer space allocated?  I thought things happened
as data flowed, but I thought someone said it happened at
socket creation time.

The reason I'm asking is that I have an application where literally
thousands (5k to 10k) TCP streams will be open at once.  I'd
be happy to limit the space on incoming data to 1k or 2k, and outgoing
to 2k or 4k.  Bandwidth isn't really an issue -- in fact, I don't
want any one client using much of it at all.  Small windows are
fine by me, with most data backed up on the remote end.

My questions are:

	If I use setsockopt() on the socket I'm listening on,
	would it make sense for sockets that I accept() from
	it to aquire the same incoming/outgoing buffer space
	limits?

	If I set the incoming to something small, how small
	can I get before I break, or seriously confuse TCP?

	I assume setting the incoming space to something small
	will cause the TCP window to shut quickly, buffering data
	on the client side.  This is fine by me, as I said.  But,
	will I break much?

--Michael