Vikas Paliwal wrote:
Hi,
Is there a way so that the Nagle algorithm
can be disabled. I tried the TCP_NODELAY
socket option but that does not seem to help.
I need to send specific sized packets for an experimental evaluation.
The TCP_NODELAY
option seems to work for a while, after which it switches
Nagle merely institutes a delay when you don't have
at least half a segment - this allows the kernel to
collect more data and send out a full-sized segment
more often, avoiding sending out a stream of small
packets. It is entirely possible that by the time
the kernel gets an ack back from the receiver for
the first sends (slow start) your app has written
enough data for a full sized segment to go out -
and Nagle would not come into play at all in that
case. It all depends on how your application is
written and what sized writes you are doing, etc..
to its size 1448 bytes. For example, I have an application
that writes packets of size much smaller than 1448 bytes.
Tcpdump shows that initially the packet size is the chosen small
value, but after a while it changes back to 1448 bytes (appears
like some buffer getting full). The time after which this change occurs
also varies.
Can you tell us what is the sequence of sends (size)
- tcpdump log would help.
It would be very helpful if somebody could provide
some insight into this or we can conclude either of the two:
1. No socket or kernel option can guarantee disabling of
Nagle algorithm and there is no way packet size can be chosen
as in UDP.
Since TCP is a byte stream - you can only really control
the segment sizes going out by having your application
enforce that by waiting for data in the reverse direction
or something. Turning off Nagle only helps, but is not
the entire picture..
thanks,
Nivedita
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html