From nobody Thu Aug 08 02:05:51 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 4WfVl12jVwz5Ry71 for ; Thu, 08 Aug 2024 02:06:05 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com [209.85.217.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WfVl10xX3z4DXx; Thu, 8 Aug 2024 02:06:05 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-vs1-f42.google.com with SMTP id ada2fe7eead31-49291b02e20so168306137.2; Wed, 07 Aug 2024 19:06:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723082763; x=1723687563; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D/mLJbS9U2vlj+3yhW1dDv4PcZMFcz3VVb6rwP4Tong=; b=WgOXX/VXWLJDp25IzkDU1fDrQf31OuX4guFA0CuNgWyKFo3LtyfC43Poq8sl9AUZl/ Vq+l1Tfn7Vo0AskwVTeXHlZEiGuVxZZ+xOtNVZzbKmYlycrjErtyhuHfOqWwghsIqq02 0BSS9z6QHbJlpRYy9WBbDVEp2JB1MyNR8b39comNbEJkNBimPyM6aAte06P9leIMW6+c 0RNvUs372yJs2ebos86fptb2JTYAYtZomsjKDlSc/Vdxbh3Xqa0slooPEj/tQfX+InhG ZRYG0AQlgvSB7opu6nx82Ru4s3PWrCyg9wg0fdI8UBukg04P6HZIF9j0hMyyJjSUwF1z /g6Q== X-Gm-Message-State: AOJu0YxKqXCKjDxeyzk4FvMqMLXfZ7FKwMW+EYsk5ZEfQ09mVdtWD7iQ oeT+ZBIFiYIOy5p6HfrUkxTe3ujBhLw7zFBtWZbFKhaQJb+2GwMdeISX0gOF8EHvl//Y4muy1tC NKdrUS9o1vbBn2HWHh1nZ+Gkss6DZPw== X-Google-Smtp-Source: AGHT+IG4KtjZM9X+/wXWJeAErKmr+BhVaH2hke40dwU2n3r1533HlpUHA3mb9HRUbodT8c73KsY1lS2KOGk1ZqmHkkE= X-Received: by 2002:a05:6102:4bc5:b0:492:aa42:e0cd with SMTP id ada2fe7eead31-495c5cd1e2bmr893859137.29.1723082762757; Wed, 07 Aug 2024 19:06:02 -0700 (PDT) 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 References: <88167c63-773c-42d2-93b6-f2f028f8aebb@FreeBSD.org> In-Reply-To: <88167c63-773c-42d2-93b6-f2f028f8aebb@FreeBSD.org> From: Alan Somers Date: Wed, 7 Aug 2024 20:05:51 -0600 Message-ID: Subject: Re: Monitoring packet loss To: Navdeep Parhar Cc: FreeBSD Net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4WfVl10xX3z4DXx On Wed, Aug 7, 2024 at 7:21=E2=80=AFPM Navdeep Parhar wrot= e: > > On 8/7/24 7:06 AM, Alan Somers wrote: > > I'd like to track the rate of packet loss for outbound packets from > > some production servers. Obviously, that's impossible. 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 > > The kernel already maintains a VNET-virtualized tcpstat structure for > aggregate TCP stats. netstat and systat grab these using the > net.inet.tcp.stats sysctl. This might work for you if you're okay with > global and not per-interface information. > > VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ > > $ netstat -sp tcp | grep -iE 'retr|rexm' > $ systat -tcp Yes, that's exactly what I'm looking for. Thank you!