SDP – Session Description Protocol
It is used to describe multimedia sessions in a format understood by the participants over a network. Depending on this description, a party decides whether to join a conference or when or how to join a conference.
- The owner of a conference advertises it over the network by sending multicast messages which contain description of the session e.g. the name of the owner, the name of the session, the coding, the timing etc. Depending on these information, the recipients of the advertisement take a decision about participation in the session.
- SDP is generally contained in the body part of Session Initiation Protocol popularly called SIP.
- SDP is defined in RFC 2327. An SDP message is composed of a series of lines, called fields, whose names are abbreviated by a single lower-case letter, and are in a required order to simplify parsing.
Purpose of SDP
The purpose of SDP is to convey information about media streams in multimedia sessions to help participants join or gather info of a particular session.
- SDP is a short structured textual description.
- It conveys the name and purpose of the session, the media, protocols, codec formats, timing and transport information.
- A tentative participant checks these information and decides whether to join a session and how and when to join a session if it decides to do so.
- The format has entries in the form of <type> = <value>, where the <type> defines a unique session parameter and the <value> provides a specific value for that parameter.
- The general form of a SDP message is −
x = parameter1 parameter2 … parameterN
- The line begins with a single lower-case letter, for example, x. There are never any spaces between the letter and the =, and there is exactly one space between each parameter. Each field has a defined number of parameters.
Session Description Parameters
Session description (* denotes optional)
- v = (protocol version)
- o = (owner/creator and session identifier)
- s = (session name)
- i =* (session information)
- u =* (URI of description)
- e =* (email address)
- p =* (phone number)
- c =* (connection information – not required if included in all media)
- b =* (bandwidth information)
- z =* (time zone adjustments)
- k =* (encryption key)
- a =* (zero or more session attribute lines)
The v= field contains the SDP version number. Because the current version of SDP is 0, a valid SDP message will always begin with v = 0.
The o= field contains information about the originator of the session and session identifiers. This field is used to uniquely identify the session.
- The field contains −
- The username parameter contains the originator’s login or host.
- The session-id parameter is a Network Time Protocol (NTP) timestamp or a random number used to ensure uniqueness.
- The version is a numeric field that is increased for each change to the session, also recommended to be a NTP timestamp.
- The network-type is always IN for Internet. The address-type parameter is either IP4 or IP6 for IPv4 or IPv6 address either in dotted decimal form or a fully qualified host name.
Session Name and Information
The s= field contains a name for the session. It can contain any nonzero number of characters. The optional i= field contains information about the session. It can contain any number of characters.
The optional u= field contains a uniform resource indicator (URI) with more information about the session
E-Mail Address and Phone Number
The optional e= field contains an e-mail address of the host of the session. The optional p= field contains a phone number.
The c= field contains information about the media connection.
- The field contains −
- The network-type parameter is defined as IN for the Internet.
- The address-type is defined as IP4 for IPv4 addresses and IP6 for IPv6 addresses.
- The connection-address is the IP address or host that will be sending the media packets, which could be either multicast or unicast.
- If multicast, the connection-address field contains −
where ttl is the time-to-live value, and number-of-addresses indicates how many contiguous multicast addresses are included starting with the base-multicast address.
The optional b= field contains information about the bandwidth required. It is of the form −
b=modifier:bandwidth − value
Time, Repeat Times, and Time Zones
The t= field contains the start time and stop time of the session.
The optional r= field contains information about the repeat times that can be specified in either in NTP or in days (d), hours (h), or minutes (m).
The optional z= field contains information about the time zone offsets. This field is used if are occurring session spans a change from daylight savings to standard time, or vice versa.
The optional m= field contains information about the type of media session. The field contains −
m= media port transport format-list
- The media parameter is either audio, video, text, application, message, image, or control. The port parameter contains the port number.
- The transport parameter contains the transport protocol or the RTP profile used.
- The format-list contains more information about the media. Usually, it contains media payload types defined in RTP audio video profiles.
Example: m = audio 49430 RTP/AVP 0 6 8 99
One of these three codecs can be used for the audio media session. If the intention is to establish three audio channels, three separate media fields would be used.
The optional a= field contains attributes of the preceding media session. This field can be used to extend SDP to provide more information about the media. If not fully understood by a SDP user, the attribute field can be ignored. There can be one or more attribute fields for each media payload type listed in the media field.
Attributes in SDP can be either
- session level, or
- media level.
Session level means that the attribute is listed before the first media line in the SDP. If this is the case, the attribute applies to all the media lines below it.
Media level means it is listed after a media line. In this case, the attribute only applies to this particular media stream.
SDP can include both session level and media level attributes. If the same attribute appears as both, the media level attribute overrides the session level attribute for that particular media stream. Note that the connection data field can also be either session level or media level.
An SDP Example
Given below is an example session description, taken from RFC 2327 −
v = 0 o = mhandley2890844526 2890842807 IN IP4 220.127.116.11 s = SDP Seminar i = A Seminar on the session description protocol u = http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps e = firstname.lastname@example.org(Mark Handley) c = IN IP4 18.104.22.168/127 t = 2873397496 2873404696 a = recvonly m = audio 49170 RTP/AVP 0 m = video 51372 RTP/AVP 31 m = application 32416udp wb a = orient:portrait