RFC 8085
UDP Usage Guidelines
1. Introduction โจ
Okay so, bestie, let's get into it ๐ฆ This is part 1 of 13, so grab your snacks, we're in this for the long haul ๐
The User Datagram Protocol (UDP) [RFC768] is giving minimal vibes ๐ It provides a minimal, unreliable, best-effort, message-passing transport to applications and other protocols (such as tunnels) that wish to operate over IP. Both are simply called "applications" in the remainder of this document. No cap, that's the whole pitch ๐ซถ
Compared to other transport protocols, UDP and its UDP-Lite variant [RFC3828] are unique in that they do not establish end-to-end connections between communicating end systems ๐ธ So UDP communication doesn't incur connection establishment and teardown overheads, and there's minimal associated end-system state. Because of these characteristics, UDP can offer a very efficient communication transport to some applications. Iconic efficiency, honestly ๐ญโจ
A second unique characteristic of UDP is that it provides no inherent congestion control mechanisms ๐ On many platforms, applications can send UDP datagrams at the line rate of the platform's link interface, which is often much greater than the available end-to-end path capacity, and doing so contributes to congestion along the path. Not me sending a firehose into a tiny pipe ๐ [RFC2914] describes the best current practice for congestion control in the Internet. It identifies two major reasons why congestion control mechanisms are critical for the stable operation of the Internet:
- The prevention of congestion collapse, i.e., a state where an increase in network load results in a decrease in useful work done by the network.
- The establishment of a degree of fairness, i.e., allowing multiple flows to share the capacity of a path reasonably equitably.
Because UDP itself provides no congestion control mechanisms, it is up to the applications that use UDP for Internet communication to employ suitable mechanisms to prevent congestion collapse and establish a degree of fairness. [RFC2309] discusses the dangers of congestion-unresponsive flows and states that "all UDP-based streaming applications should incorporate effective congestion avoidance mechanisms." [RFC7567] reaffirms this statement. This is an important requirement, even for applications that do not use UDP for streaming ๐ฅ Plus, congestion-controlled transmission is of benefit to an application itself, because it can reduce self-induced packet loss, minimize retransmissions, and hence reduce delays. Main character energy is being considerate of the network ๐
Congestion control is essential even at relatively slow transmission rates. For example, an application that generates five 1500-byte UDP datagrams in one second can already exceed the capacity of a 56 Kb/s path ๐ For applications that can operate at higher, potentially unbounded data rates, congestion control becomes vital to prevent congestion collapse and establish some degree of fairness. Section 3 describes a number of simple guidelines for the designers of such applications ๐
A UDP datagram is carried in a single IP packet and is hence limited to a maximum payload of 65,507 bytes for IPv4 and 65,527 bytes for IPv6 ๐ง The transmission of large IP packets usually requires IP fragmentation. Fragmentation decreases communication reliability and efficiency and should be avoided. IPv6 allows the option of transmitting large packets ("jumbograms") without fragmentation when all link layers along the path support this [RFC2675]. Some of the guidelines in Section 3 describe how applications should determine appropriate message sizes. Other sections of this document provide guidance on reliability, checksums, middlebox traversal and use of multicast ๐
This document provides guidelines and recommendations. Although most UDP applications are expected to follow these guidelines, there do exist valid reasons why a specific application may decide not to follow a given guideline ๐ฆ In such cases, it is RECOMMENDED that application designers cite the respective section(s) of this document in the technical specification of their application or protocol and explain their rationale for their design choice. Be transparent, bestie, it's the mature move ๐
[RFC5405] was scoped to provide guidelines for unicast applications only, whereas this document also provides guidelines for UDP flows that use IP anycast, multicast, broadcast, and applications that use UDP tunnels to support IP flows โจ Expanded scope, glow-up era ๐ธ
Finally, although this document specifically refers to usage of UDP, the spirit of some of its guidelines also applies to other message-passing applications and protocols (specifically on the topics of congestion control, message sizes, and reliability). Examples include signaling, tunnel or control applications that choose to run directly over IP by registering their own IP protocol number with IANA. This document is expected to provide useful background reading to the designers of such applications and protocols ๐ Read this one, it's lowkey for you too ๐ซถ
2. Terminology ๐
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 [RFC2119]. These are the official capital-letter vibes, so when you see them in caps, they're load-bearing ๐
3. UDP Usage Guidelines โจ
Okay so Internet paths are wildly unpredictable ๐ They can differ in transmission delay, available bandwidth, congestion levels, reordering probability, supported message sizes, and loss rates. And the same path can totally change its vibe over time ๐ So applications that may be used on the Internet MUST NOT make assumptions about specific path characteristics. They MUST instead use mechanisms that let them operate safely under very different path conditions. Usually that means carefully probing the current conditions of the path they talk over, so they can find a transmission behavior the path can actually sustain and that is reasonably fair to other traffic sharing it ๐ฆ
Ngl, these mechanisms are hard to get right ๐ญ For most applications, the simplest way to get them is to use one of the existing IETF transport protocols. That also dodges the trouble that protocols using a new IP protocol number run into on the Internet, where middleboxes that only support TCP and UDP sometimes show up ๐ง So the RECOMMENDED alternative to the UDP usage described in the rest of this section is to use an IETF transport protocol, such as:
- TCP [RFC793]
- Stream Control Transmission Protocol (SCTP) [RFC4960]
- SCTP Partial Reliability Extension (SCTP-PR) [RFC3758]
- Datagram Congestion Control Protocol (DCCP) [RFC4340] with its different congestion control types [RFC4341][RFC4342][RFC5622]
- transport protocols the IETF specifies in the future
(UDP-encapsulated SCTP [RFC6951] and DCCP [RFC6773] can offer support for traversing firewalls and other middleboxes where the native protocols are not supported ๐ง)
If you use these fully featured transport protocols correctly, they are not as "heavyweight" as people often claim ๐ TCP's algorithms have been improved continuously for decades, and they've reached a level of efficiency and correctness that custom application-layer mechanisms will struggle to copy easily ๐ Plus, lots of TCP implementations let an application tune its connections for its own purposes. For example, TCP's "Nagle" algorithm [RFC1122] can be disabled, which improves communication latency at the expense of more frequent (but still congestion controlled!) packet transmissions ๐ Another example is the TCP SYN cookie mechanism [RFC4987], which is available on many platforms. TCP with SYN cookies does not require a server to maintain per-connection state until the connection is established ๐ซถ
TCP also requires the end that closes a connection to maintain the TIME-WAIT state, which stops delayed segments from one connection instance from messing with a later one. Applications that are aware of and designed for this behavior can shift maintenance of the TIME-WAIT state to conserve resources by controlling which end closes a TCP connection [FABER] ๐ง And finally, TCP's built-in capacity probing and awareness of the maximum transmission unit supported by the path (PMTU) make data transmission super efficient. It quickly makes up for the initial connection setup delay, as long as the transfer exchanges more than a few segments ๐ฅ
3.1. Congestion Control Guidelines
Okay, so if an application or protocol chooses not to use a congestion-controlled transport protocol, it SHOULD control the rate at which it sends UDP datagrams to a destination host, in order to fulfill the requirements of [RFC2914]. It's important to stress that an application SHOULD perform congestion control over all UDP traffic it sends to a destination, no matter how it generates that traffic ๐ For example, an application that forks multiple worker processes, or otherwise uses multiple sockets to generate UDP datagrams, SHOULD perform congestion control over the aggregate traffic ๐ธ
There are several approaches to congestion control, and the rest of this section covers them. This section describes generic topics with an intended emphasis on unicast and anycast [RFC1546] usage. Not every approach below is right for every UDP-transmitting application, so pick your fighter ๐ฅ Section 3.1.2 discusses congestion control options for applications that do bulk transfers over UDP. These apps can use schemes that sample the path over several subsequent round-trips, during which data is exchanged, to figure out a sending rate the path can support at its current load. Other applications only exchange a few UDP datagrams with a destination. Section 3.1.3 discusses congestion control options for these "low data-volume" applications. Since they usually don't send enough data to iteratively sample the path and find a safe sending rate, they need different kinds of congestion control mechanisms ๐ฆ Section 3.1.11 covers congestion control considerations when UDP is used as a tunneling protocol. And Section 4 has more recommendations for broadcast and multicast usage โจ
It's important to note that congestion control should not be viewed as an add-on to a finished application ๐ โโ๏ธ Lots of the mechanisms in the guidelines below need application support to work correctly. Application designers need to think about congestion control throughout the design of their app, the same way they think about security aspects throughout the design process ๐
Historically, the IETF has also looked into integrated congestion control mechanisms that act on the traffic aggregate between two hosts. The example is a framework like the Congestion Manager [RFC3124], where active sessions can share current congestion information in a way that's independent of the transport protocol. These mechanisms have not seen deployment so far, but they would otherwise simplify the design of congestion control for UDP sessions, so that they fulfill the requirements in [RFC2914] ๐
3.1.1. Protocol Timer Guidelines
Understanding the latency between communicating endpoints is usually a crucial part of effective congestion control for protocols and applications โฑ๏ธ Latency estimation can be used in a bunch of protocol functions, like calculating a congestion-controlled transmission rate, triggering retransmission, and detecting packet loss. Other functions, like determining an interval for probing a path, an interval between keep-alive messages, an interval for measuring the quality of experience, or whether a remote endpoint has responded to a request to perform an action, typically operate over longer timescales than congestion control. So they aren't covered in this section ๐ค
The general recommendation in this document is that applications SHOULD leverage existing congestion control techniques and the latency estimators specified in them (see the next subsection). The following guidelines are for applications that need to design their own latency estimation mechanisms ๐ ๏ธ
The guidelines are framed in terms of "latency" and not "round-trip time," because some situations only need to characterize network-based latency (for example, TCP-Friendly Rate Control (TFRC) [RFC5348]), while other cases need to include the time the remote endpoint takes to provide feedback (for example, figuring out when to retransmit a message) ๐ค
Latency between endpoints is generally a dynamic property. So estimates SHOULD represent some sort of averaging of multiple recent measurement samples to account for variance ๐ Using an Exponentially Weighted Moving Average (EWMA) has proven useful for this purpose (for example, in TCP [RFC6298] and TFRC [RFC5348]) ๐
Independent latency estimates SHOULD be maintained for each destination an endpoint communicates with ๐ง
Latency samples MUST NOT be derived from ambiguous transactions. The classic example is a protocol that retransmits data but can't figure out which copy is being acknowledged ๐ That ambiguity makes correct computation of latency a total mess. See the discussion of Karn's algorithm in [RFC6298]. This requirement makes sure a sender builds a sound estimate of latency without relying on misleading measurements ๐
When a latency estimate is used to arm a timer that provides loss detection (with or without retransmission), expiry of that timer MUST be interpreted as an indication of congestion in the network. This causes the sending rate to be adapted to a safe, conservative rate. For example, TCP collapses the congestion window to one segment [RFC5681] ๐
Some applications need an initial latency estimate before the latency between endpoints can be sampled empirically. For instance, when arming a retransmission timer, an initial value is needed to protect the messages sent before the endpoints sample the latency ๐ This initial latency estimate SHOULD generally be as conservative (large) as possible for the given application. For instance, when there's no knowledge about a path's latency, TCP requires the initial Retransmission Timeout (RTO) to be set to no less than 1 second [RFC6298]. UDP applications SHOULD similarly use an initial latency estimate of 1 second ๐ซง Values shorter than 1 second can be problematic (see the data analysis in the appendix of [RFC6298]) ๐ฅบ
3.1.2. Bulk-Transfer Applications ๐โจ
okay so bulk-transfer apps are the ones that shove a LOT of UDP datagrams at a peer, like more than a few per RTT ๐ญ. Those apps SHOULD implement TFRC [RFC5348], window-based TCP-like congestion control, or otherwise make sure the app is playing by the congestion control principles ๐ .
TFRC was designed to give you congestion control AND fairness in a way that vibes with the IETF's other transport protocols ๐ซถ. If your app implements TFRC, it need not follow the remaining guidelines in Section 3.1.2, because TFRC already handles them ๐, but it SHOULD still follow the remaining guidelines in the subsequent subsections of Section 3. โจ
Bulk-transfer apps that don't do TFRC or TCP-like windowing SHOULD implement a congestion control scheme that results in bandwidth (capacity) use that competes fairly with TCP within an order of magnitude ๐ธ.
Section 2 of [RFC3551] suggests that applications SHOULD monitor the packet-loss rate to make sure it's within acceptable parameters ๐. Loss counts as acceptable if a TCP flow across the same network path under the same network conditions would get an average throughput, measured on a reasonable timescale, that is not less than that of the UDP flow. The TCP comparison can't be specified exactly. It's meant as an "order-of-magnitude" comparison in timescale and throughput ๐. The timer recommendations in Section 3.1.1 also apply, bestie ๐ฐ๏ธ.
Finally, some bulk-transfer apps may choose not to implement any congestion control and instead rely on transmitting across reserved path capacity (see Section 3.1.9) ๐คทโโ๏ธ. This might be an acceptable choice for a subset of restricted networking environments, but it is by no means a safe practice for the wider Internet ๐.
When the UDP traffic of these apps leaks out into unprovisioned Internet paths, it can significantly degrade the performance of other traffic sharing the path and even result in congestion collapse ๐ฑ. Apps that support an uncontrolled or unadaptive transmission behavior SHOULD NOT do so by default. They SHOULD instead require users to explicitly enable this mode of operation, and they SHOULD verify that sufficient path capacity has been reserved for them ๐ฅ.
3.1.3. Low Data-Volume Applications ๐ฆ
so when apps only ever exchange a few UDP datagrams with a destination, and they implement TFRC or one of the other schemes from Section 3.1.2, the network barely sees any benefit ๐ฉ. Those mechanisms only really work for longer transmissions, so it's not the vibe for short chats.
Apps that only exchange a few UDP datagrams with a destination SHOULD still control their transmission behavior by not sending, on average, more than one UDP datagram per RTT to a destination ๐ง. Similar to the recommendation in [RFC1536], an application SHOULD maintain an estimate of the RTT for any destination it communicates with, using the methods in Section 3.1.1 ๐.
Some apps can't maintain a reliable RTT estimate for a destination. These apps don't need to, or can't, use protocol timers to measure the RTT (Section 3.1.1) ๐. There are two cases:
- The first case is apps that exchange too few UDP datagrams with a peer to get a statistically accurate RTT estimate, but that can still monitor the reliability of transmission (Section 3.3) ๐ก. These apps MAY use a predetermined transmission interval that gets exponentially backed off when packets are deemed lost. TCP specifies an initial value of 1 second [RFC6298], which is also RECOMMENDED as an initial value for UDP apps ๐. Some low data-volume apps, e.g., SIP [RFC3261] and General Internet Signaling Transport (GIST) [RFC5971], use an interval of 500 ms, and shorter values are likely problematic in many cases ๐ฌ. Same as the previous case, the initial timeout is not the maximum possible timeout, see Section 3.1.1 โจ.
- The second case is apps that can't maintain an RTT estimate for a destination, because the destination never sends return traffic ๐ญ. These apps SHOULD NOT send more than one UDP datagram every 3 seconds, and SHOULD use an even less aggressive rate when possible ๐ข. Shorter values are likely problematic in many cases. The sending rate here has to be more conservative than in the previous cases, because without return traffic there's no way to detect packet loss (aka congestion), so the app can't do exponential backoff to reduce load ๐ญ๐ซถ.
3.1.4. Applications Supporting Bidirectional Communications ๐
apps that talk both ways SHOULD use congestion control for BOTH directions of the conversation ๐ฌ. Take a client-server, request-response style app: clients SHOULD congestion-control their request transmission to a server, and the server SHOULD congestion-control its responses to the clients ๐ฅ๏ธ. Congestion in the forward and reverse directions is uncorrelated, so an app SHOULD either independently detect and respond to congestion along both directions, or limit new and retransmitted requests based on acknowledged responses across the entire round-trip path ๐.
3.1.5. Implications of RTT and Loss Measurements on Congestion Control โฑ๏ธ
Transports like TCP, SCTP, and DCCP detect congestion quickly, so they cut their maximum sending rate right away when congestion is experienced ๐๏ธ. That reaction is typically finished 1-2 RTTs after loss or congestion shows up. Applications using UDP SHOULD implement a congestion control scheme that reacts promptly to signals indicating congestion (e.g., by reducing the rate within the next RTT after a congestion signal) ๐ฆ.
UDP congestion control can work very differently from TCP ๐ . This includes congestion controls that respond on timescales that fit apps which can't usefully work within TCP's "change rate every RTT" model. Apps with a low or varying RTT are especially vulnerable to sampling errors (e.g., from measurement noise or timer accuracy) ๐ซ . That suggests averaging loss/congestion and RTT measurements over a longer interval, but this can also add delay before congestion gets detected โณ. Some apps may not reduce their sending rate immediately, for various reasons: RTT and loss measurements are only made periodically (e.g., using RTCP), extra time is needed to filter information, or the app can only change its sending rate at predetermined intervals (e.g., some video codecs) ๐ฅ.
When you're designing a congestion control algorithm, you have to think about the total time it takes to reduce the load after a lack of feedback or a congestion event ๐ง . If the most recent RTT measurement is smaller than the actual RTT, or the measured loss rate is smaller than the current rate, an app can overestimate the available capacity. That over-estimation can lead to a sending rate that creates congestion for the app itself or for other flows sharing the path capacity, and it can contribute to congestion collapse. Both of these need to be avoided ๐ซ.
A congestion control designed for UDP SHOULD respond as quickly as possible when it experiences congestion, and it SHOULD take into account both the loss rate and the response time when choosing a new rate ๐โโ๏ธ. The implemented congestion control scheme SHOULD result in bandwidth (capacity) use that is comparable to TCP's within an order of magnitude, so it doesn't starve other flows sharing a common bottleneck ๐ค.
3.1.6. Burst Mitigation and Pacing ๐
UDP apps SHOULD provide mechanisms to regulate the bursts of transmission the app may send to the network ๐. Lots of TCP and SCTP implementations already stop a sender from blasting long bursts at line rate, because those are known to cause early loss for apps sharing a common bottleneck ๐ฅ. Using pacing with TCP [ALLMAN] has also been shown to improve how TCP flows coexist with other flows ๐ง. The need to avoid excessive transmission bursts is noted in application specifications too (e.g., [RFC7143]) ๐.
Even low data-volume UDP flows can benefit from packet pacing ๐. For example, an app that sends three copies of a packet to improve robustness to loss is RECOMMENDED to pace those three packets out over several RTTs, which lowers the chance that all three get lost to the same congestion event (or another event, like burst corruption) ๐ซถโจ.
3.1.7. Explicit Congestion Notification โจ
Okay so Internet apps can totally use Explicit Congestion Notification (ECN) [RFC3168] to level up the services they support [RFC8087] ๐
Internet transports, like TCP, come with a set of mechanisms that ECN needs in order to work. Here's the vibe: ECN sets an ECN-capable codepoint (ECT(0) or ECT(1)) in the IP header of the packets being sent. This tells ECN-capable network devices (routers and friends ๐ง) that they may mark the packet with the Congestion Experienced (CE) codepoint instead of dropping it, as an early "hey, things are getting crowded" signal ๐ฆ
UDP apps can also get the ECN glow-up ๐ธ, providing that the API supports ECN and that they implement the required protocol mechanisms to support it.
The set of mechanisms a UDP app needs to use ECN is:
- A sender MUST provide a method to determine (e.g., negotiate) that the corresponding application is able to provide ECN feedback using a compatible ECN method.
- A receiver that enables the use of ECN for a UDP port MUST check the ECN field at the receiver for each UDP datagram that it receives on this port.
- The receiving application needs to provide feedback of congestion information to the sending application. This MUST report the presence of datagrams received with a CE-mark by providing a mechanism to feed this congestion information back to the sending application. The feedback MAY also report the presence of
ECT(1)andECT(0)/Not-ECTpackets [RFC7560]. ([RFC3168] and [RFC7560] specify methods for TCP.) - An application sending ECN-capable datagrams MUST provide an appropriate congestion reaction when it receives feedback indicating that congestion has been experienced. This ought to result in reduction of the sending rate by the UDP congestion control method (see Section 3.1) that is not less than the reaction of TCP under equivalent conditions.
- A sender SHOULD detect network paths that do not support the ECN field correctly. When detected, they need to either conservatively react to congestion or even fall back to not using ECN [RFC8087]. This method needs to be robust to changes within the network path that may occur over the lifetime of a session.
- A sender is encouraged to provide a mechanism to detect and react appropriately to misbehaving receivers that fail to report CE-marked packets [RFC8087].
[RFC6679] provides guidance and an example of this support, describing a method to allow ECN to be used for UDP-based applications using the Real-Time Protocol (RTP). Applications that cannot provide this set of mechanisms, but still wish to gain the benefits of using ECN, are encouraged to use a transport protocol that already supports ECN (such as TCP) ๐ซถ
3.1.8. Differentiated Services Model ๐
An application using UDP can use the differentiated services (DiffServ) Quality of Service (QoS) framework ๐ฆ To enable differentiated services processing, a UDP sender sets the Differentiated Services Code Point (DSCP) field [RFC2475] in packets sent to the network. Normally, a UDP source/destination port pair will set a single DSCP value for all packets belonging to a flow, but multiple DSCPs can be used, as described later in this section. A DSCP may be chosen from a small set of fixed values (the class selector code points), or from a set of recommended values defined in the Per Hop Behavior (PHB) specifications, or from values that have purely local meanings to a specific network that supports DiffServ. In general, packets may be forwarded across multiple networks between source and destination.
Okay, big warning here ๐ When you set a non-default DSCP value, you have to be aware that DSCP markings may be changed or removed between the traffic source and destination. This has implications on the design of applications that use DSCPs. Specifically, applications SHOULD be designed not to rely on implementation of a specific network treatment. Instead, they need to implement congestion control methods to determine if their current sending rate is inducing congestion in the network.
[RFC7657] describes the implications of using DSCPs and provides recommendations on using multiple DSCPs within a single network five-tuple (source and destination addresses, source and destination ports, and the transport protocol used, in this case, UDP or UDP-Lite). It especially covers the expected impact on transport protocol interactions, with congestion control or reliability functionality (e.g., retransmission, reordering). Use of multiple DSCPs can result in reordering by increasing the set of network forwarding resources used by a sender. It can also increase exposure to resource depletion or failure ๐
3.1.9. QoS, Pre-Provisioned, or Reserved Capacity ๐
The IETF usually specifies protocols for use within the Best Effort General Internet. Sometimes it is relevant to specify protocols with a different applicability. An application using UDP can use the integrated services QoS framework. This framework is usually made available within controlled environments (e.g., within a single administrative domain or bilaterally agreed connection between domains). Applications intended for the Internet SHOULD NOT assume that QoS mechanisms are supported by the networks they use, and therefore need to provide congestion control, error recovery, etc., in case the actual network path does not provide provisioned service.
Some UDP applications are only expected to be deployed over network paths that use pre-provisioned capacity, or capacity reserved using dynamic provisioning, e.g., through the Resource Reservation Protocol (RSVP). Multicast applications are also used with pre-provisioned capacity (e.g., IPTV deployments within access networks). These applications MAY choose not to implement any congestion control mechanism and instead rely on transmitting only on paths where the capacity is provisioned and reserved for this use. This might be an acceptable choice for a subset of restricted networking environments, but it is by no means a safe practice for operation over the wider Internet ๐ Applications that choose this option SHOULD carefully and in detail describe the provisioning and management procedures that result in the desired containment.
Applications that support an uncontrolled or unadaptive transmission behavior SHOULD NOT do so by default, and SHOULD instead require users to explicitly enable this mode of operation.
Applications designed for use within a controlled environment (see Section 3.6) may be able to exploit network management functions to detect whether they are causing congestion, and react accordingly. If the traffic of such applications leaks out into unprovisioned Internet paths, it can significantly degrade the performance of other traffic sharing the path, and even result in congestion collapse ๐ญ Protocols designed for such networks SHOULD provide mechanisms at the network edge to prevent leakage of traffic into unprovisioned Internet paths (e.g., [RFC7510]). To protect other applications sharing the same path, applications SHOULD also deploy an appropriate circuit breaker, as described in Section 3.1.10.
An IETF specification targeting a controlled environment is expected to provide an applicability statement that restricts the application to the controlled environment (see Section 3.6) ๐
3.1.10. Circuit Breaker Mechanisms ๐
A transport circuit breaker is an automatic mechanism used to estimate the congestion caused by a flow, and to terminate (or significantly reduce the rate of) the flow when excessive congestion is detected [RFC8084]. This is a safety measure to prevent congestion collapse (starvation of resources available to other flows), and it's essential for an Internet that is heterogeneous and for traffic that is hard to predict in advance ๐
A circuit breaker is intended as a protection mechanism of last resort. Under normal circumstances, a circuit breaker should not be triggered; it is designed to protect things when there is severe overload. The goal is usually to limit the maximum transmission rate to reflect the available capacity of a network path. Circuit breakers can operate on individual UDP flows or traffic aggregates, e.g., traffic sent using a network tunnel.
[RFC8084] provides guidance and examples on the use of circuit breakers. The use of a circuit breaker in RTP is specified in [RFC8083].
Applications used in the general Internet SHOULD implement a transport circuit breaker if they do not implement congestion control or operate a low data-volume service (see Section 3.6). All applications MAY implement a transport circuit breaker [RFC8084], and are encouraged to consider implementing at least a slow-acting transport circuit breaker to provide a protection of last resort for their network traffic ๐
3.1.11. UDP Tunnels ๐ฆ
Okay bestie, UDP tunnels are SO popular rn ๐ The idea is that a tunnel endpoint wraps the packets of another protocol inside UDP datagrams and sends them to another tunnel endpoint. That one unwraps them and forwards the original packets from the payload ๐. Teredo [RFC4380] is one example ๐ง. Tunnels make virtual links that look like they directly connect places that are super far apart on the physical Internet, and you can use them to build virtual (private) networks โจ. Using UDP for this is iconic when the payload protocol isn't supported by the middleboxes on the path, because so many middleboxes are totally fine with UDP ๐.
Well-implemented tunnels are generally invisible to the endpoints that happen to send over a path with tunneled links ๐ซฅ. BUT, from the point of view of the routers between the two tunnel endpoints, a UDP tunnel's traffic is just a regular UDP flow. The encapsulator and decapsulator look like regular UDP-sending and UDP-receiving apps ๐. Other flows can share the path with one or more UDP tunnels, so congestion control needs to be considered ๐ฆ.
Two factors decide whether a UDP tunnel needs to use specific congestion control mechanisms ๐ค. First, is the payload traffic IP-based? Second, does the tunneling scheme generate UDP traffic at a volume that matches the volume of payload traffic inside the tunnel?
IP-based unicast traffic is generally assumed to be congestion controlled ๐. That means the transport protocols sending it already have mechanisms that are good enough to deal with congestion on the path. So a tunnel carrying that kind of traffic should already interact nicely with everything else sharing the path, and specific congestion control for the tunnel isn't necessary ๐ธ.
However, if the IP traffic in the tunnel is known not to be congestion controlled, additional measures are RECOMMENDED to limit the impact of the tunneled traffic on other traffic sharing the path ๐. For the specific case of a tunnel that carries IP multicast traffic, see Section 4.1 โจ.
Here's how the cases break down, in more detail ๐:
- A tunnel generates UDP traffic at a volume that corresponds to the volume of payload traffic, and the payload traffic is IP based and congestion controlled.
This is arguably the most common case for Internet tunnels ๐ . In this case, the UDP tunnel SHOULD NOT employ its own congestion control mechanism, because congestion losses of tunneled traffic will already trigger an appropriate congestion response at the original senders of the tunneled traffic. A circuit breaker mechanism may provide benefit by controlling the envelope of the aggregated traffic ๐ก๏ธ.
Note that this guideline is built on the assumption that most IP-based communication is congestion controlled ๐ค. If a UDP tunnel is used for IP-based traffic that is known to not be congestion controlled, the next set of guidelines applies ๐.
- A tunnel generates UDP traffic at a volume that corresponds to the volume of payload traffic, and the payload traffic is not known to be IP based, or is known to be IP based but not congestion controlled.
This can be the case, for example, when some link-layer protocols are encapsulated within UDP (but not all link-layer protocols; some are congestion controlled) ๐. Because it is not known that congestion losses of tunneled non-IP traffic will trigger an appropriate congestion response at the senders, the UDP tunnel SHOULD employ an appropriate congestion control mechanism or circuit breaker mechanism designed for the traffic it carries ๐ฅ. Because tunnels are usually bulk-transfer applications as far as the intermediate routers are concerned, the guidelines in Section 3.1.2 apply ๐ซถ.
- A tunnel generates UDP traffic at a volume that does not correspond to the volume of payload traffic, independent of whether the payload traffic is IP based or congestion controlled.
Examples of this class include UDP tunnels that send at a constant rate, increase their transmission rates under loss (for example, due to increasing redundancy when Forward Error Correction is used), or are otherwise unconstrained in their transmission behavior ๐ญ. These specialized uses of UDP for tunneling go beyond the scope of the general guidelines in this document. The implementer of such specialized tunnels SHOULD carefully consider congestion control in the design of their tunneling mechanism and SHOULD consider use of a circuit breaker mechanism ๐ง .
The type of encapsulated payload might be identified by a UDP port; identified by an Ethernet Type or IP protocol number. A tunnel SHOULD provide mechanisms to restrict the types of flows that may be carried by the tunnel. For instance, a UDP tunnel designed to carry IP needs to filter out non-IP traffic at the ingress. This is particularly important when a generic tunnel encapsulation is used (e.g., one that encapsulates using an EtherType value) ๐จ. Such tunnels SHOULD provide a mechanism to restrict the types of traffic that are allowed to be encapsulated for a given deployment (see [INT-TUNNELS]) ๐.
Designing a tunneling mechanism requires way more expertise than many other UDP applications, because tunnels are usually meant to be transparent to the endpoints transmitting over them. So they need to correctly emulate the behavior of an IP link [INT-TUNNELS] ๐งฉ. For example:
- Requirements for tunnels that carry or encapsulate using ECN code points [RFC6040].
- Usage of the IP DSCP field by tunnel endpoints [RFC2983].
- Encapsulation considerations in the design of tunnels [ENCAP].
- Usage of ICMP messages [INT-TUNNELS].
- Handling of fragmentation and packet size for tunnels [INT-TUNNELS].
- Source port usage for tunnels designed to support equal cost multipath (ECMP) routing (see Section 5.1.1).
- Guidance on the need to protect headers [INT-TUNNELS] and the use of checksums for IPv6 tunnels (see Section 3.4.1).
- Support for operations and maintenance [INT-TUNNELS].
At the same time, the tunneled traffic is application traffic like any other from the perspective of the networks the tunnel transmits over ๐. This document only touches upon the congestion control considerations for implementing UDP tunnels. A discussion of other required tunneling behavior is out of scope ๐คทโโ๏ธ.
3.2. Message Size Guidelines ๐
IP fragmentation lowers the efficiency and reliability of Internet communication ๐ฉ. The loss of a single fragment results in the loss of an entire fragmented packet, because even if all the other fragments arrive correctly, the original packet can't be reassembled and delivered. This fundamental issue with fragmentation exists for both IPv4 and IPv6 ๐.
It gets worse ๐. Some network address translators (NATs) and firewalls drop IP fragments. The network address translation a NAT performs only operates on complete IP packets, and some firewall policies also require inspection of complete IP packets. Even so, some NATs and firewalls simply don't implement the necessary reassembly functionality, so they choose to drop all fragments. Finally, [RFC4963] documents other issues specific to IPv4 fragmentation ๐ฅฒ.
Because of all this, an application SHOULD NOT send UDP datagrams that result in IP packets exceeding the Maximum Transmission Unit (MTU) along the path to the destination ๐ซ. So an application SHOULD either use the path MTU information provided by the IP layer or implement Path MTU Discovery (PMTUD) itself [RFC1191] [RFC1981] [RFC4821] to figure out whether the path to a destination will support its desired message size without fragmentation ๐.
However, ICMP messages that enable path MTU discovery are increasingly being filtered by middleboxes (including firewalls) [RFC4890] ๐ค. When the path includes a tunnel, some devices acting as a tunnel ingress discard ICMP messages that originate from network devices the tunnel passes over, so those messages never reach the UDP endpoint ๐ป.
Packetization Layer Path MTU Discovery (PLPMTUD) [RFC4821] doesn't rely on network support for ICMP messages, so it's considered more robust than standard PMTUD ๐ช. It isn't susceptible to "black holing" of ICMP messages ๐ณ๏ธ. To operate, PLPMTUD requires changes to the way the transport is used: both to transmit probe packets and to account for the loss or success of those probes. This not only updates the PMTU algorithm, it also impacts loss recovery, congestion control, and so on ๐. These updated mechanisms can be implemented within a connection-oriented transport (e.g., TCP, SCTP, DCCP), but they are not a part of UDP. This type of feedback is not typically present for unidirectional applications ๐ญ.
So PLPMTUD places additional design requirements on a UDP application that wants to use this method ๐ง. This is especially true for UDP tunnels, because the overhead of sending probe packets needs to be accounted for. It may require adding a congestion control mechanism to the tunnel (see Section 3.1.11), and it complicates the data path at a tunnel decapsulator ๐ ๏ธ.
Applications that do not follow the recommendation to do PMTU/PLPMTUD discovery SHOULD still avoid sending UDP datagrams that would result in IP packets exceeding the path MTU ๐งฑ. Because the actual path MTU is unknown, such applications SHOULD fall back to sending messages shorter than the default effective MTU for sending (EMTU_S in [RFC1122]). For IPv4, EMTU_S is the smaller of 576 bytes and the first-hop MTU [RFC1122]. For IPv6, EMTU_S is 1280 bytes [RFC2460]. The effective PMTU for a directly connected destination (with no routers on the path) is the configured interface MTU, which could be less than the maximum link payload size. Sending minimum-sized UDP datagrams is inefficient over paths that support a larger PMTU, which is a second reason to implement PMTU discovery ๐.
To determine an appropriate UDP payload size, applications MUST subtract the size of the IP header (which includes any IPv4 optional headers or IPv6 extension headers) as well as the length of the UDP header (8 bytes) from the PMTU size ๐งฎ. This size, known as the Maximum Segment Size (MSS), can be obtained from the TCP/IP stack [RFC1122] ๐.
Applications that don't send messages exceeding the effective PMTU of IPv4 or IPv6 don't need any of the above mechanisms ๐. Note that the presence of tunnels can cause an additional reduction of the effective PMTU [INT-TUNNELS], so implementing PMTU discovery may be beneficial โจ.
Applications that fragment an application-layer message into multiple UDP datagrams SHOULD do this fragmentation so that each datagram can be received independently, and can be independently retransmitted in case an application implements its own reliability mechanisms ๐ซถ.
3.3. Reliability Guidelines ๐
Okay so application designers already know UDP is not reliable ๐ It doesn't retransmit lost packets, and honestly that's often the whole reason people pick it in the first place โจ But if your app does need reliable message delivery, it MUST implement an appropriate mechanism itself ๐ซถ
UDP also doesn't protect against datagram duplication ๐ So an application might get multiple copies of the same UDP datagram, and some of the duplicates can show up way later than the first one ๐ Application designers SHOULD handle that duplication gracefully, and they may need to build mechanisms to detect duplicates. Even if receiving a datagram only triggers idempotent operations, apps may still want to suppress duplicates to reduce load ๐ง
Applications that require ordered delivery MUST reestablish datagram ordering themselves ๐ฅ The Internet can seriously delay some packets compared to others because of routing transients, intermittent connectivity, or mobility ๐ญ That can cause reordering, where UDP datagrams arrive at the receiver in a different order than they were sent ๐
Apps that use multiple transport ports need to be robust to reordering between sessions ๐ Load-balancing techniques inside the network, like Equal Cost Multipath (ECMP) forwarding, can also mean there's no ordering between different transport sessions, even between the same two network endpoints ๐ฆ
Here's the tea โ The time by which packets get reordered, or after which duplicates can still arrive, can be very large. Even more importantly, there is no well-defined upper boundary here ๐ [RFC793] defines the maximum delay a TCP segment should experience, the Maximum Segment Lifetime (MSL), as 2 minutes. No other RFC defines an MSL for other transport protocols or for IP itself ๐ธ The MSL value defined for TCP is conservative enough that it SHOULD be used by other protocols, including UDP. So applications SHOULD be robust to the reception of delayed or duplicate packets that arrive within that 2-minute interval ๐
Retransmitting lost packets or messages is a super common reliability mechanism ๐ But retransmissions can increase network load in response to congestion, which makes that congestion worse ๐ฌ Any application that uses retransmission is responsible for congestion control of its retransmissions (as well as its original traffic), so it's subject to the Congestion Control guidelines in Section 3.1. Guidance on measuring RTT appropriately in Section 3.1.1 also applies to timers used for retransmission packet-loss detection ๐
Instead of building these fairly complex reliability mechanisms from scratch, an application that requires reliable and ordered message delivery SHOULD, whenever possible, choose an IETF standard transport protocol that provides those features ๐ซถโจ
3.4. Checksum Guidelines ๐ง
The UDP header includes an optional, 16-bit one's complement checksum that provides an integrity check ๐ Real talk, these checks aren't strong from a coding or cryptographic perspective, and they aren't designed to detect physical-layer errors or malicious modification of the datagram [RFC3819] ๐ โโ๏ธ So application developers SHOULD implement additional checks where data integrity matters, like a Cyclic Redundancy Check (CRC), or a keyed or non-keyed cryptographic hash included with the data to verify the integrity of an entire object or file sent over the UDP service ๐
The UDP checksum gives a statistical guarantee that the payload wasn't corrupted in transit โจ It also lets the receiver verify it was the intended destination, because it covers the IP addresses, port numbers, and protocol number ๐ฌ And it checks that the packet isn't truncated or padded, because it covers the size field ๐ So it protects an app from receiving corrupted payload data in place of, or in addition to, the data that was actually sent ๐ญ More on the set of checks the checksum field performs can be found in Section 3.1 of [RFC6396] ๐
Applications SHOULD enable UDP checksums [RFC1122]. For IPv4, [RFC768] permits an option to disable them by setting a zero checksum value ๐ฅฑ An application is permitted to optionally discard UDP datagrams with a zero checksum [RFC1122] ๐๏ธ
When UDP is used over IPv6, the UDP checksum is relied upon to protect both the IPv6 and UDP headers from corruption, because IPv6 lacks a checksum of its own ๐ซ It MUST be used as specified in [RFC2460]. Under specific conditions, a UDP application is allowed to use a zero UDP checksum mode with a tunnel protocol (see Section 3.4.1) ๐ท
Apps that choose to disable UDP checksums MUST NOT make assumptions about the correctness of received data, and they MUST behave correctly when a UDP datagram arrives that was originally sent to a different destination or is otherwise corrupted ๐ซ Non-negotiable bestie ๐
3.4.1. IPv6 Zero UDP Checksum ๐ฆ
[RFC6935] defines a method that enables a zero UDP checksum mode with a tunnel protocol, as long as the method satisfies the requirements in [RFC6936] ๐๏ธ The application MUST implement mechanisms and/or usage restrictions when enabling this mode. That includes defining the scope for usage and measures to prevent leakage of traffic to other UDP applications (see Appendix A and Section 3.6) ๐ก๏ธ These extra design requirements for a zero IPv6 UDP checksum aren't present for IPv4, since the IPv4 header validates information that isn't protected in an IPv6 packet ๐ง The key requirements are:
- Use of the UDP checksum with IPv6 MUST be the default configuration for all implementations [RFC6935]. The receiving endpoint MUST only allow the use of UDP zero-checksum mode for IPv6 on a UDP destination port that is specifically enabled. ๐
- An application that supports a checksum different from the one in [RFC2460] MUST comply with all implementation requirements specified in Section 4 of [RFC6936] and with the usage requirements specified in Section 5 of [RFC6936]. ๐
- A UDP application MUST check that the source and destination IPv6 addresses are valid for any packets with a UDP zero checksum, and MUST discard any packet for which this check fails. To protect from misdelivery, new encapsulation designs SHOULD include an integrity check at the transport layer that covers at least the IPv6 header, the UDP header, and the shim header for the encapsulation, if any [RFC6936]. ๐จ
- One way to help satisfy the requirements of [RFC6936] may be to limit the usage of such tunnels, e.g., to constrain traffic to an operator network, as discussed in Section 3.6. The encapsulation defined for MPLS in UDP [RFC7510] chooses this approach. ๐งโโ๏ธ
As with IPv4, IPv6 applications that choose to disable UDP checksums MUST NOT make assumptions about the correctness of received data, and MUST behave correctly when a UDP datagram arrives that was originally sent to a different destination or is otherwise corrupted ๐ โโ๏ธ
IPv6 datagrams with a zero UDP checksum won't get passed by any middlebox that validates the checksum based on [RFC2460] or that updates the UDP checksum field, like NATs or firewalls ๐งฑ Changing that would mean those middleboxes need an update to correctly handle datagrams with zero UDP checksums. To ensure end-to-end robustness, applications that may be deployed in the general Internet MUST provide a mechanism to safely fall back to using a checksum when a path change redirects a zero UDP checksum flow over a path that includes a middlebox discarding IPv6 datagrams with a zero UDP checksum ๐๐
3.4.2. UDP-Lite ๐ป
A special class of applications can benefit from getting partially damaged payloads delivered instead of discarded, when using paths that include error-prone links ๐ฉน Those apps can tolerate payload corruption and MAY choose to use the Lightweight User Datagram Protocol (UDP-Lite) [RFC3828] variant of UDP instead of basic UDP. Applications that pick UDP-Lite over UDP should still follow the congestion control and other guidelines described for use with UDP in Section 3 ๐
UDP-Lite changes the semantics of the UDP "payload length" field into a "checksum coverage length" field ๐ Otherwise, UDP-Lite is semantically identical to UDP. The interface differs from UDP by adding a single (socket) option that communicates the checksum coverage length ๐ง At the sender, this specifies the intended checksum coverage, and the remaining unprotected part of the payload is called the "error-insensitive part" ๐ By default, UDP-Lite checksum coverage extends across the entire datagram. If needed, an application may change this length value on the fly, e.g., to offer greater protection to some messages ๐ UDP-Lite always verifies that a packet was delivered to the intended destination, meaning it always verifies the header fields. Errors in the insensitive part won't cause a UDP datagram to be discarded by the destination ๐ณ So apps using UDP-Lite MUST NOT make assumptions about the correctness of the data received in the insensitive part of the UDP-Lite payload โ ๏ธ
A UDP-Lite sender SHOULD select the minimum checksum coverage that includes all the sensitive payload information ๐ฏ For example, apps that use the Real-Time Protocol (RTP) [RFC3550] will likely want to protect the RTP header against corruption ๐ฅ Applications, where appropriate, MUST also introduce their own validity checks for protocol information carried in the insensitive part of the UDP-Lite payload (e.g., internal CRCs) โ
A UDP-Lite receiver MUST set a minimum coverage threshold for incoming packets that is not smaller than the smallest coverage used by the sender [RFC3828]. The receiver SHOULD select a threshold large enough to block packets with an inappropriately short coverage field ๐ง This may be a fixed value, or it may be negotiated by an application. UDP-Lite doesn't provide mechanisms to negotiate the checksum coverage between sender and receiver, so the application has to handle that itself ๐ค
Apps can still experience packet loss when using UDP-Lite ๐ The enhancements UDP-Lite offers rely on a link being able to intercept the UDP-Lite header to correctly identify the partial coverage required. When tunnels and/or encryption are used, UDP-Lite datagrams can get treated the same as UDP datagrams, which results in packet loss ๐ซฃ IP fragmentation can also prevent special treatment for UDP-Lite datagrams, which is another reason applications SHOULD avoid IP fragmentation (Section 3.2) ๐งฉ
UDP-Lite is supported in some endpoint protocol stacks ๐ป But current support for middlebox traversal using UDP-Lite is poor, because UDP-Lite uses a different IPv4 protocol number or IPv6 "next header" value than UDP does ๐ฅฒ So few middleboxes can currently interpret UDP-Lite and take appropriate actions when forwarding the packet. That makes UDP-Lite less suited for applications needing general Internet support, until UDP-Lite gets better support in middleboxes โญ
3.5. Middlebox Traversal Guidelines ๐ฆโจ
okay so bestie, middleboxes are the NATs and firewalls sitting along the path between two ends, and they are extremely nosy ๐. A middlebox usually does some job that means it has to remember per-flow state. For TCP, the middlebox can snoop on the connection-management info, see the handshake and teardown, and create or destroy that state at the right moments ๐ . For UDP, that's not possible, because UDP is connectionless and there's no handshake to peek at. So instead, a middlebox makes state when it sees a packet that looks like a new flow based on some local criteria ๐ง, and then it deletes that state after some time passes with no packets from that flow.
Here's the catch ๐. Depending on what the middlebox does, that timer can make certain UDP exchanges fail. Take NATs and firewalls: they usually treat the path on one side as interior to their domain and the path on the other side as exterior. When the first packet goes from interior to exterior, per-flow state gets created, and while that state exists, return traffic gets forwarded back in ๐. But if the return traffic shows up after the state has timed out, it gets dropped, and so does any other traffic arriving from the exterior that doesn't match.
Plenty of apps use UDP through middleboxes with zero extra tricks needed ๐ธ. DNS is the classic example, since it's a strict request-response pattern that usually wraps up within seconds, so the state never has time to expire.
Other apps can have communication failures when the middlebox deletes the state during quiet periods where the app isn't sending any UDP. Apps SHOULD be able to handle those failures gracefully ๐ซถ and have mechanisms to re-establish application-layer sessions and state.
For some apps, like media streams, re-syncing is really not it because it causes playback glitches users can literally hear and see ๐ญ. Those specialized apps MAY send periodic keep-alive messages to try to refresh middlebox state (for example, [RFC7675]). But real talk, keep-alives are NOT RECOMMENDED for general use ๐. Lots of apps don't need them, and they can eat up a lot of system and network resources.
If an app does need keep-alives to deliver useful service over UDP through middleboxes, it SHOULD NOT send them more often than once every 15 seconds, and it SHOULD use longer intervals when it can โจ. There's no common timeout for per-flow UDP state across arbitrary middleboxes. NATs need a state timeout of 2 minutes or longer [RFC4787] ๐. Unfortunately, the research shows a big chunk of deployed middleboxes use shorter timeouts than that ๐ฉ. The 15-second number comes from ICE [RFC5245] ๐ฆ.
If an app is deployed in a controlled environment, the deployer SHOULD check whether longer intervals are allowed there, or whether the network offers ways to explicitly control middlebox state timeouts. Examples include PCP [RFC6887], MIDCOM [RFC3303], NSIS [RFC5973], or UPnP [UPnP] ๐.
It is RECOMMENDED that apps add slight random variations ("jitter") to keep-alive timing ๐, so that keep-alives from different hosts don't get stuck in persistent sync with each other [RFC7675].
Sending keep-alives is NOT a replacement for a recovery mechanism for broken sessions ๐ . Like every UDP datagram, keep-alives can be delayed or dropped, which lets the middlebox state time out anyway. Also, the congestion control guidance in Section 3.1 covers all UDP transmissions by an app, including keep-alives ๐. So congestion control can delay or temporarily suspend keep-alive sending.
Keep-alives are a whole vibe check on battery-powered devices too ๐. If an app needs to stay connected for a long time with very little traffic, how often it sends keep-alives can become the thing that decides power consumption, depending on the underlying network tech.
Here's a fun one ๐. Many middleboxes are set up to need TCP keep-alives much less often than UDP ones, and that difference alone can be enough to make TCP the better pick for these deployments. On the flip side, there's anecdotal evidence that direct communication through middleboxes (like with ICE [RFC5245]) succeeds less often with TCP than with UDP ๐คทโโ๏ธ. So the trade-offs between transport protocols, especially for middlebox traversal, deserve a careful look ๐ง.
UDP apps that might be deployed on the Internet need to be designed knowing that middlebox behavior varies a LOT ๐. Even though UDP is connectionless, middleboxes often keep state for each UDP flow anyway. Using multiple UDP flows can eat up the available state space, and it can also change how the middlebox treats later packets, either to protect its own resources or to stop perceived misuse ๐จ. The chance of path failure goes up when apps run several UDP flows in parallel (see Section 5.1.2 for recommendations on using multiple ports) ๐ธ.
3.6. Limited Applicability and Controlled Environments ๐ง
Okay, so there are two different types of applicability identified for IETF specs that use UDP ๐:
- General Internet. By default, IETF specs target deployment on the general Internet ๐. Experience shows that protocols built for one context or one app often end up being used in a much wider range of contexts. For example, a protocol first deployed inside a local area network might later run over a virtual network that crosses the Internet, or over the Internet in general ๐ฆ. Apps designed for general Internet use may see a whole range of network device behaviors, and in particular, they SHOULD consider whether they need to work over paths that might include middleboxes ๐ .
- Controlled Environment. A protocol, encapsulation, or tunnel could be designed to only be used inside a controlled environment ๐ฐ. For example, an app designed for a network operator might only be deployed within that one operator's network, or across a set of cooperating operators next to each other. The app's traffic can then be managed to avoid congestion, instead of relying on built-in mechanisms, which ARE required when operating over the general Internet โจ. Apps targeting a limited applicability use case might be able to take advantage of special hardware (like carrier-grade equipment) or underlying protocol features of the subnetwork they run over ๐.
Specs addressing a limited applicability use case or a controlled environment SHOULD identify how a level of safety is provided in their restricted deployment that is equivalent to a protocol designed for the general Internet ๐ก๏ธ. For example, a design based on extensive experience with deployments of particular methods, plus features you can't expect from general Internet equipment, and the robustness of MPLS's design against header corruption, both helped justify using an alternate UDP integrity check [RFC7510] ๐.
An IETF spec targeting a controlled environment is expected to provide an applicability statement that restricts app traffic to that controlled environment ๐. It would also be expected to describe how methods can be provided to discourage or prevent corrupted packets from escaping the environment (for example, Section 5 of [RFC7510]) ๐ญ.
4. Multicast UDP Usage Guidelines ๐
Okay, this section adds on to Section 3 with extra guidelines that apply to multicast and broadcast usage of UDP ๐ก.
Multicast and broadcast transmission [RFC1112] usually use the UDP transport protocol, although they can be used with other transport protocols too (for example, UDP-Lite) ๐.
There are currently two models of multicast delivery ๐ฏโโ๏ธ. First there's the Any-Source Multicast (ASM) model, defined in [RFC1112]. Then there's the Source-Specific Multicast (SSM) model, defined in [RFC4607]. ASM group members receive all data sent to the group by any source, while SSM limits the distribution tree to just one single source ๐ซ.
Specialized classes of apps also use UDP for IP multicast or broadcast [RFC919] ๐ง. Designing these apps takes expertise beyond simple, unicast-specific guidelines, because these senders might transmit to potentially very many receivers, across potentially very different paths, all at the same time ๐ต. That seriously complicates congestion control, flow control, and reliability mechanisms ๐.
This section gives guidance on multicast and broadcast UDP usage ๐ฃ. Broadcast use by an app is normally constrained by routers to the local subnetwork ๐ . However, tunneling techniques and proxies can and DO result in some broadcast traffic traversing Internet paths ๐. So these guidelines also apply to broadcast traffic โจ.
The IETF has defined a reliable multicast framework [RFC3048] and several building blocks to help designers of multicast apps, such as [RFC3738] or [RFC4654] ๐ ๏ธ.
Senders to anycast destinations MUST be aware that successive messages sent to the same anycast IP address may be delivered to different anycast nodes, meaning they arrive at different locations in the topology ๐.
Hmm, wait. I need to correct that last line: the original says "must be aware", so I should keep it non-capitalized. Here's the faithful version:
Senders to anycast destinations must be aware that successive messages sent to the same anycast IP address may be delivered to different anycast nodes, meaning they arrive at different locations in the topology ๐.
Most UDP tunnels that carry IP multicast traffic use a tunnel encapsulation with a unicast destination address, such as Automatic Multicast Tunneling [RFC7450] ๐. These MUST follow the same requirements as a tunnel carrying unicast data (see Section 3.1.11) ๐ . There are deployment cases and solutions where the outer header of a UDP tunnel has a multicast destination address, such as [RFC6513] ๐ธ. These cases are mainly deployed in controlled environments over reserved capacity, often operating within a single administrative domain, or between two domains over a bilaterally agreed path with reserved capacity ๐ฐ. So congestion control is OPTIONAL ๐, but circuit breaker techniques are still RECOMMENDED ๐ to restore some degree of service if the offered load exceeds the reserved capacity (for example, because of misconfiguration) ๐ฌ.
4.1. Multicast Congestion Control Guidelines โจ
okay so unicast congestion control is lowkey not it for multicast ๐ญ it needs a two-way chat and it adjusts the rate for ONE receiver. multicast trees can fan out to massive numbers of receivers, so an in-band return channel to control the sending rate doesn't scale, and because it's one-to-many, you can't tailor the rate to each individual receiver. so generating TCP-compatible aggregate flow rates for Internet multicast data, whether it's native or tunneled, is the job of the application implementing the congestion control ๐
Applications using multicast SHOULD provide appropriate congestion control. multicast congestion control needs mechanisms that are robust to the potential heterogeneity of both the multicast distribution tree and the receivers in a group ๐ that heterogeneity can look like some receivers losing more packets than others, higher delay, and/or less ability to respond to network conditions. congestion control matters most for any multicast session where all or part of the distribution tree spans an access network (e.g., a home gateway) ๐ the RFC Series has defined two styles of congestion control:
- Feedback-based congestion control ๐ the sender gets multicast or unicast UDP messages from the receivers, so it can assess the level of congestion and then adjust its sender rate(s) (e.g., [RFC5740],[RFC4654]). multicast methods may operate on longer timescales than unicast (e.g., due to the higher group RTT of a heterogeneous group). a control method could decide NOT to reduce the rate of the entire multicast group in response to a control message from a single receiver (e.g., a sender could set a minimum rate and decide to ask a congested receiver to leave the multicast group, and could also decide to send content to those congested receivers at a lower rate using unicast congestion control).
- Receiver-driven congestion control ๐ง this one doesn't need a receiver to send explicit UDP control messages for congestion control (e.g., [RFC3738], [RFC5775]). instead, the sender spreads the data across multiple IP multicast groups (e.g., using a set of
{S,G}channels). each receiver figures out its own level of congestion and controls its reception rate using only multicast join/leave messages sent in the network control plane. this method scales to arbitrary large groups of receivers ๐ฆ
any multicast-enabled receiver may try to join and receive traffic from any group, so there may be a need for rate limits on individual receivers or on the aggregate multicast service ๐ฆ also note, at the transport layer, there is no way to stop a join message from propagating to the next-hop router.
some classes of multicast applications can monitor the user-level quality of the transfer at the receiver ๐ applications that can detect a significant reduction in user quality SHOULD treat this as a congestion signal (e.g., to leave a group when using layered multicast encoding). if they can't, they SHOULD use this signal as a circuit breaker to terminate the flow by leaving the multicast group ๐ฅ
4.1.1. Bulk-Transfer Multicast Applications ๐
applications that do bulk transmission of data over a multicast distribution tree, i.e., applications that exchange more than a few UDP datagrams per RTT, SHOULD implement a method for congestion control. the currently RECOMMENDED IETF methods are: Asynchronous Layered Coding (ALC) [RFC5775], TCP-Friendly Multicast Congestion Control (TFMCC) [RFC4654], Wave and Equation Based Rate Control (WEBRC) [RFC3738], NACK-Oriented Reliable Multicast (NORM) transport protocol [RFC5740], File Delivery over Unidirectional Transport (FLUTE) [RFC6726], and Real Time Protocol/Control Protocol (RTP/RTCP) [RFC3550] ๐
an application can also implement a different congestion control scheme, as long as it follows the guidelines of [RFC2887] and uses the framework of [RFC3048]. bulk-transfer applications that choose NOT to implement [RFC4654], [RFC5775], [RFC3738], [RFC5740], [RFC6726], or [RFC3550] SHOULD implement a congestion control scheme whose bandwidth use competes fairly with TCP within an order of magnitude ๐ซถ
Section 2 of [RFC3551] says multimedia applications SHOULD monitor the packet-loss rate to make sure it stays within acceptable parameters. packet loss is considered acceptable if a TCP flow across the same network path under the same network conditions would achieve an average throughput, measured on a reasonable timescale, that is not less than that of the UDP flow. the TCP comparison can't be specified exactly, but it's meant as an "order-of-magnitude" comparison in timescale and throughput ๐
4.1.2. Low Data-Volume Multicast Applications ๐ธ
all the recommendations in Section 3.1.3 also apply to low data-volume multicast applications ๐
4.2. Message Size Guidelines for Multicast ๐
a multicast application SHOULD NOT send UDP datagrams that result in IP packets exceeding the effective MTU described in Section 3 of [RFC6807] ๐ โโ๏ธ so an application SHOULD either use the effective MTU information provided by the "Population Count Extensions to Protocol Independent Multicast (PIM)" [RFC6807], or implement path MTU discovery itself (see Section 3.2) to figure out whether the path to each destination will support its desired message size without fragmentation โจ
5. Programming Guidelines ๐
the de facto standard application programming interface (API) for TCP/IP applications is the "sockets" interface [POSIX]. some platforms also let applications directly assemble and transmit IP packets through "raw sockets" or similar facilities. that's a second, more cumbersome way of using UDP ๐ the guidelines in this document cover all such methods an application may use to access UDP. because the sockets API is by far the most common method, the rest of this section digs into it more closely ๐งฆ
the sockets API was developed for UNIX in the early 1980s, but a wide variety of non-UNIX operating systems implement it too ๐ฅ๏ธ the sockets API supports both IPv4 and IPv6 [RFC3493]. the UDP sockets API differs from the TCP one in several key ways. since application programmers are usually more familiar with the TCP sockets API, this section talks through those differences. [STEVENS] has usage examples of the UDP sockets API ๐
UDP datagrams can be sent and received directly, with no connection setup ๐โโ๏ธ using the sockets API, applications can receive packets from more than one IP source address on a single UDP socket. some servers use this to exchange data with more than one remote host through a single UDP socket at the same time. many applications need to make sure they receive packets from a particular source address. these applications MUST implement corresponding checks at the application layer, or explicitly ask the operating system to filter the received packets ๐ก๏ธ
many operating systems also let a UDP socket be connected, i.e., bound to a specific pair of addresses and ports. this is similar to the corresponding TCP sockets API functionality. however, for UDP it's only a local operation that simplifies the local send/receive functions and filters traffic for the specified addresses and ports. binding a UDP socket does NOT establish a connection, since UDP does not notify the remote end when a local UDP socket is bound ๐ binding a socket also lets you configure options that affect the UDP or IP layers, for example, whether to use the UDP checksum or the IP Timestamp option. on some stacks, a bound socket also lets an application be notified when ICMP error messages arrive for its transmissions [RFC1122].
if a client/server application runs on a host with more than one IP interface, the application SHOULD send any UDP responses with an IP source address that matches the IP destination address of the UDP datagram that carried the request (see [RFC1122], Section 4.1.3.5). lots of middleboxes expect this behavior and drop replies sent from a different IP address, as explained in Section 3.5 ๐ซ
a UDP receiver can receive a valid UDP datagram with a zero-length payload ๐ซง note that this is different from a return value of zero from a read() socket call, which for TCP indicates the end of the connection.
UDP provides no flow control, i.e., at any given time the sender doesn't know whether the receiver can handle incoming transmissions ๐ฌ this is another reason UDP-based applications need to be robust in the presence of packet loss. the loss can also happen inside the sending host, when an application sends data faster than the line rate of the outbound network interface. it can also happen at the destination, where receive calls fail to return all the data that was sent when the application issues them too infrequently (i.e., so the receive buffer overflows). robust flow control mechanisms are difficult to implement, which is why applications that need this functionality SHOULD consider using a full-featured transport protocol such as TCP ๐
when an application closes a TCP, SCTP, or DCCP socket, the transport protocol on the receiving host is required to maintain TIME-WAIT state. this stops delayed packets from the closed connection instance being mistakenly associated with a later connection instance that happens to reuse the same IP address and port pairs. the UDP protocol does NOT implement such a mechanism, so UDP-based applications need to be robust to reordering and delay ๐ฐ๏ธ one application may close a socket or terminate, and then another application receiving on the same port may come along in time. that later application may then receive packets that were meant for the first application but got delayed in the network ๐ป
5.1. Using UDP Ports ๐
okay so the rules for the "Service Name and Transport Protocol Port Number Registry" live in [RFC6335] ๐, and [RFC7605] has the recommendations for using UDP ports ๐.
bestie, a UDP sender SHOULD NOT use a source port value of zero ๐ โโ๏ธ. A source port that nobody can easily guess from the address or payload type is a shield for the receiver ๐ก๏ธ against data injection from off-path devices ๐. And a UDP receiver SHOULD NOT bind to port zero ๐ .
Applications SHOULD implement receiver port and address checks at the application layer โจ, or they can explicitly ask the operating system to filter received packets so they don't get packets from some random port ๐งน. This is extra protection against data injection from an off-path source, where the port values might not be known ๐ต๏ธโโ๏ธ.
Applications SHOULD also have a check that guards against off-path data injection ๐ซ, so the app never gets packets made by an unauthorized third party ๐ . TCP stacks commonly use a randomized source port for this ๐ฒ [RFC6056], and UDP apps should copy that technique ๐ (okay, the word here is "should" in the lowercase sense, and I'm keeping it that way). Middleboxes and end systems often make assumptions about system ports or user ports ๐ฐ, so it's recommended to use randomized ports in the Dynamic and/or Private Port range ๐. A "randomized" source port also gives you more confidence that reported ICMP errors come from network systems on the path that a particular flow actually uses ๐งญ. Some UDP apps choose a predetermined source port (including some multicast apps) ๐, and those apps need a different technique to stay safe ๐. Protection from off-path data attacks can also come from randomizing the initial value of another protocol field inside the datagram payload, then checking that field's validity at the receiver ๐. For example, RTP has random initial sequence number and random media timestamp offsets [RFC3550] ๐ต.
When using multicast, IP routers do a reverse-path forwarding (RPF) check on every multicast packet ๐ฃ๏ธ. That gives protection from off-path data injection by making it harder to forge a packet's source address ๐. When a receiver joins a multicast group and filters based on source address, the filter verifies the sender's IP address ๐ฌ. This is always the case with an SSM {S,G} channel ๐.
5.1.1. Usage of UDP for Source Port Entropy and the IPv6 Flow Label ๐
Some apps use the UDP datagram header as a source of entropy for network devices that implement ECMP [RFC6438] ๐ง. A UDP tunnel app with this goal encapsulates an inner packet in UDP, and the UDP source port becomes part of the entropy that ECMP devices use to balance traffic ๐. The sending tunnel endpoint picks a source port value in the UDP header that's computed from the inner flow information, like the encapsulated packet headers ๐ง. To get enough entropy, the sending tunnel endpoint maps the encapsulated traffic onto one of a range of UDP source values ๐บ๏ธ. That value SHOULD be within the ephemeral port range, which is 49152 to 65535, where the high order two bits of the port are set to one โจ. The 14 bits of source port entropy you get from the ephemeral range, plus the outer IP addresses, seem like plenty of entropy for most ECMP apps [ENCAP] ๐ซถ.
To avoid reordering within an IP flow, the same UDP source port value SHOULD be used for all packets in an encapsulated flow (for example, by hashing the relevant headers) ๐. The entropy mapping for a flow MAY change over the lifetime of that flow [ENCAP] ๐ฆ. For instance, it could change as a Denial of Service (DOS) mitigation, or as a way to steer routing through the ECMP network ๐ ๏ธ. But the source port selected for a flow SHOULD NOT change more than once in every thirty seconds (for example, as in [RFC8086]) โณ.
Using the source port field for entropy has a few side effects you need to think about ๐:
- It can increase the probability of misdelivery of corrupted packets ๐ฆ. That means you need checksum computation, or something equivalent, to protect other UDP applications from misdelivery errors Section 3.4. ๐
- It's expected to reduce the probability of successful middlebox traversal Section 3.5. ๐ง This use of the source port field often won't suit applications aimed at the general Internet ๐.
- It can stop the field from protecting against off-path attacks (described in Section 5.1) ๐ฌ. So designers need other mechanisms for equivalent protection, for example by restricting use to a controlled environment [RFC7510] Section 3.6. ๐ฐ
The UDP source port field has also been used to make entropy with IPv6 ๐ง. But with IPv6, the "flow label" [RFC6437] can also be used for load balancing entropy [RFC6438] ๐ธ. Using the flow label this way fits the definition of the field, though it needed more clarity so it could be used consistently for this purpose ๐. So an updated IPv6 flow label [RFC6437] and ECMP routing [RFC6438] usage was specified ๐ .
To keep future options open for the flow label, UDP applications SHOULD set the flow label field, even when an entropy value is also set in the source port field (for example, an IPv6 tunnel endpoint could copy the source port flow entropy value into the IPv6 flow label field [RFC8086]) ๐ท๏ธ. Router vendors are encouraged to start using the IPv6 flow label as part of the flow hash ๐, which gives IP-level ECMP support without needing UDP. End-to-end use of flow labels for load balancing is a long-term solution ๐ฐ๏ธ. Even with the flow label usage clarified, there will be a transition period before a big chunk of endpoints start giving a good quality flow label to the flows they originate ๐ข. Load balancing using transport header fields will likely keep going until widespread deployment is finally achieved ๐.
5.1.2. Applications Using Multiple UDP Ports ๐งฉ
A single app can exchange several types of data ๐. Sometimes that means multiple UDP flows (for example, multiple sets of flows, each identified by a different five-tuple) ๐ญ. [RFC6335] recommends that application developers do not apply to IANA for multiple well-known ports (user or system) ๐ โโ๏ธ. It doesn't cover what happens when you use multiple flows with the same well-known port, or pairs of dynamic ports (for example, identified by a service name or signaling protocol) ๐ค.
Using multiple flows can affect the network in a few ways ๐ธ๏ธ:
- Starting a series of successive connections can increase the number of state bindings in middleboxes (for example, NAPT or Firewall) along the network path ๐. UDP-based middlebox traversal usually relies on timeouts to remove old state, since middleboxes don't know when an app has stopped using a particular flow โฐ.
- Using several flows at the same time may mean each flow sees different network characteristics ๐ฆ๏ธ. You can't assume they all follow the same path (for example, when ECMP is used, traffic is intentionally hashed onto different parallel paths based on the port numbers) ๐ค๏ธ.
- Using several flows can also fill up a binding or lookup table in a middlebox (for example, NAPT or Firewall) ๐งบ, which may make the device change how it manages flow state ๐.
- Excessive numbers of flows can also weaken a unicast congestion control's ability to react to congestion events ๐ต, unless the congestion state is shared across all flows in a session ๐ค. A receiver-driven multicast congestion control requires the sending app to spread its data over a set of IP multicast groups ๐ก, so each receiver is expected to get data from a modest number of simultaneously active UDP ports ๐ท.
So applications MUST NOT assume consistent middlebox behavior when multiple UDP flows are used ๐จ. Many devices respond differently as the number of used ports goes up ๐. If you use multiple flows with different QoS requirements, your app has to verify that the expected performance is achieved on each individual flow (five-tuple), see Section 3.1.9. ๐ฏ
5.2. ICMP Guidelines ๐ฐ๏ธ
Apps can use information about ICMP error messages that the UDP layer passes up for a bunch of purposes [RFC1122] ๐ง . Applications SHOULD appropriately validate the payload of ICMP messages ๐, to make sure they were received in response to traffic that was actually sent (that is, a reported error condition that matches a UDP datagram the application really sent) โ . Doing this needs context, like local state about communication instances to each destination ๐๏ธ. Connection-oriented transport protocols have that context readily available, but UDP-based apps don't always keep it ๐ . Note that not all platforms have the APIs needed for this validation, and some platforms already do this validation internally before passing ICMP information up to the app ๐ซง.
Any app response to ICMP error messages SHOULD be robust to temporary routing failures (sometimes called "soft errors") ๐ค๏ธ. For example, a transient ICMP "unreachable" message ought not normally cause a communication abort ๐.
ICMP messages are increasingly being filtered by middleboxes ๐งฑ. So a UDP application SHOULD NOT rely on their delivery for correct and safe operation ๐ฅบ.
6. Security Considerations ๐
Okay bestie, real talk: UDP does not provide communications security ๐ So if your app needs to protect its chats from eavesdropping, tampering, or message forgery, it SHOULD employ end-to-end security services provided by other IETF protocols ๐
UDP applications SHOULD provide protection from off-path data injection attacks using a randomized source port or equivalent technique (see Section 5.1) ๐ฒ main character defense energy โจ
Apps that answer short requests with potentially huge responses are a prime target for amplification attacks ๐ญ They SHOULD take steps to minimize how easily they can be abused as part of a DoS attack ๐จ That could mean authenticating the sender before responding. And note that the source IP address of a request is not a useful authenticator, because it can easily be spoofed, so don't trust it ๐ โโ๏ธ Or it may mean otherwise limiting the cases where short unauthenticated requests produce large responses. Apps MAY also want to offer ways to limit the number of requests they respond to in a time interval, so they can cap the bandwidth they eat ๐
One option for securing UDP is IPsec [RFC4301] ๐ It can give authentication for flows of IP packets through the Authentication Header (AH) [RFC4302], and encryption and/or authentication through the Encapsulating Security Payload (ESP) [RFC4303]. Apps use the Internet Key Exchange (IKE) [RFC7296] to set up IPsec for their sessions. Depending on how IPsec is configured for a flow, it can authenticate or encrypt the UDP headers as well as the UDP payloads ๐ง If an app only needs authentication, ESP with no encryption but with authentication is often a better option than AH, because ESP can operate across middleboxes. An app that uses IPsec needs an operating system that implements the IPsec protocol suite, and the network path must permit IKE and IPsec traffic. This may become more common with IPv6 deployments [RFC6092] ๐
Although it is possible to use IPsec to secure UDP, not all operating systems support IPsec or let apps easily configure it for their flows, so it's not always the move ๐ฅฒ A second option is Datagram Transport Layer Security (DTLS) [RFC6347][RFC7525] ๐ฆ DTLS gives communication privacy by encrypting UDP payloads. It does not protect the UDP headers though. The best part is that apps can implement DTLS without relying on support from the operating system โจ
There are many other ways to authenticate or encrypt UDP payloads ๐ For example, the GSS-API security framework [RFC2743] or Cryptographic Message Syntax (CMS) [RFC5652] could be used to protect UDP payloads. There are also a bunch of security options for RTP [RFC3550] over UDP, especially for key management, see [RFC7201]. These options cover lots of usages, including point-to-point, centralized group communication, and multicast ๐ In some apps, a better solution is to protect larger stand-alone objects, such as files or messages, instead of individual UDP payloads. In those situations, CMS [RFC5652], S/MIME [RFC5751] or OpenPGP [RFC4880] could be used. And yes, there are plenty of non-IETF protocols in this area too ๐ซถ
Like congestion control mechanisms, security mechanisms are hard to design and implement correctly ๐ตโ๐ซ So it is hence RECOMMENDED that apps use well-known standard security mechanisms such as DTLS or IPsec, rather than inventing their own. Don't be that girlie who rolls her own crypto ๐
The Generalized TTL Security Mechanism (GTSM) [RFC5082] may be used with UDP apps when the intended endpoint is on the same link as the sender. This lightweight mechanism lets a receiver filter out unwanted packets ๐งน
Congestion-wise, [RFC2309] and [RFC2914] talk about the dangers of congestion-unresponsive flows to the Internet ๐ช๏ธ [RFC8084] describes methods that can set a performance envelope, which can help prevent congestion collapse when there's no congestion control or when the congestion control fails to react to congestion events. This document gives designers of UDP-based apps guidance on congestion-controlling their transmissions, and it does not raise any additional security concerns ๐
Some network operators have seen surges of UDP attack traffic that are multiple orders of magnitude above the baseline UDP traffic rate ๐ฑ That can push operators to limit the data rate or packet rate of UDP traffic. This may in turn limit the throughput an app can get using UDP, and could also cause higher packet loss for UDP traffic that wouldn't happen if other transport protocols were used. So be aware, it's a whole thing ๐ซ
A UDP app with a long-lived association between the sender and receiver ought to be designed so that the sender periodically checks that the receiver still wants ("consents") to receive traffic, and it needs to be designed to stop if there is no explicit confirmation of this [RFC7675]. Apps that need communication in both directions to run protocol functions (such as reliability or congestion control) will need to independently check both directions of communication, and may have to exchange keep-alive messages to traverse middleboxes (see Section 3.5). Consent is iconic, check it ๐
7. Summary ๐
This section sums up the key guidelines from Sections 3 - 6 in a table (Table 1) so you can reference them easily ๐ Here's the whole vibe check:
+---------------------------------------------------------+---------+
| Recommendation | Section |
+---------------------------------------------------------+---------+
| MUST tolerate a wide range of Internet path conditions | 3 |
| SHOULD use a full-featured transport (e.g., TCP) | |
| | |
| SHOULD control rate of transmission | 3.1 |
| SHOULD perform congestion control over all traffic | |
| | |
| for bulk transfers, | 3.1.2 |
| SHOULD consider implementing TFRC | |
| else, SHOULD in other ways use bandwidth similar to TCP | |
| | |
| for non-bulk transfers, | 3.1.3 |
| SHOULD measure RTT and transmit max. 1 datagram/RTT | 3.1.1 |
| else, SHOULD send at most 1 datagram every 3 seconds | |
| SHOULD back-off retransmission timers following loss | |
| | |
| SHOULD provide mechanisms to regulate the bursts of | 3.1.6 |
| transmission | |
| | |
| MAY implement ECN; a specific set of application | 3.1.7 |
| mechanisms are REQUIRED if ECN is used. | |
| | |
| for DiffServ, SHOULD NOT rely on implementation of PHBs | 3.1.8 |
| | |
| for QoS-enabled paths, MAY choose not to use CC | 3.1.9 |
| | |
| SHOULD NOT rely solely on QoS for their capacity | 3.1.10 |
| non-CC controlled flows SHOULD implement a transport | |
| circuit breaker | |
| MAY implement a circuit breaker for other applications | |
| | |
| for tunnels carrying IP traffic, | 3.1.11 |
| SHOULD NOT perform congestion control | |
| MUST correctly process the IP ECN field | |
| | |
| for non-IP tunnels or rate not determined by traffic, | |
| SHOULD perform CC or use circuit breaker | 3.1.11 |
| SHOULD restrict types of traffic transported by the | |
| tunnel | |
| | |
| SHOULD NOT send datagrams that exceed the PMTU, i.e., | 3.2 |
| SHOULD discover PMTU or send datagrams < minimum PMTU; | |
| Specific application mechanisms are REQUIRED if PLPMTUD | |
| is used. | |
| | |
| SHOULD handle datagram loss, duplication, reordering | 3.3 |
| SHOULD be robust to delivery delays up to 2 minutes | |
| | |
| SHOULD enable IPv4 UDP checksum | 3.4 |
| SHOULD enable IPv6 UDP checksum; Specific application | 3.4.1 |
| mechanisms are REQUIRED if a zero IPv6 UDP checksum is | |
| used. | |
| | |
| SHOULD provide protection from off-path attacks | 5.1 |
| else, MAY use UDP-Lite with suitable checksum coverage | 3.4.2 |
| | |
| SHOULD NOT always send middlebox keep-alive messages | 3.5 |
| MAY use keep-alives when needed (min. interval 15 sec) | |
| | |
| Applications specified for use in limited use (or | 3.6 |
| controlled environments) SHOULD identify equivalent | |
| mechanisms and describe their use case. | |
| | |
| Bulk-multicast apps SHOULD implement congestion control | 4.1.1 |
| | |
| Low volume multicast apps SHOULD implement congestion | 4.1.2 |
| control | |
| | |
| Multicast apps SHOULD use a safe PMTU | 4.2 |
| | |
| SHOULD avoid using multiple ports | 5.1.2 |
| MUST check received IP source address | |
| | |
| SHOULD validate payload in ICMP messages | 5.2 |
| | |
| SHOULD use a randomized source port or equivalent | 6 |
| technique, and, for client/server applications, SHOULD | |
| send responses from source address matching request | |
| 5.1 | |
| SHOULD use standard IETF security protocols when needed | 6 |
+---------------------------------------------------------+---------+
Table 1: Summary of Recommendations ๐ธ
8. References ๐
The reference entries aren't included in this part of the text, so I'm leaving that list for whenever it shows up ๐
8.1. Normative References ๐
okay bestie, these are the normative refs, the stuff you literally NEED to read before you can say you get this doc ๐โจ
[RFC768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, DOI 10.17487/RFC0768, August 1980, <http://www.rfc-editor.org/info/rfc768>.
[RFC793] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, DOI 10.17487/RFC0793, September 1981, <http://www.rfc-editor.org/info/rfc793>.
[RFC1122] Braden, R., Ed., "Requirements for Internet Hosts - Communication Layers", STD 3, RFC 1122, DOI 10.17487/RFC1122, October 1989, <http://www.rfc-editor.org/info/rfc1122>.
[RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, DOI 10.17487/RFC1191, November 1990, <http://www.rfc-editor.org/info/rfc1191>.
[RFC1981] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery for IP version 6", RFC 1981, DOI 10.17487/RFC1981, August 1996, <http://www.rfc-editor.org/info/rfc1981>.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <http://www.rfc-editor.org/info/rfc2119>.
[RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, DOI 10.17487/RFC2460, December 1998, <http://www.rfc-editor.org/info/rfc2460>.
[RFC2914] Floyd, S., "Congestion Control Principles", BCP 41, RFC 2914, DOI 10.17487/RFC2914, September 2000, <http://www.rfc-editor.org/info/rfc2914>.
[RFC3828] Larzon, L-A., Degermark, M., Pink, S., Jonsson, L-E., Ed., and G. Fairhurst, Ed., "The Lightweight User Datagram Protocol (UDP-Lite)", RFC 3828, DOI 10.17487/RFC3828, July 2004, <http://www.rfc-editor.org/info/rfc3828>.
[RFC4787] Audet, F., Ed. and C. Jennings, "Network Address Translation (NAT) Behavioral Requirements for Unicast UDP", BCP 127, RFC 4787, DOI 10.17487/RFC4787, January 2007, <http://www.rfc-editor.org/info/rfc4787>.
[RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU Discovery", RFC 4821, DOI 10.17487/RFC4821, March 2007, <http://www.rfc-editor.org/info/rfc4821>.
[RFC5348] Floyd, S., Handley, M., Padhye, J., and J. Widmer, "TCP Friendly Rate Control (TFRC): Protocol Specification", RFC 5348, DOI 10.17487/RFC5348, September 2008, <http://www.rfc-editor.org/info/rfc5348>.
[RFC5405] Eggert, L. and G. Fairhurst, "Unicast UDP Usage Guidelines for Application Designers", BCP 145, RFC 5405, DOI 10.17487/RFC5405, November 2008, <http://www.rfc-editor.org/info/rfc5405>.
[RFC6040] Briscoe, B., "Tunnelling of Explicit Congestion Notification", RFC 6040, DOI 10.17487/RFC6040, November 2010, <http://www.rfc-editor.org/info/rfc6040>.
[RFC6298] Paxson, V., Allman, M., Chu, J., and M. Sargent, "Computing TCP's Retransmission Timer", RFC 6298, DOI 10.17487/RFC6298, June 2011, <http://www.rfc-editor.org/info/rfc6298>.
[RFC8084] Fairhurst, G., "Network Transport Circuit Breakers", BCP 208, RFC 8084, DOI 10.17487/RFC8084, March 2017, <http://www.rfc-editor.org/info/rfc8084>.
8.2. Informative References ๐ฆ
these ones are the extra reading ๐ธ super helpful for going deeper, but not required to get the core ideas ๐ซถ
[ALLMAN] Allman, M. and E. Blanton, "Notes on burst mitigation for transport protocols", March 2005.
[BEHAVE-APP] Ford, B., "Application Design Guidelines for Traversal through Network Address Translators", Work in Progress, draft-ford-behave-app-05, March 2007.
[ENCAP] Nordmark, E., Ed., Tian, A., Gross, J., Hudson, J., Kreeger, L., Garg, P., Thaler, P., and T. Herbert, "Encapsulation Considerations", Work in Progress, draft-ietf-rtgwg-dt-encap-02, October 2016.
[FABER] Faber, T., Touch, J., and W. Yue, "The TIME-WAIT State in TCP and Its Effect on Busy Servers", Proc. IEEE Infocom, March 1999.
[INT-TUNNELS] Touch, J. and W. Townsley, "IP Tunnels in the Internet Architecture", Work in Progress, draft-ietf-intarea-tunnels-03, July 2016.
[POSIX] IEEE Std. 1003.1-2001, , "Standard for Information Technology - Portable Operating System Interface (POSIX)", Open Group Technical Standard: Base Specifications Issue 6, ISO/IEC 9945:2002, December 2001.
[RFC919] Mogul, J., "Broadcasting Internet Datagrams", STD 5, RFC 919, DOI 10.17487/RFC0919, October 1984, <http://www.rfc-editor.org/info/rfc919>.
[RFC1112] Deering, S., "Host extensions for IP multicasting", STD 5, RFC 1112, DOI 10.17487/RFC1112, August 1989, <http://www.rfc-editor.org/info/rfc1112>.
[RFC1536] Kumar, A., Postel, J., Neuman, C., Danzig, P., and S. Miller, "Common DNS Implementation Errors and Suggested Fixes", RFC 1536, DOI 10.17487/RFC1536, October 1993, <http://www.rfc-editor.org/info/rfc1536>.
[RFC1546] Partridge, C., Mendez, T., and W. Milliken, "Host Anycasting Service", RFC 1546, DOI 10.17487/RFC1546, November 1993, <http://www.rfc-editor.org/info/rfc1546>.
[RFC2309] Braden, B., Clark, D., Crowcroft, J., Davie, B., Deering, S., Estrin, D., Floyd, S., Jacobson, V., Minshall, G., Partridge, C., Peterson, L., Ramakrishnan, K., Shenker, S., Wroclawski, J., and L. Zhang, "Recommendations on Queue Management and Congestion Avoidance in the Internet", RFC 2309, DOI 10.17487/RFC2309, April 1998, <http://www.rfc-editor.org/info/rfc2309>.
[RFC2475] Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., and W. Weiss, "An Architecture for Differentiated Services", RFC 2475, DOI 10.17487/RFC2475, December 1998, <http://www.rfc-editor.org/info/rfc2475>.
[RFC2675] Borman, D., Deering, S., and R. Hinden, "IPv6 Jumbograms", RFC 2675, DOI 10.17487/RFC2675, August 1999, <http://www.rfc-editor.org/info/rfc2675>.
[RFC2743] Linn, J., "Generic Security Service Application Program Interface Version 2, Update 1", RFC 2743, DOI 10.17487/RFC2743, January 2000, <http://www.rfc-editor.org/info/rfc2743>.
[RFC2887] Handley, M., Floyd, S., Whetten, B., Kermode, R., Vicisano, L., and M. Luby, "The Reliable Multicast Design Space for Bulk Data Transfer", RFC 2887, DOI 10.17487/RFC2887, August 2000, <http://www.rfc-editor.org/info/rfc2887>.
[RFC2983] Black, D., "Differentiated Services and Tunnels", RFC 2983, DOI 10.17487/RFC2983, October 2000, <http://www.rfc-editor.org/info/rfc2983>.
[RFC3048] Whetten, B., Vicisano, L., Kermode, R., Handley, M., Floyd, S., and M. Luby, "Reliable Multicast Transport Building Blocks for One-to-Many Bulk-Data Transfer", RFC 3048, DOI 10.17487/RFC3048, January 2001, <http://www.rfc-editor.org/info/rfc3048>.
[RFC3124] Balakrishnan, H. and S. Seshan, "The Congestion Manager", RFC 3124, DOI 10.17487/RFC3124, June 2001, <http://www.rfc-editor.org/info/rfc3124>.
[RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition of Explicit Congestion Notification (ECN) to IP", RFC 3168, DOI 10.17487/RFC3168, September 2001, <http://www.rfc-editor.org/info/rfc3168>.
[RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M., and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, DOI 10.17487/RFC3261, June 2002, <http://www.rfc-editor.org/info/rfc3261>.
[RFC3303] Srisuresh, P., Kuthan, J., Rosenberg, J., Molitor, A., and A. Rayhan, "Middlebox communication architecture and framework", RFC 3303, DOI 10.17487/RFC3303, August 2002, <http://www.rfc-editor.org/info/rfc3303>.
[RFC3493] Gilligan, R., Thomson, S., Bound, J., McCann, J., and W. Stevens, "Basic Socket Interface Extensions for IPv6", RFC 3493, DOI 10.17487/RFC3493, February 2003, <http://www.rfc-editor.org/info/rfc3493>.
[RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. Jacobson, "RTP: A Transport Protocol for Real-Time Applications", STD 64, RFC 3550, DOI 10.17487/RFC3550, July 2003, <http://www.rfc-editor.org/info/rfc3550>.
[RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and Video Conferences with Minimal Control", STD 65, RFC 3551, DOI 10.17487/RFC3551, July 2003, <http://www.rfc-editor.org/info/rfc3551>.
[RFC3738] Luby, M. and V. Goyal, "Wave and Equation Based Rate Control (WEBRC) Building Block", RFC 3738, DOI 10.17487/RFC3738, April 2004, <http://www.rfc-editor.org/info/rfc3738>.
[RFC3758] Stewart, R., Ramalho, M., Xie, Q., Tuexen, M., and P. Conrad, "Stream Control Transmission Protocol (SCTP) Partial Reliability Extension", RFC 3758, DOI 10.17487/RFC3758, May 2004, <http://www.rfc-editor.org/info/rfc3758>.
[RFC3819] Karn, P., Ed., Bormann, C., Fairhurst, G., Grossman, D., Ludwig, R., Mahdavi, J., Montenegro, G., Touch, J., and L. Wood, "Advice for Internet Subnetwork Designers", BCP 89, RFC 3819, DOI 10.17487/RFC3819, July 2004, <http://www.rfc-editor.org/info/rfc3819>.
[RFC4301] Kent, S. and K. Seo, "Security Architecture for the Internet Protocol", RFC 4301, DOI 10.17487/RFC4301, December 2005, <http://www.rfc-editor.org/info/rfc4301>.
[RFC4302] Kent, S., "IP Authentication Header", RFC 4302, DOI 10.17487/RFC4302, December 2005, <http://www.rfc-editor.org/info/rfc4302>.
[RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", RFC 4303, DOI 10.17487/RFC4303, December 2005, <http://www.rfc-editor.org/info/rfc4303>.
[RFC4340] Kohler, E., Handley, M., and S. Floyd, "Datagram Congestion Control Protocol (DCCP)", RFC 4340, DOI 10.17487/RFC4340, March 2006, <http://www.rfc-editor.org/info/rfc4340>.
[RFC4341] Floyd, S. and E. Kohler, "Profile for Datagram Congestion Control Protocol (DCCP) Congestion Control ID 2: TCP-like Congestion Control", RFC 4341, DOI 10.17487/RFC4341, March 2006, <http://www.rfc-editor.org/info/rfc4341>.
[RFC4342] Floyd, S., Kohler, E., and J. Padhye, "Profile for Datagram Congestion Control Protocol (DCCP) Congestion Control ID 3: TCP-Friendly Rate Control (TFRC)", RFC 4342, DOI 10.17487/RFC4342, March 2006, <http://www.rfc-editor.org/info/rfc4342>.
[RFC4380] Huitema, C., "Teredo: Tunneling IPv6 over UDP through Network Address Translations (NATs)", RFC 4380, DOI 10.17487/RFC4380, February 2006, <http://www.rfc-editor.org/info/rfc4380>.
[RFC4607] Holbrook, H. and B. Cain, "Source-Specific Multicast for IP", RFC 4607, DOI 10.17487/RFC4607, August 2006, <http://www.rfc-editor.org/info/rfc4607>.
okay bestie, here are the receipts ๐๐ these are the Informative References I'm leaning on, all still exactly as they are.
[RFC4654] Widmer, J. and M. Handley, "TCP-Friendly Multicast Congestion Control (TFMCC): Protocol Specification", RFC 4654, DOI 10.17487/RFC4654, August 2006, http://www.rfc-editor.org/info/rfc4654. ๐ธ
[RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. Thayer, "OpenPGP Message Format", RFC 4880, DOI 10.17487/RFC4880, November 2007, http://www.rfc-editor.org/info/rfc4880. ๐
[RFC4890] Davies, E. and J. Mohacsi, "Recommendations for Filtering ICMPv6 Messages in Firewalls", RFC 4890, DOI 10.17487/RFC4890, May 2007, http://www.rfc-editor.org/info/rfc4890. ๐งฑ
[RFC4960] Stewart, R., Ed., "Stream Control Transmission Protocol", RFC 4960, DOI 10.17487/RFC4960, September 2007, http://www.rfc-editor.org/info/rfc4960. ๐ฆ
[RFC4963] Heffner, J., Mathis, M., and B. Chandler, "IPv4 Reassembly Errors at High Data Rates", RFC 4963, DOI 10.17487/RFC4963, July 2007, http://www.rfc-editor.org/info/rfc4963. ๐
[RFC4987] Eddy, W., "TCP SYN Flooding Attacks and Common Mitigations", RFC 4987, DOI 10.17487/RFC4987, August 2007, http://www.rfc-editor.org/info/rfc4987. ๐
[RFC5082] Gill, V., Heasley, J., Meyer, D., Savola, P., Ed., and C. Pignataro, "The Generalized TTL Security Mechanism (GTSM)", RFC 5082, DOI 10.17487/RFC5082, October 2007, http://www.rfc-editor.org/info/rfc5082. โฑ๏ธ
[RFC5245] Rosenberg, J., "Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols", RFC 5245, DOI 10.17487/RFC5245, April 2010, http://www.rfc-editor.org/info/rfc5245. ๐ง
[RFC5622] Floyd, S. and E. Kohler, "Profile for Datagram Congestion Control Protocol (DCCP) Congestion ID 4: TCP-Friendly Rate Control for Small Packets (TFRC-SP)", RFC 5622, DOI 10.17487/RFC5622, August 2009, http://www.rfc-editor.org/info/rfc5622. ๐
[RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, RFC 5652, DOI 10.17487/RFC5652, September 2009, http://www.rfc-editor.org/info/rfc5652. ๐๏ธ
[RFC5681] Allman, M., Paxson, V., and E. Blanton, "TCP Congestion Control", RFC 5681, DOI 10.17487/RFC5681, September 2009, http://www.rfc-editor.org/info/rfc5681. ๐ฆ
[RFC5740] Adamson, B., Bormann, C., Handley, M., and J. Macker, "NACK-Oriented Reliable Multicast (NORM) Transport Protocol", RFC 5740, DOI 10.17487/RFC5740, November 2009, http://www.rfc-editor.org/info/rfc5740. ๐ก
[RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 3.2 Message Specification", RFC 5751, DOI 10.17487/RFC5751, January 2010, http://www.rfc-editor.org/info/rfc5751. โ๏ธ
[RFC5775] Luby, M., Watson, M., and L. Vicisano, "Asynchronous Layered Coding (ALC) Protocol Instantiation", RFC 5775, DOI 10.17487/RFC5775, April 2010, http://www.rfc-editor.org/info/rfc5775. ๐ถ
[RFC5971] Schulzrinne, H. and R. Hancock, "GIST: General Internet Signalling Transport", RFC 5971, DOI 10.17487/RFC5971, October 2010, http://www.rfc-editor.org/info/rfc5971. ๐ถ
[RFC5973] Stiemerling, M., Tschofenig, H., Aoun, C., and E. Davies, "NAT/Firewall NSIS Signaling Layer Protocol (NSLP)", RFC 5973, DOI 10.17487/RFC5973, October 2010, http://www.rfc-editor.org/info/rfc5973. ๐ก๏ธ
[RFC6056] Larsen, M. and F. Gont, "Recommendations for Transport-Protocol Port Randomization", BCP 156, RFC 6056, DOI 10.17487/RFC6056, January 2011, http://www.rfc-editor.org/info/rfc6056. ๐ฒ
[RFC6092] Woodyatt, J., Ed., "Recommended Simple Security Capabilities in Customer Premises Equipment (CPE) for Providing Residential IPv6 Internet Service", RFC 6092, DOI 10.17487/RFC6092, January 2011, http://www.rfc-editor.org/info/rfc6092. ๐
[RFC6335] Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S. Cheshire, "Internet Assigned Numbers Authority (IANA) Procedures for the Management of the Service Name and Transport Protocol Port Number Registry", BCP 165, RFC 6335, DOI 10.17487/RFC6335, August 2011, http://www.rfc-editor.org/info/rfc6335. ๐ข
[RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, January 2012, http://www.rfc-editor.org/info/rfc6347. ๐
[RFC6396] Blunk, L., Karir, M., and C. Labovitz, "Multi-Threaded Routing Toolkit (MRT) Routing Information Export Format", RFC 6396, DOI 10.17487/RFC6396, October 2011, http://www.rfc-editor.org/info/rfc6396. ๐บ๏ธ
[RFC6437] Amante, S., Carpenter, B., Jiang, S., and J. Rajahalme, "IPv6 Flow Label Specification", RFC 6437, DOI 10.17487/RFC6437, November 2011, http://www.rfc-editor.org/info/rfc6437. ๐ท๏ธ
[RFC6438] Carpenter, B. and S. Amante, "Using the IPv6 Flow Label for Equal Cost Multipath Routing and Link Aggregation in Tunnels", RFC 6438, DOI 10.17487/RFC6438, November 2011, http://www.rfc-editor.org/info/rfc6438. โ๏ธ
[RFC6513] Rosen, E., Ed. and R. Aggarwal, Ed., "Multicast in MPLS/BGP IP VPNs", RFC 6513, DOI 10.17487/RFC6513, February 2012, http://www.rfc-editor.org/info/rfc6513. ๐
[RFC6679] Westerlund, M., Johansson, I., Perkins, C., O'Hanlon, P., and K. Carlberg, "Explicit Congestion Notification (ECN) for RTP over UDP", RFC 6679, DOI 10.17487/RFC6679, August 2012, http://www.rfc-editor.org/info/rfc6679. ๐จ
[RFC6726] Paila, T., Walsh, R., Luby, M., Roca, V., and R. Lehtonen, "FLUTE - File Delivery over Unidirectional Transport", RFC 6726, DOI 10.17487/RFC6726, November 2012, http://www.rfc-editor.org/info/rfc6726. ๐ฆ
[RFC6773] Phelan, T., Fairhurst, G., and C. Perkins, "DCCP-UDP: A Datagram Congestion Control Protocol UDP Encapsulation for NAT Traversal", RFC 6773, DOI 10.17487/RFC6773, November 2012, http://www.rfc-editor.org/info/rfc6773. ๐
[RFC6807] Farinacci, D., Shepherd, G., Venaas, S., and Y. Cai, "Population Count Extensions to Protocol Independent Multicast (PIM)", RFC 6807, DOI 10.17487/RFC6807, December 2012, http://www.rfc-editor.org/info/rfc6807. ๐ข
[RFC6887] Wing, D., Ed., Cheshire, S., Boucadair, M., Penno, R., and P. Selkirk, "Port Control Protocol (PCP)", RFC 6887, DOI 10.17487/RFC6887, April 2013, http://www.rfc-editor.org/info/rfc6887. ๐๏ธ
[RFC6935] Eubanks, M., Chimento, P., and M. Westerlund, "IPv6 and UDP Checksums for Tunneled Packets", RFC 6935, DOI 10.17487/RFC6935, April 2013, http://www.rfc-editor.org/info/rfc6935. โ
[RFC6936] Fairhurst, G. and M. Westerlund, "Applicability Statement for the Use of IPv6 UDP Datagrams with Zero Checksums", RFC 6936, DOI 10.17487/RFC6936, April 2013, http://www.rfc-editor.org/info/rfc6936. 0๏ธโฃ
[RFC6951] Tuexen, M. and R. Stewart, "UDP Encapsulation of Stream Control Transmission Protocol (SCTP) Packets for End-Host to End-Host Communication", RFC 6951, DOI 10.17487/RFC6951, May 2013, http://www.rfc-editor.org/info/rfc6951. ๐ฆ
[RFC7143] Chadalapaka, M., Satran, J., Meth, K., and D. Black, "Internet Small Computer System Interface (iSCSI) Protocol (Consolidated)", RFC 7143, DOI 10.17487/RFC7143, April 2014, http://www.rfc-editor.org/info/rfc7143. ๐พ
[RFC7201] Westerlund, M. and C. Perkins, "Options for Securing RTP Sessions", RFC 7201, DOI 10.17487/RFC7201, April 2014, http://www.rfc-editor.org/info/rfc7201. ๐
[RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. Kivinen, "Internet Key Exchange Protocol Version 2 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 2014, http://www.rfc-editor.org/info/rfc7296. ๐ค
[RFC7450] Bumgardner, G., "Automatic Multicast Tunneling", RFC 7450, DOI 10.17487/RFC7450, February 2015, http://www.rfc-editor.org/info/rfc7450. ๐
[RFC7510] Xu, X., Sheth, N., Yong, L., Callon, R., and D. Black, "Encapsulating MPLS in UDP", RFC 7510, DOI 10.17487/RFC7510, April 2015, http://www.rfc-editor.org/info/rfc7510. ๐
[RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, "Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 2015, http://www.rfc-editor.org/info/rfc7525. ๐ก๏ธ
[RFC7560] Kuehlewind, M., Ed., Scheffenegger, R., and B. Briscoe, "Problem Statement and Requirements for Increased Accuracy in Explicit Congestion Notification (ECN) Feedback", RFC 7560, DOI 10.17487/RFC7560, August 2015, http://www.rfc-editor.org/info/rfc7560. ๐
[RFC7567] Baker, F., Ed. and G. Fairhurst, Ed., "IETF Recommendations Regarding Active Queue Management", BCP 197, RFC 7567, DOI 10.17487/RFC7567, July 2015, http://www.rfc-editor.org/info/rfc7567. ๐ฐ
[RFC7605] Touch, J., "Recommendations on Using Assigned Transport Port Numbers", BCP 165, RFC 7605, DOI 10.17487/RFC7605, August 2015, http://www.rfc-editor.org/info/rfc7605. ๐
[RFC7657] Black, D., Ed. and P. Jones, "Differentiated Services (Diffserv) and Real-Time Communication", RFC 7657, DOI 10.17487/RFC7657, November 2015, http://www.rfc-editor.org/info/rfc7657. ๐๏ธ
[RFC7675] Perumal, M., Wing, D., Ravindranath, R., Reddy, T., and M. Thomson, "Session Traversal Utilities for NAT (STUN) Usage for Consent Freshness", RFC 7675, DOI 10.17487/RFC7675, October 2015, http://www.rfc-editor.org/info/rfc7675. ๐
[RFC8083] Perkins, C. and V. Singh, "Multimedia Congestion Control: Circuit Breakers for Unicast RTP Sessions", RFC 8083, DOI 10.17487/RFC8083, March 2017, http://www.rfc-editor.org/info/rfc8083. โก
[RFC8086] Yong, L., Ed., Crabbe, E., Xu, X., and T. Herbert, "GRE-in-UDP Encapsulation", RFC 8086, DOI 10.17487/RFC8086, March 2017, http://www.rfc-editor.org/info/rfc8086. ๐ซง
[RFC8087] Fairhurst, G. and M. Welzl, "The Benefits of Using Explicit Congestion Notification (ECN)", RFC 8087, DOI 10.17487/RFC8087, March 2017, http://www.rfc-editor.org/info/rfc8087. ๐
[STEVENS] Stevens, W., Fenner, B., and A. Rudoff, "UNIX Network Programming, The sockets Networking API", Addison-Wesley, 2004. ๐
[UPnP] UPnP Forum, , "Internet Gateway Device (IGD) Standardized Device Control Protocol V 1.0", November 2001. ๐
Appendix A. Case Study of the Use of IPv6 UDP Zero-Checksum Mode โจ
okay bestie, this appendix is a case study ๐ It looks at MPLS-in-UDP as an example of a UDP Tunnel Encapsulation that defines a UDP encapsulation ๐ฆ The whole point is to show a real example of which mechanisms were needed to safely use UDP zero-checksum mode for MPLS-in-UDP tunnels over IPv6 ๐ By default, UDP needs a checksum when it's used with IPv6 ๐ซถ There's an option that allows a zero IPv6 UDP checksum in specific environments, described in [RFC7510], and it comes with a set of operational constraints for using that mode ๐ธ Here's the short version:
A UDP tunnel or encapsulation using a zero-checksum mode with IPv6 must only be deployed within a single network (with a single network operator), or within networks of an adjacent set of cooperating network operators where traffic is managed to avoid congestion ๐ It is NOT meant for the Internet, where congestion control is required ๐ญ MPLS-in-UDP was specified for networks under single administrative control, like inside one operator's network ๐ง That's where it's known (maybe from knowing the equipment types and doing lower-layer checks) that packet corruption is exceptionally unlikely, and where the operator is willing to take the risk of undetected packet corruption ๐
The tunnel encapsulator SHOULD use different IPv6 addresses for each UDP tunnel that uses the UDP zero-checksum mode, no matter which decapsulator it goes to ๐ This helps strengthen the decapsulator's check of the IPv6 source address, because the same IPv6 source address SHOULD NOT be used with more than one IPv6 destination address ๐ That's true whether the destination is unicast or multicast ๐ MPLS-in-UDP can also be extended to networks within a set of closely cooperating network administrations, like operators who've agreed to team up and jointly provide specific services [RFC7510] ๐ซถ
Now the protection story, which is honestly iconic ๐ฅ MPLS-in-UDP endpoints have to check the source IPv6 address as well as the destination IPv6 address, and there's a strong recommendation against reusing source IPv6 addresses among MPLS-in-UDP tunnels ๐ Together, these give some mitigation for the fact that the UDP checksum doesn't cover the IPv6 header ๐ฆ On top of that, the MPLS data plane only forwards packets with valid labels (labels that were distributed by the tunnel egress Label Switched Router, LSR) โจ So if a misdelivered packet contains a label that isn't valid for forwarding at the receiving LSR, that's an extra chance to catch the misdelivery ๐ธ The expected result for IPv6 UDP zero-checksum mode with MPLS-in-UDP is that corruption of the destination IPv6 address will usually cause the packet to be discarded ๐ญ Offsetting corruptions to the source IPv6 address and/or the MPLS top label are unlikely, so that's the reason ๐
There's extra assurance too, because the exceptions above limit this mode to well-managed networks where MPLS packet corruption hasn't really been a problem in practice ๐ So MPLS-in-UDP is suitable for transmission over lower layers in well-managed networks that fit those exceptions, and the rate of corruption of the inner IP packet on those networks isn't expected to go up compared to MPLS traffic that isn't encapsulated in UDP ๐ง For these reasons, MPLS-in-UDP does not provide an additional integrity check when UDP zero-checksum mode is used with IPv6 ๐ This design follows requirements 2, 3, and 5 specified in Section 5 of [RFC6936] ๐
Here's the spicy bit ๐ถ๏ธ The MPLS-in-UDP encapsulation has no mechanism to safely fall back to using a checksum when a path change redirects a tunnel over a path that includes a middlebox which discards IPv6 datagrams with a zero UDP checksum ๐ If that happens, the MPLS-in-UDP tunnel gets black-holed by that middlebox ๐ญ The recommended changes that let firewalls, NATs and other middleboxes support an IPv6 zero UDP checksum are described in Section 5 of [RFC6936] ๐ซถ Also, MPLS doesn't accumulate incorrect state because of label-stack corruption ๐ฆ A corrupt MPLS label either gets the packet discarded, or the packet gets forwarded (and forgotten) without any MPLS protocol state building up ๐ธ Active monitoring of MPLS-in-UDP traffic for errors is REQUIRED ๐ฅ Errors do lead to some error information accumulating outside the MPLS protocol, for operational and management purposes, so this matters ๐ This design follows requirement 4 specified in Section 5 of [RFC6936] โจ IPv6 traffic with a zero UDP checksum MUST be actively monitored for errors by the network operator ๐
Operators SHOULD also deploy packet filters, so IPv6 packets with a zero UDP checksum can't escape from the network because of misconfiguration or packet errors ๐ And one more time for the back row: IPv6 traffic with a zero UDP checksum MUST be actively monitored for errors by the network operator ๐
Acknowledgments ๐ซถ
The middlebox traversal guidelines in Section 3.5 pull ideas from Section 5 of [BEHAVE-APP] by Bryan Ford, Pyda Srisuresh, and Dan Kegel ๐ The protocol timer guidelines in Section 3.1.1 were mostly contributed by Mark Allman ๐ธ
G. Fairhurst received funding from the European Union's Horizon 2020 research and innovation program 2014-2018 under grant agreement No. 644334 (NEAT) ๐ช๐บ Lars Eggert has received funding from the European Union's Horizon 2020 research and innovation program 2014-2018 under grant agreement No. 644866 (SSICLOPS) โจ This document reflects only the authors' views, and the European Commission is not responsible for any use that may be made of the information it contains ๐
Authors' Addresses ๐
Lars Eggert
NetApp
Sonnenallee 1
Kirchheim 85551
Germany
Phone: +49 151 120 55791
Email: lars@netapp.com
URI: https://eggert.org/
Godred Fairhurst
University of Aberdeen
Department of Engineering
Fraser Noble Building
Aberdeen AB24 3UE
Scotland
Email: gorry@erg.abdn.ac.uk
URI: http://www.erg.abdn.ac.uk/
Greg Shepherd
Cisco Systems
Tasman Drive
San Jose
United States of America
Email: gjshep@gmail.com
๐ฆ where this page comes from
- ietf: rfc8085 2017-03
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms