Doubts about the Winsock Kernel Buffer and Nagle algorithm

When reading this article, I had a doubt.

I realized that when transferring small data, the Nagle algorithm is turned on by default, which combines small packets. This causes some data to be cached before being transferred. I believe Winsock Kernel Buffer is where caching takes place. Correct me if I am wrong.

Does this mean that if the Winsock Kernel Buffer is set to zero with the SO_SNDBUF parameter, will the Nagle algorithm be disabled?

If not, where does WINSOCK cache small data?

+3
source share
3 answers

, , ...

, Winsock , Winsock. (, ), , .

, TCP_NODELAY SO_SNDBUF = 0, Nagle, ,

TCP_NODELAY Nagle, .

Winsock, , SO_SNDBUF ( 8K). Winsock , SO_SNDBUF. , Winsock , . - Winsock, SO_SNDBUF 0.


, , , TCP_NODELAY SO_SNDBUF = 0 , , . , , Nagle TCP- ( ), SO_SNDBUF UDP.

SO_SNDBUF , "" ( , ).

TCP_NODELAY Nagle TCP, ( , ).

+5

SO_SNDBUF, 0, .

0

Setting SO_SNDBUF to zero will not implicitly disable nagle; The nagle state supported by WSK is independent of where the buffer is located. It is your responsibility to maintain the buffers that you publish until the transport consumes them.

0
source

Source: https://habr.com/ru/post/1710833/


All Articles