From: Phillip Susi
The entire point of having a window is so that the sender can send multiple packets before the first is ACK'd. Are you sure that the existing code refuses to send even when the window should allow it?
I've been wrong before, but that's my interpretation of what's happening. We've only sent one byte and are trying to send another single byte.
Or is the window just too small?
Since a window size of 1 doesn't make sense, the window size must be big enough. I believe it is actually 16384, plenty of room for the 2 bytes we've sent/are trying to send.
From: art yerkes
The problem is likely in our loopback pseudo adapter rather than the BSD code, I'd guess.
Please don't take this the wrong way (I'm still impressed by the work you and Casper did on integrating the network stack), but that was my initial thought too... However, as far as I can see the second send just doesn't make it to the loopback adapter, it's tcp_output() which decides it shouldn't be sent.
It actually doesn't come directly from BSD. It was first in oskit, in which some work was done to isolate a few parts of FreeBSD and simplify and generalize the buffer management code. If there's a mistake in the TCP implementation itself, I might have introduced it.
I checked the FreeBSD code and there seems to be a fix in there (which is not present in our tree) related to this (http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netinet/tcp_output.c#rev1.53) :
"Add a flag TF_LASTIDLE, that forces a previously idle connection to send all its data, especially when the data is less than one MSS. This fixes an issue where the stack was delaying the sending of data, eventhough there was enough window to send all the data and the sending of data was emptying the socket buffer."
That same TF_LASTIDLE flag is also present in OpenBSD (not surprising, since they say they imported it from FreeBSD). I'll see if I can apply the same change to our tree.
GvG