Live data from Hacker News

How a little bit of TCP knowledge is essential

jvns.ca

41–44 of 44 posts

Re: How a little bit of TCP knowledge is essential

#41

Earlier quoted context omitted.

There is some overlap, yes. TCP_CORK is a mode however. It's silly to introduce the complexity of extra state when a single method call (flushHint()) would suffice. My proposed flushHint() is also quite different to TCP_NODELAY. Let's say you do 100 writes of 1 byte to a socket. If TCP_NODELAY is set, 100 packets would be sent. However if you do 100 writes to the socket, then one flushHint() call, only one packet wou…

> There is some overlap, yes. TCP_CORK is a mode however. It's silly to introduce the complexity of extra state when a single method call (flushHint()) would suffice. It is a single call. Note that last sentence from the man page entry: "setting this option forces an explicit flush of pending output, even if TCP_CORK is currently set." When TCP_CORK is on (turn it on once at socket creation time), the following code…

Hi, It sounds like this could be a good shim for flushHint(), as you said, if only on platforms where TCP_CORK is supported (Linux only?).

It's still more complex than just having a flushHint() method built in though, as it involves two modes (TCP_CORK and TCP_NODELAY).

Re: How a little bit of TCP knowledge is essential

#42

Earlier quoted context omitted.

> There is some overlap, yes. TCP_CORK is a mode however. It's silly to introduce the complexity of extra state when a single method call (flushHint()) would suffice. It is a single call. Note that last sentence from the man page entry: "setting this option forces an explicit flush of pending output, even if TCP_CORK is currently set." When TCP_CORK is on (turn it on once at socket creation time), the following code…

Hi, It sounds like this could be a good shim for flushHint(), as you said, if only on platforms where TCP_CORK is supported (Linux only?). It's still more complex than just having a flushHint() method built in though, as it involves two modes (TCP_CORK and TCP_NODELAY).

Other platforms don't have it as simple; but you can accomplish similar things via manipulation of TCP_NODELAY on most systems. e.g. see http://stackoverflow.com/a/22118709/282536

Re: How a little bit of TCP knowledge is essential

#43

Earlier quoted context omitted.

Hi, It sounds like this could be a good shim for flushHint(), as you said, if only on platforms where TCP_CORK is supported (Linux only?). It's still more complex than just having a flushHint() method built in though, as it involves two modes (TCP_CORK and TCP_NODELAY).

Other platforms don't have it as simple; but you can accomplish similar things via manipulation of TCP_NODELAY on most systems. e.g. see http://stackoverflow.com/a/22118709/282536

Yeah. With enough jumping through hoops it's possible. What I am after is a nice, simple, logical API though.

Re: How a little bit of TCP knowledge is essential

#44
post #27
post #16

Earlier quoted context omitted.

One thing that confuses me is -- are ACK delays part of the default TCP implementation on Linux? I originally assumed this was some kind of edge case / unusual behavior.

So it would appear, according to the man pages: http://linux.die.net/man/7/tcp In quickack mode, acks are sent immediately, rather than delayed if needed in accordance to normal TCP operation. So "normal TCP operation" is to delay ACKs "if needed". Not sure if "needed" is the right word to use, but whatever. Looks like RHEL has a system-wide fix: https://access.redhat.com/documentation/en-US/Red_Hat_Enterp...

There is also "ip route change ROUTE quickack 1"
Post reply on HN