From nobody Wed Nov 16 08:37:32 2022 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 4NBxJ11zYpz4hFfL for ; Wed, 16 Nov 2022 08:37:37 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NBxJ06b4jz3r8s for ; Wed, 16 Nov 2022 08:37:36 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:8544:35e7:7303:ae7f]) (Authenticated sender: macmic) by drew.franken.de (Postfix) with ESMTPSA id AE5997FCDEABE; Wed, 16 Nov 2022 09:37:32 +0100 (CET) Content-Type: text/plain; charset=utf-8 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 \(3731.200.110.1.12\)) Subject: Re: ICMPv6 over lo0 From: tuexen@freebsd.org In-Reply-To: <13ea449d-0496-e104-405e-1aa63b917b2d@yandex.ru> Date: Wed, 16 Nov 2022 09:37:32 +0100 Cc: freebsd-net Content-Transfer-Encoding: quoted-printable Message-Id: <0A62F19A-A578-4B00-964D-50B8DE71C0C7@freebsd.org> References: <13ea449d-0496-e104-405e-1aa63b917b2d@yandex.ru> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.3731.200.110.1.12) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4NBxJ06b4jz3r8s X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > On 16. Nov 2022, at 08:54, Andrey V. Elsukov = wrote: >=20 > 16.11.2022 00:14, tuexen@freebsd.org =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> when using the master branch of today (or 13.1) I get when running >> tuexen@ampere128:~ % ping6 -c 1 -b 30000 -s 20000 ::1 >> PING6(20048=3D40+8+20000 bytes) ::1 --> ::1 >> 20008 bytes from ::1, icmp_seq=3D0 hlim=3D64 time=3D0.709 ms >> --- ::1 ping6 statistics --- >> 1 packets transmitted, 1 packets received, 0.0% packet loss >> round-trip min/avg/max/std-dev =3D 0.709/0.709/0.709/0.000 ms >> which is expected. What I don't expect is: >> tuexen@ampere128:~ % tcpdump -i lo0 -n >> tcpdump: verbose output suppressed, use -v or -vv for full protocol = decode >> listening on lo0, link-type NULL (BSD loopback), capture size 262144 = bytes >> 22:06:38.835630 IP6 ::1 > ::1: frag (0|1232) ICMP6, echo request, seq = 0, length 1232 >> 22:06:38.835639 IP6 ::1 > ::1: frag (1232|1232) >> 22:06:38.835641 IP6 ::1 > ::1: frag (2464|1232) >> Why is for the Echo Request an MTU of 1280 used, whereas for the = response an MTU of 16384 >> is used. >> Is this intended? At least for me, it is not expected... >=20 > Hi Michael, >=20 > I believe it is default behavior for ping6: > ``` > -u By default, ping asks the kernel to fragment packets to fit into > the minimum IPv6 MTU. The -u option will suppress the behavior > in the following two levels: when the option is specified once, > the behavior will be disabled for unicast packets. When the > option is more than once, it will be disabled for both unicast > and multicast packets. > ``` >=20 > ``` > % ktrace ping6 -c 1 -b 30000 -s 20000 ::1 > % kdump | grep -A1 MIN_MTU > 14793 ping6 CALL = setsockopt(0x3,IPPROTO_IPV6,IPV6_USE_MIN_MTU,0x7fffffffe614,0x4) > 14793 ping6 RET setsockopt 0 > ``` >=20 > ``` > if (mflag !=3D 1) { > optval =3D mflag > 1 ? 0 : 1; >=20 > if (setsockopt(ssend, IPPROTO_IPV6, IPV6_USE_MIN_MTU, > &optval, sizeof(optval)) =3D=3D -1) > err(1, "setsockopt(IPV6_USE_MIN_MTU)"); > } > ``` Hi Andrey, thank you very much for the explanation! I wasn't aware of this. Best regards Michael > --=20 > WBR, Andrey V. Elsukov