Search code examples
network-programmingnetstat

ZeroWindow errors and netstat statistics?


I have been told that one of my servers intermittently throws ZeroWindow errors. I would like to monitor this in Prometheus.

If I run neststat -s some of the results are:

netstat -s

Ip:
   ...
IcmpMsg:
   ...
Tcp:
   ...
TcpExt:
    TCPFromZeroWindowAdv: 96
    TCPToZeroWindowAdv: 96
    TCPWantZeroWindowAdv: 16

It is very difficult to find a definition for this the closest that I have found is:

  • WantZeroWindowAdv: +1 each time window size of a sock is 0
  • ToZeroWindowAdv: +1 each time window size of a sock dropped to 0
  • FromZeroWindowAdv: +1 each time window size of a sock increased from 0

Reading this I believe that WantZeroWindowAdv show the ZeroWindow problems. (It counts each time that a socket is requested its window size and responds with 0.)

Not part of the question - then I would need to add this to nodes_netstat.go for prometheus.

Am I correct - is this approach valid? Netstat is not highly documented.


Solution

  • Your descriptions of "To" and "From" are correct.

    "Want" is when TCP would have liked to have sent a zero window back to a sender, but couldn't because that would have implied a shrinking of the window rather than it being full.