I'm diagnosing an UDP packet loss issue in FreeBSD. netstat -s -p udp
has the following output:
udp:
116974545 datagrams received
0 with incomplete header
0 with bad data length field
0 with bad checksum
198 with no checksum
6313 dropped due to no socket
119696 broadcast/multicast datagrams undelivered
41534 dropped due to full socket buffers
0 not for hashed pcb
116807002 delivered
955 datagrams output
0 times multicast source filter matched
Although most of the output is straight forward, I'm really confused about what does broadcast/multicast datagrams undelivered
indicate. Is that the total number of undelivered multicast packets? Or does that refer to the number caused by a specific reason, like drooped due to full socket buffers
does?
"broadcast/multicast datagrams undelivered"
indicates total number of received multicast/broadcast UDP packets with no socket willing to accept them. The counter is bumped in two cases:
Case #1 -- accounts for all/most of undelivered UDP multicast/broadcast packets in your case:
531 /*
532 * No matching pcb found; discard datagram. (No need
533 * to send an ICMP Port Unreachable for a broadcast
534 * or multicast datgram.)
535 */
536 UDPSTAT_INC(udps_noportbcast);
Case #2 would also bump "dropped due to no socket" counter which is probably not your situation.
596 UDPSTAT_INC(udps_noport);
597 if (m->m_flags & (M_BCAST | M_MCAST)) {
598 UDPSTAT_INC(udps_noportbcast);
599 goto badunlocked;
600 }