Date: Wed, 7 Aug 2024 20:05:51 -0600 From: Alan Somers <asomers@freebsd.org> To: Navdeep Parhar <np@freebsd.org> Cc: FreeBSD Net <freebsd-net@freebsd.org> Subject: Re: Monitoring packet loss Message-ID: <CAOtMX2h4UXHebjZJ9j8SbRqTdevLOOvExQ=Hc6Fw9AKVRFykuQ@mail.gmail.com> In-Reply-To: <88167c63-773c-42d2-93b6-f2f028f8aebb@FreeBSD.org> References: <CAOtMX2hLaYEhVpoPG5HtJ7Qj030PvGOBFeo78fqmRxPMJAfxmQ@mail.gmail.com> <88167c63-773c-42d2-93b6-f2f028f8aebb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 7, 2024 at 7:21=E2=80=AFPM Navdeep Parhar <np@freebsd.org> 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!
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2h4UXHebjZJ9j8SbRqTdevLOOvExQ=Hc6Fw9AKVRFykuQ>