UDP - Message too long

Cause


Practice

Use ICMP pacakge to find out best MTU value

IP pacakge header occupy 20 bytes, ICMP package header occupy 8 bytes.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Linux
# google.com 216.58.204.110
# ping -c (number) -M do -s (bytes) IP
ping -c 1 -M do -s 1470 216.58.204.110
# or ping -c 1 -M do -s 1472 216.58.204.110

# regular output
--- 216.58.204.110 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 4.616/4.616/4.616/0.000 ms


ping -c 1 -M do -s 1500 216.58.204.110
# or ping -c 1 -M do -s 1473 216.58.204.110
# error output
PING 216.58.204.110 (216.58.204.110) 1500(1528) bytes of data.
ping: local error: Message too long, mtu=1500

--- 216.58.204.110 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms