Documente Academic
Documente Profesional
Documente Cultură
SIP
Instructor
Prof. Dr. Rod Fatoohi
Abstract
In this project we propose to perform in-depth analysis of the SIP, Session Initiation Protocol which is an
application layer control protocol. Voice over IP is a very upcoming technology widely used in
performing PC-PC, PC to PSTN and PSTN to PC calls due to usage of low bandwidth and integration of
voice with data. Most of the VOIP applications use SIP, as its signaling protocol in performing the basic
operations in a call establishment which are creation, management and termination of sessions between
hosts in any IP based network. A detailed study of the SIP functionality and its structure is performed
followed by the experimental analysis of the SIP protocol which is done by using the two most widely
used VOIP applications, Yahoo Messenger and Media Talk Ring. Test connections are set up between two
hosts using the above mentioned applications and the data packets are captured using the Wireshark tool
where the various SIP methods and messages are presented. Some of the test scenarios such as call setup,
call forwarding on no answer, call placed with a request URI where the user does not exist, user located at
another location, called party is busy, called party terminates the call are performed by setting up calls
between PC-PC and PC-PSTN users. SIP works in conjunction with another protocol called SDP, the
Session Description Protocol which is used to share the session information between the two hosts. A
detailed study of the SDP is also performed with respect to the RFCs and a detailed analysis is done and
verified.
Introduction
SIP is a TCP/IP based Application Layer control protocol which initiates, manages and terminates
multimedia sessions. SIP runs on TCP, UDP and is designed to be independent of the underlying transport
layer. It is a text based Protocol similar to the Hypertext Transfer Protocol. Participants can be invited to
already existing sessions using SIP. It developed by the SIP working group within the Internet engineering
Task Force (IETF) multimedia data and control architecture. It is used in conjunction with Session
Description Protocol (SDP) which is an IETF protocol.
SIP Architecture
SIP consists of two basic components: the SIP clients and SIP servers. The SIP clients are also knows as
User-AgentTeam Members:
clients (UAC) is an end system component to initiate a call or send SIP requests. The SIP
server also known as User Agent Server (UAS) is a network device that answers the call or responds to
the requests. SIP is a client-server Protocol.
SIP network consists of four
Lalitha different servers
Garudadri Proxy
SJSU Id: server, redirect
006196034 server, user agent server, and registrar
<lalithagarudadri@gmail.com>
server.
User Agent:
Varun Kalyan Anantharaman SJSU Id: 005889377 < varunkalyan@gmail.com>
It is an endpoint entity. It starts and ends the session by exchanging requests and response. It is a client who is starting a session between server
and client. This client is always a sender in sip server while server is a receiver. This client can be phone, fax or anything. According to
requirements the role of server and client can be interchanged in the single session.
Registrar:
In SIP registrar has the same functionality as Gate Keeper has in H.323. This register is working as a database center in SIP Server.
It has all the information like IP address and port address of all connected users. It is also updating its data base according to the
connection changes between server and client. It is performing an authentication function.
Proxy Server:
Proxy Servers execute call signaling on the behalf of the parties they serve. It is also performing an authentication function. Proxy Server stay in
the path of call routing. It receives SIP requests and routes them to the other users or other Proxy Servers. Server do it based on the
routing data base and routing rules. Proxy Server can stay in the path of call.
Redirect Server:
Redirect Server determine the current location of the called party and gave its address to the calling party . Then calling party can do
direct contact of called party. It is basically used to point the location purpose. Redirect server is not staying in the path of call.
SIP Advantages
Start line: The start line consists of the request-line and status line. The request line specifies the
type of request and the status line gives the response for the request a success or a failure.
Zero or more headers: This field gives additional information like the message originator, message
recipient, retry-after header and subject header.
Message body: Consists of SDP which provides format for describing the session information
between the session participants.
INVITE: The SIP INVITE method is used to start a session or place a call. This method consists of
the following fields
• Request-line: Which shows the SIP method INVITE, request URI i.e., address of the
called party sip:kmgarudadri@68.142.233.158:5050 and SIP version transport=tcp sip/2.0
• Message Header: The message body consists of From, To, Call-ID, Cseq, User-Agent, Via,
Contact, Allow, Content type, and Content-length fields.
• Message Body: It consists of the SDP which provides format for describing the session
information like session name, session originator, media type etc between the session
participants.
CANCEL: This method is used to terminate a session for which an INVITE method is sent but a
final response is not received. The Content-length field is zero as observed from the captures as
there is no message body.
BYE: This method is used to terminate the session. It can be initiated by the calling or the called
party. The Content-Length filed is set to zero as there is no message body.
OPTIONS: This method can be used to find the features like type of media supported by the called
party by enquiring the server.
REGISTER: This method is used by the user agent client to let the register server know where it is
located so that it can be contacted. The UAC registers its address with the SIP server for this
purpose. It can be observed that To and the From fields are the same as the user is registering
himself. The Register messages for one user should use the same call ID. The content length is set
to 0 as there is no message body. The Expires field is set to 3600sec indicating the duration for
which the registration is valid.
NOTIFY: When the events occur the client is informed using the NOTIFY method for the events it
subscribed to. It can be observed from the capture that the Event field is set to ‘billing’ to the
corresponding SUBSCRIBE request.
INFO: This method is used to communicate the mid-session signaling information by carrying
the session-related control information. This method does not changes the state of SIP calls and
the state of sessions initiated by SIP. It is used to provide more information which can enhance
the applications using SIP.
• ADDRESS INCOMPLETE 484: Indicates that a request is received by the server with an
incomplete Request-URI
• REQUEST TERMINATED 487: This response is sent when the request is terminated by a
CANCEL or BYE request.
SIP Scenarios
1. Simple Call flow
➢ Call Initiation
This scenario is used to show the basic function of exchange of SIP messages used to initiate a
session. To study the exchange of messages a call is setup between two clients using SIP Yahoo
Messenger VoIP application. A call is placed between the two clients using SIP identity i.e..,
SIP URI which is Uniform Resource Identifier. The exchange of the SIP messages between the
two clients is shown in the figure below.
Timeline Capture: Showing the exchange of SIP messages for establishing a call
The SIP URI is similar to an Email address which consists of a username and host name or
Username and Phone. It can be observed from the capture that SIP URI in this scenario is
sip:garudadrikrishnamurthy@68.142.233.115:443 where 68.142.233.115:443 is the domain of the
called party SIP service provider.
It can be observed from the To and From field that the proxy server for both the calling
and called party is the same.
• TYRING message: When the INVITE message is received by the proxy server
(68.142.233.155) it acts on behalf of the called party and sends a TYRING(100) response back
to the calling party.
• RINGING message: When the INVITE message is received by the called party the called
party is alerted to the incoming call and if the called party decides to receive the call a 180
ringing response is sent back to the calling party.
Capture: Ringing Message
• OK message: When the called party receives the call 200 OK response is sent by the called
party indicating that the call is answered. This response contains a message body with the SDP
media description which indicates the type of session the called party is ready to establish with
the calling party.
Capture: OK message
• ACK message: An Ack message is sent by the calling party to the called party to confirm the
reception of the final response.
Capture: Session Description Message send from calling party to called party
Capture: Session Description Message send from called party to calling party
➢ Call termination:
The capture below shows the exchange of SIP messages when a party wishes to terminate a call.
• BYE message: One of the parties generates a BYE message when it is decided to terminate the
call. In this scenario the calling party generates a BYE message.
Capture: BYE message
• OK message: The called party sends a 200 OK message to confirm receipt of the BYE
message which terminates the session.
Capture: OK message
2. Call hold
In this scenario a call is placed is placed to one client using Yahoo Messenger and the call is
placed on hold and another call is made to second client. The second call is terminated and the
first call is resumed back. Finally the first call is terminated. The Exchange of SIP packets is
shown in the capture below.
3. Call Forwarding on No Answer: - 181 response
This capture is obtained when a call is placed between two Yahoo Messenger SIP clients and the called
party does not receive the call. The call is being forwarded to an automatic voice message system.
Capture: Showing the exchange of SIP messages
The timeline graph below shows the exchange of SIP messages for the call set up. The call establishment
process is the same as explained in the first scenario. When a ringing 180 message is sent from the called
to the calling party it is up to the called party to answer the call or ignore the call. When the called party
does not receive the call a 181 message is sent from the called to the calling party.
Capture: Showing the exchange of SIP messages when the called party does not
receive the call (181 call is being forwarded message).
4. Call placed to an Invalid number
The following capture is obtained when a call is placed to an invalid number a Call Forbidden 403
response is sent back to the calling party indicating that it’s an invalid number.
The capture below is obtained by placing a call from Yahoo Messenger which does not have a phone
out service. When the user tires to place the call a Forbidden 403 message is also sent by the server
indicating that Subscription is required.
5. Call placed with a Request-URI where the user does not exist.
The following capture is obtained by placing a call using MediaRing talk to a number which does not
match with any of the domains that the recipient of the request handles. A Not Found 404 response is
sent back to the calling party indicating that the user does not exist at the domain specified in the
Request URI.
Capture: Showing the exchange of SIP messages when the called party is available at another
location (480 Temporarily Unavailable).
7. Call Placed with Request – URI that does not match transaction
When a call is placed from Yahoo Messenger with an ID that does not have the phone out service with a
number that doesnot match any transaction or match any existing numbers the server sends back Call
Leg/Transaction does not exist to the calling party. The response can be observed from the capture below.
Capture: Call Leg/ Transaction Does not Exist
Capture: Showing the exchange of SIP messages when the number does not match any transaction
(481 Call Leg/ Transaction Does not Exist).
Capture: Showing the exchange of SIP messages when the called party busy (486 Busy
Here).
Capture: Showing the exchange of SIP messages when server receives invalid response
from downstream server (502 Bad Gateway).
Capture: Showing the exchange of SIP messages when the server is Temporarily Unavailable (503
Service Unavailable).
When the server does not receive a timely response when it tries to process the request from an
external server a Server Time-out 504 response is sent back to the calling party as shown in the
capture below.
Capture: Showing the exchange of SIP messages when the Server does not receive a timely response
(504 Server Time-Out).
PSTN internetworking concept is described using a test scenario when a call is placed from Yahoo
message (SIP client) to a mobile phone (PSTN Network). The SIP network should be able to
communicate with the PSTN when a call is established between a SIP-based network and PSTN
using the signaling protocol used by the PSTN which is the SS7 protocol. For internetworking
between the SIP and the PSTN there is a Gateway entity in the network to provide the conversion
from circuit-switched media to packet-switched media.
When a call is placed from Phone out service provided by the Yahoo messenger to Mobile phone
connected to the PSTN switch the exchange of SIP messages takes place as shown in the captures
below. It can be observed that the SIP URL has the form of a telephone number which can be viewed
in the To field in the INVITE message. The INVITE message sent by the calling party to establish a
session is mapped to the IAM message of the calling party. The PSTN switch sends an ACM message
in response to the IAM which is mapped to the 183 (session – progress) response. The in-band
information which is contained in the SDP of the 183 response message is returned from the called
switch to the SIP caller. This enables a one way path from the Called to the Calling party. An ANM is
returned back which is mapped to the 200 (Ok) responses when the call is answered. An updated
Session description is sent in this response. An ACK message is sent from the calling to the called
party. Two way voice sessions is established. Any party can terminate the session by sending a Bye
message.
Capture: Invite message showing the SIP URL has the form of telephone number in the To field
At the end of the session a Notify message is sent back to the caller. The SDP in this message
contains the billing information: the cost if the call, the remaining balance etc which is shown in the
capture below.
Capture: Notify message showing the billing information at the end of the session