Date: Wed, 16 Nov 2022 23:15:05 +0800 From: Zhenlei Huang <zlei.huang@gmail.com> To: tuexen@freebsd.org Cc: freebsd-net <freebsd-net@freebsd.org> Subject: Re: ICMPv6 over lo0 Message-ID: <05FB9658-5293-4154-BB50-2E3A189DD306@FreeBSD.org> In-Reply-To: <D353907A-2295-46B8-9F3A-C4AC0370C8E0@FreeBSD.org> References: <DDDFD026-72AF-4558-93E4-60D361C671DF@freebsd.org> <D353907A-2295-46B8-9F3A-C4AC0370C8E0@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_578914C8-0B57-4ADA-A14B-0DA453CB8278 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Nov 16, 2022, at 11:19 AM, Zhenlei Huang <zlei@FreeBSD.org> wrote: >=20 >>=20 >> On Nov 16, 2022, at 5:14 AM, tuexen@freebsd.org wrote: >>=20 >> Dear all, >>=20 >> when using the master branch of today (or 13.1) I get when running >>=20 >> 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 >>=20 >> --- ::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 >>=20 >> which is expected. What I don't expect is: >>=20 >> 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) >> 22:06:38.835641 IP6 ::1 > ::1: frag (3696|1232) >> 22:06:38.835642 IP6 ::1 > ::1: frag (4928|1232) >> 22:06:38.835642 IP6 ::1 > ::1: frag (6160|1232) >> 22:06:38.835643 IP6 ::1 > ::1: frag (7392|1232) >> 22:06:38.835644 IP6 ::1 > ::1: frag (8624|1232) >> 22:06:38.835644 IP6 ::1 > ::1: frag (9856|1232) >> 22:06:38.835645 IP6 ::1 > ::1: frag (11088|1232) >> 22:06:38.835645 IP6 ::1 > ::1: frag (12320|1232) >> 22:06:38.835646 IP6 ::1 > ::1: frag (13552|1232) >> 22:06:38.835647 IP6 ::1 > ::1: frag (14784|1232) >> 22:06:38.835647 IP6 ::1 > ::1: frag (16016|1232) >> 22:06:38.835648 IP6 ::1 > ::1: frag (17248|1232) >> 22:06:38.835648 IP6 ::1 > ::1: frag (18480|1232) >> 22:06:38.835649 IP6 ::1 > ::1: frag (19712|296) >> 22:06:38.836002 IP6 ::1 > ::1: frag (0|16336) ICMP6, echo reply, seq = 0, length 16336 >> 22:06:38.836006 IP6 ::1 > ::1: frag (16336|3672) >> ^C >> 19 packets captured >> 19 packets received by filter >> 0 packets dropped by kernel >>=20 >> Why is for the Echo Request an MTU of 1280 used, whereas for the = response an MTU of 16384 >> is used. >>=20 >> Since >> tuexen@ampere128:~ % ifconfig lo0 >> lo0: flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384 >> options=3D680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6> >> inet6 ::1 prefixlen 128 >> inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 >> inet 127.0.0.1 netmask 0xff000000 >> groups: lo >> nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL> >> is used, I would expect an MTU of 16384 also be used for the Echo = Request instead of >> the minimum IPv6 MTU of 1280. >=20 > I believe MTU of 16384 should be used for Echo Request. That is by intuition. RFC 3542 introduced IPV6_USE_MIN_MTU and FreeBSD implemented it in = 33841545909f4. IPv6 is different from IPv4 of fragmentation, intermediate routers are = not allowed to do fragmentation and thus PMTU is a must (or a minimal MTU should be chosen). Section 11.1 in RFC 3542: > For unicast destinations path > MTU discovery should be performed by default. For multicast > destinations path MTU discovery should be disabled by default. For simple ping6 program it seems disable performing PMTU for both = unicast and multicast destinations by default is lightweight. In most cases we do not send large payload = via ping6. >=20 >>=20 >> Is this intended? At least for me, it is not expected... >>=20 >> Best regards >> Michael --Apple-Mail=_578914C8-0B57-4ADA-A14B-0DA453CB8278 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><div = class=3D""><br class=3D""></div><div><blockquote type=3D"cite" = class=3D""><div class=3D"">On Nov 16, 2022, at 11:19 AM, Zhenlei Huang = <<a href=3D"mailto:zlei@FreeBSD.org" = class=3D"">zlei@FreeBSD.org</a>> wrote:</div><br = class=3D"Apple-interchange-newline"><div class=3D""><blockquote = type=3D"cite" style=3D"font-family: Helvetica; font-size: 12px; = font-style: normal; font-variant-caps: normal; font-weight: normal; = letter-spacing: normal; orphans: auto; text-align: start; text-indent: = 0px; text-transform: none; white-space: normal; widows: auto; = word-spacing: 0px; -webkit-text-size-adjust: auto; = -webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><br = class=3D"Apple-interchange-newline">On Nov 16, 2022, at 5:14 AM, <a = href=3D"mailto:tuexen@freebsd.org" class=3D"">tuexen@freebsd.org</a> = wrote:<br class=3D""><br class=3D"">Dear all,<br class=3D""><br = class=3D"">when using the master branch of today (or 13.1) I get when = running<br class=3D""><br class=3D"">tuexen@ampere128:~ % ping6 -c 1 -b = 30000 -s 20000 ::1<br class=3D"">PING6(20048=3D40+8+20000 bytes) ::1 = --> ::1<br class=3D"">20008 bytes from ::1, icmp_seq=3D0 hlim=3D64 = time=3D0.709 ms<br class=3D""><br class=3D"">--- ::1 ping6 statistics = ---<br class=3D"">1 packets transmitted, 1 packets received, 0.0% packet = loss<br class=3D"">round-trip min/avg/max/std-dev =3D = 0.709/0.709/0.709/0.000 ms<br class=3D""><br class=3D"">which is = expected. What I don't expect is:<br class=3D""><br = class=3D"">tuexen@ampere128:~ % tcpdump -i lo0 -n<br class=3D"">tcpdump: = verbose output suppressed, use -v or -vv for full protocol decode<br = class=3D"">listening on lo0, link-type NULL (BSD loopback), capture size = 262144 bytes<br class=3D"">22:06:38.835630 IP6 ::1 > ::1: frag = (0|1232) ICMP6, echo request, seq 0, length 1232<br = class=3D"">22:06:38.835639 IP6 ::1 > ::1: frag (1232|1232)<br = class=3D"">22:06:38.835641 IP6 ::1 > ::1: frag (2464|1232)<br = class=3D"">22:06:38.835641 IP6 ::1 > ::1: frag (3696|1232)<br = class=3D"">22:06:38.835642 IP6 ::1 > ::1: frag (4928|1232)<br = class=3D"">22:06:38.835642 IP6 ::1 > ::1: frag (6160|1232)<br = class=3D"">22:06:38.835643 IP6 ::1 > ::1: frag (7392|1232)<br = class=3D"">22:06:38.835644 IP6 ::1 > ::1: frag (8624|1232)<br = class=3D"">22:06:38.835644 IP6 ::1 > ::1: frag (9856|1232)<br = class=3D"">22:06:38.835645 IP6 ::1 > ::1: frag (11088|1232)<br = class=3D"">22:06:38.835645 IP6 ::1 > ::1: frag (12320|1232)<br = class=3D"">22:06:38.835646 IP6 ::1 > ::1: frag (13552|1232)<br = class=3D"">22:06:38.835647 IP6 ::1 > ::1: frag (14784|1232)<br = class=3D"">22:06:38.835647 IP6 ::1 > ::1: frag (16016|1232)<br = class=3D"">22:06:38.835648 IP6 ::1 > ::1: frag (17248|1232)<br = class=3D"">22:06:38.835648 IP6 ::1 > ::1: frag (18480|1232)<br = class=3D"">22:06:38.835649 IP6 ::1 > ::1: frag (19712|296)<br = class=3D"">22:06:38.836002 IP6 ::1 > ::1: frag (0|16336) ICMP6, echo = reply, seq 0, length 16336<br class=3D"">22:06:38.836006 IP6 ::1 > = ::1: frag (16336|3672)<br class=3D"">^C<br class=3D"">19 packets = captured<br class=3D"">19 packets received by filter<br class=3D"">0 = packets dropped by kernel<br class=3D""><br class=3D"">Why is for the = Echo Request an MTU of 1280 used, whereas for the response an MTU of = 16384<br class=3D"">is used.<br class=3D""><br class=3D"">Since<br = class=3D"">tuexen@ampere128:~ % ifconfig lo0<br class=3D"">lo0: = flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384<br = class=3D""><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> = </span>options=3D680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6= ><br class=3D""><span class=3D"Apple-tab-span" style=3D"white-space: = pre;"> </span>inet6 ::1 prefixlen 128<br class=3D""><span = class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>inet6 = fe80::1%lo0 prefixlen 64 scopeid 0x3<br class=3D""><span = class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>inet = 127.0.0.1 netmask 0xff000000<br class=3D""><span class=3D"Apple-tab-span" = style=3D"white-space: pre;"> </span>groups: lo<br class=3D""><span = class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>nd6 = options=3D21<PERFORMNUD,AUTO_LINKLOCAL><br class=3D"">is used, I = would expect an MTU of 16384 also be used for the Echo Request instead = of<br class=3D"">the minimum IPv6 MTU of 1280.<br = class=3D""></blockquote><br style=3D"caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = text-decoration: none;" class=3D""><span style=3D"caret-color: rgb(0, 0, = 0); font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = text-decoration: none; float: none; display: inline !important;" = class=3D"">I believe MTU of 16384 should be used for Echo = Request.</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant-caps: = normal; font-weight: normal; letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: = none;" class=3D""></div></blockquote><div><br class=3D""></div><div>That = is by intuition.</div><div><br class=3D""></div><div>RFC 3542 = introduced IPV6_USE_MIN_MTU and FreeBSD implemented it = in 33841545909f4.</div><div><br class=3D""></div><div>IPv6 is = different from IPv4 of fragmentation, intermediate routers are not = allowed to do <span style=3D"caret-color: rgb(0, 0, 0); color: = rgb(0, 0, 0);" class=3D"">fragmentation</span></div><div><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=3D"">and = thus PMTU is a must (or a minimal MTU should be = chosen).</span></div><div><span style=3D"caret-color: rgb(0, 0, 0); = color: rgb(0, 0, 0);" class=3D""><br class=3D""></span></div><div><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" = class=3D"">Section 11.1 in RFC 3542:</span></div><div><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=3D"">> = </span><font color=3D"#000000" class=3D""><span = style=3D"caret-color: rgb(0, 0, 0);" class=3D"">For unicast destinations = path</span></font></div><div><font color=3D"#000000" class=3D""><span = style=3D"caret-color: rgb(0, 0, 0);" class=3D"">> MTU = discovery should be performed by default. For = multicast</span></font></div><div><font color=3D"#000000" class=3D""><span= style=3D"caret-color: rgb(0, 0, 0);" class=3D"">> = destinations path MTU discovery should be disabled by = default.</span></font></div><div><font color=3D"#000000" class=3D""><span = style=3D"caret-color: rgb(0, 0, 0);" class=3D""><br = class=3D""></span></font></div><div><font color=3D"#000000" = class=3D""><span style=3D"caret-color: rgb(0, 0, 0);" class=3D"">For = simple ping6 program it seems disable performing PMTU for both unicast = and multicast destinations</span></font></div><div><font color=3D"#000000"= class=3D""><span style=3D"caret-color: rgb(0, 0, 0);" class=3D"">by = default is lightweight. In most cases we do not send large payload via = ping6.</span></font></div><br class=3D""><blockquote type=3D"cite" = class=3D""><div class=3D""><br style=3D"caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = text-decoration: none;" class=3D""><blockquote type=3D"cite" = style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = orphans: auto; text-align: start; text-indent: 0px; text-transform: = none; white-space: normal; widows: auto; word-spacing: 0px; = -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; = text-decoration: none;" class=3D""><br class=3D"">Is this intended? At = least for me, it is not expected...<br class=3D""><br class=3D"">Best = regards<br class=3D"">Michael</blockquote></div></blockquote></div><br = class=3D""></body></html>= --Apple-Mail=_578914C8-0B57-4ADA-A14B-0DA453CB8278--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?05FB9658-5293-4154-BB50-2E3A189DD306>