START sys/netinet/pmtu 2024-03-25T19:37:55Z rm -f addr.py addr.py.tmp echo 'LOCAL_IF = "em2"' >>addr.py.tmp echo 'LOCAL_MAC = "90:e2:ba:a4:76:86"' >>addr.py.tmp echo 'REMOTE_MAC = "90:e2:ba:d8:67:2d"' >>addr.py.tmp echo 'LOCAL_ADDR = "10.188.81.21"' >>addr.py.tmp echo 'LOCAL_ADDR6 = "fdd7:e83e:66bc:81::21"' >>addr.py.tmp echo 'REMOTE_ADDR = "10.188.81.22"' >>addr.py.tmp echo 'REMOTE_ADDR6 = "fdd7:e83e:66bc:81::22"' >>addr.py.tmp echo 'FAKE_NET_ADDR = "10.188.80.188"' >>addr.py.tmp echo 'FAKE_NET_ADDR6 = "fdd7:e83e:66bc:80::188"' >>addr.py.tmp echo 'FAKE_NET = "10.188.80.0/24"' >>addr.py.tmp echo 'FAKE_NET6 = "fdd7:e83e:66bc:80::/64"' >>addr.py.tmp mv addr.py.tmp addr.py true ssh -t ot2 true Pseudo-terminal will not be allocated because stdin is not a terminal. ==== pfctl ==== # default "block return; pass" interferes with test, use "block; pass" cat addr.py /usr/src/regress/sys/netinet/pmtu/pf.conf | /sbin/pfctl -n -f - cat addr.py /usr/src/regress/sys/netinet/pmtu/pf.conf | /sbin/pfctl -a regress -f - cat addr.py /usr/src/regress/sys/netinet/pmtu/pf.conf | ssh ot2 pfctl -a regress -f - ==== run-ping ==== route -n delete -inet -host 10.188.81.22 || true delete host 10.188.81.22 ssh ot2 route -n delete -inet -host 10.188.80.188 || true delete host 10.188.80.188: not in table Check ping LOCAL_ADDR ping -n -c 1 10.188.81.21 PING 10.188.81.21 (10.188.81.21): 56 data bytes 64 bytes from 10.188.81.21: icmp_seq=0 ttl=255 time=0.084 ms --- 10.188.81.21 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.084/0.084/0.084/0.000 ms Check ping REMOTE_ADDR ping -n -c 1 10.188.81.22 PING 10.188.81.22 (10.188.81.22): 56 data bytes 64 bytes from 10.188.81.22: icmp_seq=0 ttl=255 time=0.449 ms --- 10.188.81.22 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.449/0.449/0.449/0.000 ms ==== run-ping6 ==== route -n delete -inet6 -host fdd7:e83e:66bc:81::22 || true delete host fdd7:e83e:66bc:81::22 ssh ot2 route -n delete -inet6 -host fdd7:e83e:66bc:80::188 || true delete host fdd7:e83e:66bc:80::188: not in table Check ping6 LOCAL_ADDR6 ping6 -n -c 1 fdd7:e83e:66bc:81::21 PING fdd7:e83e:66bc:81::21 (fdd7:e83e:66bc:81::21): 56 data bytes 64 bytes from fdd7:e83e:66bc:81::21: icmp_seq=0 hlim=64 time=0.085 ms --- fdd7:e83e:66bc:81::21 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.085/0.085/0.085/0.000 ms Check ping6 REMOTE_ADDR6 ping6 -n -c 1 fdd7:e83e:66bc:81::22 PING fdd7:e83e:66bc:81::22 (fdd7:e83e:66bc:81::22): 56 data bytes 64 bytes from fdd7:e83e:66bc:81::22: icmp_seq=0 hlim=64 time=0.520 ms --- fdd7:e83e:66bc:81::22 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.520/0.520/0.520/0.000 ms ==== run-pmtu ==== route -n delete -inet -host 10.188.81.22 || true delete host 10.188.81.22 ssh ot2 route -n delete -inet -host 10.188.80.188 || true delete host 10.188.80.188: not in table Send ICMP fragmentation needed after fake TCP connect PYTHONPATH=/usr/src/regress/sys/netinet/pmtu/obj python3 -u /usr/src/regress/sys/netinet/pmtu/tcp_connect.py /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:471: CryptographyDeprecationWarning: Blowfish has been deprecated and will be removed in a future release cipher=algorithms.Blowfish, /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:485: CryptographyDeprecationWarning: CAST5 has been deprecated and will be removed in a future release cipher=algorithms.CAST5, Send SYN packet, receive SYN+ACK. Begin emission: Finished sending 1 packets. ...* Received 4 packets, got 1 answers, remaining 0 packets Send ACK packet, receive chargen data. Begin emission: Finished sending 1 packets. .* Received 2 packets, got 1 answers, remaining 0 packets Fill our receive buffer. Send ICMP fragmentation needed packet with MTU 1300. . Sent 1 packets. Path MTU discovery will resend first data with length 1300. Cleanup the other's socket with a reset packet. . Sent 1 packets. len=1300 ==== run-pmtu6 ==== route -n delete -inet6 -host fdd7:e83e:66bc:81::22 || true delete host fdd7:e83e:66bc:81::22 ssh ot2 route -n delete -inet6 -host fdd7:e83e:66bc:80::188 || true delete host fdd7:e83e:66bc:80::188: not in table Send ICMP6 packet too big after fake TCP connect PYTHONPATH=/usr/src/regress/sys/netinet/pmtu/obj python3 -u /usr/src/regress/sys/netinet/pmtu/tcp_connect6.py /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:471: CryptographyDeprecationWarning: Blowfish has been deprecated and will be removed in a future release cipher=algorithms.Blowfish, /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:485: CryptographyDeprecationWarning: CAST5 has been deprecated and will be removed in a future release cipher=algorithms.CAST5, Send SYN packet, receive SYN+ACK. Begin emission: Finished sending 1 packets. .* Received 2 packets, got 1 answers, remaining 0 packets Send ACK packet, receive chargen data. Begin emission: Finished sending 1 packets. .* Received 2 packets, got 1 answers, remaining 0 packets Fill our receive buffer. Send ICMP6 packet too big packet with MTU 1300. . Sent 1 packets. Path MTU discovery will resend first data with length 1300. Cleanup the other's socket with a reset packet. . Sent 1 packets. len=1300 ==== run-udp6 ==== route -n delete -inet6 -host fdd7:e83e:66bc:81::22 || true delete host fdd7:e83e:66bc:81::22 ssh ot2 route -n delete -inet6 -host fdd7:e83e:66bc:80::188 || true delete host fdd7:e83e:66bc:80::188 Send ICMP6 packet too big after UDP echo PYTHONPATH=/usr/src/regress/sys/netinet/pmtu/obj python3 -u /usr/src/regress/sys/netinet/pmtu/udp_echo6.py /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:471: CryptographyDeprecationWarning: Blowfish has been deprecated and will be removed in a future release cipher=algorithms.Blowfish, /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:485: CryptographyDeprecationWarning: CAST5 has been deprecated and will be removed in a future release cipher=algorithms.CAST5, Send UDP packet with 1400 octets payload, receive echo. Begin emission: Finished sending 1 packets. .* Received 2 packets, got 1 answers, remaining 0 packets Send ICMP6 packet too big packet with MTU 1300. . Sent 1 packets. Clear route cache at echo socket by sending from different address. . Sent 1 packets. Send UDP packet with 1400 octets payload. . Sent 1 packets. Path MTU discovery will send UDP fragment with maximum length 1300. UDP echo has IPv6 and UDP header, so expected payload len is 1448. elen=1448 Fragments contain multiple of 8 octets, so expected len is 1296. flen=1296 ==== run-gateway6 ==== route -n delete -inet6 -host fdd7:e83e:66bc:81::22 || true delete host fdd7:e83e:66bc:81::22 ssh ot2 route -n delete -inet6 -host fdd7:e83e:66bc:80::188 || true delete host fdd7:e83e:66bc:80::188 Send ICMP6 packet too big after UDP echo PYTHONPATH=/usr/src/regress/sys/netinet/pmtu/obj python3 -u /usr/src/regress/sys/netinet/pmtu/udp_echo6.py /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:471: CryptographyDeprecationWarning: Blowfish has been deprecated and will be removed in a future release cipher=algorithms.Blowfish, /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:485: CryptographyDeprecationWarning: CAST5 has been deprecated and will be removed in a future release cipher=algorithms.CAST5, Send UDP packet with 1400 octets payload, receive echo. Begin emission: Finished sending 1 packets. .* Received 2 packets, got 1 answers, remaining 0 packets Send ICMP6 packet too big packet with MTU 1300. . Sent 1 packets. Clear route cache at echo socket by sending from different address. . Sent 1 packets. Send UDP packet with 1400 octets payload. . Sent 1 packets. Path MTU discovery will send UDP fragment with maximum length 1300. UDP echo has IPv6 and UDP header, so expected payload len is 1448. elen=1448 Fragments contain multiple of 8 octets, so expected len is 1296. flen=1296 Remove gateway route of a dynamic PMTU route ssh ot2 route -n delete -inet6 -host fdd7:e83e:66bc:81::21 delete host fdd7:e83e:66bc:81::21 ssh ot2 route -n get -inet6 -host fdd7:e83e:66bc:80::188 >pmtu.route cat pmtu.route route to: fdd7:e83e:66bc:80::188 destination: fdd7:e83e:66bc:80::188 mask: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff gateway: fdd7:e83e:66bc:81::21 interface: em1 if address: fdd7:e83e:66bc:81::22 priority: 8 (static) flags: use mtu expire 7 0 595 grep -q 'gateway: fdd7:e83e:66bc:81::21' pmtu.route grep -q 'flags: ' pmtu.route PYTHONPATH=/usr/src/regress/sys/netinet/pmtu/obj python3 -u /usr/src/regress/sys/netinet/pmtu/udp_echo6.py /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:471: CryptographyDeprecationWarning: Blowfish has been deprecated and will be removed in a future release cipher=algorithms.Blowfish, /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:485: CryptographyDeprecationWarning: CAST5 has been deprecated and will be removed in a future release cipher=algorithms.CAST5, Send UDP packet with 1400 octets payload, receive echo. Begin emission: Finished sending 1 packets. ...* Received 4 packets, got 1 answers, remaining 0 packets Send ICMP6 packet too big packet with MTU 1300. . Sent 1 packets. Clear route cache at echo socket by sending from different address. . Sent 1 packets. Send UDP packet with 1400 octets payload. . Sent 1 packets. Path MTU discovery will send UDP fragment with maximum length 1300. UDP echo has IPv6 and UDP header, so expected payload len is 1448. elen=1448 Fragments contain multiple of 8 octets, so expected len is 1296. flen=1296 ==== run-tcpfrag6 ==== route -n delete -inet6 -host fdd7:e83e:66bc:81::22 || true delete host fdd7:e83e:66bc:81::22 ssh ot2 route -n delete -inet6 -host fdd7:e83e:66bc:80::188 || true delete host fdd7:e83e:66bc:80::188 Send ICMP6 and try to trigger a short TCP segment PYTHONPATH=/usr/src/regress/sys/netinet/pmtu/obj python3 -u /usr/src/regress/sys/netinet/pmtu/tcp_atomicfrag6.py /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:471: CryptographyDeprecationWarning: Blowfish has been deprecated and will be removed in a future release cipher=algorithms.Blowfish, /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:485: CryptographyDeprecationWarning: CAST5 has been deprecated and will be removed in a future release cipher=algorithms.CAST5, Send SYN packet, receive SYN+ACK. Begin emission: Finished sending 1 packets. .* Received 2 packets, got 1 answers, remaining 0 packets Send ACK packet, receive chargen data. Begin emission: Finished sending 1 packets. .* Received 2 packets, got 1 answers, remaining 0 packets Fill our receive buffer. Send ICMP6 packet too big packet with MTU 1272. . Sent 1 packets. Path MTU discovery will not resend data, ICMP6 packet is ignored. IPv6 atomic fragments must not be generated. Send ACK again to trigger retransmit. Begin emission: Finished sending 1 packets. .* Received 2 packets, got 1 answers, remaining 0 packets Cleanup the other's socket with a reset packet. . Sent 1 packets. len=1500 ==== run-udpfrag6 ==== route -n delete -inet6 -host fdd7:e83e:66bc:81::22 || true delete host fdd7:e83e:66bc:81::22 ssh ot2 route -n delete -inet6 -host fdd7:e83e:66bc:80::188 || true delete host fdd7:e83e:66bc:80::188: not in table Send ICMP6 and try to trigger an atomic UDP IPv6 fragment PYTHONPATH=/usr/src/regress/sys/netinet/pmtu/obj python3 -u /usr/src/regress/sys/netinet/pmtu/udp_atomicfrag6.py /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:471: CryptographyDeprecationWarning: Blowfish has been deprecated and will be removed in a future release cipher=algorithms.Blowfish, /usr/local/lib/python3.10/site-packages/scapy/layers/ipsec.py:485: CryptographyDeprecationWarning: CAST5 has been deprecated and will be removed in a future release cipher=algorithms.CAST5, Send UDP packet with 1200 octets payload, receive echo. Begin emission: Finished sending 1 packets. .* Received 2 packets, got 1 answers, remaining 0 packets Send ICMP6 packet too big packet with MTU 1272. . Sent 1 packets. Clear route cache at echo socket by sending from different address. . Sent 1 packets. Send UDP packet with 1200 octets payload. . Sent 1 packets. Path MTU discovery will not send UDP atomic fragment. IPv6 atomic fragments must not be generated. Send echo again and expect reply without fragmentation. Begin emission: Finished sending 1 packets. .* Received 2 packets, got 1 answers, remaining 0 packets UDP echo has IPv6 and UDP header, so expected payload len is 1248. rlen=1248 ==== reset-route ==== route -n delete -inet -host 10.188.81.22 || true delete host 10.188.81.22 ssh ot2 route -n delete -inet -host 10.188.80.188 || true delete host 10.188.80.188 ==== reset-route6 ==== route -n delete -inet6 -host fdd7:e83e:66bc:81::22 || true delete host fdd7:e83e:66bc:81::22 ssh ot2 route -n delete -inet6 -host fdd7:e83e:66bc:80::188 || true delete host fdd7:e83e:66bc:80::188: not in table PASS sys/netinet/pmtu Duration 0m51.56s