Originally posted by: SivakumarKrishnasamy
Try the below tcpdump filter to see if this helps,
tcpdump -vv -i en0 " ( tcp[tcpflags] & tcp-ack != 0 and ( (ip[2:2] - ((ip[0]&0xf)<<2) ) - ((tcp[12]&0xf0)>>2) -1 ) == 0 )"
Few things to consider here,
-
netstat reports cumulative statistics for all configured interfaces and so while the tcpdump captures packets specific to an interface, TCP connections over other interfaces may be sending these keepalive packets. So make sure you run tcpdump on the right interface.
-
Network options tcp_keepidle and tcp_keepintvl control, when and how frequently these keepalive packets are sent. So make sure you capture tcpdump long enough to capture the keepalive packets. For AIX default values, if a TCP connection is idle for 7200 seconds (14400 half seconds) only then the first keepalive probe is sent and then the value of tcp_keepintvl decides how frequently these probes are sent from this point on (these tunables can controlled at socket level too using setsockopt subroutine and will take preference over network options which are system wide)
Your wireshark filter string seems right and may be you didn't capture the keepalive packets (i.e during your tcpdump run there were no keepalive probes packets sent out). When you run above tcpdump command, make sure you see the relevant netstat statistics show an increase in numbers (which will confirm that the keepalive probe packets are sent out)