How to get the amount of non ACK-ed TCP data for a socket?

Linux has the ioctl SIOCOUTQ, described in the tcp (7) man page, which returns the amount of unsent data in socket buffers. If I understand the kernel code correctly, all data without ACKed is considered "unsent". Ioctl has been available since at least version 2.4.x.

Is there anything similar for {Free, Net, Open, *} BSD, Solaris, Windows?

+5
source share
2 answers

There are (at least) two different pieces of information that you may need: the amount of data that has not yet been sent, and the amount of data that has been sent but not ACK-ed.

Linux: SIOCOUTQ , , ( + , ACK-ed). A ( 2016) tcpi_notsent_bytes TCP_INFO.

macOS iOS: getsockopt(fd, SOL_SOCKET, SO_NWRITE, ...) , SIOCOUTQ: , , ( + , ACK-ed). , .

Windows: GetPerTcpConnectionEStats TcpConnectionEstatsSendBuff , , ACK-ed .

, .

+5

TCP/IP , , queue- > q_count ( ).

0

All Articles