SIP Server Location: Locating Session Initiation Protocol (SIP) Servers in a Dual-Stack IP Network
How a SIP client that speaks both IPv4 and IPv6 should look up and order the addresses of a server.
Johansson, O., Salgueiro, G., Gurbani, V., and D. Worley, Ed., "Locating Session Initiation Protocol (SIP) Servers in a Dual-Stack IP Network", RFC 7984, DOI 10.17487/RFC7984, September 2016, <https://www.rfc-editor.org/info/rfc7984>.
@misc{rfc7984,
series = {Request for Comments},
number = 7984,
howpublished = {RFC 7984},
publisher = {RFC Editor},
doi = {10.17487/RFC7984},
url = {https://www.rfc-editor.org/info/rfc7984},
author = {O. Johansson and G. Salgueiro and V. Gurbani and D. Worley},
title = {{Locating Session Initiation Protocol (SIP) Servers in a Dual-Stack IP Network}},
pagetotal = 10,
year = 2016,
month = sep,
} RFC text
Contents
Internet Engineering Task Force (IETF) O. Johansson
Request for Comments: 7984 Edvina AB
Updates: 3263 G. Salgueiro
Category: Standards Track Cisco Systems
ISSN: 2070-1721 V. Gurbani
Bell Labs, Nokia Networks
D. Worley, Ed.
Ariadne
September 2016
Locating Session Initiation Protocol (SIP) Servers
in a Dual-Stack IP Network
Abstract
RFC 3263 defines how a Session Initiation Protocol (SIP)
implementation, given a SIP Uniform Resource Identifier (URI), should
locate the next-hop SIP server using Domain Name System (DNS)
procedures. As SIP networks increasingly transition from IPv4-only
to dual-stack, a quality user experience must be ensured for dual-
stack SIP implementations. This document updates the DNS procedures
described in RFC 3263 for dual-stack SIP implementations in
preparation for forthcoming specifications for applying "Happy
Eyeballs" principles to SIP.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 7841.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained 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
1. Introduction
The Session Initiation Protocol (SIP) [RFC3261] and the additional
documents that extended it provide support for both IPv4 and IPv6.
However, this support does not fully extend to the highly hybridized
environments that are characteristic of the transitional migratory
phase from IPv4 to IPv6 networks. During this phase, many server and
client implementations run on dual-stack hosts. In such
environments, a dual-stack host will likely suffer greater connection
delay, and by extension an inferior user experience, than an
IPv4-only host. The need to remedy this diminished performance of
dual-stack hosts led to the development of the "Happy Eyeballs"
[RFC6555] algorithm, which has since been implemented in many
protocols and applications.
This document updates the DNS lookup procedures of RFC 3263 [RFC3263]
in preparation for the specification of the application of Happy
Eyeballs to SIP. Happy Eyeballs will provide enhanced performance,
and consequently enhanced user experience, in highly hybridized dual-
stack SIP networks. The procedures described herein are such that a
dual-stack client should look up both A and AAAA records in DNS and
then select the best way to set up a network flow. The details of
how the latter is done is considered out of scope for this document.
See the Happy Eyeballs algorithm and implementation and design
considerations in RFC 6555 [RFC6555] for more information about
issues with setting up dual-stack network flows.
Section 4 of this document clarifies the interaction of [RFC3263]
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 additional terms used in this document
that are specific to the SIP domain such as "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" that is defined to include
the following SIP entities: user agent server, registrar, redirect
server, a SIP proxy in the role of user agent server, and a B2BUA in
the role of a user agent server.
While this document focuses on the dual-stack situation described in
RFC 6555 and other documents, concerning the migration from an
IPv4-only network to a network supporting both IPv4 and IPv6, the
techniques described can be used in other situations. Possible
situations include when a device has multiple interfaces with
distinct addressing characteristics and when additional IP address
families are created in the future. This document uses the general
term "dual-stack" to include all situations where the client has
access to multiple communication methods that have distinct
addressing characteristics.
The term "address records" means the DNS records that translate a
domain name into addresses within the address family or families that
the entity supports (as A records provide IPv4 addresses and AAAA
records provide IPv6 addresses), regardless of whether the address
family was defined before or after this document was approved.
3. DNS Procedures in a Dual-Stack Network
This specification introduces two normative DNS lookup procedures.
These are designed to improve the performance of dual-stack clients
in IPv4/IPv6 networks.
3.1. Dual-Stack SIP UA DNS Record Lookup Procedure
Once the transport protocol has been determined, the procedure for
discovering an IP address if the TARGET is not a numeric IP address
but the port is explicitly stated in the URI, is detailed in
Section 4.2 of RFC 3263 [RFC3263]. The piece relevant to this
discussion is:
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 goes on to describe the
procedure for discovering an IP address if the TARGET is not a
numeric IP address, and no port is present in the URI. The piece
relevant to this discussion 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.
Happy Eyeballs [RFC6555] documents that looking up the "A or AAAA
record" is not an effective practice for dual-stack clients and that
it can add significant connection delay and greatly degrade user
experience. Therefore, this document makes the following normative
addendum to the DNS lookup procedures in Section 4.2 of RFC 3263
[RFC3263] for IPv4/IPv6 hybrid SIP networks and recommends it as a
best practice for such dual-stack networks:
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.
3.2. Indicating Address Family Preference in DNS SRV Records
The Happy Eyeballs algorithm [RFC6555] is particularly effective for
dual-stack HTTP client applications that have significant performance
differences between their IPv4 and IPv6 network paths. This is
because the client can initiate two TCP connections to the server,
one using IPv4 and one using IPv6, and then use the connection that
completes first. This works properly because the client can test
each route by initiating a TCP connection, but simply opening a TCP
connection to an HTTP server does not change the server's state; the
client will send the HTTP request on only one connection.
Unfortunately, in common SIP situations, it is not possible to "race"
simultaneous request attempts using two address families. If the SIP
requests are transmitted as single UDP packets, sending two copies of
the request to two different addresses risks having two copies of the
request propagating through the SIP network at the same time. The
difference between SIP and HTTP is that in SIP, the sender cannot
test a route in a non-state-changing way.
(If two copies of the same request arrive at the destination client,
the client SHOULD reject the second of them with a response code of
482 [RFC3261]. To convey information on why the request was rejected
to the originator, the client can include a descriptive reason
phrase, for example, "Merged Request". However, issuing the 482
response is not sufficient to prevent user-visible differences in
behavior. A proxy that is upstream of the second request to arrive
at the client may (almost immediately!) serially fork the second
request to further destinations (e.g., the voicemail service for the
destination client).)
In this common scenario, it is often necessary for a dual-stack
client to indicate a preference for either IPv4 or IPv6. A service
may use DNS SRV records to indicate such a preference for an address
family. This way, a server with a high-latency and/or low-capacity
IPv4 tunnel may indicate a preference for being contacted using IPv6.
A server that wishes to do this can use the lowest SRV priority to
publish host names that only resolve in IPv6 and the next priority
with host names that resolve in both address families.
Note that host names that have addresses in only one address family
are discouraged by [RFC6555]. Such special-purpose host names SHOULD
be used only as described in this section, as targets of SRV records
for an aggregate host name, where the aggregate host name ultimately
resolves to addresses in all families supported by the client.
4. Clarification of Interaction with RFC 6724
Section 5 of [RFC6157] specifies that the addresses from the address
records for a single target DNS name for a server's DNS name must be
contacted in the order specified by the source and destination
address selection algorithms defined in [RFC6724]. The set of
addresses provided to a single 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. Typically, destination address selection is done by
using the (relatively new) getaddrinfo() function to translate the
target DNS name into a list of IPv4 and/or IPv6 addresses in the
order in which they are to be contacted, as that function implements
[RFC6724].
Thus, if SRV lookup on the server's DNS name is successful, the major
ordering of the complete list of destination addresses is determined
by the priority and weight fields of the SRV records (as specified in
[RFC2782]), and the (minor) ordering among the destinations derived
from the "target" field of a single SRV record is determined by
[RFC6724].
For example, consider a server with DNS name example.com, with TCP
transport specified. 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.
The processing of [RFC2782] results in 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
Thus, the complete list of destination addresses has this ordering:
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
In particular, the destination addresses derived from
sip-1.example.com and those derived from sip-2.example.com are not
interleaved; [RFC6724] does not operate on the complete list. This
would be true even if the two SRV records had the same priority and
were (randomly) ordered based on their weights, as 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 prescribed in [RFC3263]. Neither of these changes
introduce any new security considerations because it has always been
assumed that a client desiring 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.
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
AI ELI5
On this page
§1Why SIP Needs Dual-Stack Rules
SIP supports both IPv4 and IPv6, but the RFC says that support does not fully cover the mixed environments of the transition from IPv4 to IPv6. A dual-stack host will likely suffer greater connection delay, and a worse user experience, than an IPv4-only host. The Happy Eyeballs algorithm (RFC 6555) was developed to fix that for other protocols.
This document updates the DNS lookup procedures of RFC 3263 in preparation for a later specification of Happy Eyeballs for SIP. How a client then picks the best way to set up a network flow is out of scope here.
Computers now have an old kind of address and a new kind. When a computer knows both, it can get slow if it tries them badly. This RFC sets up the first step to fix that.
§2Terms and Scope of Dual-Stack
The document uses SIP server to mean a user agent server, registrar, redirect server, a SIP proxy acting as a user agent server, or a B2BUA acting as a user agent server. Address records means the DNS records that map a name to addresses in the families the entity supports, such as A records for IPv4 and AAAA records for IPv6, whether or not the family existed when the document was approved.
The term dual-stack is used broadly. It covers any client with access to several communication methods that have distinct addressing characteristics, such as a device with multiple interfaces, or address families created in the future.
A 'dual-stack' computer is like a person who speaks two languages. The RFC says the same ideas also work for more than two.
§3.1Looking Up Every Address Family
RFC 3263 says that when the target is not a numeric IP address and a port is given, or when no SRV records are found, the client performs an A or AAAA lookup. RFC 6555 documents that this is not effective for dual-stack clients and can add significant connection delay.
So the RFC adds a normative rule: the dual-stack client SHOULD look up address records for all address families it supports for the domain name and add the resulting addresses to the list to be contacted. A client MUST be prepared for records in families it does not support, and such records MUST be ignored as unusable.
Instead of asking for just one kind of address, ask for all the kinds you understand and put them in one list. Ignore any kind you cannot use.
- SRV recordsPriority and weight (RFC 2782) order the target names
- Address records of one targetRFC 6724 orders the A and AAAA addresses
- Final contact listAddresses of different SRV targets are never interleaved
§3.2Signalling a Preferred Address Family
Happy Eyeballs works well for HTTP because a client can open one TCP connection over IPv4 and one over IPv6 and keep whichever finishes first. Opening a connection does not change the server's state, so the client sends the request on only one of them.
SIP cannot usually do this. If requests go out as single UDP packets, sending two copies to two addresses risks two copies of the request travelling through the SIP network at once. The sender cannot test a route in a way that does not change state. A destination that receives the second copy SHOULD reject it with response code 482, but the RFC notes that this is not enough to prevent user-visible differences, because an upstream proxy may fork the second request onwards, for example to voicemail.
Instead, a service may use DNS SRV records to show a preference. A server with a high-latency or low-capacity IPv4 tunnel can publish IPv6-only host names at the lowest SRV priority and host names resolving in both families at the next priority. Such single-family host names are discouraged by RFC 6555 and SHOULD be used only as targets of SRV records for an aggregate host name that ultimately resolves in all families the client supports.
Knocking on two doors at once could make two people answer a call meant for one. So instead, a house can put a sign saying 'please use the new door first'.
§4SRV Order and RFC 6724 Address Order
RFC 6157 says the addresses for a single target name must be contacted in the order given by the address selection algorithms of RFC 6724. This RFC clarifies the scope: the set of addresses given to one run of destination address selection MUST be the address records for the target name in a single SRV record (or the URI name or NAPTR-derived name if there are no SRV records). The algorithm MUST NOT reorder addresses derived from different SRV records.
The result is two levels of ordering. The major order comes from the SRV priority and weight fields (RFC 2782). The minor order, among addresses from one SRV target, comes from RFC 6724, typically through the getaddrinfo() function.
First you sort the shops by the list you were given. Then, inside each shop, you sort the doors. You never mix doors from different shops.
§4.1A Worked Ordering Example
The RFC takes example.com with TCP and two SRV records: sip-1.example.com at priority 10 and sip-2.example.com at priority 20, both on port 5060. Each target has three AAAA and three A records, already ordered by RFC 6724 with IPv6 first.
The complete list is the three IPv6 and three IPv4 addresses of sip-1, followed by the three IPv6 and three IPv4 addresses of sip-2. The addresses of the two targets are not interleaved, and the RFC says this would hold even if the SRV records had the same priority and were randomly ordered by weight.
All of the first shop's doors come first, then all of the second shop's doors, even if the second shop has a fancier new door.
§5Security Considerations
The RFC says its two new procedures introduce no new security considerations. A client may contact additional target addresses, or contact them in a different order than RFC 3263 prescribes, but it has always been assumed that a client wanting to send to a URI may contact any target listed in DNS.
The specific attacks and threat models of SIP, DNS, SRV records and Happy Eyeballs are left to their own specifications.
The RFC says it only changes which listed addresses you try and in what order, so it does not open any new door for bad guys.