Gentoo Archives: gentoo-user

From: David Haller <gentoo@×××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] {OT} ISP requires MTU below 1500?
Date: Tue, 20 Sep 2016 14:47:35
Message-Id: 20160920144615.juwnp76jtqe6ec7y@grusum.endjinn.de
In Reply to: Re: [gentoo-user] {OT} ISP requires MTU below 1500? by Grant
1 Hello,
2
3 On Tue, 20 Sep 2016, Grant wrote:
4 >> MTU is per network interface but you really don't want to end up having
5 >> your router fragment every IP packet because systems on your subnet are
6 >> using a larger MTU.
7 >>
8 >> Todd
9 >
10 >That makes sense. So in my case, I'm thinking 1492 MTU on every
11 >interface in the network.
12 >
13 >So I'm sure I understand, should everyone with a DSL connection set an
14 >MTU of 1492 (or potentially lower) on all of their network interfaces
15 >to avoid packet fragmentation?
16
17 That depends on your traffic flow. But, then again, 8 bytes out of
18 1500 means that you're "losing" just 0.533% of the maximum payload and
19 fragmenting can mean you have to send/recv 2 Frames for each 1500 Byte
20 packet you see locally.
21
22
23 I've just tested that (with the MTU set at 1492, so with the ping
24 overhead of 28 bytes, that leaves 1464 ping-payload without fragmenting)
25 ("ping -M do" disallows, "-M dont" allows fragmenting).
26
27
28 $ ping -n -c 1 -M do -s 1465 www.dslreports.com
29 PING www.dslreports.com (64.91.255.98) 1465(1493) bytes of data.
30 From 192.168.178.11 icmp_seq=1 Frag needed and DF set (mtu = 1492)
31
32 --- www.dslreports.com ping statistics ---
33 0 packets transmitted, 0 received, +1 errors
34
35 ==== corresponding tcpdump -n -i eth0 icmp ====
36 [nothing]
37 ====
38
39
40 Ok, go down a byte:
41
42
43 $ ping -n -c 1 -M do -s 1464 www.dslreports.com
44 PING www.dslreports.com (64.91.255.98) 1464(1492) bytes of data.
45 1472 bytes from 64.91.255.98: icmp_seq=1 ttl=51 time=136 ms
46
47 --- www.dslreports.com ping statistics ---
48 1 packets transmitted, 1 received, 0% packet loss, time 0ms
49 rtt min/avg/max/mdev = 136.638/136.638/136.638/0.000 ms
50
51 ==== corresponding tcpdump -n -i eth0 icmp ====
52 15:48:39.587143 IP 192.168.178.11 > 64.91.255.98: ICMP echo request, id 3656, seq 1, length 1472
53 15:48:39.723751 IP 64.91.255.98 > 192.168.178.11: ICMP echo reply, id 3656, seq 1, length 1472
54 ====
55
56
57 One packet sent and received for 1492 bytes packet size / 1464 bytes payload.
58
59
60 $ ping -n -c 1 -M dont -s 1465 www.dslreports.com
61 PING www.dslreports.com (64.91.255.98) 1465(1493) bytes of data.
62 1473 bytes from 64.91.255.98: icmp_seq=1 ttl=51 time=137 ms
63
64 --- www.dslreports.com ping statistics ---
65 1 packets transmitted, 1 received, 0% packet loss, time 0ms
66 rtt min/avg/max/mdev = 137.888/137.888/137.888/0.000 ms
67
68 ==== corresponding tcpdump -n -i eth0 icmp ====
69 15:47:07.983484 IP 192.168.178.11 > 64.91.255.98: ICMP echo request, id 3595, seq 1, length 1472
70 15:47:07.983494 IP 192.168.178.11 > 64.91.255.98: icmp
71 15:47:08.121308 IP 64.91.255.98 > 192.168.178.11: ICMP echo reply, id 3595, seq 1, length 1472
72 15:47:08.121343 IP 64.91.255.98 > 192.168.178.11: icmp
73 ====
74
75
76 Two packets sent and received for 1493 bytes packet size / 1465 bytes
77 ping-payload.
78
79 Try with e.g. 'ping -c 4 -M dont -s 1472 www.dslreports.com' for
80 yourself to see, that you'll send/recv 2 packets for each ping-packet
81 (and 1472 bytes is the ping-payload that just fits into the standard
82 1500 bytes MTU).
83
84 So, unless you have Gigs of internal traffic (and then you should have
85 a look at jumbo frames and might tune those to split nicely) and
86 little to the 'net, I'd definitely prefer losing those 8 bytes of
87 payload over sending double the packets (esp. with TCP, if just one of
88 those two of the fragmented bigger frame gets lost on the way, _both_
89 have to be retransmitted, as both TCP ends don't know (AFAIK, at least
90 usually?) about the fragmentation taking place inbetween, so basically
91 you're doubling the risk for lost TCP-packets for the "end-user" ...
92
93 With larger frames used internally (jumbo-frames) it gets complicated,
94 so I just send you to
95 https://en.wikipedia.org/wiki/IP_fragmentation
96 https://en.wikipedia.org/wiki/IPv4#Fragmentation_and_reassembly
97
98 And there's Path-MTU though. No idea if that works via the last-mile
99 PPPoE etc.
100
101 Disclaimer: I just know the basics of networking (and where to search
102 for what ;)
103
104 -dnh
105
106 --
107 I got an expresso maker at orkplace. Expresso maker is deemed too complex by
108 all but me & PFY. All expresso maker are belong to us. :) Caffeine is good.
109 Bzzzzzzzzz.... -- Mike Raeder

Replies

Subject Author
Re: [gentoo-user] {OT} ISP requires MTU below 1500? Grant <emailgrant@×××××.com>