<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.43 (Ruby 3.4.9) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-seemann-tsvwg-udp-fragmentation-03" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.34.1 -->
  <front>
    <title abbrev="IP fragmentation on UDP Sockets">Controlling IP Fragmentation on Common Platforms</title>
    <seriesInfo name="Internet-Draft" value="draft-seemann-tsvwg-udp-fragmentation-03"/>
    <author fullname="Marten Seemann">
      <organization/>
      <address>
        <email>martenseemann@gmail.com</email>
      </address>
    </author>
    <author fullname="Max Inden">
      <organization>Mozilla</organization>
      <address>
        <email>mail@max-inden.de</email>
      </address>
    </author>
    <date year="2026" month="October" day="28"/>
    <area>Web and Internet Transport</area>
    <workgroup>Transport and Services Working Group</workgroup>
    <keyword>IP fragmentation</keyword>
    <keyword>Don't Fragment</keyword>
    <keyword>Path MTU Discovery</keyword>
    <keyword>DPLPMTUD</keyword>
    <abstract>
      <?line 35?>

<t>When performing Path MTU Discovery (PMTUD) over UDP, applications must prevent
fragmentation of UDP datagrams both by the sender's kernel and during network
transit. This document provides guidance for implementers on configuring socket
options to prevent fragmentation of IPv4 and IPv6 packets across commonly used
platforms.</t>
    </abstract>
    <note removeInRFC="true">
      <name>Discussion Venues</name>
      <t>Discussion of this document takes place on the
    Transport and Services Working Group Working Group mailing list (tsvwg@ietf.org),
    which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/tsvwg/"/>.</t>
      <t>Source for this draft and an issue tracker can be found at
    <eref target="https://github.com/marten-seemann/draft-seemann-tsvwg-udp-fragmentation"/>.</t>
    </note>
  </front>
  <middle>
    <?line 43?>

<section anchor="introduction">
      <name>Introduction</name>
      <t><xref target="RFC0791"/> defines the Don't Fragment (DF) bit in the IPv4 header. When set,
this bit prevents routers from fragmenting IP packets. If a router needs to
fragment a packet with the DF bit set, it will instead drop the packet and send
an ICMP "Fragmentation Needed" message back to the sender.</t>
      <t>The DF bit has historically been most relevant to TCP (<xref target="RFC9293"/>), where the
kernel handles Path MTU Discovery (PMTUD) internally. Applications using TCP
sockets do not need to interact with the DF bit directly.</t>
      <t>In IPv6 (<xref target="RFC8200"/>), fragmentation by intermediate nodes is not permitted.
All IPv6 packets effectively have the DF bit set; however, the sender's kernel
might still break up UDP datagrams that are too large to fit the MTU of the
interface before sending a packet into the network.</t>
      <t><xref target="RFC8899"/> defines Datagram Packetization Layer Path MTU Discovery (DPLPMTUD),
a mechanism that allows protocols running over UDP to determine the maximum
packet size they can send. Setting the DF bit is crucial for DPLPMTUD, as it
ensures that packets larger than the Path MTU are dropped, allowing the endpoint
to detect the MTU limitation.</t>
      <t>QUIC <xref target="RFC9000"/> is one such protocol that runs over UDP and makes use of
DPLPMTUD. As QUIC implementations typically run in user space, they need to
configure the DF bit on their UDP sockets to perform DPLPMTUD correctly.</t>
      <t>This document provides guidance for implementers on how to set the DF bit on UDP
sockets across different platforms.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

</section>
    <section anchor="setting-the-df-bit">
      <name>Setting the DF bit</name>
      <t>While routers don't fragment IPv6 packets in transit, the sender's kernel will
still fragment UDP datagrams that are too large to fit the MTU of the interface
before sending a packet into the network. Therefore, operating systems offer
socket options to control the fragmentation behavior for IPv6 packets.</t>
      <t>For user-space implementations of DPLPMTUD, applications need to set the DF bit on
IPv4 sockets and prevent fragmentation on IPv6 sockets.</t>
      <section anchor="linux">
        <name>Linux</name>
        <t>PMTUD behavior is controlled via the IP_MTU_DISCOVER and IPV6_MTU_DISCOVER
socket options at the IPPROTO_IP and IPPROTO_IPV6 levels. There are two closely
related values: For IPv4, both IP_PMTUDISC_DO and IP_PMTUDISC_PROBE enable
setting the DF bit. For IPv6, both IPV6_PMTUDISC_DO and IPV6_PMTUDISC_PROBE
prevent fragmentation by the sender.</t>
        <t>The DO modes enforce the kernel's cached Path MTU, whereas the PROBE modes
permit sending packets larger than that cached value.</t>
        <t>When the kernel processes an ICMP "Fragmentation Needed" message, it will
prevent the transmission of larger datagrams. Applications that wish to only
respond to fully encrypted end-to-end signals (for example, QUIC
(<xref target="RFC9000"/>)) might therefore wish to use IP_PMTUDISC_PROBE and
IPV6_PMTUDISC_PROBE.</t>
        <t>For dual-stack sockets, both IPv4 and IPv6 socket options can be set
independently.</t>
      </section>
      <section anchor="apple">
        <name>Apple</name>
        <t>For IPv4, Apple platforms use the IP_DONTFRAG socket option at the IPPROTO_IP
level with a value of 1. For IPv6, IPV6_DONTFRAG with a value of 1 is used at the
IPPROTO_IPV6 level.</t>
        <t>However, dual-stack sockets are handled differently: To open a dual-stack socket,
an IPv6 socket needs to be opened and the IPV6_V6ONLY option needs to be set to
0. This enables the socket to send both IPv4 and IPv6 packets. IPv4 packets must
be sent using an IPv4-mapped IPv6 address.</t>
        <t>When using a dual-stack socket, it is only necessary (and possible) to set the
IPV6_DONTFRAG socket option. This results in the DF bit being set when sending
IPv4 packets and prevents fragmentation of IPv6 packets. It is not possible to
control the fragmentation behavior of IPv4 and IPv6 separately.</t>
        <t>On macOS, setting the DF bit on IPv4 packets sent from a dual-stack socket
requires macOS 15 (Sequoia) or later. On earlier macOS versions,
IPV6_DONTFRAG does not set the DF bit on IPv4 packets.</t>
      </section>
      <section anchor="windows">
        <name>Windows</name>
        <t>For IPv4, Windows uses the IP_DONTFRAGMENT socket option at the IPPROTO_IP
level with a value of 1. For IPv6, IPV6_DONTFRAG with a value of 1 is used at the
IPPROTO_IPV6 level.</t>
        <t>As on Apple platforms, dual-stack sockets are IPv6 sockets with the
IPV6_V6ONLY option set to 0. IPv4 packets must be sent using an IPv4-mapped
IPv6 address. However, unlike on Apple platforms, the DF bit on IPv4
packets is controlled by the IP_DONTFRAGMENT socket option.</t>
      </section>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>Forged ICMP "Fragmentation Needed" or ICMPv6 "Packet Too Big" messages can
reduce the kernel's cached Path MTU, degrading performance or preventing
transmission. Applications performing DPLPMTUD need to avoid enforcement of
that cached value and validate any ICMP messages they use, as described in
<xref target="RFC8899"/>. Validation of quoted packets can mitigate off-path attacks,
but does not prevent an on-path attacker from forging these messages.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>
  </middle>
  <back>
    <references anchor="sec-normative-references">
      <name>Normative References</name>
      <reference anchor="RFC0791">
        <front>
          <title>Internet Protocol</title>
          <author fullname="J. Postel" initials="J." surname="Postel"/>
          <date month="September" year="1981"/>
        </front>
        <seriesInfo name="STD" value="5"/>
        <seriesInfo name="RFC" value="791"/>
        <seriesInfo name="DOI" value="10.17487/RFC791"/>
      </reference>
      <reference anchor="RFC9293">
        <front>
          <title>Transmission Control Protocol (TCP)</title>
          <author fullname="W. Eddy" initials="W." role="editor" surname="Eddy"/>
          <date month="August" year="2022"/>
          <abstract>
            <t>This document specifies the Transmission Control Protocol (TCP). TCP is an important transport-layer protocol in the Internet protocol stack, and it has continuously evolved over decades of use and growth of the Internet. Over this time, a number of changes have been made to TCP as it was specified in RFC 793, though these have only been documented in a piecemeal fashion. This document collects and brings those changes together with the protocol specification from RFC 793. This document obsoletes RFC 793, as well as RFCs 879, 2873, 6093, 6429, 6528, and 6691 that updated parts of RFC 793. It updates RFCs 1011 and 1122, and it should be considered as a replacement for the portions of those documents dealing with TCP requirements. It also updates RFC 5961 by adding a small clarification in reset handling while in the SYN-RECEIVED state. The TCP header control bits from RFC 793 have also been updated based on RFC 3168.</t>
          </abstract>
        </front>
        <seriesInfo name="STD" value="7"/>
        <seriesInfo name="RFC" value="9293"/>
        <seriesInfo name="DOI" value="10.17487/RFC9293"/>
      </reference>
      <reference anchor="RFC8200">
        <front>
          <title>Internet Protocol, Version 6 (IPv6) Specification</title>
          <author fullname="S. Deering" initials="S." surname="Deering"/>
          <author fullname="R. Hinden" initials="R." surname="Hinden"/>
          <date month="July" year="2017"/>
          <abstract>
            <t>This document specifies version 6 of the Internet Protocol (IPv6). It obsoletes RFC 2460.</t>
          </abstract>
        </front>
        <seriesInfo name="STD" value="86"/>
        <seriesInfo name="RFC" value="8200"/>
        <seriesInfo name="DOI" value="10.17487/RFC8200"/>
      </reference>
      <reference anchor="RFC8899">
        <front>
          <title>Packetization Layer Path MTU Discovery for Datagram Transports</title>
          <author fullname="G. Fairhurst" initials="G." surname="Fairhurst"/>
          <author fullname="T. Jones" initials="T." surname="Jones"/>
          <author fullname="M. Tüxen" initials="M." surname="Tüxen"/>
          <author fullname="I. Rüngeler" initials="I." surname="Rüngeler"/>
          <author fullname="T. Völker" initials="T." surname="Völker"/>
          <date month="September" year="2020"/>
          <abstract>
            <t>This document specifies Datagram Packetization Layer Path MTU Discovery (DPLPMTUD). This is a robust method for Path MTU Discovery (PMTUD) for datagram Packetization Layers (PLs). It allows a PL, or a datagram application that uses a PL, to discover whether a network path can support the current size of datagram. This can be used to detect and reduce the message size when a sender encounters a packet black hole. It can also probe a network path to discover whether the maximum packet size can be increased. This provides functionality for datagram transports that is equivalent to the PLPMTUD specification for TCP, specified in RFC 4821, which it updates. It also updates the UDP Usage Guidelines to refer to this method for use with UDP datagrams and updates SCTP.</t>
            <t>The document provides implementation notes for incorporating Datagram PMTUD into IETF datagram transports or applications that use datagram transports.</t>
            <t>This specification updates RFC 4960, RFC 4821, RFC 6951, RFC 8085, and RFC 8261.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8899"/>
        <seriesInfo name="DOI" value="10.17487/RFC8899"/>
      </reference>
      <reference anchor="RFC9000">
        <front>
          <title>QUIC: A UDP-Based Multiplexed and Secure Transport</title>
          <author fullname="J. Iyengar" initials="J." role="editor" surname="Iyengar"/>
          <author fullname="M. Thomson" initials="M." role="editor" surname="Thomson"/>
          <date month="May" year="2021"/>
          <abstract>
            <t>This document defines the core of the QUIC transport protocol. QUIC provides applications with flow-controlled streams for structured communication, low-latency connection establishment, and network path migration. QUIC includes security measures that ensure confidentiality, integrity, and availability in a range of deployment circumstances. Accompanying documents describe the integration of TLS for key negotiation, loss detection, and an exemplary congestion control algorithm.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9000"/>
        <seriesInfo name="DOI" value="10.17487/RFC9000"/>
      </reference>
      <reference anchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
    </references>
    <?line 177?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA81Z7W4bNxb9z6fgKj8aLyTBTrxu4u22VSy7EWBbWltxECwW
ATVDSYRnhirJkaMEeZd9ln2yPZfkjGYkNS36a4ui1nDIy3vPved+THu9HmNO
uUye886FLpzRWaaKBR9N+JURi1wWTjilC45/L3Se488kE26uTW47TMxmRq5x
FNvnu9vfDSf8XieP0mFnIpxcaLM556qYa8ZSnRQix62pEXPXs1Lmoih6zq6f
Fr0yXfVa4nrHL5ktZ7myFk9us8LB0eX0ivNnXGRWQwNVpHIl8Z/Cdbq8I1Pl
tFEio4fR4A3+aINfd9OrDivKfCbNOUuh1DlLdGFlYUt7zp0pJYM9L5kwUkDq
eznjokj5qHDSFNLxqRGFXWnjOuxJm8eF0eUK++plv/temrVKpOXvsYXQ/IW2
ddij3OBQes54j+8iRmtDXXznatxpZSLckt9M3/GhsoleS7Px+ybXEywOGROl
W2pDAhnHP/MyywKsN8I4WUATj6t/iV8qO+e5fxMB/3lBi/1E54dEfILdANSv
a7MQhfrsdcU7/VllmWjLVdnPufjUI08U/VQyViBKcGANkBm5ffvEer0eFzPr
jEgcY++X0HUlDW0hvPbN5s+9xUecnii0ulysVplKvEKW56V1fIVgJOB2QnHu
QxHOFgsjcstnGtJnG+6WklsKGfOd5Y/k38y7Ly0NKQF3k4uZI98q1+fTpbIc
gVuSbFym1yqFkxelSkWRSA7tucpXmaT30lgiAYJrrhZBoPVkYHoVVHa6UniX
O3NEx/o0BN5kfcZXwrOIi8RoayGTeJhteGllylYVHfsB1VylaQbwn1HQG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