\documentclass[11pt]{article}
\usepackage{times}
\usepackage{graphics}
\usepackage{i-d}
\usepackage{tight}
\usepackage{txtpsfig}
\usepackage[dvips]{changebar}

\newcommand{\ACK}{\textsf{ACK}}
\newcommand{\BYE}{\textsf{BYE}}
\newcommand{\INVITE}{\textsf{INVITE}}
\newcommand{\OPTIONS}{\textsf{OPTIONS}}
\newcommand{\REGISTER}{\textsf{REGISTER}}
\newcommand{\header}[1]{\textsf{#1}}
\newcommand{\SETUP}{\textsf{SETUP}}
\newcommand{\CONNECT}{\textsf{CONNECT}}

\title{DHCPv4 Option for SIP Servers}
\author{H.Schulzrinne}
\shorttitle{}
\filename{draft-ietf-sip-dhcp-06}
\wg{SIP WG}
\address{Columbia University}
\pubdate{\today}
\expires{August 2002}

\begin{document}
\maketitle

\begin{abstract}
This document defines a DHCP-for-IPv4 option that contains a list of
domain names or IPv4 addresses that can be mapped to one or more SIP
outbound proxy servers.  This is one of the many methods that a SIP
client can use to obtain the addresses of such a local SIP server.
\end{abstract}

\section{Terminology}
\label{sec:terminology}
\begin{description}

\item[DHCP client:] A DHCP \cite{rfc2131} client is an Internet host
that uses DHCP to obtain configuration parameters such as a network
address.

\item[DHCP server:] A DHCP server is an Internet host that returns
configuration parameters to DHCP clients.

\item[SIP server:] As defined in RFC 3261 \cite{rfc3261}.  This server
{\MUST} be an outbound proxy server, as defined in
\cite{draft-ietf-sip-srv}.  In the context of this document, a SIP
server refers to the host the SIP server is running on.

\item[SIP client:] As defined in RFC 3261.  The client can be a user
agent client or the client portion of a proxy server.  In the context of
this document, a SIP client refers to the host the SIP client is running
on.

\end{description}

In this document, the key words ``{\MUST}'', ``{\MUSTNOT}'',
``{\REQUIRED}'', ``{\SHALL}'', ``{\SHALLNOT}'', ``{\SHOULD}'',
``{\SHOULDNOT}'', ``{\RECOMMENDED}'', ``{\MAY}'', and ``{\OPTIONAL}''
are to be interpreted as described in RFC 2119 \cite{rfc2119}.

\section{Introduction}

The Session Initiation Protocol (SIP) \cite{rfc3261} is an
application-layer control protocol that can establish, modify and
terminate multimedia sessions or calls.  A SIP system has a number of
logical components:  user agents, proxy servers, redirect servers and
registrars.  User agents {\MAY} contain SIP clients, proxy servers
always do.

This draft specifies a DHCP option \cite{rfc2131,rfc2132} that allows
SIP clients to locate a local SIP server that is to be used for all
outbound SIP requests, a so-called outbound proxy server.  (SIP clients
{\MAY} contact the address identified in the SIP URL directly, without
involving a local SIP server.  However in some circumstances, for
example, when firewalls are present, SIP clients need to use a local
server for outbound requests.) This is one of many possible solutions
for locating the outbound SIP server; manual configuration is an example
of another.

\section{SIP Server DHCP Option}
\label{sec:sipn}

The SIP server DHCP option carries either a 32-bit (binary) IPv4 address
or, preferably, a DNS (RFC 1035 \cite{rfc1035}) fully-qualified domain
name to be used by the SIP client to locate a SIP server. 

The option has two encodings, specified by the encoding byte ('enc')
that follows the code byte.  If the encoding byte has the value 0, it is
followed by a list of domain names, as described below
(Section~\ref{sec:dnl}).  If the encoding byte has the value 1, it is
followed by one or more IPv4 addresses (Section~\ref{sec:ipl}). All
implementations {\MUST} support both encodings. The 'Len' field
indicates the total number of octets in the option following the 'Len'
field, including the encoding byte. 

A DHCP server {\MUSTNOT} mix the two encodings in the same DHCP message,
even if it sends two different instances of the same option.  Attempts
to do so would result in incorrect client behavior as DHCP processing
rules call for the concatenation of multiple instances of an option into
a single option prior to processing the option
\cite{draft-ietf-dhc-concat}.

The code for this option is 120.

\subsection{Domain Name List}
\label{sec:dnl}

If the 'enc' byte has a value of 0, the encoding byte is followed by a
sequence of labels, encoded according to Section 3.1 of RFC 1035
\cite{rfc1035}, quoted below:

\begin{quotation}
Domain names in messages are expressed in terms of a sequence of labels. 
Each label is represented as a one octet length field followed by that
number of octets.  Since every domain name ends with the null label of
the root, a domain name is terminated by a length byte of zero.  The
high order two bits of every length octet must be zero, and the
remaining six bits of the length field limit the label to 63 octets or
less.  To simplify implementations, the total length of a domain name
(i.e., label octets and label length octets) is restricted to 255 octets
or less.
\end{quotation}

\motivation{RFC 1035 encoding was chosen to accomodate future
internationalized domain name mechanisms.}

The minimum length for this encoding is 3.

The option {\MAY} contain multiple domain names, but these {\SHOULD}
refer to different NAPTR records, rather than different A records.  The
client {\MUST} try the records in the order listed, applying the
mechanism described in Section 4.1 of RFC 3263 \cite{rfc3263} for each. 
The client only resolves the subsequent domain names if attempts to
contact the first one failed or yielded no common transport protocols
between client and server or denote a domain administratively prohibited
by client policy.

\motivation{Use of multiple domain names is not meant to replace NAPTR
and SRV records, but rather to allow a single DHCP server to indicate
outbound proxy servers operated by multiple providers.}

Clients {\MUST} support compression according to the encoding in Section
4.1.4 of ``Domain Names - Implementation And Specification''
\cite{rfc1035}.

\motivation{Since the domain names are supposed to be different domains,
compression will likely have little effect, however.}

If the length of the domain list exceeds the maximum permissible within
a single option (254 octets), then the domain list {\MUST} be
represented in the DHCP message as specified in
\cite{draft-ietf-dhc-concat}.

The DHCP option for this encoding has the following format:

\begin{verbatim}
  Code  Len   enc   DNS name of SIP server
+-----+-----+-----+-----+-----+-----+-----+-----+--
| TBD |  n  |  0  |  s1 |  s2 |  s3 |  s4 | s5  |  ...
+-----+-----+-----+-----+-----+-----+-----+-----+--
\end{verbatim}

As an example, consider the case where the server wants to offer two
outbound proxy servers, ``example.com'' and ``example.net''. These would
be encoded as follows:

\begin{verbatim}
  +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  |TBD|27 | 0 | 7 |'e'|'x'|'a'|'m'|'p'|'l'|'e'| 3 |'c'|'o'|'m'| 0 |
  +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  +---+---+---+---+---+---+---+---+---+---+---+---+---+
  | 7 |'e'|'x'|'a'|'m'|'p'|'l'|'e'| 3 |'n'|'e'|'t'| 0 |
  +---+---+---+---+---+---+---+---+---+---+---+---+---+
\end{verbatim}

\subsection{IPv4 Address List}
\label{sec:ipl}

If the 'enc' byte has a value of 1, the encoding byte is followed by a
list of IPv4 addresses indicating SIP outbound proxy servers available
to the client.  Servers {\MUST} be listed in order of preference.

Its minimum length is 5, and the length {\MUST} be a multiple of 4 plus
one. The DHCP option for this encoding has the following format:

\begin{verbatim}
         Code   Len   enc      Address 1            Address 2
        +-----+-----+-----+-----+-----+-----+-----+-----+--
        | TBD |  n  |  1  |  a1 |  a2 |  a3 |  a4 | a1  |  ...
        +-----+-----+-----+-----+-----+-----+-----+-----+--
\end{verbatim}

\section{Security Consideration}

The ecurity considerations in RFC 2131 \cite{rfc2131}, RFC 3261
\cite{rfc3261} and RFC XXXX \cite{draft-ietf-sip-srv} apply.  If an
adversary manages to modify the response from a DHCP server or insert
its own response, a SIP user agent could be led to contact a rogue SIP
server, possibly one that then intercepts call requests or denies
service.  A modified DHCP answer could also omit host names that
translated to TLS-based SIP servers, thus facilitating intercept.

\section{IANA Considerations}

IANA has assigned a DHCP option number of TBD for the ``SIP Servers
DHCP Option'' defined in this document.

\section{Acknowledgements}

Ralph Droms, Robert Elz, Wenyu Jiang, Peter Koch, Gautam Nair, Thomas
Narten, Erik Nordmark, Jonathan Rosenberg, Kundan Singh, Sven Ubik,
Bernie Volz and Dean Willis provided useful feedback through the
evolution of this draft.

\section{Authors' Addresses}
\begin{flushleft}
Henning Schulzrinne\\
Dept. of Computer Science\\
Columbia University\\
1214 Amsterdam Avenue, MC 0401\\
New York, NY 10027\\
USA\\
electronic mail: {\sf schulzrinne@cs.columbia.edu}\\
\end{flushleft}

\bibliographystyle{ieeetr}
\bibliography{itu,i-d,rfc}

\input{copyright}
\end{document}
