From nobody Thu Aug 08 01:02:33 2024 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WfTKs4jtCz5TWyC for ; Thu, 08 Aug 2024 01:02:41 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WfTKs3pxXz45k2; Thu, 8 Aug 2024 01:02:41 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723078961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=03ez0mqTF53lTlUeN8s2ne5RhM3TYd2kBD1P95oq3lY=; b=WHJS1ck0irc2UA2ARopVxgV1HO9herfuirhmvUlJuHFsazQG11f6gLSkWtIzAzpex81KAV CJ/RhTdOZIgk1/PCey4HrNR2B8HCCzHG0ejQDXp5QuMFfS9tsscH6u1o23TqFLZ9IDKRpe ZirOnDQvXD4cPGkLh28At2o2ViaaZpn7af+ossR7IRmJdr9b26152WINWvdR2vE3lRzsBn 0Yo7T8UcWOfz0u+DMHczAHldrksMDYe3rbKrF6kpywWbLjHVDh53sN2D4aFRgHnAcV20bw bOMTOIortBLDgxazFu4M2z1ZGIRDiNN8NpcU6F8ipUpYqDyFRU3DQe/JZXzuGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723078961; a=rsa-sha256; cv=none; b=u8YkTk8imFUyWkUmkfNvnxA6dNvxc+4+QIb0uTYWVdpbt/4ncgCaUlBWD3/8nwv3MhRUXF svHcksUZPQ2c8YAo9hh4vC60DPm6BAAEugfJRZmIE6sAcjXYtxt8Ro4kv+vbbOfpYxwlF0 92I450sjIzfJVUGDGO0IKIBZUlmk5xmsp7iQ+Y1tvm+JYvUNJVz+pFhPUXpmOBHGqXdPRH CNzInflYW8ANrZnZXyuF96Dk+OWfxO5EAVeiuO6HvzyBYxy27VnNCAdyZgfNv7KiZw4SZq BU1DoLnldAjhBwM7lKoZ04gAFEMdP6scVGNTNNzdlfEEA0gOUnAN4/XYpnWA4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723078961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=03ez0mqTF53lTlUeN8s2ne5RhM3TYd2kBD1P95oq3lY=; b=JlQhlVVi3PFJ+JG8LNwCmIoThqGoQ1DH2POBGkeeEbyQ+8Yk1KdlDAQCBHTUx/UJJjnOm6 s/siQNPz0GV5EvKo/AE2AG2b94vXEvCsoJNhh6vbkqelHWlxYWg3WMbdwBUZmgTh89zj5H T4vQWQd5VSVSEfas0gC8OgQtg8vnbNyAFvMzABbH4d5ixAixPm0DA8v5iyDqPE1TFJZOEa sxlXIrjBbd1hvhWkhJOoveLjwhja7SeMj0AJWfN6BKP5QAn9csvx+Zu9HaKHBiVJs7q64l 217Xl6I4GC+KaqHev18OQxO3E8h+AR0F2/WJ+7LhnzTKQP802CMm/eLaz/NByw== Received: from smtpclient.apple (unknown [IPv6:2001:19f0:6001:9db:98f0:9fe0:3545:10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WfTKr4wf6zgxQ; Thu, 8 Aug 2024 01:02:40 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: Monitoring packet loss From: Zhenlei Huang In-Reply-To: Date: Thu, 8 Aug 2024 09:02:33 +0800 Cc: FreeBSD Net Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Alan Somers X-Mailer: Apple Mail (2.3696.120.41.1.8) > On Aug 7, 2024, at 10:06 PM, Alan Somers wrote: >=20 > I'd like to track the rate of packet loss for outbound packets from > some production servers. Obviously, that's impossible. =20 Can `netstat -di` fulfill ? The column `Oerrs` and `Drop` ( this is the out dropped packets ) may be = what you want. The drivers also expose some internal stats via sysctl. But different = drivers vary. For example cxgbe(4) ``` # sysctl dev.cxl.0.stats.tx_drop ``` Best regards, Zhenlei > But I think > that the rate of TCP retransmissions should be a close proxy for > packet loss. Currently I can only observe TCP retransmissions by > using wireshark, a slow and laborious process. But it seems to me > that the network stack should already have that information. Would it > be possible to add a sysctl to expose the total number of > retransmissions since boot? This information would be very useful. > It could reveal for example problems with a model of NIC, or > congestion on one network segment but not another, or a regression in > the OS. >=20 > -Alan >=20