RFC 3264
RFC 3264
Rosenberg
Request for Comments: 3264 dynamicsoft
Obsoletes: 2543 H. Schulzrinne
Category: Standards Track Columbia U.
June 2002
Copyright Notice
Abstract
This document defines a mechanism by which two entities can make use
of the Session Description Protocol (SDP) to arrive at a common view
of a multimedia session between them. In the model, one participant
offers the other a description of the desired session from their
perspective, and the other participant answers with the desired
session from their perspective. This offer/answer model is most
useful in unicast sessions where information from both participants
is needed for the complete view of the session. The offer/answer
model is used by protocols like the Session Initiation Protocol
(SIP).
Table of Contents
1 Introduction ........................................ 2
2 Terminology ......................................... 3
3 Definitions ......................................... 3
4 Protocol Operation .................................. 4
5 Generating the Initial Offer ........................ 5
5.1 Unicast Streams ..................................... 5
5.2 Multicast Streams ................................... 8
6 Generating the Answer ............................... 9
6.1 Unicast Streams ..................................... 9
6.2 Multicast Streams ................................... 12
7 Offerer Processing of the Answer .................... 12
8 Modifying the Session ............................... 13
1 Introduction
The means by which the offers and answers are conveyed are outside
the scope of this document. The offer/answer model defined here is
the mandatory baseline mechanism used by the Session Initiation
Protocol (SIP) [7].
2 Terminology
3 Definitions
4 Protocol Operation
At any time, either agent MAY generate a new offer that updates the
session. However, it MUST NOT generate a new offer if it has
received an offer which it has not yet answered or rejected.
Furthermore, it MUST NOT generate a new offer if it has generated a
prior offer for which it has not yet received an answer or a
rejection. If an agent receives an offer after having sent one, but
before receiving an answer to it, this is considered a "glare"
condition.
The higher layer protocol needs to provide a means for resolving such
conditions. The higher layer protocol will need to provide a means
for ordering of messages in each direction. SIP meets these
requirements [7].
The offer (and answer) MUST be a valid SDP message, as defined by RFC
2327 [1], with one exception. RFC 2327 mandates that either an e or
a p line is present in the SDP message. This specification relaxes
that constraint; an SDP formulated for an offer/answer application
MAY omit both the e and p lines. The numeric value of the session id
and version in the o line MUST be representable with a 64 bit signed
integer. The initial value of the version MUST be less than
(2**62)-1, to avoid rollovers. Although the SDP specification allows
for multiple session descriptions to be concatenated together into a
large SDP message, an SDP message used in the offer/answer model MUST
contain exactly one session description.
The SDP "s=" line conveys the subject of the session, which is
reasonably defined for multicast, but ill defined for unicast. For
unicast sessions, it is RECOMMENDED that it consist of a single space
character (0x20) or a dash (-).
The SDP "t=" line conveys the time of the session. Generally,
streams for unicast sessions are created and destroyed through
external signaling means, such as SIP. In that case, the "t=" line
SHOULD have a value of "0 0".
The offer will contain zero or more media streams (each media stream
is described by an "m=" line and its associated attributes). Zero
media streams implies that the offerer wishes to communicate, but
that the streams for the session will be added at a later time
through a modified offer. The streams MAY be for a mix of unicast
and multicast; the latter obviously implies a multicast address in
the relevant "c=" line(s).
For recvonly and sendrecv streams, the port number and address in the
offer indicate where the offerer would like to receive the media
stream. For sendonly RTP streams, the address and port number
indirectly indicate where the offerer wants to receive RTCP reports.
Unless there is an explicit indication otherwise, reports are sent to
the port number one higher than the number indicated. The IP address
and port present in the offer indicate nothing about the source IP
address and source port of RTP and RTCP packets that will be sent by
the offerer. A port number of zero in the offer indicates that the
stream is offered but MUST NOT be used. This has no useful semantics
in an initial offer, but is allowed for reasons of completeness,
since the answer can contain a zero port indicating a rejected stream
(Section 6). Furthermore, existing streams can be terminated by
setting the port to zero (Section 8). In general, a port number of
zero indicates that the media stream is not wanted.
The list of media formats for each media stream conveys two pieces of
information, namely the set of formats (codecs and any parameters
associated with the codec, in the case of RTP) that the offerer is
capable of sending and/or receiving (depending on the direction
attributes), and, in the case of RTP, the RTP payload type numbers
used to identify those formats. If multiple formats are listed, it
means that the offerer is capable of making use of any of those
formats during the session. In other words, the answerer MAY change
formats in the middle of the session, making use of any of the
formats listed, without sending a new offer. For a sendonly stream,
the offer SHOULD indicate those formats the offerer is willing to
send for this stream. For a recvonly stream, the offer SHOULD
indicate those formats the offerer is willing to receive for this
stream. For a sendrecv stream, the offer SHOULD indicate those
codecs that the offerer is willing to send and receive with.
For recvonly RTP streams, the payload type numbers indicate the value
of the payload type field in RTP packets the offerer is expecting to
receive for that codec. For sendonly RTP streams, the payload type
numbers indicate the value of the payload type field in RTP packets
the offerer is planning to send for that codec. For sendrecv RTP
streams, the payload type numbers indicate the value of the payload
type field the offerer expects to receive, and would prefer to send.
However, for sendonly and sendrecv streams, the answer might indicate
different payload type numbers for the same codecs, in which case,
the offerer MUST send with the payload type numbers from the answer.
In all cases, the formats in the "m=" line MUST be listed in order of
preference, with the first format listed being preferred. In this
case, preferred means that the recipient of the offer SHOULD use the
format with the highest preference that is acceptable to it.
A typical usage example for multiple media streams of the same type
is a pre-paid calling card application, where the user can press and
hold the pound ("#") key at any time during a call to hangup and make
a new call on the same card. This requires media from the user to
two destinations - the remote gateway, and the DTMF processing
application which looks for the pound. This could be accomplished
with two media streams, one sendrecv to the gateway, and the other
sendonly (from the perspective of the user) to the DTMF application.
Once the offerer has sent the offer, it MUST be prepared to receive
media for any recvonly streams described by that offer. It MUST be
prepared to send and receive media for any sendrecv streams in the
offer, and send media for any sendonly streams in the offer (of
course, it cannot actually send until the peer provides an answer
with the needed address and port information). In the case of RTP,
even though it may receive media before the answer arrives, it will
not be able to send RTCP receiver reports until the answer arrives.
For each "m=" line in the offer, there MUST be a corresponding "m="
line in the answer. The answer MUST contain exactly the same number
of "m=" lines as the offer. This allows for streams to be matched up
based on their order. This implies that if the offer contained zero
"m=" lines, the answer MUST contain zero "m=" lines.
The "t=" line in the answer MUST equal that of the offer. The time
of the session cannot be negotiated.
For streams marked as recvonly in the answer, the "m=" line MUST
contain at least one media format the answerer is willing to receive
with from amongst those listed in the offer. The stream MAY indicate
additional media formats, not listed in the corresponding stream in
the offer, that the answerer is willing to receive. For streams
marked as sendonly in the answer, the "m=" line MUST contain at least
one media format the answerer is willing to send from amongst those
listed in the offer. For streams marked as sendrecv in the answer,
the "m=" line MUST contain at least one codec the answerer is willing
to both send and receive, from amongst those listed in the offer.
The stream MAY indicate additional media formats, not listed in the
corresponding stream in the offer, that the answerer is willing to
send or receive (of course, it will not be able to send them at this
time, since it was not listed in the offer). For streams marked as
inactive in the answer, the list of media formats is constructed
based on the offer. If the offer was sendonly, the list is
constructed as if the answer were recvonly. Similarly, if the offer
was recvonly, the list is constructed as if the answer were sendonly,
and if the offer was sendrecv, the list is constructed as if the
answer were sendrecv. If the offer was inactive, the list is
constructed as if the offer were actually sendrecv and the answer
were sendrecv.
The connection address and port in the answer indicate the address
where the answerer wishes to receive media (in the case of RTP, RTCP
will be received on the port which is one higher unless there is an
explicit indication otherwise). This address and port MUST be
present even for sendonly streams; in the case of RTP, the port one
higher is still used to receive RTCP.
Although the answerer MAY list the formats in their desired order of
preference, it is RECOMMENDED that unless there is a specific reason,
the answerer list formats in the same relative order they were
present in the offer. In other words, if a stream in the offer lists
audio codecs 8, 22 and 48, in that order, and the answerer only
supports codecs 8 and 48, it is RECOMMENDED that, if the answerer has
The answerer MAY include a non-zero ptime attribute for any media
stream; this indicates the packetization interval that the answerer
would like to receive. There is no requirement that the
packetization interval be the same in each direction for a particular
stream.
The answerer MAY include a bandwidth attribute for any media stream;
this indicates the bandwidth that the answerer would like the offerer
to use when sending media. The value of zero is allowed, interpreted
as described in Section 5.
If there are no media formats in common for all streams, the entire
offered session is rejected.
Once the answerer has sent the answer, it MUST be prepared to receive
media for any recvonly streams described by that answer. It MUST be
prepared to send and receive media for any sendrecv streams in the
answer, and it MAY send media immediately. The answerer MUST be
prepared to receive media for recvonly or sendrecv streams using any
media formats listed for those streams in the answer, and it MAY send
media immediately. When sending media, it SHOULD use a packetization
interval equal to the value of the ptime attribute in the offer, if
any was present. It SHOULD send media using a bandwidth no higher
than the value of the bandwidth attribute in the offer, if any was
present. The answerer MUST send using a media format in the offer
that is also listed in the answer, and SHOULD send using the most
preferred media format in the offer that is also listed in the
answer. In the case of RTP, it MUST use the payload type numbers
from the offer, even if they differ from those in the answer.
The ptime and bandwidth attributes in the answer MUST equal the ones
in the offer, if present. If not present, a non-zero ptime MAY be
added to the answer.
When the offerer receives the answer, it MAY send media on the
accepted stream(s) (assuming it is listed as sendrecv or recvonly in
the answer). It MUST send using a media format listed in the answer,
and it SHOULD use the first media format listed in the answer when it
does send.
The reason this is a SHOULD, and not a MUST (its also a SHOULD,
and not a MUST, for the answerer), is because there will
oftentimes be a need to change codecs on the fly. For example,
during silence periods, an agent might like to switch to a comfort
noise codec. Or, if the user presses a number on the keypad, the
agent might like to send that using RFC 2833 [9]. Congestion
control might necessitate changing to a lower rate codec based on
feedback.
The offerer SHOULD send media according to the value of any ptime and
bandwidth attribute in the answer.
The offerer MAY immediately cease listening for media formats that
were listed in the initial offer, but not present in the answer.
At any point during the session, either participant MAY issue a new
offer to modify characteristics of the session. It is fundamental to
the operation of the offer/answer model that the exact same
offer/answer procedure defined above is used for modifying parameters
of an existing session.
The offer MAY be identical to the last SDP provided to the other
party (which may have been provided in an offer or an answer), or it
MAY be different. We refer to the last SDP provided as the "previous
SDP". If the offer is the same, the answer MAY be the same as the
previous SDP from the answerer, or it MAY be different. If the
offered SDP is different from the previous SDP, some constraints are
placed on its construction, discussed below.
Nearly all aspects of the session can be modified. New streams can
be added, existing streams can be deleted, and parameters of existing
streams can change. When issuing an offer that modifies the session,
the "o=" line of the new SDP MUST be identical to that in the
previous SDP, except that the version in the origin field MUST
increment by one from the previous SDP. If the version in the origin
line does not increment, the SDP MUST be identical to the SDP with
that version number. The answerer MUST be prepared to receive an
offer that contains SDP with a version that has not changed; this is
effectively a no-op. However, the answerer MUST generate a valid
answer (which MAY be the same as the previous SDP from the answerer,
or MAY be different), according to the procedures defined in Section
6.
Reusing its slot means that the new media description replaces the
old one, but retains its positioning relative to other media
descriptions in the SDP. New media descriptions MUST appear below
any existing media sections. The rules for formatting these media
descriptions are identical to those described in Section 5.
When the answerer receives an SDP with more media descriptions than
the previous SDP from the offerer, or it receives an SDP with a media
stream in a slot where the port was previously zero, the answerer
knows that new media streams are being added. These can be rejected
or accepted by placing an appropriately structured media description
in the answer. The procedures for constructing the new media
description in the answer are described in Section 6.
Existing media streams are removed by creating a new SDP with the
port number for that stream set to zero. The stream description MAY
omit all attributes present previously, and MAY list just a single
media format.
A stream that is offered with a port of zero MUST be marked with port
zero in the answer. Like the offer, the answer MAY omit all
attributes present previously, and MAY list just a single media
format from amongst those in the offer.
The port number for a stream MAY be changed. To do this, the offerer
creates a new media description, with the port number in the m line
different from the corresponding stream in the previous SDP. If only
the port number is to be changed, the rest of the media stream
description SHOULD remain unchanged. The offerer MUST be prepared to
receive media on both the old and new ports as soon as the offer is
sent. The offerer SHOULD NOT cease listening for media on the old
port until the answer is received and media arrives on the new port.
Doing so could result in loss of media during the transition.
The corresponding media stream in the answer MAY be the same as the
stream in the previous SDP from the answerer, or it MAY be different.
If the updated stream is accepted by the answerer, the answerer
SHOULD begin sending traffic for that stream to the new port
immediately. If the answerer changes the port from the previous SDP,
it MUST be prepared to receive media on both the old and new ports as
soon as the answer is sent. The answerer MUST NOT cease listening
for media on the old port until media arrives on the new port. At
that time, it MAY cease listening for media on the old port. The
same is true for an offerer that sends an updated offer with a new
port; it MUST NOT cease listening for media on the old port until
media arrives on the new port.
To change the IP address where media is sent to, the same procedure
is followed for changing the port number. The only difference is
that the connection line is updated, not the port number.
The transport for a stream MAY be changed. The process for doing
this is identical to changing the port, except the transport is
updated, not the port.
The mappings need to remain fixed for the duration of the session
because of the loose synchronization between signaling exchanges
of SDP and the media stream.
When an agent ceases using a media format (by not listing that format
in an offer or answer, even though it was in a previous SDP) the
agent will still need to be prepared to receive media with that
format for a brief time. How does it know when it can be prepared to
stop receiving with that format? If it needs to know, there are three
techniques that can be applied. First, the agent can change ports in
addition to changing formats. When media arrives on the new port, it
knows that the peer has ceased sending with the old format, and it
can cease being prepared to receive with it. This approach has the
benefit of being media format independent. However, changes in ports
may require changes in resource reservation or rekeying of security
protocols. The second approach is to use a totally new set of
dynamic payload types for all codecs when one is discarded. When
media is received with one of the new payload types, the agent knows
that the peer has ceased sending with the old format. This approach
doesn’t affect reservations or security contexts, but it is RTP
specific and wasteful of a very small payload type space. A third
approach is to use a timer. When the SDP from the peer is received,
the timer is set. When it fires, the agent can cease being prepared
to receive with the old format. A value of one minute would
typically be more than sufficient. In some cases, an agent may not
care, and thus continually be prepared to receive with the old
formats. Nothing need be done in this case.
The media type (audio, video, etc.) for a stream MAY be changed. It
is RECOMMENDED that the media type be changed (as opposed to adding a
new stream), when the same logical data is being conveyed, but just
in a different media format. This is particularly useful for
changing between voiceband fax and fax in a single stream, which are
both separate media types. To do this, the offerer creates a new
media description, with a new media type, in place of the description
in the previous SDP which is to be changed.
If a party in a call wants to put the other party "on hold", i.e.,
request that it temporarily stops sending one or more unicast media
streams, a party offers the other an updated SDP.
RFC 2543 [10] specified that placing a user on hold was accomplished
by setting the connection address to 0.0.0.0. Its usage for putting
a call on hold is no longer recommended, since it doesn’t allow for
RTCP to be used with held streams, doesn’t work with IPv6, and breaks
with connection oriented media. However, it can be useful in an
initial offer when the offerer knows it wants to use a particular set
of media streams and formats, but doesn’t know the addresses and
ports at the time of the offer. Of course, when used, the port
number MUST NOT be zero, which would specify that the stream has been
disabled. An agent MUST be capable of receiving SDP with a
connection address of 0.0.0.0, in which case it means that neither
RTP nor RTCP should be sent to the peer.
9 Indicating Capabilities
The transport component of the "m=" line indicates the transport for
that media type. For each media format of that type supported by the
agent, there SHOULD be a media format listed in the "m=" line. In
the case of RTP, if dynamic payload types are used, an rtpmap
v=0
o=carol 28908764872 28908764872 IN IP4 100.3.6.6
s=-
t=0 0
c=IN IP4 192.0.2.4
m=audio 0 RTP/AVP 0 1 3
a=rtpmap:0 PCMU/8000
a=rtpmap:1 1016/8000
a=rtpmap:3 GSM/8000
m=video 0 RTP/AVP 31 34
a=rtpmap:31 H261/90000
a=rtpmap:34 H263/90000
The SDP of Figure 1 indicates that the agent can support three audio
codecs (PCMU, 1016, and GSM) and two video codecs (H.261 and H.263).
Assume that the caller, Alice, has included the following description
in her offer. It includes a bidirectional audio stream and two
bidirectional video streams, using H.261 (payload type 31) and MPEG
(payload type 32). The offered SDP is:
v=0
o=alice 2890844526 2890844526 IN IP4 host.anywhere.com
s=
c=IN IP4 host.anywhere.com
t=0 0
m=audio 49170 RTP/AVP 0
a=rtpmap:0 PCMU/8000
m=video 51372 RTP/AVP 31
a=rtpmap:31 H261/90000
m=video 53000 RTP/AVP 32
a=rtpmap:32 MPV/90000
The callee, Bob, does not want to receive or send the first video
stream, so he returns the SDP below as the answer:
v=0
o=bob 2890844730 2890844730 IN IP4 host.example.com
s=
c=IN IP4 host.example.com
t=0 0
m=audio 49920 RTP/AVP 0
a=rtpmap:0 PCMU/8000
m=video 0 RTP/AVP 31
m=video 53000 RTP/AVP 32
a=rtpmap:32 MPV/90000
At some point later, Bob decides to change the port where he will
receive the audio stream (from 49920 to 65422), and at the same time,
add an additional audio stream as receive only, using the RTP payload
format for events [9]. Bob offers the following SDP in the offer:
v=0
o=bob 2890844730 2890844731 IN IP4 host.example.com
s=
c=IN IP4 host.example.com
t=0 0
m=audio 65422 RTP/AVP 0
a=rtpmap:0 PCMU/8000
m=video 0 RTP/AVP 31
m=video 53000 RTP/AVP 32
a=rtpmap:32 MPV/90000
m=audio 51434 RTP/AVP 110
a=rtpmap:110 telephone-events/8000
a=recvonly
v=0
o=alice 2890844526 2890844527 IN IP4 host.anywhere.com
s=
c=IN IP4 host.anywhere.com
t=0 0
m=audio 49170 RTP/AVP 0
a=rtpmap:0 PCMU/8000
m=video 0 RTP/AVP 31
a=rtpmap:31 H261/90000
m=video 53000 RTP/AVP 32
a=rtpmap:32 MPV/90000
m=audio 53122 RTP/AVP 110
a=rtpmap:110 telephone-events/8000
a=sendonly
The initial offer from Alice to Bob indicates a single audio stream
with the three audio codecs that are available in the DSP. The
stream is marked as inactive, since media cannot be received until a
codec is locked down:
v=0
o=alice 2890844526 2890844526 IN IP4 host.anywhere.com
s=
c=IN IP4 host.anywhere.com
t=0 0
m=audio 62986 RTP/AVP 0 4 18
a=rtpmap:0 PCMU/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=inactive
Bob can support dynamic switching between PCMU and G.723. So, he
sends the following answer:
v=0
o=bob 2890844730 2890844731 IN IP4 host.example.com
s=
c=IN IP4 host.example.com
t=0 0
m=audio 54344 RTP/AVP 0 4
a=rtpmap:0 PCMU/8000
a=rtpmap:4 G723/8000
a=inactive
Alice can then select any one of these two codecs. So, she sends an
updated offer with a sendrecv stream:
v=0
o=alice 2890844526 2890844527 IN IP4 host.anywhere.com
s=
c=IN IP4 host.anywhere.com
t=0 0
m=audio 62986 RTP/AVP 4
a=rtpmap:4 G723/8000
a=sendrecv
v=0
o=bob 2890844730 2890844732 IN IP4 host.example.com
s=
c=IN IP4 host.example.com
t=0 0
m=audio 54344 RTP/AVP 4
a=rtpmap:4 G723/8000
a=sendrecv
11 Security Considerations
12 IANA Considerations
13 Acknowledgements
The authors would like to thank Allison Mankin, Rohan Mahy, Joerg
Ott, and Flemming Andreasen for their detailed comments.
14 Normative References
[2] Bradner, S., "Key Words for Use in RFCs to Indicate Requirement
Levels", BCP 14, RFC 2119, March 1997.
[5] Schulzrinne, H., "RTP Profile for Audio and Video Conferences
with Minimal Control", RFC 1890, January 1996.
15 Informative References
16 Authors’ Addresses
Jonathan Rosenberg
dynamicsoft
72 Eagle Rock Avenue
First Floor
East Hanover, NJ 07936
EMail: jdrosen@dynamicsoft.com
Henning Schulzrinne
Dept. of Computer Science
Columbia University
1214 Amsterdam Avenue
New York, NY 10027
USA
EMail: schulzrinne@cs.columbia.edu
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
Acknowledgement