Date: Fri, 17 Jan 2020 16:36:45 +0700 From: Victor Sudakov <vas@sibptus.ru> To: Eugene Grosbein <eugen@grosbein.net> Cc: freebsd-net@freebsd.org, "Andrey V. Elsukov" <bu7cher@yandex.ru>, Michael Tuexen <tuexen@freebsd.org> Subject: Re: IPSec transport mode, mtu, fragmentation... Message-ID: <20200117093645.GA51899@admin.sibptus.ru> In-Reply-To: <72355e03-1cf8-c58f-3aec-b0a21e631870@grosbein.net> References: <20191220152314.GA55278@admin.sibptus.ru> <4cc83b85-dd30-8c0d-330e-aa549ce98c98@yandex.ru> <f9b7357e-ced1-4ce5-40d5-8e3dcad42442@yandex.ru> <d263a709-63cf-7da5-1747-8a6791f6503f@grosbein.net> <20200116155305.GA465@admin.sibptus.ru> <55f7bafa-24c4-9810-0d21-f82cb332ee2d@grosbein.net> <20200116160745.GA1356@admin.sibptus.ru> <72355e03-1cf8-c58f-3aec-b0a21e631870@grosbein.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Eugene Grosbein wrote: >=20 > >>> What beats me is that I cannot reproduce this problem in bhyve. In th= is > >>> 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. > >> > >> I could not reproduce the problem with unpatched recent stable/11, eit= her :-) > >=20 > > Is there a way to view the MSS in the TCP segments before encryption or > > after decryption? I want to compare them in situations with IPSec > > enabled and disabled. > >=20 > > I've never been able to see anything in "tcpdump -i enc0", probably it > > cannot do transport mode IPSec because the man page talks about "outer > > and inner header." >=20 > enc0 does what you need but before you use it, remember: >=20 > 1) before starting, you better change sysctls to: >=20 > net.enc.in.ipsec_filter_mask=3D0 > net.enc.out.ipsec_filter_mask=3D0 >=20 > so using enc0 does not pass packets over netpfilter rules extra time; >=20 > 2) don't forget: ifconfig enc0 up Perhaps I was forgetting some of those steps previously, because this time I got the desired traffic from enc0.=20 >=20 > 3) tcpdump has no means to filter by inner attributes in case of tunnel m= ode; > it still shows decoded IPSec transport mode packets correctly. Most importantly, Wireshark recognizes it as "Encapsulation type: OpenBSD enc(4) encapsulating interface" and shows the contents correctly. Back to the point. I've figured out that both encrypted (in transport mode) and unencrypted TCP segments have the same MSS=3D1460. Then I'm completely at a loss how the encrypted packets avoid being fragmented. TCP has no way to know in advance that encryption overhead will be added. --=20 Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ --d6Gm4EdcadzBjdND Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJeIYAtAAoJEA2k8lmbXsY0/YUIAJlPiqAcUg7lzK50R2m20g+u nNTC+XBgaC56YkYWZtQXxLTNrZPbgXsUHdJXPiUnqQM6lWTWZ0nTdpy7PC9H0PgZ ZmeoXHzh+oKqT+Y5mWwylisGoqFetExkpE2prGp8u73y36N4VTJU4PSRBl0hAkz+ 4dG4xuNz8ZDql7QnPiEQZe5KY9BNC73Wl/2bZw19XfMdKMJ8rEHrUbA66skKVXxi 1xQeRjXiZpv38UwWc1UZ4AkYlNpkuLCXukEKkJFnF+7NtKE9hOIOqW2can07W0yY k6LbY62azEgrJEpa7E+mAChotX+Z2h3r4VNUV2u7za8WjfP2uFBmugxxRbvymSM= =LK9w -----END PGP SIGNATURE----- --d6Gm4EdcadzBjdND--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200117093645.GA51899>