From owner-freebsd-net@freebsd.org Sat Feb 20 12:13:42 2021 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73C4E54446A for ; Sat, 20 Feb 2021 12:13:42 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4DjS5y2nKwz3MNv for ; Sat, 20 Feb 2021 12:13:42 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id 5F8BD544CA2; Sat, 20 Feb 2021 12:13:42 +0000 (UTC) Delivered-To: net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F571544960 for ; Sat, 20 Feb 2021 12:13:42 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DjS5y2H9dz3MLd; Sat, 20 Feb 2021 12:13:42 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 11A0C2B8FE; Sat, 20 Feb 2021 12:13:42 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 6B67E4FE0A; Sat, 20 Feb 2021 13:13:40 +0100 (CET) From: "Kristof Provost" To: "Doug Hardie" Cc: "net@freebsd.org" Subject: Re: IPv6 Fragmentation Date: Sat, 20 Feb 2021 13:13:39 +0100 X-Mailer: MailMate (1.13.2r5673) Message-ID: In-Reply-To: References: <472A2B49-9BEC-4335-B6FB-AC4DAA0F0310@lurchi.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2021 12:13:42 -0000 On 20 Feb 2021, at 5:32, Doug Hardie wrote: >> On 19 February 2021, at 01:48, Michael Tuexen >> wrote: >> >>> On 19. Feb 2021, at 03:29, Doug Hardie wrote: >>> >>> I don't know if this is a feature or a bug. On FreeBSD 9, the >>> following ping worked: >>> >>> ping6 -s 5000 -b 6000 fe80::213:72ff:fec3:180f%dc0 >> I don't have a dc0 interface, but using re0 at one side and bge at >> the other, I get >> with FreeBSD CURRENT: >> tuexen@cirrus:~ % ping6 -s 5000 -b 6000 fe80::2e09:4dff:fe00:c00%re0 >> PING6(5048=40+8+5000 bytes) fe80::aaa1:59ff:fe0c:da92%re0 --> >> fe80::2e09:4dff:fe00:c00%re0 >> 5008 bytes from fe80::2e09:4dff:fe00:c00%re0, icmp_seq=0 hlim=255 >> time=0.393 ms >> 5008 bytes from fe80::2e09:4dff:fe00:c00%re0, icmp_seq=1 hlim=255 >> time=0.419 ms >> 5008 bytes from fe80::2e09:4dff:fe00:c00%re0, icmp_seq=2 hlim=255 >> time=0.354 ms >> 5008 bytes from fe80::2e09:4dff:fe00:c00%re0, icmp_seq=3 hlim=255 >> time=0.446 ms >> 5008 bytes from fe80::2e09:4dff:fe00:c00%re0, icmp_seq=4 hlim=255 >> time=0.421 ms >> 5008 bytes from fe80::2e09:4dff:fe00:c00%re0, icmp_seq=5 hlim=255 >> time=0.372 ms >> ^C >> --- fe80::2e09:4dff:fe00:c00%re0 ping6 statistics --- >> 6 packets transmitted, 6 packets received, 0.0% packet loss >> round-trip min/avg/max/std-dev = 0.354/0.401/0.446/0.031 ms >> >> Best regards >> Michael >>> >>> It had to be stopped, but it returned the number of ping responses >>> received along with statistics. >>> >>> With FreeBSD 12.2 and 13.0-BETA2, it returns 100% packet loss. >>> tcpdump shows that it properly fragments the data, sends it, the >>> other end receives it and sends back the ACKs. The ACKs are >>> received, but somehow ping doesn't find out that the packets were >>> received. >>> >>> Without the -s and -b arguments, it works and you get 100% packets >>> received. > > I found the problem. pf does not handle IPv6 packets that are > fragmented the obvious way. I suspect it is because icmp header is > only in the first fragment. I had to reassemble fragments in pf in > order to make the large pings work. > If you don’t have `scrub fragment reassemble` set then you have to include something like `pass log inet6 proto ipv6-frag all` to pass fragmented packets (assuming you block by default). You really, really want `scrub fragment reassemble` because otherwise your firewall can be trivially bypassed, but you need one of the two for fragmented packets to work. Best regards, Kristof