About TCP window full/TCP zero window

TCP window full means that the data sent by the sender has reached the upper limit of the receiving window.
Then stop sending and wait for the notification of the new receiving window

At this time, the receiving end returns a TCP zero window, which means that the receiving end window is 0. From the packet capture, it can be seen that
insert image description here when the receiving end clears the cache and the window is no longer 0, it updates its window size
insert image description here. Set the TCP_NODELAY option in the socket.

setsockopt( s, IPPROTO_TCP, TCP_NODELAY, (char*) &dummy, sizeof(dummy) )

Find the definition of this macro in the compiler header file, and compile ldap and find that this macro is always on, that is, the Nagle algorithm is not used by default.

root@ubuntu-64bit:# grep -rnwa "TCP_NODELAY" /opt/mv_tools
/opt/mv_tools/mipsel-linux-uclibc/sys-root/usr/include/linux_bak/tcp.h:118:#define TCP_NODELAY          1       /* Turn off Nagle's algorithm. */
/opt/mv_tools/mipsel-linux-uclibc/sys-root/usr/include/linux/tcp.h:118:#define TCP_NODELAY              1       /* Turn off Nagle's algorithm. */
/opt/mv_tools/mipsel-linux-uclibc/sys-root/usr/include/netinet/tcp.h:40:#define TCP_NODELAY      1      /* Don't delay send to coalesce packets  */

I didn't find where the TCP_NODELAY macro was defined in the code, so I found the macro in the compiler header file

Guess you like

Origin blog.csdn.net/csdn_zmf/article/details/106649777