From nobody Thu Aug 08 01:21:43 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 4WfTlv5JVrz5TZ8N for ; Thu, 08 Aug 2024 01:21:47 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) (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 4WfTlv3dY3z46qP; Thu, 8 Aug 2024 01:21:47 +0000 (UTC) (envelope-from nparhar@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-7105043330aso476280b3a.0; Wed, 07 Aug 2024 18:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723080105; x=1723684905; darn=freebsd.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=Pvv89gq33MF3fdjnX8eWtIuOS5RICxaAgaFEXnCaUIk=; b=NChOLwGRcdpuYg4J1OKxup8290QOuYNR+i18UsSS7So+BKzlg3AFMMoOQV+dJYXwba u/J9qmQBtgKX8bMwS8y/MNP0YHUuYF4wTKvVGYnjXaRXBvUKrpC69DwzsqYtBMxuOhBd RPtIrn0fowS8tWy8t4gIplkdSmb7l6pb2uJ/8JEik2mE4LBsi/sO/l3pnU1JrNDwxJ3/ PYjRr+vDEPatKKVeBGr5bJ9fNlkYZNPZ4hhB9MoCbkPtrlnpZ0xO0f/zdruAWKV4G3hg Quk5fZx8NbG6MEgBCUekLTuBka9yZODEUt15cQiYZMsrjOhDQcVWGHxCj1/CVSnnKS4S QHcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723080105; x=1723684905; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Pvv89gq33MF3fdjnX8eWtIuOS5RICxaAgaFEXnCaUIk=; b=pLR9IpfTwKhiobHaiA8cln6+aTwSr3iBRuCjer8Nm0QOmwfyM0UpsY1WJTS/cDkp/K Qk5wB1OZyAnnuzsNrKMHgEL1FNGWLqyyB/1VftUq9xJ3El64lZ7C4zkwR7F9ylEY3QAK DCm1WEoubatxw0ZerNEn4K3Jb01v3vrZKsU+kTTibvkE58donezE97mkL8KGqIzXlzxc saCo3aiYCqpFEfYvvdJ+8aZb/DlAxbRX2YPpXVV4Eerv/LInXSa2RN9B0sVNCe00Hobn uss7YiZrzntPTlWXTil88ZI17/Uv4kHzZSSPQwhcqWtuBYl1XyYmfw9CwYTE4zMmQZ0y oWOQ== X-Forwarded-Encrypted: i=1; AJvYcCXk4MtfzxvYkxGpd//b2kq4r1aZD+OdHF6DnobAA6JRIYpD3Fj52uj2C3bjaGJ4B6p+c97Cih+TqFfDXfKirt6Fkekcea/RtQ== X-Gm-Message-State: AOJu0Ywn3xjT5UtaUmhRPbZ8OpRUOIQwvKAuZ62fnoBi12kchRUQrJx8 NHtNRqmMLQ7EYeYmj9Qzk1gQ4R/RMyRU+M/adiEQdvZ9FsstrDVF0aV1vw== X-Google-Smtp-Source: AGHT+IEq+3/1Hm6L2TimuRrsKzTo7LO6yt78245+cto4sMzOKFi7FHUMqmOKgMsi2N1MT04xANarOw== X-Received: by 2002:a05:6a20:3949:b0:1c0:f5ea:d447 with SMTP id adf61e73a8af0-1c6fcf0b0fdmr381726637.31.1723080104981; Wed, 07 Aug 2024 18:21:44 -0700 (PDT) Received: from [10.192.161.10] (stargate.chelsio.com. [12.32.117.8]) by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-2d1b3b36067sm2233000a91.41.2024.08.07.18.21.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Aug 2024 18:21:44 -0700 (PDT) Message-ID: <88167c63-773c-42d2-93b6-f2f028f8aebb@FreeBSD.org> Date: Wed, 7 Aug 2024 18:21:43 -0700 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 User-Agent: Mozilla Thunderbird Subject: Re: Monitoring packet loss Content-Language: en-US To: Alan Somers , FreeBSD Net References: From: Navdeep Parhar Autocrypt: addr=np@FreeBSD.org; keydata= xsDiBEosaGcRBACOXnXquGEW53BjpMt2jViod/TUf1xgjMekcbDxqOODPeX7eYfrwJ8G6BCN OpGjBmWDu/JcNj4Z+gmTilJ6WLZQ7ecFZfEeO91pt6ys0cyWh0xfO+/mT83D7W81S/kqrJBk QbBIdV6LumevdErHo272r8RcMELC4Ru87eRtX3hmEwCgnnGNJMpQFUfYTt5XE7nY0yQoeV8D /0OcWmJbEZWxX9O7AuliCe3zd2Dw0B4LB9SZ2Dis7+gpVd3xVgYnt5wRE9kM+ThgrMA/wqr8 07qmEG6bcfUsfwwGN9YUtNF3xAN07cXTs026sCIFNZK816PrThBzCgkwR7pDpkMzGWIBr8Wi XXy0eB+JlQ6UV4PEiXuZ5ulzP0b1A/9CZm3wJfrNC0r1gMyrfVedg4zwKU997bmPLGcYs+rW XDTI9CvMseOUYn4CoDZQCp/9zxuHK+VU7Y/w0c/hVE5ERACSn4SjN2unEDstK9njZBMHEPVk Ae/YvSG5cmc97SHlVE+eu/bbLKcvFb6rRLPOaVFQJMJA2VJEGWtYhvP7Zc0fTmF2ZGVlcCBQ YXJoYXIgPG5wQEZyZWVCU0Qub3JnPsJgBBMRAgAgBQJKLGhnAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQyrIrk6yriBL0MQCfUJOiS2PbJFDeiav1ylcXXwfpggAAoJRoS7GDENGy M4BzjJ4b0ptZqTLRzsFNBEosaGcQCACFCWs47SL4DQA6bNDlVJu4w8wLf8uVOyatuGmdXX8Y /OTVQJgA3vS+ODNVJCxhKVlvhcn7bhBdGdWKS9K+lr8+eEvr4hf2bQpesoHC+uFgKyILkCBN L8raixbhysyq0pfZWWDJMyn+G42BG1yJJi+bykygdpYnbIVA8dYHmBibI8mkPKOHSohjXT1S RfGGn+l1w54OO4NlJhCXMkjTA/Z9Bt4XeaiR85uJi0UUfV8FGZHhgSvT+/P1xIvz+nytuehS P/QLXl13CtAG/nKVkAcZnsT/3NrJ4Z2r45k+c50Wrf210scAaBogrrV5eIHfNGgOANApN8+8 vj+aXO4pXRuXAAMFB/44ea8rd+P5N3OMrfuM8i91Qe1bJ+BIoroKPOr8jvCry0h3QpdfLKUN IgaqbS3JZeBJ8HHnWSGCF+o6H5gzRe1hvylPEclLPDCuPe7T746h9Mzejf2hNDJvOg+BuweD ZW4KhovVbdS+syJEvpGF4bO8qgHT2CKgruXSHbFetdQWbkM0rfMmTuo0GcR2BEVrPb/SPFv6 4ZZyAZzmnGO4vT1bzClnTzJixrDpH74M3vSEYegMB4KdbLYBi8Jx4QUKgVEhJHjJubKWX4et yU/uuehOC3xYrmr1UXvsom3U8r36Dvdo77Yr3dgDVXa7bolNx0TIhdWxZI+R4z9E75QY+/wg wkkEGBECAAkFAkosaGcCGwwACgkQyrIrk6yriBI+JQCfUxgyqGtzZvLh5Al7gsTmRc11PLwA niD3NfWGRcO2+9uxSSQqRH1ywC4n In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WfTlv3dY3z46qP 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 Regards, Navdeep > 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. > > -Alan >