Internet Engineering Task Force (IETF) V. Gurbani, Ed.
Request for Comments: 5954 Bell Laboratories, Alcatel-Lucent
Updates: 3261 B. Carpenter, Ed.
Category: Standards Track Univ. of Auckland
ISSN: 2070-1721 B. Tate, Ed.
BroadSoft
August 2010
Essential Correction for IPv6 ABNF and URI Comparison in RFC 3261
Abstract
This document corrects the Augmented Backus-Naur Form (ABNF)
production rule associated with generating IPv6 literals in RFC 3261.
It also clarifies the rule for Uniform Resource Identifier (URI)
comparison when the URIs contain textual representation of IP
addresses.
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 5741.
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/rfc5954.
Copyright Notice
Copyright (c) 2010 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.
Gurbani, et al. Standards Track [Page 1]

RFC 5954 SIP IPv6 ABNF August 2010
Historically, the ABNF pertaining to IPv6 references in RFC 3261
was derived from Appendix B of RFC 2373 [7], which was flawed to
begin with (see errata for RFC 2373 [8]). RFC 2373 has been
subsequently obsoleted by RFC 4291 [6].
The ABNF for IPv6reference is reproduced from RFC 3261 below:
IPv6reference = "[" IPv6address "]"
IPv6address = hexpart [ ":" IPv4address ]
IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT
hexpart = hexseq / hexseq "::" [ hexseq ] / "::" [ hexseq ]
hexseq = hex4 *( ":" hex4)
hex4 = 1*4HEXDIG
Note that the ambiguity occurs in the <IPv6address> production rule
where the <IPv4address> non-terminal is prefixed by the ":" token.
Because the <hexpart> production rule is defined such that two of its
alternatives already include the "::" token, this may yield to the
faulty construction of an IPv6-mapped IPv4 address with an extra
colon when expanding those alternatives.
3.2. Comparing URIs with Textual Representation of IP Addresses
In SIP, URIs are compared for a variety of reasons. Registrars
compare URIs when they receive a binding update request, for
instance. Section 19.1.4 of RFC 3261 [1] provides the rules for
comparing URIs. Among other rules, it states that:
For two URIs to be equal, the user, password, host, and port
components must match.
Does the above rule then imply that the following URIs are equal:
sip:bob@[::ffff:192.0.2.128] = sip:bob@[::ffff:c000:280]?
sip:bob@[2001:db8::9:1] = sip:bob@[2001:db8::9:01]?
sip:bob@[0:0:0:0:0:FFFF:129.144.52.38] = sip:bob@
[::FFFF:129.144.52.38]?
In all of the above examples, the textual representation of the IPv6
address is different, but these addresses are binary equivalents
(implementers are also urged to consult Section 5 of this document
for recommendations on IPv6 address text representations). Section19.1.4 of RFC 3261 does not provide any rule for URIs containing
different textual representations of IPv6 addresses that all
correspond to the same binary equivalent.
Gurbani, et al. Standards Track [Page 3]

RFC 5954 SIP IPv6 ABNF August 20104.2. Clarification for Comparison of URIs with Textual Representation of IP Addresses
The resolution to this ambiguity is a simple clarification
acknowledging that the textual representation of an IP address
varies, but it is the binary equivalence of the IP address that must
be taken into consideration when comparing two URIs that contain
varying textual representations of an IP address.
Accordingly, the existing rule from the bulleted list in Section19.1.4 of RFC 3261 MUST be modified as follows:
OLD:
o For two URIs to be equal, the user, password, host, and port
components must match.
NEW:
o For two URIs to be equal, the user, password, host, and port
components must match. If the host component contains a textual
representation of IP addresses, then the representation of those
IP addresses may vary. If so, the host components are considered
to match if the different textual representations yield the same
binary IP address.
In addition, the text in the following paragraph MUST be added to the
existing list of examples in Section 19.1.4 of RFC 3261 in order to
demonstrate the intent of the modified rule:
The following URIs are equivalent because the underlying binary
representation of the IP addresses are the same although their
textual representations vary:
sip:bob@[::ffff:192.0.2.128]
sip:bob@[::ffff:c000:280]
sip:bob@[2001:db8::9:1]
sip:bob@[2001:db8::9:01]
sip:bob@[0:0:0:0:0:FFFF:129.144.52.38]
sip:bob@[::FFFF:129.144.52.38]
5. Generating a Canonical IPv6 Textual Representation
Implementers SHOULD generate IPv6 text representation as defined in
RFC 5952 [5].
Gurbani, et al. Standards Track [Page 5]