VOIP
&
Session Initiation Protocol (SIP)
Pardeep Verma
09/29/16
Contents
What does VOIP
Mean?
Why VOIP?
VOIP Challenges.
VOIP
Implementations.
VOIP Protocols.
09/29/16
What is SIP?
SIP History.
SIP Architecture.
SIP Network Entities.
SIP Call Establishment.
SIP Message Syntax.
SIP Requests.
SIP Responses.
SIP Addressing.
SIP Message Headers.
Usage of SDP with SIP.
Features & Services by SIP.
Inter Working with PSTN.
2
What does VOIP Mean?
VOIP is simply the transport of VOICE
Traffic by using Internet Protocol.
Internet Protocol (IP) is the Un-reliable,
Packet Based Protocol.
To ensure that packets are delivered to
the destination, other protocols are
developed (TCP) to operate in conjunction
with IP.
IP is originally designed for Data Transfer
& not for Voice Transfer.
09/29/16
Why VOIP?
Why Carry VOICE?
Why use IP for VOICE?
09/29/16
Why VOIP?Why Carry Voice?
Why carry voice?
Because VOICE is a big business.
Tremendous growth of Internet lead
to creation of companies (Dot COM)
that are capitalizing on these
opportunities.
09/29/16
Why VOIP?Why Carry Voice?
Revenue generated by these are
miniscule compared to that by
telephone companies
eg(for FY 1999):Company
Revenue
Income
[Link] $1.6 b
Yahoo $5.8 b
$61.1 m
Bell Atlantic $33 b
$470 m
09/29/16
Why VOIP?Why IP for Voice?
Many reasons for it:Lower equipment cost.
In Ckt switching:Equipments are proprietary.
Equipment up-gradation cost & effort
involved is huge.
Whereas in IP Telephony:Most of the hardware is standard
computer components & are mass
produced.
09/29/16
Why VOIP?Why IP for Voice?
Integration of Voice & data applications.
Combination of Voice & Data can
give
some advanced features.
eg:Price negotiation during Shop-Online.
Assistance from Customer-Service
representative during a transaction
& many more
09/29/16
Why VOIP?Why IP for Voice?
Lower bandwidth requirement.
Bandwidth saving saves carriers Initial
Investment & Operational Cost.
Ckt-Switched telephone N/Ws use G.711
Codec (64kbs).
Other Codecs are available which enable
speech to be transmitted at
32kbps,16kbps, 8kbps, 6.3kbps &
5.3kbps.
Cont
09/29/16
Why VOIP?Why IP for Voice?
Lower bandwidth requirement (Cont.)
To take advantage of Low-Bandwidth
Codecs these should be implemented in
every telephone Switch in the world.
Two ends in the N/W should be capable
to negotiate the coding scheme to use.
Cont
09/29/16
10
Why VOIP?Why IP for Voice?
Lower bandwidth requirement (Cont..)
and If different Codec at destination
then call should be passed through
some inter-working device.
None of these capabilities are
supported in traditional telephony.
09/29/16
11
Why VOIP?Why IP for Voice?
Lower bandwidth requirement.
VOIP standards enable the two
ends of a call to negotiate which
coding
scheme to use.
Thus VOIP is in position to
significantly reduce the bandwidth
to as little as one-eighth of what
is used in Ckt-Switching.
09/29/16
12
Why VOIP?Why IP for Voice
Widespread availability of IP.
VOIP is not the only Packet based solution.
Other Options are Voice Over Frame Relay
(VoFR) & Voice Over ATM(VoATM).
But IP is practically everywhere-In PCs,
LANs, WANs, Dial up N/Wing etc..
This gives IP upper hand than other
options.
09/29/16
13
VOIP Challenges
Reliability
As an alternative to Ckt Switching,
reliability of VOIP should be same as
of Ckt Switching i.e Five 9s (99.999) .
Voice Quality
Speech must be of Toll Quality (With
MOS between 4-Good & 5-Excellent)
09/29/16
14
VOIP Implementations
IP-Based PBX.
IP Voice Mail.
Hosted PBX-Solutions.
IP Call Centers.
09/29/16
15
VOIP Protocols
SIGNALING
SIP/SDP (IETF), H.323 (ITU-T)
MEDIA
RTP (IETFs adopted by ITU-T)
TRANSPORT
UDP,TCP, SCTP (Stream Control Transport
Protocol)
09/29/16
16
VOIP Protocols.
SUPPORTING PROTOCOLS
DNS
Domain Name Service
TRIP
(Telephone Routing over IP
Discovery & Exchange of IP
routing tables
between providers)
RSVP
COPS
telephony gateway
Resource reservation setup Protocol
Common open policy serviceprotocol for supporting policy
control over QOS.
DIAMETER -
Authentication, Accounting &
Authorization.
09/29/16
17
Session Initiation Protocol
SIP
09/29/16
18
What is SIP?
SIP is IETFs Signaling Protocol that
handles the Setup, Modification &
Teardown of multimedia sessions.
SIP is an
Internet proposed standard
documented in RFC 2543.
SIP is an application layer control protocol
that can establish, modify and terminate
multimedia sessions or calls.
09/29/16
19
What is SIP?..
SIP sessions may involve one or more
participants and can use unicast or
multicast communication.
Each session may include different
types of data such as audio and video.
The multimedia sessions include
multimedia conferences, distance
learning, Internet telephony and
similar applications.
09/29/16
20
What is SIP?..
SIP message format is based on the
Hyper Text Transport Protocol (HTTP)
message format, which uses a humanreadable, text-based encoding.
SIP is transport-layer independent
protocol i.e. it can be used with any
datagram or stream protocol like UDP,
TCP, SCTP, ATM etc.
09/29/16
21
What is SIP?..
It uses the session description
protocol (SDP) for media
negotiations.
SIP is also the the most preferred
protocol choice for communication
between MGCs (Call Agents).
09/29/16
22
Call Signaling
Over IP
MGC
MGC
SIP or H.323
Control &
Status
Signaling
MG
MG
MGCP or MEGACO
Media Over
IP
Control &
Status
Signaling
MG
MG
MGC
SIP User Agent
SIP or
H.323
PSTN Switch
PSTN
Signaling
MGCP or
MEGACO
Media over
IP
Speech
SIP History
Work began in 1995 in IETF mmusic WG.
02/1996 : draft-ietf-mmusic-sip-00, 15
ASCII
pages, One request Type.
12/1996 : draft-01, 30 ASCII pages, Two
request Types.
01/1999 : draft-12, 149 ASCII pages, Six
request Types.
03/1999 : Rfc-2543, 153 ASCII pages,
Six
methods.
09/29/16
25
SIP History
11/1999
: SIP-WG formed.
11/2000
: draft-ietf-siprfc2543bis- 02, 6 Methods
05/2001
: draft-03, 6 Methods.
07/2001
: draft-04, 6 Methods.
09/29/16
26
SIP Architecture
SIP is Text Based Protocol using ISO
10646 in UTF-8 encoding.
SIP is Lower Layer Independent
Protocol.
In a SIP controlled Call, Media can
use any transport Protocol.
09/29/16
27
SIP Architecture
SIP
Signaling
Media Stream (RTP)
SIP USER
SIP USER
Separation of Signaling & media
09/29/16
28
SIP Network Entities
SIP defines two basic classes of
Network Entities: Clients &
Servers.
SIP a Client-Server Protocol
09/29/16
29
SIP N/W EntitiesSIP Clients
SIP Client is also known as User
Agent Client.
It is an Application Program that
sends SIP-Requests & receive
Response for that Request.
09/29/16
30
SIP N/W EntitiesSIP Servers
Server is an application program
that accept requests in order to
Service Requests and sends back
responses to those requests.
Servers are
User Agent Server
Registrar Server.
Proxy Server
Redirect Server
09/29/16
31
SIP N/W EntitiesRegistrar Server
A SIP Registrar server receives
registrations from clients regarding
current locations.
The Registrar stores the registration
information in a location Server via a
non-SIP protocol.
Once the information is stored, the
Registrar sends the appropriate
response back to the Client.
09/29/16
32
A SIP Registration
Location Server
1) REGISTER sip:[Link] SIP/2.0
FROM: sip:aish@[Link]
2) aish@[Link] TO: sip:aish@[Link]
Contact:sip:[Link]
Expires:36000
3) SIP/2.0 200 OK
SIP REGISTRAR ([Link])
09/29/16
User Agent
33
SIP N/W EntitiesProxy Server
Perform routing function i.e,
determine to which hop
(UA/Proxy/Redirect) signaling should
be relayed.
Allow the routing functions to be
programmable e.g Firewall Control.
Forking: Several destinations may be
tried for a request sequentially or in
parallel.
09/29/16
34
SIP Operation in Proxy Mode
Location Server
3) aish@[Link]
1)
INVITE sip:aish@[Link] SIP/2.0
FROM: sip:abc@[Link] 2) aish
TO: sip:aish@[Link]
4) INVITE sip:aish@[Link] SIP/2.0
FROM: sip:abc@[Link]
TO: sip:aish@[Link]
6) SIP/2.0 200 OK
7) ACK
09/29/16
5) SIP/2.0 200 OK
PROXY
8) Media Streams
35
SIP N/W EntitiesProxy Server
Proxy Server can be either STATELESS
or STATEFUL.
STATELESS PROXY does not maintain
any states for a SIP Transaction.
STATEFUL PROXY maintains state for a
SIP Transaction & forgets afterwards.
09/29/16
36
SIP N/W EntitiesRedirect Server
The SIP redirect server on receiving
requests from client determines the nexthop server.
Returns the address of the next-hop
server to the client instead of forwarding
the request.
Redirection is useful if an user moves or
changes his service provider.
Redirect Server returns the current
address of a User.
09/29/16
37
SIP Operation in Redirect Mode
Location Server
2)
aish@work
3) aish@home
1) INVITE aish@work
4) 302 gone home
Contact: aish@home
5) ACK
6) INVITE aish@home
8) ACK
7) 200 OK
SIP Call Establishment
INVITE
RINGING
OK
ACK
SIP USER
Conversation
SIP USER
BYE
OK
09/29/16
39
SIP Message Syntax
A SIP Message Can be
either
A REQUEST from Client to Server
or
A RESPONSE from Server to
Client
09/29/16
40
SIP Message Syntax..ABNF
Message = Start Line
*Message-Headers
CRLF
[Message Body]
Start Line = Request | Response
09/29/16
41
SIP Message REQUEST
SIP REQUEST specifies the type of
Request.
e.g: INVITE, BYE etc
INVITE
BYE
SIP USER
09/29/16
SIP USER
42
SIP Message RESPONSE
SIP RESPONSE specifies the outcome
of the REQUEST.
e.g: RINGING, OK, Called UA Busy
etc.
RINGING
OK
SIP USER
09/29/16
UA Busy
SIP USER
43
SIP Message Message Headers
Message Headers provide the additional
information regarding the REQUEST or
RESPONSE.
e.g: FROM
- Who is caller.
TO
- Who is callee.
SUBJECT - Purpose of Call.
Retry-After - When a REQUEST should
be
attempted again.
09/29/16
44
SIP Message Message Body
Message Body describes the type of
session to be established including
media to be exchanged (e.g G.711).
SIP does not define the structure or
content of the Message Body.
Session Description Protocol (SDP-RFC
2327) defines the most common
structure of Message Body.
09/29/16
45
SIP Message Message Body
Message Body can also contain
ISUP information in binary format.
SIP does not care about what the
Message Body happens to say.
SIP is concerned only with making
sure that Message Body is carried
from one party to another.
09/29/16
46
SIP REQUESTS
Syntax of a SIP REQUEST is
METHOD SP REQUEST-URI SP SIP-VERSION
METHOD tells purpose of the REQUEST.
REQUEST-URI tells the Address of Callee.
SIP-VERSION tells the version of SIP.
e.g INVITE sip:aish@[Link] SIP/2.0
09/29/16
47
SIP REQUESTSMETHODS
RFC-2543 defines SIX Methods (i.e SIX
different Requests)
INVITE Initiates Sessions.
ACK
Confirm Session Establishment
BYE
Terminates a Session
CANCEL Cancel a pending INVITE
OPTIONSCapability Enquiry of the Server
REGISTER- Bind a permanent address to
current location
09/29/16
48
SIP REQUESTSMETHODS
SIP Extensions Define following Methods.
INFO
Mid Call Information
(RFC 2976)
COMET Pre Condition Met
(draft-ietf-sip-manyfolks-resource)
PRACK Acknowledgement of reliable
provision responses
(draft-ietf-sip-100rel)
SUBSCRIBE/ - Instant Messaging
NOTIFY/
(draft-rosenberg-impp-*)
MESSAGE
09/29/16
49
SIP METHODSINVITE
INVITE Method Initiates a Session.
INVITE is akin to the IAM in ISUP.
INVITE can be used to initiates a
simple two party or a multi-party
conference call.
09/29/16
50
SIP METHODSINVITE
The negotiation of the parameters of the
session such as port which will receive
the media stream or which Codec will be
used is carried out using this method.
In the middle of a call, it is also possible
to change the current parameters of the
media stream sending a new INVITE
request.
09/29/16
51
SIP METHODSINVITE
An UAS will respond to INVITE with
one or more Provisional
responses(like Call in Progress &
Ringing in PSTN) and a FINAL
responses (like
ANM in PSTN).
INVITE
Ringing
SIP USER
09/29/16
Final Response
SIP USER
52
SIP METHODSACK
ACK is used only with INVITE
Requests.
Caller sends ACK to confirms that
Final Response to INVITE has been
received.
INVITE
Final response
can be OK, Called
UA Busy etc. Final Response
SIP USER
09/29/16
ACK
SIP USER
53
SIP METHODSBYE
BYE Method terminates a session.
BYE Method is used when a party in a
session hangs up.
BYE is akin to REL in ISUP.
BYE Method can be used by either by
calling party or called party
09/29/16
54
BYE example
INVITE
RINGING
OK
ACK
SIP USER
Conversation
SIP USER
BYE
OK
09/29/16
55
SIP METHODSOPTIONS
With OPTIONS Method caller can
determine the capabilities of
Called party.
The recipient of the OPTION
request responds with the
capabilities supported.
09/29/16
56
OPTIONS Example
OPTIONS sip:UAS@[Link] SIP/2.0
From : UAC@[Link]
To: UAS@[Link]
Accept: Application/sdp
Call-ID:123@[Link]
Cseq: 1 OPTIONS
Content-Length:0
UAC
SIP/2.0 200 OK
From : UAC@[Link]
To: UAS@[Link]
Accept: Application/sdp
Call-ID:123@[Link]
Cseq: 1 OPTIONS
Content-Length:0
v=0
o = uas 45678 001 IN IP4 [Link]
s= session
c=IN IP4 [Link]
t=0 0
m=audio 0 RTP/AVP 0 3
UAS
SIP METHODSCANCEL
Terminates a pending request or the
search for a user.
CANCEL does not affect a completed
request or existing calls.
The CANCEL method is also used to
terminate parallel searches in case of a
Forking Proxy.
09/29/16
58
SIP METHODSREGISTER
A UAC uses the REGISTER to log in &
register its address with a SIP-Server.
A UAC can register with multiple
servers by using a multicast address
([Link]).
A client can have multiple registrations
at the same Registrar Server (One
Number Service)
09/29/16
59
Multiple Registrations..One Number Service
User at addr A
Registrar/Proxy
User at addr B
REGISTER (Address-A)
Caller-Aish
OK (for address A)
REGISTER(Addr B)
OK (for address B)
INVITE
INVITE
INVITE
OK
OK for INVITE
CANCEL
ACK
ACK
09/29/16
60
SIP RESPONSES
There are SIX types of SIP-RESPONSES.
1XX
Informational
100 - Trying
180 - Ringing
2XX
Final
200 - OK
3XX
Redirection
300 Multiple Choices
301 - Moved Temporarily
09/29/16
61
SIP RESPONSES
4XX - Client Error
400 Bad Request
401 - Unauthorized
5XX - Server Error
500 Internal Server Error
6XX - Global Failure
600 Busy Everywhere
09/29/16
62
SIP-Addressing
SIP gives a Globally reachable address.
UA bind to this address by REGISTER
Method.
Callers use this address to establish real
time communication with Callees.
SIP Addresses are known as SIP-URLs.
SIP-Addresses take the form of user@host.
09/29/16
63
SIP-Addressing.
SIP URL has the syntax
sip:user@host
eg:
sip:aish@[Link]
Address Space is unlimited.
09/29/16
64
SIP-Message Headers
Message Headers are included in a
Request or response to give further
information or to enable appropriate
handling of the Message.
for eg: FROM-Indicates Calling Party.
TO
-Indicates Called Party
09/29/16
65
Message [Link]
There are Four Categories of
Message headers.
General Headers
Request Headers
Response Headers
Entity Headers
09/29/16
66
[Link] Headers
General Headers can be used
within both Requests & Responses.
There are total of 19 Headers in
this category (sip-draft-02).
eg:- FROM, TO, Call-Id, Contact.
09/29/16
67
Headers. Request Headers
Request Headers are used only in SIPRequests to provide additional
information about the Request.
There are total of 10 Headers in this
category (sip-draft-02).
eg:Subject : Provides Textual Description
of the
Topic of Call.
Priority : Used to indicate urgency of
request.
09/29/16
68
Headers. Response Headers
Response Headers are used only in SIPResponses to provide further
information about the Response.
There are total of 7 Headers in this
category (sip-draft-02).
eg: Retry-After : To indicate when a called
user will be available.
09/29/16
69
Headers. Entity Headers
Entity Headers are used to indicate
the type & format of the information
in Message Body so that
appropriate application can be
called upon.
There are total of 7 headers in this
category (sip-draft-02).
09/29/16
70
Headers. Entity Headers
eg:
Content-length specifies the length of
Message Body in octets.
Content Type specifies the media type
of the Message Body.
Content-Encoding indicates coding
applied to Message Body.
09/29/16
71
Usage of SDP With SIP
SIP Message Body contains information
about the Media to be exchanged such as
RTP Payload, Addresses & Ports.
SIP uses Session Description Protocol (SDP)
to carry all this information in Message
Body.
Usage of SDP within SIP follows an Offeranswer [Link] side OFFER the SDP
& other side ANSWER the SDP.
09/29/16
72
Offer-Answer Model
MODEL-1
INVITE with SDP
MODEL-2
INVITE without SDP
200 with SDP
200 with SDP
ACK without SDP
ACK with SDP
Usage of SDP With SIP
SIP & SDP is a wonderful
combination for transmission of
session information & Media
Negotiation.
SIP Messaging mechanism for
establishment of a multimedia
session.
SDP Describes those Sessions.
09/29/16
74
Usage of SDP With SIP
At any point during a call, either
participant may issue a re-INVITE
to modify characteristics of the
session.
Can add new streams.
Can remove existing streams.
Can change parameters of existing
streams.
09/29/16
75
Removal of a Media Stream
OFFER
v=0
o=alice 2890844526
2890844526 IN IP4
[Link]
s=New board design
e=alice@[Link]
t=0 0
c=IN IP4
[Link]
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
ANSWER
v=0
o=bob 2890844730
2890844730 IN IP4
[Link]
s=New board design
e=bob@[Link]
t=0 0
c=IN IP4
[Link]
m=audio 47920 RTP/AVP
0 1 a=rtpmap:0
PCMU/8000
m=video 0 RTP/AVP 31
m=video 53000 RTP/AVP
32 a=rtpmap:32
MPV/90000
Addition of a Media Stream
v=0
o=bob 2890844730
2890844730 IN IP4
[Link]
s=New board design
e=bob@[Link]
t=0 0
c=IN IP4
[Link]
m=audio 47920 RTP/AVP 0
1
a=rtpmap:0 PCMU/8000
m=video 0 RTP/AVP 31
m=video 53000 RTP/AVP
32
a=rtpmap:32 MPV/90000
v=0
o=bob 2890844730
2890844731 IN IP4
[Link]
s=New board design
e=bob@[Link]
t=0 0
c=IN IP4 [Link]
m=audio 6400 RTP/AVP 0 1
a=rtpmap:0 PCMU/8000
m=video 0 RTP/AVP 31
m=video 53000 RTP/AVP 32
a=rtpmap:32 MPV/90000
m=audio 8864 RTP/AVP 110
a=rtpmap:110 telephoneevents
a=recvonly
Media Negotiation in SIP
INVITE sip:B SIP/2.0
v=0
o =A 45678 001 IN IP4 [Link]
s= session
c=IN IP4 [Link]
t=0 0
m=audio 4444 RTP/AVP 2 4 15
a=rtpmap 2 G726/8000
a=rtpmap 4 G723/8000
a=rtpmap 15 G728/8000
SIP/2.0 200 OK
v=0
o = B 45678 001 IN IP4 [Link]
s= session
c=IN IP4 [Link]
t=0 0
m=audio 0 RTP/AVP 15
a=rtpmap 15 G728/8000
Use of OPTION for Media Negotiation
OPTIONS sip:UAS@[Link] SIP/2.0
From : UAC@[Link]
To: UAS@[Link]
Accept: Application/sdp
Call-ID:123@[Link]
Cseq: 1 OPTIONS
Content-Length:0
UAC
SIP/2.0 200 OK
From : UAC@[Link]
To: UAS@[Link]
Accept: Application/sdp
Call-ID:123@[Link]
Cseq: 1 OPTIONS
Content-Length:0
v=0
o = uas 45678 001 IN IP4 [Link]
s= session
c=IN IP4 [Link]
t=0 0
m=audio 0 RTP/AVP 0 3
UAS
G.711 mu-law(0)
GSM (3)
Auto Call Back Example
SIP User Agent
SIP User Agent
1 INVITE
2 486 Busy Here
The called party is
busy so call fails.
3 ACK
4 SUBSCRIBE
5 200 OK
Caller requests
notification when
called party is no
longer busy.
6 NOTIFY
7 200 OK
Called party sends
notification
8 INVITE
9 200 OK
10 ACK
Media Session
Caller calls back and
successfully
establishes session.
Call Forwarding
User 1
User 2
[Link]
INVITE sip:User2@[Link]
TO: sip:User2@[Link]
INVITE sip:User2@[Link]
TO: sip:User2@[Link]
SIP 2.0 100 Trying
SIP 2.0 486 Busy
INVITE sip:User3@[Link]
TO: sip:User2@[Link]
SIP 2.0 200 OK
ACK
SIP 2.0 200 OK
User 3
Inter Working with PSTN
09/29/16
82
To Route Calls between SIP & PSTN it is
required to:1. Address PSTN destinations from SIP.
both PSTN number & Destination Domain known
eg: sip:+1-212-5555-555@[Link];user=phone
Route Call to Gateway Directly.
Only PSTN number is known then Ask Proxy.
2. Address SIP Destinations from PSTN.
SIP Devices uses E.164 numbering.
PSTN Routes calls to Gateways.
Gateway translate Numbers into SIP-URL using
ENUM.
& Continue
09/29/16
83
IP-Telephony
Tier 1: [Link]"
SIP URL
H323 URL
Tier 2: NAPTR records
Internet
IP-System
(H323 Gatekeeper)
(IP-PBX)
(SIP Proxy)
Outbound
Gateway
Inbound
Gateway
PSTN &
Mobile
Internet
Devices
PSTN
Devices
Call Flow SIP to PSTN
Sip Caller
PSTN Gateway
INVITE sip:+1212333122@[Link]
183 Call in Progress
PSTN Switch
IAM
ACM
PSTN Phone
Ringing Voltage
PRACK
200 OK for PRACK
RTP packets
Ring Back Tone
Answer (off hook)
ANM
200 for INVITE
ACK
RTP packets
PCM Speech
Analog Speech
INFO
Digits
DTMF Digits
200 for INFO
BYE
200 for BYE
REL
RLC
Hang Up