From owner-freebsd-net@freebsd.org Thu Jan 16 15:53:16 2020 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 BE9B91ED123 for ; Thu, 16 Jan 2020 15:53:16 +0000 (UTC) (envelope-from vas@sibptus.ru) Received: from admin.sibptus.ru (admin.sibptus.ru [IPv6:2001:19f0:5001:21dc::10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47z7yM4855z4CRc; Thu, 16 Jan 2020 15:53:15 +0000 (UTC) (envelope-from vas@sibptus.ru) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sibptus.ru; s=20181118; h=In-Reply-To:Message-ID:Subject:To:From:Date; bh=zldqQgl1DrvBc1DwfFVATHMQJOToH+gebOZdxxTM5OY=; b=STnxZxh7mZ6/I+zUiR34BGOABb 8eEwPQtjoZIHj5pMaFUTXq+2ipZyXMOtFz9LgQ5L8VFsX3YitlDfwofGIZAK/jGRkPaUq2Ti+N6P+ 4xjUQywSvPE4XnTBpHHxCi0BemNOqgf8wucFpVmB72bDPFLr1deNfGF26T91uNoF3gD0=; Received: from vas by admin.sibptus.ru with local (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1is7SD-0000Fk-Fq; Thu, 16 Jan 2020 22:53:05 +0700 Date: Thu, 16 Jan 2020 22:53:05 +0700 From: Victor Sudakov To: Eugene Grosbein Cc: "Andrey V. Elsukov" , freebsd-net@freebsd.org, Michael Tuexen Subject: Re: IPSec transport mode, mtu, fragmentation... Message-ID: <20200116155305.GA465@admin.sibptus.ru> References: <20191220152314.GA55278@admin.sibptus.ru> <4cc83b85-dd30-8c0d-330e-aa549ce98c98@yandex.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://admin.sibptus.ru/~vas/ X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 X-Rspamd-Queue-Id: 47z7yM4855z4CRc X-Spamd-Bar: -------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=sibptus.ru header.s=20181118 header.b=STnxZxh7; dmarc=pass (policy=none) header.from=sibptus.ru; spf=pass (mx1.freebsd.org: domain of vas@sibptus.ru designates 2001:19f0:5001:21dc::10 as permitted sender) smtp.mailfrom=vas@sibptus.ru X-Spamd-Result: default: False [-8.41 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[sibptus.ru:s=20181118]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; IP_SCORE(-3.31)[ip: (-9.89), ipnet: 2001:19f0:5000::/38(-4.94), asn: 20473(-1.68), country: US(-0.05)]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[sibptus.ru:+]; DMARC_POLICY_ALLOW(-0.50)[sibptus.ru,none]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5000::/38, country:US]; FREEMAIL_CC(0.00)[yandex.ru]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jan 2020 15:53:16 -0000 --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Eugene Grosbein wrote: >=20 > > I prepared the PoC patch that should fix the problem with TCP and > > transport mode IPsec. But I have not free time currently to properly > > test and debug it. It is only compile-tested. But If you want, you can > > try :) > > Currently only IPv4 support is implemented. > >=20 > > https://people.freebsd.org/~ae/ipsec_transport_mode_ctlinput.diff >=20 > In fact, I've faced this problem long time ago too and I work around it w= ith different approaches > like "ipfw tcp-setmss" (MSS adjust) or by using IPSec transport mode > with gif(4) interface removing DF bit out of encapsulated packets. >=20 > I was going to test your patch with my home router but the patch does not= apply to stable/11, at all. > Do you have time to adjust it to stable/11 ? What beats me is that I cannot reproduce this problem in bhyve. In this packet dump: http://admin.sibptus.ru/~vas/ipsec1.pcap.gz I'm scp-ing a 50M file from 192.168.246.10 (bhyve guest) to 192.168.246.1 (bhyve host), and I see no fragments, and the largets packet is 1466 bytes, and the scp never stalls nor fails. Why is it NOT broken this time? Both hosts are 12.1-RELEASE-p1. --=20 Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ --VbJkn9YxBvnuCH5J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJeIIbhAAoJEA2k8lmbXsY0AkkH/389HQVIP9uikJV3TMCeijtD 2+VALcn04wYpzJVReFIEYIdcE2hmxa+EusRdVA3pOFFSixWr/xmsH0+OeHvpZIlU ZxDqNccij/4d4RApuN1lR73wZTfJmIQPA4EPD6AHKLPlzYstGfUyDHJ/cVrIgVwD hMkWtyULpg/DzAbZ0E3asKY+o0dfgeLiPst/qNkLKo4C+o3zy8b2g/hOtH80+q+7 gsZNqSjqoBg9Qn8IG+7H5UcgbYjySR6jSHQMTrNenIyIKe5jn0VcESMJqsw4eWd0 qnNBCdQF5tbSENZzM+AaI2PCeww8HqF1P71J9ozOiSwzwhWLFH9W2m8sTzwC6ow= =EbVp -----END PGP SIGNATURE----- --VbJkn9YxBvnuCH5J--