代码之家  ›  专栏  ›  技术社区  ›  GuLearn

netstat中的“广播/多播数据报未送达”表示什么?

  •  2
  • GuLearn  · 技术社区  · 12 年前

    我正在诊断FreeBSD中的UDP数据包丢失问题。 netstat -s -p udp 具有以下输出:

    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
    

    虽然大多数输出都是直接的,但我真的很困惑 broadcast/multicast datagrams undelivered 表明这是未送达的多播数据包的总数吗?还是指特定原因导致的数字,如 drooped due to full socket buffers

    1 回复  |  直到 12 年前
        1
  •  2
  •   ArtemB    12 年前

    "broadcast/multicast datagrams undelivered" 指示没有套接字愿意接受的接收的多播/广播UDP数据包的总数。计数器在两种情况下发生碰撞:

    Case #1 --在您的情况下,占所有/大部分未送达的UDP多播/广播数据包的比例:

    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 也会碰到“由于没有插座而掉落”的计数器,这可能不是您的情况。

    596        UDPSTAT_INC(udps_noport);
    597        if (m->m_flags & (M_BCAST | M_MCAST)) {
    598            UDPSTAT_INC(udps_noportbcast);
    599            goto badunlocked;
    600        }