Hi Noah,
Below are some (IPv4) UDP examples from our internal packetdrill suite, which we have not had a chance to post upstream yet. Feel free to let me know how these work for you.
best,
neal
--------------
0 socket(..., SOCK_DGRAM, IPPROTO_UDP) = 3
// Send the biggest possible UDP/IPv4 packet (without fragmentation).
+.01 sendto(3, ..., 1472, 0, ..., ...) = 1472
+0 > udp (1472)
// RFC 791 says the minimum IPv4 MTU is 68 bytes, so we should allow this.
+.01 < icmp unreachable frag_needed mtu 68 [udp (1472)]
+.01 < udp (1472)
+0 recvfrom(3, ..., 1472, 0, ..., ...) = 1472
--------------
0 socket(..., SOCK_DGRAM, IPPROTO_UDP) = 3
+.01 connect(3, ..., ...) = 0
+0 getsockopt(3, IPPROTO_IP, IP_MTU, [1500], [4]) = 0
// Send the biggest possible UDP/IPv4 packet (without fragmentation).
+0 write(3, ..., 1472) = 1472
+0 > udp (1472)
// Check behavior with an MTU of net.ipv4.route.min_pmtu = 552 (512 + 20 + 20)
+.01 < icmp unreachable frag_needed mtu 552 [udp (1472)]
+.01 < udp (1472)
+0 read(3, ..., 2000) = -1 EMSGSIZE (Message too long)
+0 read(3, ..., 2000) = 1472