Re: Linux 2.2.2 TCP delays every 41st small packet by 10-20 ms

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Sat, 27 Feb 1999 09:15:00 +0100 (MET)


David Miller wrote:
>
> 2) Even if your fix was to be the final one, we have to be careful,
> as just blindly ACK'ing immediately for small PSH packets is
> deadly and will kill Nagle immediately. Actually the effect is
> that nobody will be able to successfully perform Nagle to us.

Ho! stop!

Nagle was designed to work when there are -=wire=- latencies involved.
It was not designed to do something about the delayed ack that the
other side might do. This means that nagle won't kick in on local
ethernet. That's exactly what it was designed to do.

Small packets (wether they have PSH or not) should be acked
immediately. Or am I missing something?

I've seen machines sending the result of an 8k write as 5 x 1500 bytes
plus 500 with PSH. Either their deamon feeding the socket is slow
enough to let the socket buffer empty, or their "wake up the writer
when there is enough space in the buffer" algorithm is flaky. They
should deal with the extra ACK they might elicit from Linux.

The other side can always trick us into sending at least one ack for
every packet. (send p0 p2 p3 p4 p5 p6 p1 p8 p9 p10 p11 p12 p7 etc
etc.)

I didn't look up RFC 896, but Richard steven says:

We saw in 19.3 that the round trip time on an ethernet for a single
byte to be sent, acknowledged, and echoed averaged around 16 ms. To
generate data faster than this we would have to be typing more than 60
characters per second. This means that we rarely encounter this
algorithm when sending data between two hosts on a LAN.

(TCP/IP illustrated, (first or second edition) page 267. section 19.4)

See, he does the calculation with 16ms, (not 200 which would happen if
nagle kicked in), and he agrees that it doesn't happen on LANs.

I might be missing something... Feel free to clue me in....

Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
*   Never blow in a cat's ear because if you do, usually after three or  *
*   four times, they will bite your lips!  And they don't let go for at  *
*   least a minute. -- Lisa Coburn, age 9

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/