Who is not Connecting to What

It may be useful when troubleshooting connection issues to see who is failing to connect to their requested ports. This is equivalent to seeing where incoming SYNs arrive when no listener is present, as per RFC 793:

# dtrace -n 'tcp:::accept-refused \
{ @[args[2]->ip_daddr, args[4]->tcp_sport] = count(); }' 
dtrace: description 'tcp:::receive ' matched 1 probes
^C

  192.0.2.14/27                                         23                2

Here you traced two failed attempts by host 192.0.2.14 to connect to port 23 (telnet).