RFC 7604
Comparison of Different NAT Traversal Techniques for Media Controlled by the Real-Time Streaming Protocol (RTSP)
RFC 7604: Comparison of Different NAT Traversal Techniques for Media Controlled by the Real-Time Streaming Protocol (RTSP) π
Okay bestie, here's the title block. It's an Informational doc from the IETF, published in September 2015 β¨
- RFC number: 7604
- Authors: M. Westerlund (Ericsson) and T. Zeng (PacketVideo Corp) π§
- Category: Informational
- ISSN: 2070-1721
- Date: September 2015
- Obsoletes / Updates: the title block doesn't list anything this one obsoletes or updates πΈ
Abstract π
Okay so this doc compares a bunch of NAT traversal techniques (ways to get past a Network Address Translator) that people considered for setting up the RTP media flows controlled by the Real-Time Streaming Protocol (RTSP). Each technique comes with how you'd use it, its security implications, and any other deployment considerations it has π
It also talks about how NAT traversal connects to firewalls, and how each technique fits different use cases. These findings were used when picking the NAT traversal for RTSP 2.0, which is specified in a separate document π¦
Status of This Memo π
This document is not an Internet Standards Track specification. It's published for informational purposes β¨
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community, and it got public review and was approved for publication by the Internet Engineering Steering Group (IESG). Not every document the IESG approves is a candidate for any level of Internet Standard, so check Section 2 of RFC 5741 if you want the details π
If you want the current status, any errata, or a way to send feedback on it, go to http://www.rfc-editor.org/info/rfc7604 π
Copyright Notice βοΈ
Copyright (c) 2015 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they're in effect on the date of publication. Please read these carefully, because they describe your rights and restrictions for this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty as described in the Simplified BSD License π
Table of Contents πΊοΈ
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1. Network Address Translators . . . . . . . . . . . . . . . 5
1.2. Firewalls . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3. Glossary . . . . . . . . . . . . . . . . . . . . . . . . 7
2. Detecting the Loss of NAT Mappings . . . . . . . . . . . . . 8
3. Requirements on Solutions . . . . . . . . . . . . . . . . . . 9
4. NAT-Traversal Techniques . . . . . . . . . . . . . . . . . . 10
4.1. Stand-Alone STUN . . . . . . . . . . . . . . . . . . . . 11
4.1.1. Introduction . . . . . . . . . . . . . . . . . . . . 11
4.1.2. Using STUN to Traverse NAT without Server
Modifications . . . . . . . . . . . . . . . . . . . . 11
4.1.3. ALG Considerations . . . . . . . . . . . . . . . . . 14
4.1.4. Deployment Considerations . . . . . . . . . . . . . . 14
4.1.5. Security Considerations . . . . . . . . . . . . . . . 15
4.2. Server Embedded STUN . . . . . . . . . . . . . . . . . . 16
4.2.1. Introduction . . . . . . . . . . . . . . . . . . . . 16
4.2.2. Embedding STUN in RTSP . . . . . . . . . . . . . . . 16
4.2.3. Discussion on Co-located STUN Server . . . . . . . . 17
4.2.4. ALG Considerations . . . . . . . . . . . . . . . . . 17
4.2.5. Deployment Considerations . . . . . . . . . . . . . . 18
4.2.6. Security Considerations . . . . . . . . . . . . . . . 19
4.3. ICE . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3.1. Introduction . . . . . . . . . . . . . . . . . . . . 19
4.3.2. Using ICE in RTSP . . . . . . . . . . . . . . . . . . 20
4.3.3. Implementation Burden of ICE . . . . . . . . . . . . 21
4.3.4. ALG Considerations . . . . . . . . . . . . . . . . . 22
4.3.5. Deployment Considerations . . . . . . . . . . . . . . 22
4.3.6. Security Considerations . . . . . . . . . . . . . . . 23
4.4. Latching . . . . . . . . . . . . . . . . . . . . . . . . 23
4.4.1. Introduction . . . . . . . . . . . . . . . . . . . . 23
4.4.2. Necessary RTSP Extensions . . . . . . . . . . . . . . 24
4.4.3. ALG Considerations . . . . . . . . . . . . . . . . . 25
4.4.4. Deployment Considerations . . . . . . . . . . . . . . 25
4.4.5. Security Considerations . . . . . . . . . . . . . . . 26
4.5. A Variation to Latching . . . . . . . . . . . . . . . . . 27
4.5.1. Introduction . . . . . . . . . . . . . . . . . . . . 27
4.5.2. Necessary RTSP Extensions . . . . . . . . . . . . . . 28
4.5.3. ALG Considerations . . . . . . . . . . . . . . . . . 28
4.5.4. Deployment Considerations . . . . . . . . . . . . . . 28
4.5.5. Security Considerations . . . . . . . . . . . . . . . 29
4.6. Three-Way Latching . . . . . . . . . . . . . . . . . . . 29
4.6.1. Introduction . . . . . . . . . . . . . . . . . . . . 29
4.6.2. Necessary RTSP Extensions . . . . . . . . . . . . . . 29
4.6.3. ALG Considerations . . . . . . . . . . . . . . . . . 30
4.6.4. Deployment Considerations . . . . . . . . . . . . . . 30
4.6.5. Security Considerations . . . . . . . . . . . . . . . 30
4.7. Application Level Gateways . . . . . . . . . . . . . . . 31
4.7.1. Introduction . . . . . . . . . . . . . . . . . . . . 31
4.7.2. Outline on How ALGs for RTSP Work . . . . . . . . . . 31
4.7.3. Deployment Considerations . . . . . . . . . . . . . . 32
4.7.4. Security Considerations . . . . . . . . . . . . . . . 33
4.8. TCP Tunneling . . . . . . . . . . . . . . . . . . . . . . 33
4.8.1. Introduction . . . . . . . . . . . . . . . . . . . . 33
4.8.2. Usage of TCP Tunneling in RTSP . . . . . . . . . . . 34
4.8.3. ALG Considerations . . . . . . . . . . . . . . . . . 34
4.8.4. Deployment Considerations . . . . . . . . . . . . . . 34
4.8.5. Security Considerations . . . . . . . . . . . . . . . 35
4.9. Traversal Using Relays around NAT (TURN) . . . . . . . . 35
4.9.1. Introduction . . . . . . . . . . . . . . . . . . . . 35
4.9.2. Usage of TURN with RTSP . . . . . . . . . . . . . . . 36
4.9.3. ALG Considerations . . . . . . . . . . . . . . . . . 37
4.9.4. Deployment Considerations . . . . . . . . . . . . . . 37
4.9.5. Security Considerations . . . . . . . . . . . . . . . 37
5. Firewalls . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6. Comparison of NAT Traversal Techniques . . . . . . . . . . . 39
7. Security Considerations . . . . . . . . . . . . . . . . . . . 41
8. Informative References . . . . . . . . . . . . . . . . . . . 42
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 45
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 46
1. Introduction β¨
Okay, so there's a lot of different NAT boxes out there now, and in many cases they only loosely follow standards [RFC3022] [RFC2663] [RFC3424] [RFC4787] [RFC5382]. NATs cause discontinuity in address realms [RFC3424]. That's why an application protocol like the Real-Time Streaming Protocol (RTSP) [RFC2326] [RTSP] has to deal with those discontinuities π«Ά
Here's the tricky bit. RTSP is a media control protocol managing one or more media streams, and it carries network address and port information inside its protocol messages. So even if RTSP itself isn't blocked by NATs (say, when it's carried over the Transmission Control Protocol (TCP) [RFC793]), its media streams can get blocked by NATs. That happens unless special protocol provisions are added to support NAT traversal π
Firewalls are middleboxes too, so they need a look. They help stop unwanted traffic from getting into or out of the protected network. RTSP is designed so a firewall can let RTSP-controlled media streams through with limited implementation effort. The effort needed is to implement an Application Level Gateway (ALG) that interprets RTSP parameters π§
There's also a big class of firewalls, commonly home firewalls, that use a filtering behavior that looks the same as what NATs do. These get traversed successfully using the same solution used for NAT traversal, instead of relying on an RTSP ALG. So firewalls get discussed here too, and some important differences get highlighted π
This document describes several NAT traversal mechanisms for RTSP-controlled media streaming. Many of these NAT solutions fall into the category of "UNilateral Self-Address Fixing (UNSAF)" as defined in [RFC3424] and quoted below: [UNSAF] is a process whereby some originating process attempts to determine or fix the address (and port) by which it is known - e.g. to be able to use address data in the protocol exchange, or to advertise a public address from which it will receive connections.
Following the guidelines spelled out in RFC 3424, the doc describes the required RTSP extensions for each method, transition strategies, and security concerns. The transition strategies cover how and if the method encourages a move towards not having any NATs on the path π¦
This document captures the evaluation done to recommend firewall/NAT traversal methods for RTSP streaming servers based on [RFC2326] as well as the RTSP 2.0 core specification [RTSP]. The evaluation focuses on NAT traversal for media streams carried over the User Datagram Protocol (UDP) [RFC768], with RTP [RFC3550] over UDP being the main case for that usage. The findings should be applicable to other protocols as long as they have similar properties π
When most of the work on this document was done, a single level of NAT was the dominant NAT deployment. Multiple levels of NATs, including Carrier-Grade NATs (CGNs), weren't considered. So any characterizations or findings may not apply in those scenarios, unless CGN or multiple levels of NATs are explicitly noted π
An RTSP NAT traversal mechanism based on Interactive Connectivity Establishment (ICE) is specified in "A Network Address Translator (NAT) Traversal Mechanism for Media Controlled by Real-Time Streaming Protocol (RTSP)" [RTSP-NAT] π
1.1. Network Address Translators β¨
okay bestie, we're starting with two quotes from Section 3 of [RFC4787] ("Network Address Translation (NAT) Behavioral Requirements for Unicast UDP") about NATs and their terminology π§
Readers are urged to refer to [RFC2663] for information on NAT
taxonomy and terminology. Traditional NAT is the most common type
of NAT device deployed. Readers may refer to [RFC3022] for
detailed information on traditional NAT. Traditional NAT has two
main varieties -- Basic NAT and Network Address/Port Translator
(NAPT).
NAPT is by far the most commonly deployed NAT device. NAPT allows
multiple internal hosts to share a single public IP address
simultaneously. When an internal host opens an outgoing TCP or
UDP session through a NAPT, the NAPT assigns the session a public
IP address and port number, so that subsequent response packets
from the external endpoint can be received by the NAPT,
translated, and forwarded to the internal host. The effect is
that the NAPT establishes a NAT session to translate the (private
IP address, private port number) tuple to a (public IP address,
public port number) tuple, and vice versa, for the duration of the
session. An issue of relevance to peer-to-peer applications is
how the NAT behaves when an internal host initiates multiple
simultaneous sessions from a single (private IP, private port)
endpoint to multiple distinct endpoints on the external network.
In this specification, the term "NAT" refers to both "Basic NAT"
and "Network Address/Port Translator (NAPT)".
This document uses the term "Address and Port Mapping" as the
translation between an external address and port and an internal
address and port. Note that this is not the same as an "address
binding" as defined in RFC 2663.
Note: In the above text, it would be more correct to use an
external IP address instead of a public IP address. The external
IP address is commonly a public one, but it might be of another
type if the NAT's external side is in a private address domain.
so the big takeaway π is that NAPT is the MVP of NAT devices. it lets a bunch of internal hosts share one public IP at the same time. when an internal host starts an outgoing TCP or UDP session, the NAPT gives that session a public IP address and port number, so replies from the outside can find their way back through the NAPT and get forwarded to the right internal host. for as long as the session lasts, the NAPT keeps a session mapping from the (private IP address, private port number) pair to the (public IP address, public port number) pair, and back again. peer-to-peer apps care a lot about what happens when one internal endpoint opens several sessions at once to different external endpoints π
this doc uses "Address and Port Mapping" for the translation between an external address and port and an internal address and port. and yes, it's not the same thing as an "address binding" from RFC 2663, so don't mix them up π
also, the note is pointing out that "external IP address" is the more accurate phrase. it's usually a public address, but if the NAT's external side lives in a private address domain, it could be something else.
in addition to all that, there are a bunch of address and port mapping behaviors covered in more detail in Section 4.1 of [RFC4787], and they're super relevant to what we're talking about here π¦
NATs also have a filtering behavior for traffic arriving on the external side. this affects how well different NAT traversal methods work through them. check Section 5 of [RFC4787] for the different kinds of filtering that have been identified π₯
1.2. Firewalls π
okay so a firewall is a security gateway that enforces certain access control policies between two network administrative domains: a private domain (intranet) and an external domain, e.g., the Internet. lots of organizations use firewalls to stop intrusions and malicious attacks on computing resources inside the private intranet [RFC2588] π‘οΈ
here's how NAT and firewalls compare:
- A firewall sits at security enforcement/protection points, while NAT sits at borders between two address domains.
- NAT does not in itself provide security, although some access control policies can be implemented using address translation schemes. The inherent filtering behaviors are commonly mistaken for real security policies.
it's worth knowing that a lot of NAT devices meant for Residential or Small Office, Home Office (SOHO) use include both NAT and firewall functionality π β¨
1.3. Glossary π
here's the glossary, bestie. every term, straight up:
- Address-Dependent Mapping: The NAT reuses the port mapping for subsequent packets sent from the same internal IP address and port to the same external IP address, regardless of the external port; see [RFC4787].
- Address and Port-Dependent Mapping: The NAT reuses the port mapping for subsequent packets sent from the same internal IP address and port to the same external IP address and port while the mapping is still active; see [RFC4787].
- ALG: Application Level Gateway is an entity that can be embedded in a NAT or other middlebox to perform the application layer functions required for a particular protocol to traverse the NAT/middlebox.
- Endpoint-Independent Mapping: The NAT reuses the port mapping for subsequent packets sent from the same internal IP address and port to any external IP address and port; see [RFC4787].
- ICE: Interactive Connectivity Establishment; see [RFC5245].
- DNS: Domain Name Service
- DoS: Denial of Service
- DDoS: Distributed Denial of Service
- NAT: Network Address Translator; see [RFC3022].
- NAPT: Network Address/Port Translator; see [RFC3022].
- RTP: Real-Time Transport Protocol; see [RFC3550].
- RTSP: Real-Time Streaming Protocol; see [RFC2326] and [RTSP].
- RTT: Round Trip Times
- SDP: Session Description Protocol; see [RFC4566].
- SSRC: Synchronization source in RTP; see [RFC3550].
2. Detecting the Loss of NAT Mappings π
so a few NAT traversal techniques in the next chapter rely on the fact that a NAT UDP mapping's external address and port can be discovered. that info is then used to get through the NAT box. BUT, and this is a big but π«£, that info is only good while the mapping is still valid. as the IAB's UNSAF document [RFC3424] points out, a mapping can either time out or change its properties. so it's really important for NAT traversal solutions to handle the loss or change of NAT mappings, according to RFC 3424.
first, since NATs may dynamically reclaim or readjust address/port translations, "keep-alive" and periodic repolling may be required according to RFC 3424. second, it's possible to detect and recover from the situation where the mapping has been changed or removed. you can detect the loss of a mapping when no traffic arrives for a while. below, we'll give some recommendations on how to detect the loss of NAT mappings when using RTP/RTCP under RTSP control π
an RTP session normally has both RTP and RTCP streams. the loss of an RTP mapping can only be detected when expected traffic doesn't arrive. if a client doesn't receive media data within a few seconds after getting the "200 OK" response to an RTSP PLAY request that starts the media delivery, it may be because a middlebox is blocking the traffic. however, for a receiver to be more certain it's detecting the case where no RTP traffic was delivered due to NAT trouble, it should monitor the RTCP Sender reports if they're received and not also blocked. the sender report carries a field telling how many packets the server has sent. if that number has gone up and no RTP packets have arrived for a few seconds, it's likely the mapping for the RTP stream has been removed π₯Ί
the loss of an RTCP mapping is simpler to detect. RTCP is normally sent periodically in each direction, even during the RTSP ready state. if RTCP packets are missing for several RTCP intervals, the mapping is likely lost. also, if neither RTCP packets nor RTSP messages are received by the RTSP server for a while (default 60 seconds), the RTSP server has the option to delete the corresponding RTP session, SSRC and RTSP session ID. the reason is that either the client can't get through a middlebox NAT/firewall, or the client is malfunctioning π
3. Requirements on Solutions π
this section looks at the set of requirements for evaluating RTSP NAT traversal solutions. π
RTSP is a client-server protocol. typically, service providers deploy RTSP servers on the Internet or another reachable address realm. but there are use cases where it's the other way around: RTSP clients connect from any address realm to RTSP servers behind NATs, e.g., in a home. this happens, for instance, when home surveillance cameras running as RTSP servers want to stream video to cell phone users in the public address realm through a home NAT πΉ in terms of requirements, the main thing to solve is the RTSP NAT traversal problem for RTSP servers deployed in a network where the server is on the external side of any NAT, i.e., the server is not behind a NAT. a server behind a NAT is desirable, but it's way lower priority π«Ά
another important thing for any NAT traversal technique is whether any protocol modifications are needed, and where the implementation burden lands (e.g., server, client, or middlebox). if the incentive to get RTSP working over a NAT is strong enough, it'll motivate the owner of the server, client, or middlebox to update, configure, or otherwise change the device and its software to support NAT traversal. so who this burden falls on, and how big it is, are highly relevant questions π€
here are the feature requirements for RTSP NAT solutions:
- Must work for all flavors of NATs, including NATs with Address and Port-Dependent Filtering.
- Must work for firewalls (subject to pertinent firewall administrative policies), including those with ALGs.
- Should have minimal impact on clients not behind NATs and that are not dual hosted. RTSP dual hosting means that the RTSP signaling protocol and the media protocol (e.g., RTP) are implemented on different computers with different IP addresses.
- For instance, no extra protocol RTT before arrival of media.
- Should be simple to use/implement/administer so people actually turn them on.
- Discovery of the address(es) assigned by NAT should happen automatically, if possible.
- Should authenticate dual-hosted client's media transport receiver to prevent usage of RTSP servers for DDoS attacks.
the last requirement is about the Distributed Denial-of-Service (DDoS) threat, which relates to NAT traversal as explained below π¨
during NAT traversal, when the RTSP server works out the media destination (address and port) for the client, the RTP receiver host may have a different IP address than the RTSP client host. this poses a DDoS threat with significant amplification potential, because RTP media streams in general consist of a large number of IP packets. DDoS attacks can happen if an attacker can fake the messages in the NAT traversal mechanism to trick the RTSP server into believing that the client's RTP receiver is on a host that's being attacked. for example, user A might use their RTSP client to direct the RTSP server to send video RTP streams to target.example.com in order to degrade the services provided by target.example.com π€
note that a simple mitigation is for the RTSP server to disallow cases where the client's RTP receiver has a different IP address than the RTSP client. this is recommended behavior in RTSP 2.0 unless other solutions to prevent this attack are present; see Section 21.2.1 in [RTSP]. with the increased deployment of NAT middleboxes by operators, i.e., CGN, many customers reusing the same IP address on the NAT's external side reduces the protection provided. also, in some applications (e.g., centralized conferencing), dual-hosted RTSP/RTP clients have valid use cases. the key is how to authenticate the messages exchanged during the NAT traversal process π
4. NAT-Traversal Techniques β¨
Okay bestie, so there are a bunch of NAT traversal techniques RTSP could use to get past NATs π¦. They each have different features, they fit different network layouts, they cost different amounts, and they come with different security levels π₯. In the sections below, each technique gets outlined along with its pros and cons, so you can see the full picture π .
The survey of these techniques happened before 2007 and only covers what existed back then πΈ. This section includes some NAT traversal techniques that aren't formally specified anywhere else, which means this document might be the only public spec for a few of them π. That's not a real blocker though, because you can still evaluate the techniques without a formal spec π. Some of the techniques used in these traversal solutions have since been recommended against, or they're no longer possible because of standards work that happened afterward, or because they never progressed within the IETF after this evaluation. For example, RTP No-Op [RTP-NO-OP] was a proposed RTP payload format that never got specified, so it isn't available for use today π. Whenever something like that happens, the missing parts get called out and we explain the basic reasons why π«Ά.
4.1. Stand-Alone STUN
4.1.1. Introduction
Session Traversal Utilities for NAT (STUN) [RFC5389] is a standardized protocol that lets a client use secure methods to figure out whether a NAT sits between itself and the STUN server π. The client asks the STUN server what address and port mappings the NAT assigned to it. With those NAT mappings in hand, the client can use the external addresses to connect directly to the independent RTSP server π. Here's the catch though: this only works if the NAT's address and port mapping behavior is such that the STUN server and the RTSP server see the same external address and port for the same internal address and port β οΈ.
STUN is a client-server protocol, so the STUN client sends a request to a STUN server and the server sends back a response π. There are two types of STUN messages: Binding Requests and Indications β¨. Binding Requests are used to determine a client's external address, and they ask the STUN server to respond with the address it saw π. Indications are used by the client for keep-alive messages sent to the server, and they don't need any response from the server π.
The first version of STUN [RFC3489] included categorization and parameterization of NATs. That got dropped in the updated version [RFC5389] because it was unreliable and brittle π. This particular traversal method still uses that removed functionality from RFC 3489 to detect the NAT type, so it can give an early failure indication when the NAT behaves in a way this method can't support π§. This method also suggests using the RTP No-Op payload format [RTP-NO-OP] for keep-alives of the RTP traffic in the client-to-server direction π¦. That can be swapped out for another form of UDP packet, as we'll get into below π.
4.1.2. Using STUN to Traverse NAT without Server Modifications
This section explains how a client can use STUN to get through NATs to RTSP servers without needing the servers to be modified πΈ. Heads up that this method has limited applicability, because the server has to be reachable in the external/public address realm from the perspective of the client sitting behind the NAT(s) π.
Limitations:
- The server must be located in either a public address realm or the next-hop external address realm in regards to the client.
- The client may only be located behind NATs that perform Endpoint-Independent or Address-Dependent Mappings (the STUN server and RTSP server on the same IP address). Clients behind NATs that do Address and Port-Dependent Mappings cannot use this method. See [RFC4787] for the full definition of these terms.
- This is based on the discontinued middlebox classification of the replaced STUN specification [RFC3489], so it is brittle and unreliable π.
Method:
An RTSP client using RTP transport over UDP can use STUN to traverse a NAT(s) in the following way π:
- Use STUN to try to discover the type of NAT and the timeout period for any UDP mapping on the NAT. This is recommended to be performed in the background as soon as IP connectivity is established. If this is performed prior to establishing a streaming session, the delays in the session establishment will be reduced. If no NAT is detected, normal SETUP should be used β¨.
- The RTSP client determines the number of UDP ports needed by counting the number of needed media transport protocols sessions in the multimedia presentation. This information is available in the media description protocol, e.g., SDP [RFC4566]. For example, each RTP session will in general require two UDP ports: one for RTP, and one for RTCP π.
- For each UDP port required, establish a mapping and discover the public/external IP address and port number with the help of the STUN server. A successful mapping looks like: client's local address/port <-> public address/port π¦.
- Perform the RTSP SETUP for each media. In the
Transportheader, the following parameter should be included with the given values:"dest_addr"[RTSP] or"destination"+"client_port"[RFC2326] with the public/external IP address and port pair for both RTP and RTCP. To be certain that this works, servers must allow a client to set up the RTP stream on any port, not only even ports and with non-contiguous port numbers for RTP and RTCP. This requires the new feature provided in RTSP 2.0 [RTSP]. The server should respond with aTransportheader containing a"src_addr"or"source"+"server_port"parameter with the RTP and RTCP source IP address and port of the media stream π§. - To keep the mappings alive, the client should periodically send UDP traffic over all mappings needed for the session. For the mapping carrying RTCP traffic, the periodic RTCP traffic is likely enough. For mappings carrying RTP traffic and for mappings carrying RTCP packets at too low of a frequency, keep-alive messages should be sent π.
If a UDP mapping gets lost, the discovery process above has to be repeated π. The media stream also needs to be SETUP again so the transport parameters can change to the new ones, and that will cause a glitch in media playback π.
To let UDP packets arrive from the server at a client behind an Address-Dependent or Address and Port-Dependent Filtering NAT, the client must first send a UDP packet to establish the filtering state in the NAT π₯. Before sending an RTSP PLAY request, the client must send a so-called hole-punching packet on each mapping to the IP address and port given as the server's source address and port π. For a NAT that only does Address-Dependent Filtering, the hole-punching packet could be sent to the server's discard port (port number 9) π. For Address and Port-Dependent Filtering NATs, the hole-punching packet must go to the port used for sending UDP packets to the client. To be able to do that, the server needs to include the "src_addr" in the Transport header (which is the "source" transport parameter in RFC2326) π«Ά. Since UDP packets are inherently unreliable, hole-punching packets should be retransmitted a reasonable number of times so that at least one UDP message gets through the NAT π.
RTP No-Op packets [RTP-NO-OP] could have been used as hole-punching and keep-alive messages if they had been defined. That would have made the traffic look like RTP, which would likely have the least risk of getting dropped by any firewall π¦. The drawback is that the payload type number has to be dynamically assigned through RTSP first π. Other options are STUN, an RTP packet without any payload, or a UDP packet without any payload. For RTCP, the most suitable choice is correctly generated RTCP packets π. In general, sending unsolicited traffic to the RTSP server may trigger security functions, which could result in the keep-alive messages being blocked or the RTSP session itself being terminated π¨.
This method is also brittle because it doesn't support Address and Port-Dependent Mappings. So it proposes using the old STUN methods to classify the NAT behavior, which enables early error indication π§. This is strictly not required, but it will lead to failures during setup when the NAT has the wrong behavior. That failure can also happen if the NAT changes the properties of the existing mapping and filtering state, or if it changes between the classification message exchange and the actual RTSP session setup, for example due to load π.
4.1.3. ALG Considerations
If a NAT supports an RTSP ALG (Application Level Gateway) but isn't aware of the STUN traversal option, service failure may happen π. The reason is that a client discovers its NAT external IP address and port numbers and puts them into its SETUP requests. When the RTSP ALG processes the SETUP request, it may change the destination and port number, and that leads to unpredictable behavior π. An ALG should not update address fields that contain addresses other than the NAT's internal address domain. In cases where the ALG modifies fields unnecessarily, there are two alternatives π:
- Use Transport Layer Security (TLS) to encrypt the data over the RTSP TCP connection to prevent the ALG from reading and modifying the RTSP messages.
- Turn off the STUN-based NAT traversal mechanism.
It can be hard to figure out why the failure happens, so using TLS-protected RTSP message exchange at all times would avoid this issue πβ¨.
4.1.4. Deployment Considerations π
Okay, so for the stand-alone usage of STUN, here's the deal β¨
Advantages:
- STUN is a solution that SIP applications [RFC3261] used first π (see Sections 1 and 2 of [RFC5389]). As shown above, with little or no changes, the RTSP application can reuse STUN as a NAT traversal solution, so it avoids the pitfall of solving a problem twice. Iconic efficiency π§
- Using STUN does not require RTSP server modifications, assuming the server is compliant with RTSP 2.0. It only affects the client implementation πΈ
Disadvantages:
- It requires a STUN server deployed in the same address domain as the server π
- It only works with NATs that perform Endpoint-Independent and Address-Dependent Mappings. Address and Port-Dependent Filtering NATs create some issues π
- It's brittle to NATs changing the properties of the NAT mapping and filtering π
- It does not work with Address and Port-Dependent Mapping NATs without server modifications π₯²
- It will not work if a NAT uses multiple IP addresses, because RTSP servers generally require all media streams to use the same IP as the one used in the RTSP connection, to prevent becoming a DDoS tool π«
- Interaction problems exist when an RTSP-aware ALG interferes with the use of STUN for NAT traversal, unless TLS-secured RTSP message exchange is used π
- Using STUN requires that RTSP servers and clients support the updated RTSP specification [RTSP]. That's because it is no longer possible to guarantee that RTP and RTCP ports are adjacent to each other, as required by the
client_portandserver_portparameters in RFC 2326 π‘
Transition:
The usage of STUN can be phased out gradually, because the first step of a STUN-capable server or client should be to check the presence of NATs. Removing STUN capability from client implementations will have to wait until there is absolutely no need to use STUN π
4.1.5. Security Considerations π‘οΈ
Okay, this part is seriously important bestie π€ To stop the RTSP server from being used as a Denial-of-Service (DoS) attack tool, the RTSP Transport header parameters destination and dest_addr are generally not allowed to point to any IP address other than the one the RTSP message came from. The RTSP server only makes an exception to this rule when the client is trusted, e.g., through a secure authentication process or through some secure method of challenging the destination to verify its willingness to accept the RTP traffic π. This restriction means that STUN in general does not work for use cases where RTSP and media transport go to different addresses π©
STUN combined with RTSP that is restricted by destination address has the same security properties as the core RTSP. It's protected from being used as a DoS attack tool, unless the attacker has the ability to spoof the TCP connection carrying RTSP messages π¦
Using STUN's support for message authentication and the secure transport of RTSP messages, attackers cannot modify STUN responses or RTSP messages (TLS) to change the media destination. This protects against hijacking. However, since a client can be the initiator of an attack, these mechanisms cannot securely prevent RTSP servers from being used as DoS attack tools. Not the safe vibes we want ππ
4.2. Server Embedded STUN π§ββοΈ
4.2.1. Introduction π
This section describes an alternative to the stand-alone STUN usage from the previous section, and it behaves in quite significantly different ways β¨
4.2.2. Embedding STUN in RTSP π
Here we outline how STUN gets adapted and embedded within RTSP. This lets STUN traverse any type of NAT, including Address and Port-Dependent Mapping NATs. It would require RTSP-level protocol changes π
This NAT traversal solution has limitations, though:
- It does not work if both the RTSP client and the RTSP server are behind separate NATs.
- The RTSP server may, for security reasons, refuse to send media streams to an IP that is different from the IP in the client RTSP requests.
Deviations from STUN as defined in RFC 5389:
- The RTSP application must provision the client with an identity and shared secret to use in the STUN authentication.
- We require the STUN server to be co-located on the RTSP server's media source ports.
If the STUN server is co-located with the RTSP server's media source port, an RTSP client using RTP transport over UDP can use STUN to traverse ALL types of NATs π¦ In the case of Address and Port-Dependent Mapping NATs, the party on the inside of the NAT must initiate UDP traffic. The STUN Binding Request is a UDP packet itself, so it can serve as the traffic-initiating packet π« After that, both the STUN Binding Response packets and the RTP/RTCP packets can traverse the NAT. This works regardless of whether the RTSP server or the RTSP client is behind NAT, though only one of them can be behind a NAT π«Ά
Likewise, if an RTSP server is behind a NAT, then an embedded STUN server must be co-located on the RTSP client's RTCP port. Also, the client becomes the one that needs to disclose its destination address rather than the server, so the server can correctly determine its NAT external source address for the media streams. In this case, we assume that the client has some means of establishing a TCP connection to the RTSP server behind NAT, so it can exchange RTSP messages with the server, potentially using a proxy or static rules πΈ
To minimize delay, we require that the RTSP server supporting this option informs the client about the RTP and RTCP ports from which the server will send out RTP and RTCP packets, respectively. This can be done by using the server_port parameter in RFC 2326 and the src_addr parameter in [RTSP]. Both live in the RTSP Transport header. In general, though, this strategy requires one to first send one SETUP request per media to learn the server ports, then perform the STUN checks, followed by a subsequent SETUP to change the client port and destination address to what was learned during the STUN checks. It's a lot of steps, but it's worth it π
To be certain that RTCP works correctly, the RTSP endpoint (server or client) will be required to send and receive RTCP packets from the same port π₯
4.2.3. Discussion on Co-located STUN Server π
In order to use STUN to traverse Address and Port-Dependent Filtering or Mapping NATs, the STUN server needs to be co-located with the streaming server's media output ports. This creates a demultiplexing problem: we must be able to tell a STUN packet apart from a media packet π΅ This will be done based on heuristics. The existing STUN heuristics are the first byte in the packet and the Magic Cookie field (added in RFC 5389). These work fine between STUN and RTP or RTCP, because the first byte happens to be different in each. Thanks to the Magic Cookie field, it is unlikely that other protocols would be mistaken for a STUN packet, but this is not assured π For more discussion of this, please see Section 5.1.2 of [RFC5764] π
4.2.4. ALG Considerations π§©
The same ALG traversal considerations that apply to stand-alone STUN apply here too (Section 4.1.3) β¨
4.2.5. Deployment Considerations π
For the "Embedded STUN" method, the following applies:
Advantages:
- STUN is a solution that SIP applications first used. As shown above, with little or no changes, the RTSP application can reuse STUN as a NAT traversal solution, so it avoids the pitfall of solving a problem twice π
- STUN has built-in message authentication features, which make it more secure against hijacking attacks. See the next section for an in-depth security discussion π
- This solution works as long as there is only one RTSP endpoint in the private address realm, regardless of the NAT's type. There may even be multiple NATs (see Figure 1 in [RFC5389]) π
- Compared to other UDP-based NAT traversal methods in this document, STUN requires little new protocol development (since STUN is already an IETF standard), and most likely less implementation effort, since open source STUN server and client implementations are available [STUN-IMPL] [PJNATH] π
Disadvantages:
- Some extensions to the RTSP core protocol, likely signaled by RTSP feature tags, must be introduced π¬
- It requires an embedded STUN server to be co-located on each of the RTSP server's media protocol's ports (e.g., RTP and RTCP ports). This means more processing is required to demultiplex STUN packets from media packets. For example, the demultiplexer must be able to tell an RTCP RR packet apart from a STUN packet, and forward the former to the streaming server and the latter to the STUN server π₯΄
- It does not support use cases that require the RTSP connection and the media reception to happen at different addresses, unless the server's security policy is relaxed π ββοΈ
- Interaction problems exist when an RTSP ALG is not aware of STUN, unless TLS is used to protect the RTSP messages π
- Using STUN requires that RTSP servers and clients support the updated RTSP specification [RTSP], and that they both agree to support the NAT traversal feature π€
- It increases the setup delay by at least the amount of time it takes to perform STUN message exchanges. Most likely an extra SETUP sequence will be required β³
Transition:
The usage of STUN can be phased out gradually, because the first step of a STUN-capable machine can be used to check the presence of NATs for the presently used network connection. Removing STUN capability from client implementations will have to wait until there is absolutely no need to use STUN, i.e., no NATs or firewalls π·
4.2.6. Security Considerations π
See Stand-Alone STUN (Section 4.1.5) π
4.3. ICE β¨
4.3.1. Introduction β¨
okay so ICE (Interactive Connectivity Establishment) [RFC5245] is a NAT traversal methodology that was built for SIP using SDP offer/answer π¦. The core idea is to try, in a staggered parallel fashion, every possible connection address an endpoint could be reached at πΈ. That way the endpoint can grab the best available UDP "connection" (meaning two UDP endpoints that can actually reach each other) π. And the best part? Basically every NAT topology can be traversed, which is so iconic πβ¨
Here's how ICE works at a high level, bestie π§. Endpoint A collects all the addresses it could possibly use: local IP addresses, STUN-derived addresses, Traversal Using Relay NAT (TURN) addresses, etc. π On every local port that any of those address and port pairs lead to, a STUN server gets installed. This STUN server only accepts STUN requests that use the correct authentication, through a username and password π.
Then endpoint A sends a request to establish connectivity with endpoint B, and it includes all possible "destinations" [RFC5245] to get the media through to A π. Note that each of A's local address/port pairs (host candidates and server reflexive base) has a co-located STUN server, so it's all connected π«Ά. B then hands A all of its possible destinations for the different media streams. A and B then use a STUN client to try reaching all the address and port pairs that A specified, from B's corresponding destination ports. The destinations where the STUN requests successfully complete get indicated, and one is selected π.
If B fails to get any STUN response from A, all hope is not lost π₯Ή. Certain NAT topologies need multiple tries from both ends before successful connectivity is accomplished, so requests get retransmitted multiple times π. The STUN requests may also uncover more connectivity alternatives (destinations), which get conveyed in the STUN responses. Main character energy, honestly π.
4.3.2. Using ICE in RTSP π
ICE in RTSP needs both the client and the server to be updated to include the ICE functionality. If both parties implement the necessary functionality, the following steps could provide ICE support for RTSP π.
This assumes it's possible to establish a TCP connection for the RTSP messages between the client and the server. Fair warning, this is not trivial when the server is located behind a NAT. It may require opening some TCP ports, deploying proxies, etc. π
The negotiation of ICE in RTSP is necessarily going to work differently than in SIP with SDP offer/answer. The protocol interactions are different, so the possibilities for transferring state are also somewhat different π¦. The goal is also to avoid adding extra delay to the setup process, at least when the server is not behind a NAT with respect to the client, and the client either has an address in the same address domain or is behind the NAT(s), which can reach the address domain of the server β¨. This process is only intended to support PLAY mode, i.e., media traffic flows from server to client π¬.
- ICE usage begins in the SDP. The SDP for the service indicates that ICE is supported at the server. No candidates can be given here, because that would not work with on demand, DNS load balancing, etc., which have the SDP indicate a resource on a server park rather than a specific machine π°.
- The client gathers addresses and puts together its candidates for each media stream indicated in the session description π§Ί.
- In each SETUP request, the client includes its candidates in an ICE-specific transport specification. For the server, this indicates the ICE support by the client. One candidate is the most prioritized candidate, and the prioritization for this address should be somewhat different compared to SIP. High-performance candidates are recommended rather than candidates with the highest likelihood of success, since a server is more likely to not be behind a NAT compared to a SIP user agent π.
- The server responds to the SETUP (200 OK) for each media stream with its candidates. A server not behind a NAT usually only provides a single ICE candidate. Also, here one candidate is the server primary address π.
- The connectivity checks are performed. For the server, the connectivity checks from the server to the clients have an additional usage. They verify that there is someone willing to receive the media, which prevents the server from unknowingly performing a DoS attack π‘οΈ.
- Connectivity checks from the client promoting a candidate pair were successful. Thus, no further SETUP requests are necessary, and processing can proceed with step 7. If an address other than the primary has been verified by the client to work, that address may then be promoted for usage in a SETUP request (go to step 7). If the checks for the available candidates failed, and further candidates have been derived during the connectivity checks, then those can be signaled in new candidate lines in a SETUP request updating the list (go to step 5) π.
- The client issues the PLAY request. If the server has also completed its connectivity checks for the promoted candidate pair (based on the username, as it may be derived addresses if the client was behind a NAT), then it can directly answer 200 OK (go to step 8). If the connectivity check has not yet completed, the server responds with a 1xx code to indicate that it is verifying the connectivity. If that fails within the set timeout, an error is reported back. The client needs to go back to step 6 π¬.
- Process completed and media can be delivered π. ICE candidates that weren't used may be released.
To keep media paths alive, the client needs to periodically send data to the server. This will be realized with STUN. RTCP sent by the client should be able to keep RTCP open, but STUN will also be used for SIP, based on the same motivations as for ICE π .
4.3.3. Implementation Burden of ICE π§±
The usage of ICE will require a number of new protocols and new RTSP/SDP features to be implemented. This makes ICE the solution with the largest impact on client and server implementations among all the NAT/firewall traversal methods in this document. Literally a lot of work, ngl π.
RTSP server implementation requirements are:
- STUN server features
- Limited STUN client features
- SDP generation with more parameters
- RTSP error code for ICE extension
RTSP client implementation requirements are:
- Limited STUN server features
- Limited STUN client features
- RTSP error code and ICE extension
4.3.4. ALG Considerations π΅οΈββοΈ
If there is an RTSP ALG that doesn't support the NAT traversal method, it may interfere with the NAT traversal. Since ICE shows up in the RTSP message primarily as a new transport specification, an ALG that passes through unknown specifications will not prevent the traversal. An ALG that discards unknown specifications will, however, prevent the NAT traversal π«. These issues can be avoided by stopping the ALG from interfering with the signaling, by using TLS for the RTSP message transport π.
An ALG that supports this traversal method can, on the most basic level, just pass the transport specifications through. ALGs in NATs and firewalls could use the ICE candidates to establish a filtering state that allows incoming STUN messages before any outgoing hole-punching packets. That way it could speed up the connectivity checks and reduce the risk of failures β‘.
4.3.5. Deployment Considerations πΊοΈ
Advantages:
- Solves NAT connectivity discovery for basically all cases, as long as a TCP connection between the client and server can be established. This includes servers behind NATs. (Note that a proxy between address domains may be required to get TCP through.) π
- Improves defenses against DDoS attacks, since a media-receiving client requires authentication via STUN on its media reception ports π‘οΈ.
Disadvantages:
- Increases the setup delay by at least the amount of time it takes for the server to perform its STUN requests π’.
- Assumes it's possible to demultiplex between the packets of the media protocol and STUN packets. This is possible for RTP, as discussed, for example, in Section 5.1.2 of [RFC5764] π§©.
- Has a fairly high implementation burden on both the RTSP server and client. However, several open source ICE implementations do exist, such as [NICE] and [PJNATH] π».
4.3.6. Security Considerations π¨
One should review the Security Considerations section of ICE and STUN to understand that ICE contains some potential issues. However, these can be avoided by correctly using ICE in RTSP. An important factor is to secure the signaling, i.e., use TLS between the RTSP client and server π.
Securing the signaling is the big deal here, bestie. Don't skip it! π€
In fact, ICE does help avoid the DDoS attack issue with RTSP substantially. It reduces the possibility of a DDoS using RTSP servers on attackers that are on path between the RTSP server and the target and capable of intercepting the STUN connectivity check packets and correctly sending a response to the server. The ICE connectivity checks, with their random transaction IDs, from the server to the client serve as a return-routability check, and they prevent off-path attackers from succeeding with address spoofing. This is similar to Mobile IPv6's return routability procedure (Section 5.2.5 of [RFC6275]) π¦.
4.4. Latching π¦
4.4.1. Introduction π
Latching is a NAT traversal solution based on requiring RTSP clients to send UDP packets to the server's media output ports π€. Conventionally, RTSP servers send RTP packets in one direction: from server to client. Latching is similar to connection-oriented traffic, where one side (e.g., the RTSP client) first "connects" by sending an RTP packet to the other side's RTP port, and the recipient then replies to the originating IP and Port π. This method is also referred to as "late binding" π§ . It requires that all RTP/RTCP transport be done symmetrically. In effect, this requires Symmetric RTP [RFC4961]. Refer to [RFC7362] for a description of the Latching of SIP-negotiated media streams in Session Border Controllers π.
Specifically, when the RTSP server receives the Latching packet (a.k.a. hole-punching packet, since it is used to punch a hole in the firewall/NAT) from its client, it copies the source IP and Port number and uses them as the delivery address for media packets. By having the server send media traffic back the same way the client's packets are sent to the server, address and port mappings will be honored. Therefore, this technique works for all types of NATs, given that the server is not behind a NAT. However, it does require server modifications. The format of the Latching packet will have to be defined π οΈ.
Latching is very vulnerable to both hijacking and becoming a tool in DDoS attacks (see Security Considerations in [RFC7362]), because attackers can simply forge the source IP and Port of the Latching packet π±. The rule for restricting IP addresses to one of the signaling connections will need to be applied here too. However, that does not protect against hijacking from another client behind the same NAT. This can become a serious issue in deployments with CGNs π.
4.4.2. Necessary RTSP Extensions β¨
Okay so, to make Latching work, RTSP signaling has to be extended so the RTSP client can say "hey, I'm using Latching" π
. The client also needs to be able to signal its RTP SSRC to the server in its SETUP request. The RTP SSRC is how we get some basic protection against hijacking attacks, or just avoid mis-association when multiple clients are behind the same NAT π¦. Picking the SSRC is a whole vibe though, so be careful! First, it must be unique within all the RTP sessions belonging to the same RTSP session. Second, if the RTSP server is sending media packets to multiple clients from the same send port, the RTP SSRC needs to be unique among those clients' RTP sessions.
Collisions can happen, so the RTSP server must be able to signal to a client that a collision has occurred and that it wants the client to use a different RTP SSRC carried in the SETUP response, or use unique ports per RTSP session π. Just a heads up: using unique ports limits how many sessions an RTSP server can handle at once per interface IP address π§.
The Latching packet we talked about above should have a field that can hold a client and RTP session identifier, so it gets matched to the right context π. If you use an RTP packet, it would be nice to have a well-defined RTP payload format, like the No-Op payload format proposed [RTP-NO-OP]. But if that spec doesn't exist, an RTP packet without a payload could work too. Using the SSRC is great because RTP and RTCP both keep working as-is π. Other packet formats could also carry the identification of the context, and that solution gets its own look in Section 4.5.
4.4.3. ALG Considerations πΈ
An RTSP ALG that doesn't support this method could mess with the signaling used to say Latching is happening, plus the SSRC signaling, and that means the method just won't work π. But if the RTSP ALG opens the matching pinholes and creates the right mapping in the NAT instead, traversal still works, periodt π . Securing the RTSP message transport with TLS avoids this issue entirely π.
An RTSP ALG that supports this traversal method can, for basic functionality, just pass the related signaling parameters through transparently. Because of the security considerations for Latching, there might be a benefit to an RTSP ALG that enables NAT traversal, negotiates with the path, and turns off the Latching procedures when the ALG handles it. But that opens up failure modes when there are multiple levels of NAT and only one of them supports an RTSP ALG π€.
4.4.4. Deployment Considerations π
Advantages:
- Works for all types of client-facing NATs (requirement 1 in Section 3) π
- Has few interaction problems with any RTSP ALG changing the client's information in the
Transportheader π
Disadvantages:
- Requires modifications to both the RTSP server and client π©
- Limited to working with servers that are not behind a NAT π
- The format of the packet for "connection setup" (a.k.a Latching packet) is not defined π€·ββοΈ
- SSRC management if RTP is used for Latching, due to the risk of mis-association of clients to RTSP sessions at the server if an SSRC collision occurs π
- Has significant security considerations (See Section 4.4.5), due to the lack of a strong authentication mechanism, and will need to use address restrictions π¨
4.4.5. Security Considerations π
Okay, this section is serious, bestie. Read it all. π«Ά
Latching's major security issue is that RTP streams can be hijacked and directed at any target the attacker wants, unless address restrictions are used. Even with multiple clients on the inside of a NAT, hijacking can still happen π±. This becomes a significant threat in the context of CGNs.
The most serious problem is a deliberate attack using an RTSP client and Latching. The attacker uses RTSP to set up a media session. Then it uses Latching with a spoofed source address of the intended target of the attack. There is no defense against this attack other than restricting the addresses a Latching packet can come from to the same address the RTSP TCP connection comes from. This stops Latching from being used in use cases that need different addresses for media destination and signaling. Even allowing only a limited address range that contains the signaling address, from where Latching is allowed, opens up a significant vulnerability, because it is difficult to determine the address usage for the network the client connects from π₯Ί.
A hijack attack can also be carried out in various ways. The basic attack relies on the ability to read the RTSP signaling packets, so the attacker learns the address and port the server will send from, plus the SSRC the client will use. With that info, the attacker can send its own Latching packets containing the correct RTP SSRC to the correct address and port on the server. The RTSP server will then use the source IP and port from the Latching packet as the destination for the media packets it sends π€.
Another variation is a man in the middle modifying the RTP Latching packet a client sends to the server, simply by changing the source IP and port to the target the attacker wants to hit π.
You can fend off the snooping-based attack by encrypting the RTSP signaling transport. However, if the attacker is a man in the middle modifying Latching packets, the attack is impossible to defend against except through address restrictions. Since a NAT rewrites the source IP and (possibly) port, this cannot be authenticated, but authentication is required to protect against this type of DoS attack π‘οΈ.
Yet another issue is that these attacks can also be used to completely deny the client the service it wants from the RTSP server. The attacker modifies or originates its own Latching packets using a port other than the one the legit Latching packets use, which makes the media server send RTP/RTCP traffic to ports the client isn't listening on for RTP/RTCP π.
How well Latching can fend off stream hijacking by parties off the client-to-server network path (i.e., parties who can't see the client's Latching packets) depends on the amount of random, non-guessable material in the Latching packet. The proposal above uses the 32-bit RTP SSRC field for this purpose. So it is important that this field is derived with a non-predictable random number generator. It should not be possible, by knowing the algorithm used and a couple of basic facts, to derive which random number a certain client will use π².
An attacker who doesn't know the SSRC, but knows which port numbers a server sends from, can run a brute-force attack on the server by testing lots of different SSRCs until one matches π¨. So a server could implement functionality that blocks packets to ports, or from sources, that receive or send multiple Latching packets with different invalid SSRCs, especially when they come from the same IP and port. Note that this mitigation itself opens up a new avenue for DoS attacks against legit users trying to latch π.
To improve security against attackers, the amount of random material could be increased. To get a longer random tag while still using RTP and RTCP, it will be necessary to develop RTP and RTCP payload formats for carrying the random material β¨.
4.5. A Variation to Latching π¦
4.5.1. Introduction π·
Latching as described above requires a valid RTP format for the Latching packet, i.e., the first packet the client sends to the server to establish a bidirectional transport flow for RTP streams. Right now there is no appropriate RTP packet format for this purpose. The RTP No-Op format was a proposal to fix the problem [RTP-NO-OP], but that work was abandoned π₯. [RFC6263] discusses the implications of different types of packets used as keep-alives for RTP, and its findings are very relevant to the format of the Latching packet π.
Meanwhile, NAT/firewall traversal techniques that use non-RTP messages as Latching packets have been deployed in the wireless streaming marketplace. This section describes a variant, based on a subset of those solutions, that changes the Latching solution described earlier π§.
4.5.2. Necessary RTSP Extensions π
In this variation of Latching, the Latching packet is a small UDP packet that does not contain an RTP header. In response to the client's Latching packet, the RTSP server sends back a similar Latching packet as confirmation, so the client can stop the so-called "connection phase" of this NAT traversal technique. After that, the client only has to periodically send Latching packets as keep-alive messages for the NAT mappings π.
The server listens on its RTP-media output port and tries to decode any received UDP packet as the Latching packet. This is valid since an RTSP server is not expecting RTP traffic from the RTSP client π. It can then correlate the Latching packet with the RTSP client's session ID or the client's SSRC, and record the NAT bindings accordingly. The server then sends a Latching packet back to the client as the response.
The Latching packet can contain the SSRC to identify the RTP stream. Care must be taken if the packet is bigger than 12 bytes, ensuring that it is distinctively different from RTP packets, whose header size is 12 bytes π.
RTSP signaling can be added to do the following:
- Enable or disable such Latching message exchanges. When the firewall/NAT has an RTSP-aware ALG, it is possible to disable Latching message exchange and let the ALG work out the address and port mappings π§ .
- Configure the number of retries and the retry interval of the Latching message exchanges β±οΈ.
4.5.3. ALG Considerations π
See Latching ALG considerations in Section 4.4.3.
4.5.4. Deployment Considerations π
This approach has the following advantages compared with the Latching approach (Section 4.4):
- There is no need to define an RTP payload format for firewall traversal. That makes it simpler to use, implement, and administer (requirement 4 in Section 3) than a Latching protocol, which must be defined π.
- When properly defined, this kind of Latching packet exchange can also authenticate RTP receivers, to prevent hijacking attacks π.
This approach has the following disadvantage compared with the Latching approach:
- The server's sender SSRC for the RTP stream, or other session identity information, must be signaled in the RTSP's
SETUPresponse, in theTransportheader of the RTSPSETUPresponse π€.
4.5.5. Security Considerations π
okay so this variant is lowkey more secure than regular Latching π First, it gives the Latching packets a bigger random field, which makes it way less likely that an off-path attacker can pull off a hijack attack π ββοΈ Second, the confirmation lets the client know when Latching is working and when it isn't, so it knows when to restart the process by updating the SSRC π
Still, the big issue that's left is that the RTSP server can't tell whether the source address in a Latching packet came from an RTSP client who actually wants to receive media, or from someone who just wants to point media traffic at a DoS target ππ that's the boss fight π
4.6. Three-Way Latching π¦
4.6.1. Introduction
Three-Way Latching is basically the answer to the biggest security problems in both of the variants we just talked about β¨ It adds a request and response exchange right after the initial Latching, so the server can check that the target address in the Latching packet is a real, active listener and confirm that it actually wants a media flow π«Ά
4.6.2. Necessary RTSP Extensions
It uses the same RTSP extensions as the Alternative Latching method (Section 4.5) does πΈ The only extensions for this variant are in the format and transmission of the Latching packets π§
The client-to-server Latching packet looks a lot like Alternative Latching (Section 4.5), so it's a UDP packet with some session identifiers and a random value π When the server answers the Latching packet with a Latching confirmation, it adds a random value (nonce) of its own, and it also echoes back the one the client sent π Then a third message joins the party π₯³ The client acknowledges that it got the Latching confirmation and echoes back the server's nonce. This proves that the Latched address goes to an RTSP client that started the Latching and is really sitting at that address π₯ The RTSP server will refuse to send any media until it has received the Latching Acknowledgement with a valid nonce π ββοΈ
4.6.3. ALG Considerations
See Latching ALG considerations in Section 4.4.3 π
4.6.4. Deployment Considerations
A solution with a three-way handshake and its own Latching packets can be compared to the ICE-based solution (Section 4.3), and there are some differences π
- Only works for servers that are not behind a NAT.
- May be simpler to implement due to the avoidance of the ICE prioritization and check-board mechanisms.
ngl though, a Three-Way Latching protocol is super similar to using STUN in both directions as a Latching and verification protocol π€ Using STUN would mean you don't have to build a brand new protocol at all π¦β¨
4.6.5. Security Considerations
Three-Way Latching is significantly more secure than the simpler versions above ππ The client-to-server nonce is included in signaling, and it can be bigger than the 32 bits of random data that the SSRC field supports. That makes it really hard for an off-path attacker to pull off a DoS attack by diverting the media π
The client-to-server nonce and its echo do not protect against on-path attackers, including malicious clients π¬ The server-to-client nonce and its echo do, though, stop malicious clients from diverting the media stream by spoofing the source address and port, because they can't echo back the nonce in those cases π‘οΈ This is similar to the Mobile IPv6 return routability procedure (Section 5.2.5 of [RFC6275]) π§
Three-Way Latching is really only vulnerable to an on-path attacker that is extremely capable π First, the attacker can learn the client-to-server nonce, either by intercepting the signaling or by changing the source information (target destination) of a client's Latching packet. Second, the attacker has to be on-path between the server and the target destination too, so it can generate a response using the server's nonce. An adversary with these capabilities is usually able to cause way worse damage using other methods π
Three-Way Latching makes the server-to-client packet bigger than the client-to-server packet, since it includes the server-to-client nonce as well as the client-to-server nonce π So yes, an amplification effect does exist π However, to get that amplification, the attacker has to create a session state on the RTSP server first π The RTSP server can also cap the number of responses it will generate before it considers the Latching to have failed π
4.7. Application Level Gateways π
4.7.1. Introduction
An ALG reads the application level messages and makes the changes needed so the protocol can work through the middlebox π§ But this behavior causes some problems for RTSP π©
- It does not work when RTSP is used with end-to-end security. Since the ALG can't inspect and change the application level messages, the protocol will fail because of the middlebox π
- ALGs need to be updated if extensions to the protocol are added. Because changing ALGs is hard to deploy, this may also break the end-to-end functionality of RTSP π₯²
For all of those reasons, it is not recommended to use an RTSP ALG in NATs π ββοΈ This matters most for NATs aimed at home users and small office environments, since NATs deployed in SOHO environments are very hard to upgrade π
4.7.2. Outline on How ALGs for RTSP Work
In this section, we walk through a step-by-step outline of how someone could write an ALG so RTSP can traverse a NAT πΊοΈβ¨
- Detect any SETUP request.
- Try to detect the usage of any of the NAT traversal methods that replace the address and port of the Transport header parameters
destinationordest_addr. If any of these methods are used, then the ALG should not change the address. Ways to detect that these methods are used are:- For embedded STUN, it would be to watch for a feature tag, like
nat.stun, and to see if any of those exist in thesupported,proxy-require, orrequireheaders of the RTSP exchange. - For stand-alone STUN and TURN-based solutions: This can be detected by inspecting the
destinationordest_addrparameter. If it contains either one of the NAT's external IP addresses or a public IP address, then such a solution is in use. However, if multiple NATs are used, this detection may fail. Remapping should only be done for addresses belonging to the NAT's own private address space.
- For embedded STUN, it would be to watch for a feature tag, like
Otherwise, continue to the next step. π
- Create UDP mappings (client given IP and Port <-> external IP and Port) where needed for all possible transport specifications in the Transport header of the request found in (step 1). Enter the external address and port(s) of these mappings in the Transport header. Mappings shall be created with consecutive external port numbers starting on an even number for RTP for each media stream. Mappings should also be given a long timeout period, at least 5 minutes β°
- When the SETUP response is received from the server, the ALG may remove the unused UDP mappings, i.e., the ones not present in the Transport header. The session ID should also be bound to the UDP mappings part of that session π§Ή
- If the SETUP response settles on RTP over TCP or RTP over RTSP as lower transport, do nothing: let TCP tunneling take care of NAT traversal π«Ά Otherwise, go to the next step.
- The ALG should keep the UDP mappings belonging to the RTSP session as long as: an RTSP message with the session's ID has been sent in the last timeout interval, or a UDP message has been sent on any of the UDP mappings during the last timeout interval π
- The ALG may remove a mapping as soon as a TEARDOWN response has been received for that media stream π
4.7.3. Deployment Considerations
Advantages:
- No impact on either client or server. π
- Can work for any type of NATs. π
Disadvantages:
- When deployed, they are hard to update to reflect protocol modifications and extensions. If not updated, they will break the functionality. π
- When end-to-end security is used, the ALG functionality will fail. π
- Can interfere with other types of traversal mechanisms, such as STUN. π
Transition:
An RTSP ALG will not be phased out in any automatic way. It must be removed, probably through the removal or update of the NAT it is associated with ποΈ bestie, that's a whole project π
4.7.4. Security Considerations
An ALG will not work with end-to-end RTSP signaling security deployed π« However, it will work with the hop-by-hop security method defined in Section 19.3 of RTSP 2.0 [RTSP] π So deploying an ALG may end up with clients behind NATs that aren't using end-to-end security, or, more likely, with people choosing a NAT traversal solution that allows for security π€·ββοΈ
Creating a UDP mapping based on the signaling message has some potential security implications π First of all, if the RTSP client releases its ports and another application gets assigned them instead, that application could receive RTP media for as long as the mappings exist and the RTSP server has failed to be signaled or to notice the lack of client response π±
A NAT with an RTSP ALG that assigns mappings based on SETUP requests could become the victim of a resource exhaustion attack π¨ If an attacker creates a lot of RTSP sessions, even without starting any media transmission, that could exhaust the pool of available UDP ports on the NAT. So only a limited number of UDP mappings should be allowed to be created by the RTSP ALG π
4.8. TCP Tunneling π§¦
4.8.1. Introduction
Using a TCP connection that is established from the client to the server makes sure the server can send data to the client π The connection opened from the private domain ensures that the server can send data back to the client π To send data that was originally meant to go over UDP, the TCP connection has to support some kind of framing of the media data packets π¦ Using TCP also means the client has to accept that real-time performance can take a hit π¬ TCP's problem with ensuring timely delivery was one of the reasons RTP was developed π The problems you run into with TCP are head-of-line blocking, delay introduced by retransmissions, and a highly varying rate due to the congestion control algorithm π If the receiving client can tolerate a sufficient amount of buffering (several seconds), then TCP will clearly work π
4.8.2. Usage of TCP Tunneling in RTSP
The RTSP core specification [RTSP] supports interleaving media data on the TCP connection that carries RTSP signaling π§΅ See Section 14 in [RTSP] for how to do this type of TCP tunneling π There's also another way to transport RTP over TCP, defined in Appendix C.2 in [RTSP] π For signaling and the rules on how to establish the TCP connection in lieu of UDP, see Appendix C.2 in [RTSP] as well π This is based on the framing of RTP over the TCP connection as described in [RFC4571] π«Ά
4.8.3. ALG Considerations
okay so an RTSP ALG has a whole different problem with TCP tunneling ππ«Ά, at least the interleaved version. Now the entire media data stream can end up flowing through the ALG implementation. So it's super important that the ALG handles those interleaved media data frames efficiently, otherwise it eats up too many resources and you get performance issues π.
The RTSP ALG can also mess with the transport specifications that say TCP tunneling is allowed, and with how they're prioritized. It could even remove the transport specification altogether, which stops TCP tunneling from happening at all π ββοΈ.
4.8.4. Deployment Considerations
Advantage:
- Works through all types of NATs where the RTSP server is not NATed or is at least reachable like it was not.
Disadvantages:
- Functionality needs to be implemented on both server and client.
- Will not always meet multimedia stream's real-time requirements.
Transition:
The tunneling over RTSP's TCP connection is not planned to be phased out π¦. It's meant to be a fallback mechanism, and it's for when total media reliability is desired, even at the potential price of loss of real-time properties πΈ.
4.8.5. Security Considerations
The TCP tunneling of RTP has no known significant security problems besides those already presented in the RTSP specification π. It's difficult to get any amplification effect for DoS attacks because of TCP's flow control π . The RTSP server's TCP socket, if it's independently used for media tunneling or only RTSP messages, can be used for a redirected syn attack. By spoofing the source address of any TCP init packets, the TCP SYNs from the server can be directed towards a target π±.
A possible security consideration, when session media data is interleaved with RTSP, would be the performance bottleneck when RTSP encryption is applied, since all session media data also needs to be encrypted π₯.
4.9. Traversal Using Relays around NAT (TURN) π§
4.9.1. Introduction
okay bestie, TURN [RFC5766] is a protocol for setting up traffic relays. These let clients behind NATs and firewalls receive incoming traffic for both UDP and TCP β¨. The relays are controlled and have limited resources, so they need to be allocated before you use them π. TURN lets a client temporarily bind an address/port pair on the relay (the TURN server) to its local source address/port pair, which is what it uses to contact the TURN server. Then the TURN server forwards packets between the two sides of the relay π¦.
To prevent DoS attacks on either recipient, the forwarded packets are restricted to a specific source address π‘οΈ. On the client side, that's the source that set up the allocation. On the external side, it's limited to the source address/port pair that the TURN client who created the allocation gave permission to. Packets from any other source on that address get discarded π«.
Using a TURN server makes it possible for an RTSP client to receive media streams from even an unmodified RTSP server π. The problem is that RTSP servers most likely restrict media destinations to no other IP address than the one the RTSP message arrives from π©. This means TURN could only be used if the server knows and accepts that the IP belongs to a TURN server, and the TURN server can't be targeted at an unknown address. Otherwise, both the RTSP TCP connection and the RTP media get relayed through the same TURN server π«Ά.
4.9.2. Usage of TURN with RTSP
To use a TURN server for NAT traversal, the following steps should be performed π.
- The RTSP client connects with the RTSP server. The client retrieves the session description to determine the number of media streams. To avoid the issue of having the RTSP connection and media traffic from different addresses, the TCP connection must also be done through the same TURN server as the one in the next step. This will require the usage of TURN for TCP [RFC6062] π.
- The client establishes the necessary bindings on the TURN server. It must choose the local RTP and RTCP ports that it desires to receive media packets on. TURN supports requesting bindings of even port numbers and contiguous ranges π’.
- The RTSP client uses the acquired address and port allocations in the RTSP SETUP request, using the
destinationheader π¨. - The RTSP server sends the SETUP reply, which must include the Transport header's
src_addrparameter (source and port in RTSP 1.0). Note that the server is required to have a mechanism to verify that it is allowed to send media traffic to the given address, unless TCP relaying of the RTSP messages is also performed π. - The RTSP client uses the RTSP server's response to create TURN permissions for the server's media traffic π.
- The client requests that the server starts playing. The server starts sending media packets to the given destination address and ports βΆοΈ.
- Media packets arrive at the TURN server on the external port. If the packets match an established permission, the TURN server forwards the media packets to the RTSP client π.
- If the client pauses and media is not sent for about 75% of the mapping timeout, the client should use TURN to refresh the bindings β°.
4.9.3. ALG Considerations
As the RTSP client inserts the address information of the TURN relay's external allocations in the SETUP messages, an ALG that replaces the address without considering that the address doesn't belong to the NAT's internal address realm will stop this mechanism from working π€. This can be prevented by securing the RTSP signaling π.
4.9.4. Deployment Considerations
Advantages:
- Does not require any server modifications given that the server includes the
src_addrheader in the SETUP response. - Works for any type of NAT as long as the RTSP server has a reachable IP address that is not behind a NAT.
Disadvantages:
- Requires another network element, namely the TURN server.
- A TURN server for RTSP may not scale since the number of sessions it must forward is proportional to the number of client media sessions π.
- The TURN server becomes a single point of failure π.
- Since TURN forwards media packets, as a necessity it introduces delay π’.
- An RTSP ALG may change the necessary destinations parameter. This will cause the media traffic to be sent to the wrong address π.
Transition:
TURN is not intended to be phased out completely; see Section 19 of [RFC5766]. However, the usage of TURN could be reduced when the demand for NAT traversal goes down π.
4.9.5. Security Considerations
The TURN server can become part of a DoS attack towards any victim π¨. To perform this attack, the attacker must be able to eavesdrop on the packets going from the TURN server towards a target for the DoS attack π. The attacker uses the TURN server to set up an RTSP session with media flows going through the TURN server. The attacker is in fact creating TURN mappings towards a target by spoofing the source address of TURN requests π΅οΈββοΈ. Since the attacker needs the address of these mappings, they must be able to eavesdrop on or intercept the TURN responses going from the TURN server to the target. Having these addresses, the attacker can set up an RTSP session and start delivery of the media. The attacker must be able to create these mappings. In this case, the attacker may be traced by the TURN username in the mapping requests π.
This attack requires that the attacker has access to a user account on the TURN server, so they can set up the TURN mappings. To prevent this attack, the RTSP server needs to verify that the ultimate target destination accepts this media stream. That would require something like ICE's connectivity checks being run between the RTSP server and the RTSP client π.
5. Firewalls β¨
Firewalls exist for the purpose of protecting a network from traffic the firewall owner doesn't want π§±. So it's a policy decision whether a firewall lets RTSP and its media streams through or not. RTSP is designed to be firewall friendly, in that it should be easy to design firewall policies that permit passage of RTSP traffic and its media streams π .
The firewall will need to allow the media streams associated with an RTSP session to pass through it. That means the firewall will need an ALG that reads RTSP SETUP and TEARDOWN messages π. By reading the SETUP message, the firewall can work out what type of transport is used and where the media stream packets will be sent from. Commonly, there's a need to open UDP ports for RTP/RTCP π. By looking at the source and destination addresses and ports, the opening in the firewall can be kept to the least necessary. The opening can be closed after a TEARDOWN message for that session, or when the session itself times out β³.
The above possibilities for firewalls to inspect and respond to the signaling are prevented if end-to-end confidentiality protection is used for the RTSP signaling, e.g., using the specified RTSP over TLS. As a result, firewalls can't actively open pinholes for the media streams based on the signaling π ββοΈ. To enable an RTSP ALG in the firewall to function correctly, the hop-by-hop signaling security in RTSP 2.0 can be used (see Section 19.3 of [RTSP]). If not, other methods have to be used to enable the transport flows for the media π οΈ.
Simpler firewalls do allow a client to receive media as long as it has sent packets to the target. Depending on the security level, this can behave the same way as a NAT. The only difference is that no address translation is done π·. To use such a firewall, a client would need to implement one of the NAT traversal methods described above that include sending packets to the server to create the necessary filtering state π§ββοΈ.
6. Comparison of NAT Traversal Techniques π β¨
okay so this section lines up every NAT traversal technique we just covered and checks each one against the requirements from Section 3. bestie, it's giving report card π
In the table below, each column is one of the numbered requirements. For example, the R1 column is the first requirement in Section 3: must work for all flavors of NATs. Each row is a different NAT/firewall traversal technique. Latch is short for Latching, "V. Latch" is short for "variation of Latching" as described in Section 4.5, and "3-W Latch" is short for the Three-Way Latching described in Section 4.6.
Here's a quick recap of the requirements π§
- R1: Work for all flavors of NATs
- R2: Must work with firewalls, including those with ALGs
- R3: Should have minimal impact on clients not behind NATs, counted in minimal number of additional RTTs
- R4: Should be simple to use, implement, and administer
- R5: Should provide mitigation against DDoS attacks
The following considerations are also added to the requirements πΈ
- C1: Will the solution support both clients and servers behind NAT?
- C2: Is the solution robust as NAT behaviors change?
------------+------+------+------+------+------+------+------+
| R1 | R2 | R3 | R4 | R5 | C1 | C2 |
------------+------+------+------+------+------+------+------+
STUN | No | Yes | 1 | Maybe| No | No | No |
------------+------+------+------+------+------+------+------+
Emb. STUN | Yes | Yes | 2 | Maybe| No | No | Yes |
------------+------+------+------+------+------+------+------+
ICE | Yes | Yes | 2.5 | No | Yes | Yes | Yes |
------------+------+------+------+------+------+------+------+
Latch | Yes | Yes | 1 | Maybe| No | No | Yes |
------------+------+------+------+------+------+------+------+
V. Latch | Yes | Yes | 1 | Yes | No | No | Yes |
------------+------+------+------+------+------+------+------+
3-W Latch | Yes | Yes | 1.5 | Maybe| Yes | No | Yes |
------------+------+------+------+------+------+------+------+
ALG |(Yes) | Yes | 0 | No | Yes | No | Yes |
------------+------+------+------+------+------+------+------+
TCP Tunnel | Yes | Yes | 1.5 | Yes | Yes | No | Yes |
------------+------+------+------+------+------+------+------+
TURN | Yes | Yes | 1 | No | Yes |(Yes) | Yes |
------------+------+------+------+------+------+------+------+
Figure 1: Comparison of Fulfillment of Requirements
Looking at Figure 1, you'd think TCP Tunneling or Three-Way Latching are the solutions that best fulfill the requirements, right? π€ The different techniques were discussed in the MMUSIC WG. It was established that the WG would pursue an ICE-based solution, because it's general and can also handle servers delivering media from behind NATs. TCP Tunneling is likely to stay available as an alternative, since it's specified in the main RTSP specification. So it can be used if desired, as long as the potential downsides of using TCP are acceptable in a particular deployment. Three-Way Latching is a very competitive technique too, given that you don't need support for RTSP servers behind NATs. The WG did talk about whether ICE's extra implementation burden is sufficiently motivated compared to the Three-Way Latching solution for that generality. In the end, the authors believed that the reuse of ICE, greater flexibility, and whatever is needed to deploy a new solution were the decisive factors π¦
The ICE-based RTSP NAT traversal solution is specified in "A Network Address Translator (NAT) Traversal mechanism for media controlled by Real-Time Streaming Protocol (RTSP)" [RTSP-NAT].
7. Security Considerations π
okay bestie, this part is serious, so let's get into it π In the preceding sections, we talked through the security merits of the different NAT/firewall traversal methods for RTSP. The big takeaway is that the presence of NAT(s) is a security risk, because a client cannot perform source authentication of its IP address. That blocks the deployment of any future RTSP extensions that would protect against session hijacking by a man in the middle.
Each of the proposed solutions has its own security implications π Using STUN gives the same level of security as RTSP without transport-level security and source authentication, as long as the server does not allow media to be sent to a different IP address than the one the RTSP client request was sent from.
Using Latching has a higher risk of session hijacking or DoS than normal RTSP. The reason is that there's a probability that an attacker can guess the random bits the client uses to prove its identity when creating the address bindings. The variation of Latching (Section 4.5) can handle this with authentication features. Still, both of those Latching variants are vulnerable to a deliberate attack from the RTSP client, which could redirect the requested media stream to any target if it can spoof the source address. That security vulnerability is solved by the Three-Way Latching procedure discussed in Section 4.6.
ICE resolves the binding vulnerability of Latching by using signed STUN messages, and by requiring both sides to perform connectivity checks that verify the target IP address in the candidate pair is both reachable and willing to respond π₯ ICE can, however, create a significant amount of traffic if the number of candidate pairs is large. So pacing is required, and implementations should attempt to limit their number of candidates to reduce the number of packets.
If the signaling between the ICE peers (RTSP client and server) is not confidentiality and integrity protected, ICE is vulnerable to attacks where the candidate list is manipulated. Without signaling security, it's also easier to spoof STUN binding messages, because that reveals the secret used in signing π
Using an RTSP ALG does not in itself increase the risk of session hijacking. However, deploying ALGs as the sole mechanism for RTSP NAT traversal will prevent end-to-end encrypted RTSP signaling from being deployed π«Ά
Using TCP tunneling has no known security problems. However, it might become a bottleneck for end-to-end RTSP signaling security if TCP tunneling is used on an interleaved RTSP signaling connection π§
Using TURN carries a severe risk of DoS attacks against a client. The TURN server can also be used as a redirect point in a DDoS attack, unless the server has strict enough rules about who may create bindings π¨
Since Latching and its variants have such big security issues, they should not be used at all. Three-Way Latching and ICE both mitigate these issues and perform the important return-routability checks that prevent spoofed source addresses, which is why they should be recommended π RTP ALGs are a security risk because they can create an incitement against using secure RTSP signaling. That can be avoided, since ALGs require trust in the middlebox, and that trust becomes explicit if you use the hop-by-hop security solution specified in Section 19.3 of RTSP 2.0. [RTSP]. The remaining methods can be considered safe enough, assuming the appropriate security mechanisms are used and not ignored π
8. Informative References β¨
Okay bestie, this is the reading list π Each entry is a source the document points to for background. Labels are in code so you can match them up with the citations earlier in the doc.
[NICE]Libnice, "The GLib ICE implementation", June 2015, <http://nice.freedesktop.org/wiki/>. π[PJNATH]"PJNATH - Open Source ICE, STUN, and TURN Library", May 2013, <http://www.pjsip.org/pjnath/docs/html/>. π[RFC768]Postel, J., "User Datagram Protocol", STD 6, RFC 768, DOI 10.17487/RFC0768, August 1980, <http://www.rfc-editor.org/info/rfc768>. The OG UDP paper, iconic π¦[RFC793]Postel, J., "Transmission Control Protocol", STD 7, RFC 793, DOI 10.17487/RFC0793, September 1981, <http://www.rfc-editor.org/info/rfc793>. TCP, the other classic π[RFC2326]Schulzrinne, H., Rao, A., and R. Lanphier, "Real Time Streaming Protocol (RTSP)", RFC 2326, DOI 10.17487/RFC2326, April 1998, <http://www.rfc-editor.org/info/rfc2326>. β¨[RFC2588]Finlayson, R., "IP Multicast and Firewalls", RFC 2588, DOI 10.17487/RFC2588, May 1999, <http://www.rfc-editor.org/info/rfc2588>. Multicast vs firewalls, the drama π₯[RFC2663]Srisuresh, P. and M. Holdrege, "IP Network Address Translator (NAT) Terminology and Considerations", RFC 2663, DOI 10.17487/RFC2663, August 1999, <http://www.rfc-editor.org/info/rfc2663>. The NAT glossary era πΈ[RFC3022]Srisuresh, P. and K. Egevang, "Traditional IP Network Address Translator (Traditional NAT)", RFC 3022, DOI 10.17487/RFC3022, January 2001, <http://www.rfc-editor.org/info/rfc3022>. Traditional NAT, the OG π§[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>. SIP, the signalling icon π[RFC3424]Daigle, L., Ed. and IAB, "IAB Considerations for UNilateral Self-Address Fixing (UNSAF) Across Network Address Translation", RFC 3424, DOI 10.17487/RFC3424, November 2002, <http://www.rfc-editor.org/info/rfc3424>. The UNSAF vibes are real π[RFC3489]Rosenberg, J., Weinberger, J., Huitema, C., and R. Mahy, "STUN - Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs)", RFC 3489, DOI 10.17487/RFC3489, March 2003, <http://www.rfc-editor.org/info/rfc3489>. The first STUN, obsessed π[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>. RTP, the media queen π[RFC4566]Handley, M., Jacobson, V., and C. Perkins, "SDP: Session Description Protocol", RFC 4566, DOI 10.17487/RFC4566, July 2006, <http://www.rfc-editor.org/info/rfc4566>. SDP, the session description essential β[RFC4571]Lazzaro, J., "Framing Real-time Transport Protocol (RTP) and RTP Control Protocol (RTCP) Packets over Connection-Oriented Transport", RFC 4571, DOI 10.17487/RFC4571, July 2006, <http://www.rfc-editor.org/info/rfc4571>. RTP over connection-oriented transports, lowkey clever π¦[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>. NAT behaviour rules for UDP, very structured π[RFC4961]Wing, D., "Symmetric RTP / RTP Control Protocol (RTCP)", BCP 131, RFC 4961, DOI 10.17487/RFC4961, July 2007, <http://www.rfc-editor.org/info/rfc4961>. Symmetric RTP, the mirror energy π[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>. ICE, the big one, periodt π₯[RFC5382]Guha, S., Ed., Biswas, K., Ford, B., Sivakumar, S., and P. Srisuresh, "NAT Behavioral Requirements for TCP", BCP 142, RFC 5382, DOI 10.17487/RFC5382, October 2008, <http://www.rfc-editor.org/info/rfc5382>. NAT rules for TCP πΈ[RFC5389]Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, "Session Traversal Utilities for NAT (STUN)", RFC 5389, DOI 10.17487/RFC5389, October 2008, <http://www.rfc-editor.org/info/rfc5389>. The updated STUN, iconic π[RFC5764]McGrew, D. and E. Rescorla, "Datagram Transport Layer Security (DTLS) Extension to Establish Keys for the Secure Real-time Transport Protocol (SRTP)", RFC 5764, DOI 10.17487/RFC5764, May 2010, <http://www.rfc-editor.org/info/rfc5764>. DTLS keys for SRTP, the security glow-up π[RFC5766]Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)", RFC 5766, DOI 10.17487/RFC5766, April 2010, <http://www.rfc-editor.org/info/rfc5766>. TURN, the relay queen π§[RFC6062]Perreault, S., Ed. and J. Rosenberg, "Traversal Using Relays around NAT (TURN) Extensions for TCP Allocations", RFC 6062, DOI 10.17487/RFC6062, November 2010, <http://www.rfc-editor.org/info/rfc6062>. TURN for TCP, the extension era π¦[RFC6263]Marjou, X. and A. Sollaud, "Application Mechanism for Keeping Alive the NAT Mappings Associated with RTP / RTP Control Protocol (RTCP) Flows", RFC 6263, DOI 10.17487/RFC6263, June 2011, <http://www.rfc-editor.org/info/rfc6263>. Keeping NAT mappings alive, self-care π[RFC6275]Perkins, C., Ed., Johnson, D., and J. Arkko, "Mobility Support in IPv6", RFC 6275, DOI 10.17487/RFC6275, July 2011, <http://www.rfc-editor.org/info/rfc6275>. Mobile IPv6, moving on up π[RFC7362]Ivov, E., Kaplan, H., and D. Wing, "Latching: Hosted NAT Traversal (HNT) for Media in Real-Time Communication", RFC 7362, DOI 10.17487/RFC7362, September 2014, <http://www.rfc-editor.org/info/rfc7362>. Latching and HNT, very clever π[RTP-NO-OP]Andreasen, F., "A No-Op Payload Format for RTP", Work in Progress, draft-ietf-avt-rtp-no-op-04, May 2007. A draft, still cooking π³[RTSP]Schulzrinne, H., Rao, A., Lanphier, R., Westerlund, M., and M. Stiemerling, "Real Time Streaming Protocol 2.0 (RTSP)", Work in Progress, draft-ietf-mmusic-rfc2326bis-40, February 2014. The RTSP 2.0 draft, spicy πΆοΈ[RTSP-NAT]Goldberg, J., Westerlund, M., and T. Zeng, "A Network Address Translator (NAT) Traversal Mechanism for Media Controlled by Real-Time Streaming Protocol (RTSP)", Work in Progress, draft-ietf-mmusic-rtsp-nat-22, July 2014. RTSP through NAT, the plot π¬[STUN-IMPL]"Open Source STUN Client and Server", May 2013, <http://sourceforge.net/projects/stun/>. Open source STUN, very helpful π
Acknowledgements π«Ά
Okay, the authors wanted to give a big shoutout to everyone on the MMUSIC working group's mailing list who commented on this doc, you literally made it better π The people who contributed to this protocol, listed in no special order, are: Jonathan Rosenberg, Philippe Gentric, Tom Marshall, David Yon, Amir Wolf, Anders Klemets, Flemming Andreasen, Ari Keranen, Bill Atwood, Alissa Cooper, Colin Perkins, Sarah Banks, David Black, and Alvaro Retana. Thomas Zeng also wanted to give special thanks to Greg Sherwood of PacketVideo for his input into this memo β¨
Section 1.1 includes text that was originally written for RFC 4787 by Francois Audet and Cullen Jennings πΈ
Authors' Addresses π
Magnus Westerlund Ericsson Farogatan 6 Stockholm SE-164 80 Sweden
Phone: +46 8 719 0000 Email: magnus.westerlund@ericsson.com
Thomas Zeng PacketVideo Corp
Email: thomas.zeng@gmail.com
π¦ where this page comes from
- ietf: rfc7604 2015-09
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms