| Summary: | Issues with path MTU discovery on IPv6 and SSH | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Niclas Zeising <zeising> | ||||||||||||||||
| Component: | kern | Assignee: | freebsd-net (Nobody) <net> | ||||||||||||||||
| Status: | Open --- | ||||||||||||||||||
| Severity: | Affects Some People | CC: | net, tuexen | ||||||||||||||||
| Priority: | --- | Keywords: | needs-qa | ||||||||||||||||
| Version: | CURRENT | ||||||||||||||||||
| Hardware: | Any | ||||||||||||||||||
| OS: | Any | ||||||||||||||||||
| Attachments: |
|
||||||||||||||||||
|
Description
Niclas Zeising
2019-08-09 18:40:03 UTC
So, I did some more digging, and I think my initial conclusions weren't entirely correct. I set up the following mini network, with a client on one subnet, and a server on another, and a router in between running PF. All machines are running FreeBSD 12.0. |server| ---- <MTU 1280> ---- |router| ---- <MTU 1500> ---- |client| server IP: 2001:db8:ffff:ff00::2 client IP: 2001:db8:ffff:ff10::2 I then try two connections to the server: One with ssh, running ssh on the client to connect to sshd on the server. One using netcat: nc command on server: nc -6 -l 1234 nc command on client: cat /usr/share/examples/IPv6/USAGE | nc -6 ip-of-server Between the ssh and nc invocations, I wipe the TCP host cache using sysctl net.inet.tcp.hostcache.purgenow=1 I run the above tests with three different router configurations. First, I use the ruleset modulate.pf.conf, which uses modulate state for state tracking of TCP connections. Second, I use the ruleset keep.pf.conf, which uses keep state for state tracking. Third, I disable PF completely. In the first case, using modulate state, the ssh connection stalls, and it looks like the path mtu discovery fails. The nc connection works though. In the second and third case, things work as normal. I am guessing that 'modulate state' somehow screws up path MTU discovery, so that the ptb packet sent by the router isn't recognized by the client, but this is just a guess. I've attached the two different PF rule sets used, as well as /etc/rc.conf from the router, and pcap traffic dumps from all three runs. Created attachment 206496 [details]
PF rulseset using modulate state
Created attachment 206497 [details]
pcap traffic dump using modulate state PF conf
Created attachment 206498 [details]
PF ruleset using modulate state
Created attachment 206499 [details]
PF ruleset using keep state
Created attachment 206500 [details]
pcap traffic dump using keep state PF conf
Created attachment 206501 [details]
pcap traffic dump not using PF
Created attachment 206502 [details]
router /etc/rc.conf
Switched out the router to one running OpenBSD with a similar setup. OpenBSD is affected as well. I guess you traced at the router. Could you run the first and third scenario with tracing at the client and the router at the same time? I'm wondering if the client receives the ICMPv6 PTB message at all. Right now, I don't see a problem with the TCP stack on the client side. To improve the situation, you could enable blackhole detection by setting sudo sysctl -w net.inet.tcp.pmtud_blackhole_detection=1 Then the TCP connections should not stall, but should automatically reduce the MSS after a (small) number of retransmissions. |