RFC 7984
Locating Session Initiation Protocol (SIP) Servers in a Dual-Stack IP Network
RFC 7984: Locating SIP Servers in a Dual-Stack IP Network β¨π
okay bestie, this one is from the IETF, and it's the Standards Track doc π Here's the title-block tea:
- Who wrote it: O. Johansson (Edvina AB), G. Salgueiro (Cisco Systems), V. Gurbani (Bell Labs, Nokia Networks), and D. Worley, Ed. (Ariadne) π
- What it is: Standards Track, so it's an actual Internet standard, not just a suggestion π«Ά
- When: September 2016 π
- What it touches: it updates RFC 3263 and doesn't obsolete anything π¦
- ISSN: 2070-1721
Status of This Memo
It's an Internet Standards Track document, made by the IETF and approved by the IESG after public review. More info on Internet Standards is in Section 2 of RFC 7841, and the current status, errata, and feedback info lives at http://www.rfc-editor.org/info/rfc7984. π
Copyright Notice
Copyright (c) 2016 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) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to 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 are provided without warranty as described in the Simplified BSD License. π
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. DNS Procedures in a Dual-Stack Network . . . . . . . . . . . 4
3.1. Dual-Stack SIP UA DNS Record Lookup Procedure . . . . . . 4
3.2. Indicating Address Family Preference in DNS SRV Records . 5
4. Clarification of Interaction with RFC 6724 . . . . . . . . . 6
5. Security Considerations . . . . . . . . . . . . . . . . . . . 7
6. References . . . . . . . . . . . . . . . . . . . . . . . . . 8
6.1. Normative References . . . . . . . . . . . . . . . . . . 8
6.2. Informative References . . . . . . . . . . . . . . . . . 8
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 9
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 10
Abstract πΈ
okay so the abstract is the TL;DR: RFC 3263 explains how a SIP implementation finds the next-hop SIP server from a SIP URI, using DNS. SIP networks are moving from IPv4-only to dual-stack, so dual-stack SIP apps need to give people a good experience. This doc updates the DNS procedures from RFC 3263 for dual-stack SIP, getting things ready for the upcoming "Happy Eyeballs" stuff for SIP. π¦
1. Introduction β¨
okay bestie, the main story here is that SIP (from RFC 3261, [RFC3261]) and its extensions support both IPv4 and IPv6. But that support doesn't fully cover the messy hybrid world we're in during the IPv4-to-IPv6 transition, where lots of servers and clients run on dual-stack hosts. π§
And the tea is that a dual-stack host is likely to have more connection delay than an IPv4-only host, which makes the user experience worse. That's why the "Happy Eyeballs" algorithm from [RFC6555] was created, and now lots of protocols and apps use it. π
This document updates the DNS lookup procedures from RFC 3263 [RFC3263] so Happy Eyeballs can later be applied to SIP. Happy Eyeballs will make things faster and nicer for users in hybrid dual-stack SIP networks. The plan is that a dual-stack client looks up both A and AAAA records in DNS, then picks the best way to set up a network flow. How that picking actually happens is out of scope for this document. If you want the details on dual-stack flow setup issues, check the Happy Eyeballs algorithm, implementation, and design considerations in [RFC6555]. π
Section 4 of this document clarifies how [RFC3263] interacts with [RFC6157] and [RFC6724]. π¦
2. Terminology π
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. π₯
RFC 3261 [RFC3261] defines more SIP-specific terms used here, like "proxy", "registrar", "redirect server", "user agent server" or "UAS", "user agent client" or "UAC", "back-to-back user agent" or "B2BUA", "dialog", "transaction", and "server transaction". π§
This document uses the term "SIP server" to mean any of these SIP entities: a user agent server, a registrar, a redirect server, a SIP proxy acting as a user agent server, and a B2BUA acting as a user agent server. π
The focus here is the dual-stack situation from RFC 6555 and other documents, which is about moving from an IPv4-only network to one that supports both IPv4 and IPv6. But the techniques can be used in other situations too, like when a device has multiple interfaces with different addressing characteristics, or when new IP address families show up later. This document uses "dual-stack" as a general term for any situation where the client can reach multiple communication methods with distinct addressing characteristics. π
"Address records" means the DNS records that map a domain name to addresses in the address family or families the entity supports (A records give IPv4 addresses and AAAA records give IPv6 addresses). This applies whether the address family was defined before or after this document was approved. π
3. DNS Procedures in a Dual-Stack Network β
okay so this section is the heart of it. This spec introduces two normative DNS lookup procedures, and they're designed to make dual-stack clients in IPv4/IPv6 networks perform better. π₯
3.1. Dual-Stack SIP UA DNS Record Lookup Procedure π
Once the transport protocol is decided, here's how you find an IP address when the TARGET isn't a numeric IP address but the URI has an explicit port. That's covered in Section 4.2 of RFC 3263 [RFC3263]. The part that matters here says:
If the TARGET was not a numeric IP address, but a port is present
in the URI, the client performs an A or AAAA record lookup of the
domain name. The result will be a list of IP addresses, each of
which can be contacted at the specific port from the URI and
transport protocol determined previously.
Section 4.2 of RFC 3263 [RFC3263] also covers the case where the TARGET isn't a numeric IP address and there's no port in the URI. The relevant part is:
If no SRV records were found, the client performs an A or AAAA
record lookup of the domain name. The result will be a list of IP
addresses, each of which can be contacted using the transport
protocol determined previously, at the default port for that
transport. Processing then proceeds as described above for an
explicit port once the A or AAAA records have been looked up.
Now here's the drama π. Happy Eyeballs [RFC6555] says that just looking up "A or AAAA records" isn't an effective move for dual-stack clients, and it can add a lot of connection delay and seriously hurt the user experience. So this document adds a normative addendum to the DNS lookup procedures in Section 4.2 of RFC 3263 [RFC3263]. It's meant for IPv4/IPv6 hybrid SIP networks, and it's recommended as a best practice for them. π«Ά
The addendum, verbatim (because implementers depend on every word): The dual-stack client SHOULD look up address records for all address families that it supports for the domain name and add the resulting addresses to the list of IP addresses to be contacted. A client MUST be prepared for the existence of DNS resource records containing addresses in families that it does not support; if such records may be returned by the client's DNS queries, such records MUST be ignored as unusable and the supported addresses used as specified herein.
The gist is that the dual-stack client looks up address records for every address family it supports and adds those addresses to its list of IP addresses to contact. And even if DNS hands back records for families the client doesn't support, the client has to be ready for that. Those unsupported records get ignored as unusable, and the supported addresses are used instead. π β¨
3.2. Indicating Address Family Preference in DNS SRV Records β¨
Okay so the Happy Eyeballs algorithm [RFC6555] is literally the MVP for dual-stack HTTP clients π π It's giving performance boost when the IPv4 and IPv6 paths are super different. The client opens two TCP connections to the server, one over IPv4 and one over IPv6, and then just keeps whichever one finishes first π¦ This works so well because the client can test each route by opening a TCP connection, and opening a TCP connection to an HTTP server doesn't change the server's state. The client only sends the HTTP request down one of them, so nothing gets duplicated π«Ά
SIP is a whole different story though π You can't "race" request attempts over two address families like that. If SIP requests get sent as single UDP packets, sending two copies to two different addresses risks having both copies travel through the SIP network at the same time. The big difference is that in SIP, the sender can't test a route in a non-state-changing way. Literally no way to peek π
(If two copies of the same request reach the destination client, the client SHOULD reject the second one with a 482 response code [RFC3261]. It can add a descriptive reason phrase, like "Merged Request", so the originator knows why. BUT issuing the 482 is not enough to stop users from noticing weird behavior π A proxy upstream of that second request might (almost immediately!) serially fork it to other destinations, like the voicemail service for the destination client.)
So in this common scenario, a dual-stack client often needs to indicate a preference for either IPv4 or IPv6. A service can use DNS SRV records to show that preference for an address family π§ That way, a server with a high-latency and/or low-capacity IPv4 tunnel can say "please contact me over IPv6, bestie" π To do this, the server can use the lowest SRV priority to publish host names that only resolve in IPv6, and the next priority for host names that resolve in both address families β¨
Note that [RFC6555] discourages host names that have addresses in only one address family. These special-purpose host names SHOULD be used only as described in this section, as targets of SRV records for an aggregate host name, where that aggregate host name ultimately resolves to addresses in all families the client supports π
4. Clarification of Interaction with RFC 6724 π
Okay, this part is the tea β Section 5 of [RFC6157] says the addresses from the address records for a single target DNS name for a server's DNS name must be contacted in the order set by the source and destination address selection algorithms defined in [RFC6724]. The set of addresses given to one invocation of the destination address selection algorithm MUST be the address records for the target DNS name in a single SRV record (or, if there are no SRV records, the DNS name in the URI or derived via NAPTR). The destination address selection algorithm MUST NOT reorder addresses derived from different SRV records. Usually, destination address selection is done with the (relatively new) getaddrinfo() function, which turns the target DNS name into a list of IPv4 and/or IPv6 addresses in the order they should be contacted, because that function implements [RFC6724] πΈ
So if SRV lookup on the server's DNS name succeeds, the major ordering of the full list of destination addresses comes from the priority and weight fields of the SRV records (as specified in [RFC2782]). The minor ordering among the destinations from a single SRV record's "target" field is decided by [RFC6724] π¦
For example, say we have a server with DNS name example.com, using TCP transport. The relevant SRV records for example.com are:
_sip._tcp.example.com. 300 IN SRV 10 1 5060 sip-1.example.com.
_sip._tcp.example.com. 300 IN SRV 20 1 5060 sip-2.example.com.
Processing per [RFC2782] gives this ordered list of target domain names:
sip-1.example.com
sip-2.example.com
The address records for sip-1.example.com, as ordered by [RFC6724], are:
sip-1.example.com. 300 IN AAAA 2001:0db8:58:c02::face
sip-1.example.com. 300 IN AAAA 2001:0db8:c:a06::2:cafe
sip-1.example.com. 300 IN AAAA 2001:0db8:44:204::d1ce
sip-1.example.com. 300 IN A 192.0.2.45
sip-1.example.com. 300 IN A 203.0.113.109
sip-1.example.com. 300 IN A 198.51.100.24
And the address records for sip-2.example.com, as ordered by [RFC6724], are:
sip-2.example.com. 300 IN AAAA 2001:0db8:58:c02::dead
sip-2.example.com. 300 IN AAAA 2001:0db8:c:a06::2:beef
sip-2.example.com. 300 IN AAAA 2001:0db8:44:204::c0de
sip-2.example.com. 300 IN A 192.0.2.75
sip-2.example.com. 300 IN A 203.0.113.38
sip-2.example.com. 300 IN A 198.51.100.140
So the complete list of destination addresses ends up in this order:
2001:0db8:58:c02::face
2001:0db8:c:a06::2:cafe
2001:0db8:44:204::d1ce
192.0.2.45
203.0.113.109
198.51.100.24
2001:0db8:58:c02::dead
2001:0db8:c:a06::2:beef
2001:0db8:44:204::c0de
192.0.2.75
203.0.113.38
198.51.100.140
The destination addresses from sip-1.example.com and the ones from sip-2.example.com are NOT interleaved, because [RFC6724] doesn't operate on the complete list. This would still be true even if the two SRV records had the same priority and were (randomly) ordered by their weights, since the address records of two target DNS names are never interleaved π
5. Security Considerations π
This document introduces two new normative procedures to the existing DNS procedures used to locate SIP servers. A client may contact additional target addresses for a URI beyond those prescribed in [RFC3263], and/or it may contact target addresses in a different order than [RFC3263] prescribes. Neither of these changes introduces any new security considerations, because it has always been assumed that a client wanting to send to a URI may contact any of its targets that are listed in DNS π
The specific security vulnerabilities, attacks, and threat models of the various protocols discussed in this document (SIP, DNS, SRV records, Happy Eyeballs requirements and algorithm, etc.) are well documented in their respective specifications. Go read those, they're so worth it πβ¨
6. References π
6.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <http://www.rfc-editor.org/info/rfc2119>.
[RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for specifying the location of services (DNS SRV)", RFC 2782, DOI 10.17487/RFC2782, February 2000, <http://www.rfc-editor.org/info/rfc2782>.
[RFC3263] Rosenberg, J. and H. Schulzrinne, "Session Initiation Protocol (SIP): Locating SIP Servers", RFC 3263, DOI 10.17487/RFC3263, June 2002, <http://www.rfc-editor.org/info/rfc3263>.
[RFC6157] Camarillo, G., El Malki, K., and V. Gurbani, "IPv6 Transition in the Session Initiation Protocol (SIP)", RFC 6157, DOI 10.17487/RFC6157, April 2011, <http://www.rfc-editor.org/info/rfc6157>.
[RFC6724] Thaler, D., Ed., Draves, R., Matsumoto, A., and T. Chown, "Default Address Selection for Internet Protocol Version 6 (IPv6)", RFC 6724, DOI 10.17487/RFC6724, September 2012, <http://www.rfc-editor.org/info/rfc6724>.
6.2. Informative References
[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>.
[RFC6555] Wing, D. and A. Yourtchenko, "Happy Eyeballs: Success with Dual-Stack Hosts", RFC 6555, DOI 10.17487/RFC6555, April 2012, <http://www.rfc-editor.org/info/rfc6555>.
Acknowledgments π«Ά
The authors would like to acknowledge the support and contribution of the SIP Forum IPv6 Working Group. This document is based on a lot of tests and discussions at SIPit events, organized by the SIP Forum.
This document has benefited from the expertise and review feedback of many participants of the IETF DISPATCH and SIPCORE Working Group mailing lists as well as those on the SIP Forum IPv6 Task Group mailing list. The authors wish to specifically call out the efforts and express their gratitude for the detailed and thoughtful comments and corrections of Dan Wing, Brett Tate, Rifaat Shekh-Yusef, Carl Klatsky, Mary Barnes, Keith Drage, Cullen Jennings, Simon Perreault, Paul Kyzivat, Adam Roach, Richard Barnes, Ben Campbell, Stefan Winter, Spencer Dawkins, and Suresh Krishnan. Adam Roach devised the example in Section 4 β¨
Authors' Addresses π
Olle E. Johansson Edvina AB Runbovaegen 10 Sollentuna SE-192 48 Sweden
Email: oej@edvina.net
Gonzalo Salgueiro Cisco Systems 7200-12 Kit Creek Road Research Triangle Park, NC 27709 United States of America
Email: gsalguei@cisco.com
Vijay K. Gurbani Bell Labs, Nokia Networks 1960 Lucent Lane Rm 9C-533 Naperville, IL 60563 United States of America
Email: vkg@bell-labs.com
Dale R. Worley (editor) Ariadne Internet Services 738 Main St. Waltham, MA 02451 United States of America
Email: worley@ariadne.com
π¦ where this page comes from
- ietf: rfc7984 2016-09
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms