Subject: IPV6_USE_MIN_MTU and IPV6_DONT_FRAG questions

From: Mark Andrews <[email-masked]>
Date: Wed, 07 Nov 2012 12:30:54 +1100

Should setting IPV6_USE_MIN_MTU to one (1) result in fragmented TCP packets?
Should setting IPV6_DONTFRAG to one (1) work on TCP sockets?

Both options were set on the socket with the resulting packet trace.

For reference the stack was: OS X 10.8.2 (12C60)

Mark

12:24:05.521331 IP6 2001:470:1f00:820:6233:4bff:fe01:7585 > 2001:470:1f00:820:218:f3ff:feba:9a37: frag (0|1232) 53 > 49203: Flags [.], ack 31, win 8209, options [nop,nop,TS val 986656829 ecr 3464680466], length 120012159*- 194/0/0 SOA, RRSIG, RRSIG, DNSKEY, DNSKEY, RRSIG, NSEC, RRSIG, MX bsdi.dv.isc.org. 0, RRSIG, NS bsdi1.dv.isc.org., NS drugs.dv.isc.org., RRSIG, RRSIG[|domain]
12:24:05.521582 IP6 2001:470:1f00:820:6233:4bff:fe01:7585 > 2001:470:1f00:820:218:f3ff:feba:9a37: frag (1232|228)
12:24:05.522636 IP6 2001:470:1f00:820:6233:4bff:fe01:7585 > 2001:470:1f00:820:218:f3ff:feba:9a37: frag (0|1232) 53 > 49203: Flags [.], ack 31, win 8209, options [nop,nop,TS val 986656829 ecr 3464680466], length 120020864 updateD [b2&3=0x50c3] [20596a] [50814q] [43695n] [14436au] Type35395 (Class 51553)? dv.isc.org.[|domain]
12:24:05.522887 IP6 2001:470:1f00:820:6233:4bff:fe01:7585 > 2001:470:1f00:820:218:f3ff:feba:9a37: frag (1232|228)

-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE:	+61 2 9871 4742		         INTERNET: [email-masked]

---

From: Francis Dupont <[email-masked]>
Date: Wed, 07 Nov 2012 13:44:49 +0100

>  Should setting IPV6_DONTFRAG to one (1) work on TCP sockets?

=> we should first agree about the term "fragmented": I propose to
say it means a transport message is divided into more than one
network layer message (so it is not bound to the existence of
a fragmentation header).

With this definition TCP packets should be never fragmented, so
IPV6_USE_MIN_MTU set to one (1) will result in a TCP segment size
which enforces TCP packet sizes to always be at most the minimal MTU
(1280 octets) at the network level.

This means too the IPV6_DONTFRAG is useless, so to set it to one (1)
should have no visible effect on TCP. Now we can argue about the
default value a get should return...

And there is as usual the question about when the setsockopt() are
called, even I believe the specs are clear they must be called before
the connect().

Regards

[email-masked]

---

From: Francis Dupont <[email-masked]>
Date: Wed, 07 Nov 2012 13:44:49 +0100

Regards

---

From: Fernando Gont <[email-masked]>
Date: Mon, 12 Nov 2012 22:34:19 -0300

> Should setting IPV6_USE_MIN_MTU to one (1) result in fragmented TCP packets?

No. One would expect that IPV6_USE_MIN_MTU causes the TCP SMSS (TCP
Sender MSS) to be reduced, and hence TCP would segment its data to an
appropriate size, such that it doesn't result in fragmentation.

*However*, if an ICMPv6 PTB claiming an MTU<1280 bytes is received, then
the corresponding connection might end up employing fragmentation (i.e.,
it would employ IPv6 atomic fragments). (*)

(*) that's assuming IPV6_USE_MIN_MTU means "use an MTU of 1280 bytes"
rather than "use an MTU of *at most* 1280 bytes".

> Should setting IPV6_DONTFRAG to one (1) work on TCP sockets?

Yes. Without looking at the corresponding spec, I guess that for
TCP-based sockets, IPV6_DONTFRAG implicitly means that you should employ
Path-MTU Discovery (which in most stacks is "on" by default), and that
if an ICMPv6 PTB claiming an MTU smaller than 1280 is received, it
should be signaled to the upper layer, such that e.g. the TCP SMSS
(sender MSS) is reduced, and hence generation of IPv6 atomic fragments
is avoided.

Notes:

It has been reported a few times that some networks simply do not comply
with the minimum IPv6 MTU requirement. In such case,

* If IPV6_USE_MIN_MTU means "use an MTU of 1280 bytes" (as opposed to
"use an MTU of *at most* 1280 bytes) then IPV6_USE_MIN_MTU might still
result in fragmentation. If, OTOH, IPV6_USE_MIN_MTU means "use an MTU of
at most 1280 bytes", then fragmentation might be prevented by signaling
any received ICMPv6 PTB to the upper layer, such that the TCP SMSS is
reduced acordngly, and hence fragmentation is avoided.

* IPV6_DONTFRAG would not be affected by this, though.

Cheers,
-- 
Fernando Gont
SI6 Networks
e-mail: [email-masked]
PGP Fingerprint: 6666 31C6 D484 63B2 8FB1 E3C4 AE25 0D55 1D4E 7492

---

From: Hannes Frederic Sowa <[email-masked]>
Date: Tue, 13 Nov 2012 13:38:51 +0100

> reduced acordngly, and hence fragmentation is avoided.

Is the second case really possible? MSS is defined to be always derived
from the MTU. As the IPv6 minimum MTU is 1280 I see no way how the MSS
could sink below 1280-40-20 bytes.

---

From: Mark Andrews <[email-masked]>
Date: Wed, 14 Nov 2012 00:55:15 +1100

> could sink below 1280-40-20 bytes.

While the MSS may be that, the segment size will change depending apon
which TCP option are being sent.

> --------------------------------------------------------------------
> IETF IPv6 working group mailing list
> [email-masked]
> Administrative Requests: https://www.ietf.org/mailman/listinfo/ipv6
> --------------------------------------------------------------------