
Session Initiation Protocol (SIP) is a standard designed by the Internet Engineering Task Force (IETF) to serve VoIP services. It’s an application layer protocol that can operate over UDP (User Datagram Protocol) or TCP (Transmission Control Protocol). SIP, currently at version 2, is defined in RFC 3261.
Simplicity and flexibility are the primary characteristics of SIP. However, despite its structural simplicity it can be used to establish any kind of session between end-systems (known as User Agents in SIP). SIP is responsible for session setup and tear down; supported sessions include:
Besides audio, sll supported sessions can contain video and data as well. SIP also provides the means for User Agents to negotiate session capabilities and decide about session behavior. Moreover, sophisticated services, such as UA portability and video conferencing can be well served by SIP.
The new version of SIP has much to offer:
Before getting into more details about SIP, lets take a look at the most important SIP terms:
SIP messages are text-based messages similar to HTTP. They consist of a Request line, various Header fields, and the body field (optional). The image below shows SIP’s general format.
SIP: general format
Starting line: SIP’s first line is called Request-Line in requests and Status-Line in responses. It consists of the method used along with the destination SIP URI. The following is an example of a SIP starting line:
Request-Line: INVITE sip:+4412254701@10.224.50.46:5060;user=phone SIP/2.0
Method: INVITE
Message Header fields: These fields contain useful information for efficiently routing SIP messages. They also include information about UA’s supported capabilities and sequencing of messages. A sample Header field block is provided below:
Via: SIP/2.0/UDP 10.176.22.24:5060;branch=z9hG4bK06224778770000019777. From: sip:+44133546022@anonymous.invalid;user=phone>;tag=46dfdde0-a545-0ab0141c To: <sip:+44122547012@anonymous.invalid:5060;user=phone> Call-ID: 46DFDDE0-00004139@routera CSeq: 1 INVITE Accept: application/sdp,application/isup,multipart/mixed,application/ Contact: <sip:10.176.22.24:5060> MIME-Version: 1.0 Supported: timer Supported: 100rel Max-Forwards: 70 Session-Expires: 1800 Allow: ACK,INFO,BYE,CANCEL,INVITE,OPTIONS,NOTIFY,PRACK,UPDATE Content-Type: application/sdp Content-Length: 360
Message Body: The body of the message may carry session descriptions (SDP). This part of the SIP message is used by UAs during negotiation and settlement of media related information like IP addresses, port numbers and codecs. A sample message body can be seen below:
Session Description Protocol Version (v): 0
Connection information (c): IN IP4 10.176.3.10
Time Description, active time (t): 0 0
Media Description, name and address (m): audio 5588 RTP/AVP 8 18
Media Attribute (a): rtpmap:8 PCMA/8000
Media Attribute (a): rtpmap:18 G729/8000
.
.
Media Attribute (a): sendrecv
Via: Consists of SIP version, transport protocol, SIP URI and branch code. Its purpose is to indicate the address that responses to a request should be forwarded. The branch parameter is used to identify the transaction. Example:
Via: SIP/2.0/UDP 10.176.22.24:5060;branch=z9hG4bK06224778770005001
From: Consists of the SIP URI of the originator of the request. It also contains a random generated tag for identification purposes. Example:
From: <sip:+44133546022@anonymous.invalid;user=phone>;
tag=46dfdde0-a545-0ab0141c
To: Contains the destination’s SIP URI. Example:
To: <sip:+44122547012@anonymous.invalid:5060;user=phone>
Call-ID: Is a unique reference, identifying a complete dialogue between SIP peers. Example:
Call-ID: 46DFDDE0-00004139@routera
CSeq: Contains an integer that counts the requests within a dialog and a method name. Example:
CSeq: 1 INVITE
Contact: Instructs SIP UAs where to send future requests. Example:
Contact: <sip:10.176.22.24:5060>
Supported:Optional header field used to specify SIP options that the sender supports. Example:
Supported: 100rel
Allow: Another optional header field listing all methods supported by the SIP UA that generated the message. Example:
Allow: ACK,INFO,BYE,CANCEL,INVITE,OPTIONS,NOTIFY,PRACK,UPDATE
Content-Type: Indicates the type of content within the body of the SIP message. Example:
Content-Type: application/sdp
Version (v=): Defines the SDP’s version (currently only v=0 exists)
Connection information (c=): Specifies the IP address where media is expected to arrive. Example:
Connection information (c): IN IP4 10.176.3.10
Media (m=): Indicates the type of media (e.g. audio, video), the RTP port for the media packets, transport protocol for the media and a list of supported payload formats (e.g. payload type number 8= G.711 a-law codec, number 18=G.729 codec). Example:
Media Description, name and address (m): audio 5588 RTP/AVP 8 18
Media attributes (a=): Can be either media (e.g. “rtpmap” is a media attribute describing payload types) or session attributes (e.g. “sendrecv” is a session attribute specifying media flow direction. Example:
Media Attribute (a): rtpmap:8 PCMA/8000 Media Attribute (a): rtpmap:18 G729/8000 Media Attribute (a): sendrecv
The image below presents a basic SIP Dialogue consisting of an INVITE and a BYE method.
Basic INVITE and BYE methods
The INVITE method is more like a 3-way handshake consisting of the INVITE request, the final response to the INVITE which is a 200 OK message, and an ACK transaction with no response. The BYE transaction consists of the BYE request and its response coming as a 200 OK message.
Not convinced SIP is right for you? There are other options, however SIP is the preffered choice for telecom companies for Broadband VoIP service session control, and its usage is growing more and more each day. My prediction is that SIP will eventually dominate call control protocols, so start benefiting from all that SIP has to offer.
Learn how to setup a Cisco network with step-by-step instructions and prepare for the ONT exam. You get:
Get additional information and see the free demo here!
Copyright © Train Signal Inc. All Rights Reserved.
Kit Athul Says:
November 28th, 2007 at 12:18 pm
Good write up. Thank you
VoIP, Led by SIP, Forges Ahead - Caller IP Says:
June 12th, 2008 at 2:21 pm
[...] This is a fairly technical description of SIP at Train Signal Training. The most valuable elements of the piece are a description of the benefits of “the new version of SIP” (no more information on what this means is provided) and a glossary of SIP terms. The new version of SIP, the writer says, is adaptable to network changes; scalable; text-based for easier programming; focuses intelligence in the end device; and easily adopts new services. [...]