Path MTU Discovery Using Session Traversal Utilities for NAT (STUN)Impedance Mismatchmarc@petit-huguenin.orgCisco Systems, Inc.7200-12 Kit Creek RoadResearch Triangle ParkNC27709United Statesgsalguei@cisco.comCisco Systems, Inc.7200-12 Kit Creek RoadResearch Triangle ParkNC27709United Statesfegarrid@cisco.com
TSV
TRAM
This document describes a Session Traversal Utilities for NAT (STUN) Usage for Path MTU Discovery (PMTUD) between a client and a server.
The Packetization Layer Path MTU Discovery (PMTUD) specification describes a method to discover the Path MTU but does not describe a practical protocol to do so with UDP.
Many UDP-based protocols do not implement the Path MTU discovery mechanism described in .
These protocols can make use of the probing mechanisms described in this document instead of designing their own adhoc extension.
These probing mechanisms are implemented with Session Traversal Utilities for NAT (STUN), but their usage is not limited to STUN-based protocols.
The STUN usage defined in this document for Path MTU Discovery (PMTUD) between a client and a server permits proper operations of UDP-based applications in the network.
It also simplifies troubleshooting and has multiple other applications across a wide variety of technologies.
Complementary techniques can be used to discover additional network characteristics, such as the network path (using the STUN Traceroute mechanism described in ) and bandwidth availability (using the mechanism described in ).
This section is meant to be informative only.
It is not intended as a replacement for .
A UDP endpoint that uses this specification to discover the Path MTU over UDP and knows that the endpoint it is communicating with also supports this specification can choose to use either the Simple Probing mechanism (as described in ) or the Complete Probing mechanism (as described in ).
The selection of which Probing Mechanism to use is dependent on performance and security and complexity trade-offs.
If the Simple Probing mechanism is chosen, then the Client initiates Probe transactions, as shown in , which increase in size until transactions timeout, indicating that the Path MTU has been exceeded.
It then uses that information to update the Path MTU.
If the Complete Probing mechanism (as described in ) is chosen, then the Client sends Probe Indications of various sizes (as specified in ) interleaved with UDP packets sent by the UDP protocol.
The Client then sends a Report Request for the ordered list of identifiers for the UDP packets and Probe Indications received by the Server.
The Client then compares the list returned in the Report Response with its own list of identifiers for the UDP packets and Probe Indications it sent.
The Client then uses that comparison to find which Probe Indications were dropped by the network as a result of their size.
It then uses that information to update the Path MTU.
Because of the possibility of amplification attack, the Complete Probing mechanism must be authenticated.
Particular care must be taken to prevent amplification when an external mechanism is used to trigger the Complete Probing mechanism.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 when, and only when, they appear in all capitals, as shown here.
The Probing mechanism is used to discover the Path MTU in one direction only: from the client to the server.
Two Probing mechanisms are described: a Simple Probing mechanism and a more complete mechanism that can converge more quickly and find an appropriate Path MTU in the presence of congestion.
Additionally, the Simple Probing mechanism does not require authentication except where used as an implicit signaling mechanism, whereas the complete mechanism does.
Implementations supporting this specification MUST implement the server side of both the Simple Probing mechanism and the Complete Probing mechanism.
Implementations supporting this specification MUST implement the client side of the Complete Probing mechanism.
They MAY implement the client side of the Simple Probing mechanism.
The Simple Probing mechanism is implemented by sending a Probe Request with a PADDING attribute over UDP with the DF bit set in the IP header for IPv4 packets and IPv6 packets without the Fragment Header included.
A router on the path to the server can reject each request with an ICMP message or drop it.
A client forms a Probe Request by using the Probe Method and following the rules in Section 7.1 of .
The Probe transaction MUST be authenticated if the Simple Probing mechanism is used in conjunction with the Implicit Probing Support mechanism described in .
If not, the Probe transaction MAY be authenticated.
The client adds a PADDING attribute with a length that, when added to the IP and UDP headers and the other STUN components, is equal to the Selected Probe Size, as defined in Section 7.3.
The PADDING bits SHOULD be set to zero.
The client MUST add the FINGERPRINT attribute so the STUN messages are disambiguated from the other protocol packets.
Then the client sends the Probe Request to the server over UDP with the DF bit set for IPv4 packets and IPv6 packets without the Fragment Header included.
For the purpose of this transaction, the Rc parameter specified in Section 7.2.1 of is set to 3.
The initial value for RTO stays at 500 ms.
A client MUST NOT send a probe if it does not have knowledge that the server supports this specification.
This is done either by external signalling or by a mechanism specific to the UDP protocol to which PMTUD capabilities are added or by one of the mechanisms specified in .
A server receiving a Probe Request MUST process it as specified in .
The server then creates a Probe Response.
The server MUST add the FINGERPRINT attribute so the STUN messages are disambiguated from the other protocol packets.
The server then sends the response to the client.
A client receiving a Probe Response MUST process it as specified in and MUST ignore the PADDING attribute.
If a response is received this is interpreted as a Probe Success, as defined in Section 7.6.1.
If an ICMP packet "Fragmentation needed" or "Packet Too Big" is received then this is interpreted as a Probe Failure, as defined in Section 7.6.2.
If the Probe transaction times out, then this is interpreted as a Probe Inconclusive, as defined in Section 7.6.4.
The Complete Probing mechanism is implemented by sending one or more Probe Indications with a PADDING attribute over UDP with the DF bit set in the IP header for IPv4 packets and IPv6 packets without the Fragment Header included followed by a Report Request to the same server.
A router on the path to the server can reject this Indication with an ICMP message or drop it.
The server keeps a chronologically ordered list of identifiers for all packets received (including retransmitted packets) and sends this list back to the client in the Report Response.
The client analyzes this list to find which packets were not received.
Because UDP packets do not contain an identifier, the Complete Probing mechanism needs a way to identify each packet received.
Some application layer protocols may already have a way of identifying each individual UDP packet, in which case these identifiers SHOULD be used in the IDENTIFIERS attribute of the Report Response.
While there are other possible packet identification schemes, this document describes two different ways to identify a specific packet when no application layer protocol-specific identification mechanism is available.
In the first packet identification mechanism, the server computes a checksum over each packet received and sends back to the sender the list of checksums ordered chronologically.
The client compares this list to its own list of checksums.
In the second packet identification mechanism, the client prepends the UDP data with a header that provides a sequence number.
The server sends back the chronologically ordered list of sequence numbers received that the client then compares with its own list.
A client forms a Probe Indication by using the Probe Method and following the rules in Section 7.1.
The client adds to a Probe Indication a PADDING attribute with a size that, when added to the IP and UDP headers and the other STUN components, is equal to the Selected Probe Size, as defined in Section 7.3.
The PADDING bits SHOULD be set to zero. If the authentication mechanism permits it, then the Indication MUST be authenticated.
The client MUST add the FINGERPRINT attribute so the STUN messages are disambiguated from the other protocol packets.
Then the client sends a Probe Indication to the server over UDP with the DF bit set for IPv4 packets and IPv6 packets without the Fragment Header included.
Then the client forms a Report Request by following the rules in Section 7.1.
The Report transaction MUST be authenticated to prevent amplification attacks.
The client MUST add the FINGERPRINT attribute so the STUN messages are disambiguated from the other protocol packets.
Then the client waits half the RTO after sending the last Probe Indication and then sends the Report Request to the server over UDP.
If an ICMP packet "Fragmentation needed" or "Packet Too Big" is received then this is interpreted as a Probe Failure, as defined in Section 7.5.
A server supporting this specification will keep the identifiers of all packets received in a chronologically ordered list.
The packets that are to be associated to a given flow's identifier are selected according to Section 5.2 of .
The same identifier can appear multiple times in the list because of retransmissions.
The maximum size of this list is calculated such that when the list is added to the Report Response, the total size of the packet does not exceed the unknown Path MTU, as defined in Section 7.1.
Older identifiers are removed when new identifiers are added to a list that is already full.
A server receiving a Report Request MUST process it as specified in and MUST ignore the PADDING attribute.
The server creates a Report Response and adds an IDENTIFIERS attribute that contains the chronologically ordered list of all identifiers received so far.
The server MUST add the FINGERPRINT attribute.
The server then sends the response to the client.
The exact content of the IDENTIFIERS attribute depends on what type of identifiers have been chosen for the protocol.
Each protocol adding PMTUD capabilities as specified by this specification MUST describe the format of the contents of the IDENTIFIERS attribute, unless it is using one of the formats described in this specification.
See for details about the IDENTIFIERS attribute.
A client receiving a Report Response processes it as specified in .
If the response IDENTIFIERS attribute contains the identifier of a Probe Indication, then this is interpreted as a Probe Success for this probe, as defined in Section 7.5.
If a Probe Indication identifier cannot be found in the Report Response, this is interpreted as a Probe Failure, as defined in Section 7.5.
If a Probe Indication identifier cannot be found in the Report Response but identifiers for other packets sent before or after the Probe Indication can all be found, this is interpreted as a Probe Failure as defined in Section 7.5.
If the Report Transaction times out, this is interpreted as a Full-Stop Timeout, as defined in Section 3.
When using a checksum as a packet identifier, the client keeps a chronologically ordered list of the packets it transmits, along with an associated checksum value.
For STUN Probe Indication or Request packets, the associated checksum value is the FINGERPRINT value from the packet; for other packets a checksum value is computed using a similar algorithm to the FINGERPRINT calculation. (i.e., the CRC-32 calculated per the algorithm defined in , such as subsequently been XOR’ed with 32-bit value 0x5354554e).
For each STUN Probe Indication or Request, the server retrieves the STUN FINGERPRINT value.
For all other packets, the server calculates the checksum as described above.
It puts these FINGERPRINT and checksum values in a chronologically ordered list that is sent back in the Report Response.
The contents of the IDENTIFIERS attribute is a list of 4 byte numbers, each using the same encoding that is used for the contents of the FINGERPRINT attribute.
It could have been possible to use the checksum generated in the UDP checksum for this, but this value is generally not accessible to applications.
Also, sometimes the checksum is not calculated or is off-loaded to network hardware.
When using sequence numbers, a small header similar to the TURN ChannelData header, as defined in Section 11.4 of , is added in front of all packets that are not a STUN Probe Indication or Request.
The sequence number is monotonically incremented by one for each packet sent.
The most significant bit of the sequence number is always 0.
The server collects the sequence number of the packets sent, or the 4 first bytes of the transaction ID if a STUN Probe Indication or Request is sent.
In that case, the most significant bit of the 4 first bytes is set to 1.
The Channel Number is always 0xFFFF.
The Length field specifies the length in bytes of the sequence number and application data fields.
The header values are encoded using network order.
The contents of the IDENTIFIERS attribute is a chronologically ordered list of 4 byte numbers, each containing either a sequence number, if the packet was not a STUN Probe Indication or Request, or the 4 first bytes of the transaction ID, with the most significant bit forced to 1, if the packet is a STUN Probe Indication or Request.
The PMTUD mechanism described in this document is intended to be used by any UDP-based protocols that do not have built-in PMTUD capabilities, irrespective of whether those UDP-based protocols are STUN-based or not.
So the manner in which a specific protocol discovers that it is safe to send PMTUD probes is largely dependent on the details of that specific protocol, with the exception of the Implicit Mechanism described below, which applies to any protocol.
Some of these mechanisms can use a separate signalling mechanism (for instance, an SDP attribute in an Offer/Answer exchange), or an optional flag that can be set in the protocol that is augmented with PMTUD capabilities.
STUN Usages that can benefit from PMTUD capabilities can signal in-band that they support probing by inserting a PMTUD-SUPPORTED attribute in some STUN methods.
The decision of which methods support this attribute is left to each specific STUN Usage.
UDP-based protocols that want to use any of these mechanisms, including the PMTUD-SUPPORTED attribute, to signal PMTUD capabilities MUST ensure that it cannot be used to launch an amplification attack.
An amplification attack can be prevented using techniques such as:
Authentication, where the source of the packet and the destination share a secret.
3 way handshake with some form of unpredictable cookie.
Make sure that the total size of the traffic potentially generated is lower than the size of the request that generated it.
As a result of the fact that all endpoints implementing this specification are both clients and servers, a Probe Request or Indication received by an endpoint acting as a server implicitly signals that this server can now act as a client and MAY send a Probe Request or Indication to probe the Path MTU in the reverse direction toward the former client, that will now be acting as a server.
The Probe Request or Indication that are used to implicitly signal probing support in the reverse direction MUST be authenticated to prevent amplification attacks.
The IDENTIFIERS attribute carries a chronologically ordered list of UDP packet identifiers.
While and describe two possible methods for acquiring and formatting the identifiers used for this purpose, ultimately each protocol has to define how these identifiers are acquired and formatted.
Therefore, the contents of the IDENTIFIERS attribute is opaque.
The PMTUD-SUPPORTED attribute indicates that its sender supports this mechanism, as incorporated into the STUN usage or protocol being used.
This attribute has no value part and thus the attribute length field is 0.
The PADDING attribute allows for the entire message to be padded to force the STUN message to be divided into IP fragments. PADDING consists entirely of a free-form string, the value of which does not matter. PADDING can be used in either Binding Requests or Binding
Responses.
PADDING MUST NOT be longer than the length that brings the total IP datagram size to 64K. It SHOULD be equal in length to the MTU of the outgoing interface, rounded up to an even multiple of four bytes. Because STUN messages with PADDING are intended to test the behavior of UDP fragments, they are an exception to the usual rule that STUN messages be less than the MTU of the path.
The PMTUD mechanism described in this document, when used without the signalling mechanism described in , does not introduce any specific security considerations beyond those described in .
The attacks described in Section 11 of apply equally to the mechanism described in this document.
The amplification attacks introduced by the signalling mechanism described in can be prevented by using one of the techniques described in that section.
The Simple Probing mechanism may be used without authentication because this usage by itself cannot trigger an amplification attack as the Probe Response is smaller than the Probe Request.
An unauthenticated Simple Probing mechanism cannot be used in conjunction with the Implicit Probing Support Signaling mechanism in order to prevent amplification attacks.
This specification defines two new STUN methods and two new STUN attributes.
IANA is requested to add the following methods to the STUN Method Registry:
0xXXX : Probe
0xXXX : Report
See Sections and for the semantics of these new methods.
IANA is requested to add the following attributes to the STUN Method Registry:
The IDENTIFIERS STUN attribute is defined in , the PMTUD-SUPPORTED STUN attribute is defined in ; the PADDING STUN attribute is defined in .
NOTE: TO BE DELETED BEFORE PUBLICATION. PLEASE NOTE THAT THE PADDING ATTRIBUTE ENTRY IS REPLACING THE ENTRY MADE BY RFC5780 (EXPERIMENTAL). THE SAME VALUE AND NAME ARE USED BUT THE REFERENCE SHOULD BE CHANGED TO THIS STANDARDS TRACK DOCUMENT.
Key words for use in RFCs to Indicate Requirement Levels
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.
Ambiguity of Uppercase vs Lowercase in RFC 2119 Key WordsRFC 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.Packetization Layer Path MTU Discovery
This document describes a robust method for Path MTU Discovery (PMTUD) that relies on TCP or some other Packetization Layer to probe an Internet path with progressively larger packets. This method is described as an extension to RFC 1191 and RFC 1981, which specify ICMP-based Path MTU Discovery for IP versions 4 and 6, respectively. [STANDARDS-TRACK]
Session Traversal Utilities for NAT (STUN)
Session Traversal Utilities for NAT (STUN) is a protocol that serves as a tool for other protocols in dealing with Network Address Translator (NAT) traversal. It can be used by an endpoint to determine the IP address and port allocated to it by a NAT. It can also be used to check connectivity between two endpoints, and as a keep-alive protocol to maintain NAT bindings. STUN works with many existing NATs, and does not require any special behavior from them.
STUN is not a NAT traversal solution by itself. Rather, it is a tool to be used in the context of a NAT traversal solution. This is an important change from the previous version of this specification (RFC 3489), which presented STUN as a complete solution.
This document obsoletes RFC 3489. [STANDARDS-TRACK]
Error-correcting Procedures for DCEs Using Asynchronous-to-Synchronous ConversionInternational Telecommunications UnionAn Offer/Answer Model with Session Description Protocol (SDP)
This document defines a mechanism by which two entities can make use of the Session Description Protocol (SDP) to arrive at a common view of a multimedia session between them. In the model, one participant offers the other a description of the desired session from their perspective, and the other participant answers with the desired session from their perspective. This offer/answer model is most useful in unicast sessions where information from both participants is needed for the complete view of the session. The offer/answer model is used by protocols like the Session Initiation Protocol (SIP). [STANDARDS-TRACK]
STUN Traceroute
After a UDP protocol such as RTP determines a network path is experiencing problems, a traceroute is often useful to determine which router or which link is contributing to the problem. However, operating system traceroute commands follow a different path than the actual UDP flow which complicates troubleshooting. A superior method is shown which is absolutely path-congruent with the UDP protocol itself, works on IPv4 and IPv6, and does not require administrative privileges on most operating systems.
Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)If a host is located behind a NAT, then in certain situations it can be impossible for that host to communicate directly with other hosts (peers). In these situations, it is necessary for the host to use the services of an intermediate node that acts as a communication relay. This specification defines a protocol, called TURN (Traversal Using Relays around NAT), that allows the host to control the operation of the relay and to exchange packets with its peers using the relay. TURN differs from some other relay control protocols in that it allows a client to communicate with multiple peers using a single relay address. [STANDARDS-TRACK]Traversal Using Relays around NAT (TURN) Bandwidth Probe
Performing pre-call probing to discover a reasonable value for the available bandwidth, is useful information that can be utilized by bandwidth sensitive or bandwidth intensive network devices (e.g., video encoders). The method described herein is intended to produce an initial bandwidth value. Applications using this mechanism should also employ appropriate rate adaptation techniques. In addition to bandwidth, latency and bufferbloat can also be measured. No modification is needed on the server side.
This section must be removed before publication as an RFC.
Modifications to address nits
Modifications following IESG review. Incorporated RFC5780 PADDING attribute (Adam's Discuss) and added IPv6 language (Suresh's Discuss).
Modifications following IESG review.
Modifications following reviews for gen-art (Roni Even) and secdir (Carl Wallace).
Add 3 ways of preventing amplification attacks.
Updates following Spencer’s review.
Updates following Shepherd review.
Nits.
Restore missing changelog for previous version.
Modifications following Brandon Williams review.
Modifications following Simon Perreault and Brandon Williams reviews.
Add new Overview of Operations section with ladder diagrams.
Authentication is mandatory for the Complete Probing mechanism, optional for the Simple Probing mechanism.
All the ICE specific text moves to a separate draft to be discussed in the ICE WG.
The TURN usage is removed because probing between a TURN server and TURN client is not useful.
Any usage of PMTUD-SUPPORTED or other signaling mechanisms (formerly knows as discovery mechanisms) must now be authenticated.
Both probing mechanisms are MTI in the server, the complete probing mechanism is MTI in the client.
Make clear that stopping after 3 retransmission is done by changing the STUN parameter.
Define the format of the attributes.
Make clear that the specification is for any UDP protocol that does not already have PMTUD capabilities, not just STUN based protocols.
Change the default delay to send the Report Request to 250 ms after the last Indication if the RTO is unknown.
Each usage of this specification must the format of the IDENTIFIERS attribute contents.
Better define the implicit signaling mechanism.
Extend the Security Consideration section.
Tons of nits.
Cleaned up references.
Added Security Considerations Section.
Added IANA Considerations Section.
Adopted by WG - Text unchanged.
Moved some Introduction text to the Probing Mechanism section.
Added cross-reference to the other two STUN troubleshooting mechanism drafts.
Updated references.
Added Gonzalo Salgueiro as co-author.
General refresh for republication.
Changed author address.
Changed the IPR to trust200902.
Defined checksum and sequential numbers as possible packet identifiers.
Updated the reference to RFC 5389
The FINGERPRINT attribute is now mandatory.
Changed the delay between Probe indication and Report request to be RTO/2 or 50 milliseconds.
Added ICMP packet processing.
Added Full-Stop Timeout detection.
Stated that Binding request with PMTUD-SUPPORTED does not start the PMTUD process if already started.
Removed the use of modified STUN transaction but shorten the retransmission for the simple probing mechanism.
Added a complete probing mechanism.
Removed the PADDING-RECEIVED attribute.
Added release notes.
Thanks to Eilon Yardeni, Geir Sandbakken, Paal-Erik Martinsen, Tirumaleswar Reddy, Ram Mohan R, Simon Perreault, Brandon Williams, Tolga Asveren, Spencer Dawkins, Carl Wallace, and Roni Even for their review comments, suggestions and questions that helped to improve this document.
Special thanks to Dan Wing, who supported this document since its first publication back in 2008.