1
SIP Fundamentals
Chandra Prakash Singh
2
Outline
• What is SIP
• SIP system components
• SIP messages and responses
• SIP call flows
• SDP basics/CODECs
• Questions and answers
3
What’s SIP
• IETF Standard defined by RFC 3261
• “The Session Initiation Protocol (SIP) is an application-layer
control (signaling) protocol for creating, modifying and
terminating sessions with one or more participants.”
• Can be used for voice, video, instant messaging, gaming,
etc., etc., etc.
• Uses URIs for addressing – single communications identity
– mailto:chandra@plivo.com for email
– xmpp:29889_zentrunk@conf.hipchat.com for instant messaging
– sip:919980950111@zt.plivo.com for voice and video
• Username replaced by numbers for telephone applications
4
Where’s SIP
Application
Transport
Network
Physical/Data Link Ethernet
IP
TCP UDP
RTSP SIP
SDP codecs
RTP DNS(SRV)
5
SIP Components
• User Agents
– Clients – Make requests
– Servers – Accept requests
• Server types
– Redirect Server
– Proxy Server
– Registrar Server
– Location Server
• Gateways
6
Terminating
User Agent
Originating
User Agent RTP
SIP SIP
B2BUA
SIP Peer to Peer !
Back-to-Back User Agent
Terminating
User Agent
Originating
User Agent
SIP
RTP
7
SIP Methods
• INVITE Requests a session
• ACK Final response to the INVITE
• OPTIONS Ask for server capabilities
• CANCEL Cancels a pending request
• BYE Terminates a session
• REGISTER Sends user’s address to server
8
SIP Responses
• 1XX Provisional 100 Trying
• 2XX Successful 200 OK
• 3XX Redirection 302 Moved Temporarily
• 4XX Client Error 404 Not Found
• 5XX Server Error 504 Server Time-out
• 6XX Global Failure 603 Decline
9
SIP Flows - Basic
ACK
200 - OK
INVITE: sip:18.10.0.79
“Calls”
18.18.2.4
180 - Ringing Rings
200 - OK Answers
BYEHangs up
RTPTalking Talking
User
A
User
B
10
11
12
SIP INVITE
INVITE sip:919980950111@phone.plivo.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.120:5062;branch=z9hG4bK.GlI7ViTR3;rport
From: <sip:inbound170412123914@phone.plivo.com>;tag=mpP3lkImP
To: sip:919980950111@phone.plivo.com
CSeq: 21 INVITE
Call-ID: qf8DhB2sA0
Max-Forwards: 70
Supported: replaces, outbound
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 262
Contact: <sip:inbound170412123914@111.93.146.206:46219;transport=udp>;+sip.instance="<urn:uuid:51253a19-911f-4f24-a130-71a31e37f19d>"
User-Agent: Linphone/3.10.2 (belle-sip/1.5.0)
Proxy-Authorization: Digest realm="phone.plivo.com", nonce="W0X5jltF+GJsIaAdkgwQuhBG9MjKvaxz", username="inbound170412123914",
uri="sip:919980950111@phone.plivo.com", response="adeef6fff9bbebab570cfbbb32e85b29", cnonce="sWVndGo3ERdUNmXr", nc=00000001,
qop=auth
13
Session Description Protocol
• IETF RFC 2327
• “SDP is intended for describing multimedia sessions for the
purposes of session announcement, session invitation, and
other forms of multimedia session initiation.”
• SDP includes:
– The type of media (video, audio, etc.)
– The transport protocol (RTP/UDP/IP, H.320, etc.)
– The format of the media (H.264 video, MPEG video,
etc.)
– Information to receive those media (addresses, ports,
formats and so on)
14
SDP
v=0
o=inbound170412123914 886 3120 IN IP4 192.168.1.120
s=Talk
c=IN IP4 192.168.1.120
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7078 RTP/AVP 0 8 101
a=rtpmap:101 telephone-event/8000
a=rtcp-fb:* trr-int 5000
15
CODECs
• Audio
– G.711
• 8kHz sampling rate
• 64kbps
– G.729
• 8kHz sampling rate
• 8kbps
• Voice Activity Detection
• Video
– H.264
• MPEG-4
– H.263
16
SIP Flows - Registration
200 - OK
REGISTER: sip
401 - Unauthorized
User
B sipphone
Registrar
REGISTER: (add
credentials)
DB
Location
sip:chandra@pliv
o.com
Contact IP
17
SIP REGISTER
REGISTER sip:phone.plivo.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.120:5062;branch=z9hG4bK.yvX0~BYQ6;rport
From: <sip:inbound170412123914@phone.plivo.com>;tag=azPOuWU4j
To: sip:inbound170412123914@phone.plivo.com
CSeq: 20 REGISTER
Call-ID: O2NZOkRWpQ
Max-Forwards: 70
Supported: replaces, outbound
Accept: application/sdp
Accept: text/plain
Accept: application/vnd.gsma.rcs-ft-http+xml
Contact:
<sip:inbound170412123914@192.168.1.120:5062;transport=udp>;+sip.instance="<urn:uuid:51253
911f-4f24-a130-71a31e37f19d>"
Expires: 60
User-Agent: Linphone/3.10.2 (belle-sip/1.5.0)
18
SIP REGISTER – 401 Response
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
192.168.1.120:5062;branch=z9hG4bK.yvX0~BYQ6;rport=46219;received=111.93.146.206
From: <sip:inbound170412123914@phone.plivo.com>;tag=azPOuWU4j
To: sip:inbound170412123914@phone.plivo.com;tag=378adae1ddc71986618d85886edb3f8b.6ead
CSeq: 20 REGISTER
Call-ID: O2NZOkRWpQ
WWW-Authenticate: Digest realm="phone.plivo.com",
nonce="W0X45ltF97pvAyUnhNauEQaleRnTOoJw"
Server: Plivo
Content-Length: 0
19
SIP REGISTER with Credentials
REGISTER sip:phone.plivo.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.120:5062;branch=z9hG4bK.FzY3F52HT;rport
From: <sip:inbound170412123914@phone.plivo.com>;tag=azPOuWU4j
To: sip:inbound170412123914@phone.plivo.com
CSeq: 21 REGISTER
Call-ID: O2NZOkRWpQ
Max-Forwards: 70
Supported: replaces, outbound
Accept: application/sdp
Accept: text/plain
Accept: application/vnd.gsma.rcs-ft-http+xml
Contact:
<sip:inbound170412123914@111.93.146.206:46219;transport=udp>;+sip.instance="<urn:uuid:512
9-911f-4f24-a130-71a31e37f19d>"
Expires: 60
User-Agent: Linphone/3.10.2 (belle-sip/1.5.0)
Authorization: Digest realm="phone.plivo.com", nonce="W0X45ltF97pvAyUnhNauEQaleRnTOoJw",
username="inbound170412123914", uri="sip:phone.plivo.com",
response="a1b449a5de1913f3616b6bcea1041552"
20
SIP Standards
Just a sampling of IETF standards work…
IETF RFCs http://ietf.org/rfc.html
• RFC3261 Core SIP specification – obsoletes RFC2543
• RFC2327 SDP – Session Description Protocol
• RFC1889 RTP - Real-time Transport Protocol
• RFC2326 RTSP - Real-Time Streaming Protocol
• RFC3262 SIP PRACK method – reliability for 1XX messages
• RFC3263 Locating SIP servers – SRV and NAPTR
• RFC3264 Offer/answer model for SDP use with SIP
21
SIP Standards (cont.)
• RFC3265 SIP event notification – SUBSCRIBE and NOTIFY
• RFC3266 IPv6 support in SDP
• RFC3311 SIP UPDATE method – eg. changing media
• RFC3325 Asserted identity in trusted networks
• RFC3361 Locating outbound SIP proxy with DHCP
• RFC3428 SIP extensions for Instant Messaging
• RFC3515 SIP REFER method – eg. call transfer
• RFC4474 Authenticated Identity Management
• SIMPLE IM/Presence - http://ietf.org/ids.by.wg/simple.html
22
• “Hard phones”
• “Soft phones”
Soft and Hard SIP Clients
23
Questions?
24
Thank You

Sip basic KT

  • 1.
  • 2.
    2 Outline • What isSIP • SIP system components • SIP messages and responses • SIP call flows • SDP basics/CODECs • Questions and answers
  • 3.
    3 What’s SIP • IETFStandard defined by RFC 3261 • “The Session Initiation Protocol (SIP) is an application-layer control (signaling) protocol for creating, modifying and terminating sessions with one or more participants.” • Can be used for voice, video, instant messaging, gaming, etc., etc., etc. • Uses URIs for addressing – single communications identity – mailto:chandra@plivo.com for email – xmpp:29889_zentrunk@conf.hipchat.com for instant messaging – sip:919980950111@zt.plivo.com for voice and video • Username replaced by numbers for telephone applications
  • 4.
    4 Where’s SIP Application Transport Network Physical/Data LinkEthernet IP TCP UDP RTSP SIP SDP codecs RTP DNS(SRV)
  • 5.
    5 SIP Components • UserAgents – Clients – Make requests – Servers – Accept requests • Server types – Redirect Server – Proxy Server – Registrar Server – Location Server • Gateways
  • 6.
    6 Terminating User Agent Originating User AgentRTP SIP SIP B2BUA SIP Peer to Peer ! Back-to-Back User Agent Terminating User Agent Originating User Agent SIP RTP
  • 7.
    7 SIP Methods • INVITERequests a session • ACK Final response to the INVITE • OPTIONS Ask for server capabilities • CANCEL Cancels a pending request • BYE Terminates a session • REGISTER Sends user’s address to server
  • 8.
    8 SIP Responses • 1XXProvisional 100 Trying • 2XX Successful 200 OK • 3XX Redirection 302 Moved Temporarily • 4XX Client Error 404 Not Found • 5XX Server Error 504 Server Time-out • 6XX Global Failure 603 Decline
  • 9.
    9 SIP Flows -Basic ACK 200 - OK INVITE: sip:18.10.0.79 “Calls” 18.18.2.4 180 - Ringing Rings 200 - OK Answers BYEHangs up RTPTalking Talking User A User B
  • 10.
  • 11.
  • 12.
    12 SIP INVITE INVITE sip:919980950111@phone.plivo.comSIP/2.0 Via: SIP/2.0/UDP 192.168.1.120:5062;branch=z9hG4bK.GlI7ViTR3;rport From: <sip:inbound170412123914@phone.plivo.com>;tag=mpP3lkImP To: sip:919980950111@phone.plivo.com CSeq: 21 INVITE Call-ID: qf8DhB2sA0 Max-Forwards: 70 Supported: replaces, outbound Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE Content-Type: application/sdp Content-Length: 262 Contact: <sip:inbound170412123914@111.93.146.206:46219;transport=udp>;+sip.instance="<urn:uuid:51253a19-911f-4f24-a130-71a31e37f19d>" User-Agent: Linphone/3.10.2 (belle-sip/1.5.0) Proxy-Authorization: Digest realm="phone.plivo.com", nonce="W0X5jltF+GJsIaAdkgwQuhBG9MjKvaxz", username="inbound170412123914", uri="sip:919980950111@phone.plivo.com", response="adeef6fff9bbebab570cfbbb32e85b29", cnonce="sWVndGo3ERdUNmXr", nc=00000001, qop=auth
  • 13.
    13 Session Description Protocol •IETF RFC 2327 • “SDP is intended for describing multimedia sessions for the purposes of session announcement, session invitation, and other forms of multimedia session initiation.” • SDP includes: – The type of media (video, audio, etc.) – The transport protocol (RTP/UDP/IP, H.320, etc.) – The format of the media (H.264 video, MPEG video, etc.) – Information to receive those media (addresses, ports, formats and so on)
  • 14.
    14 SDP v=0 o=inbound170412123914 886 3120IN IP4 192.168.1.120 s=Talk c=IN IP4 192.168.1.120 t=0 0 a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics m=audio 7078 RTP/AVP 0 8 101 a=rtpmap:101 telephone-event/8000 a=rtcp-fb:* trr-int 5000
  • 15.
    15 CODECs • Audio – G.711 •8kHz sampling rate • 64kbps – G.729 • 8kHz sampling rate • 8kbps • Voice Activity Detection • Video – H.264 • MPEG-4 – H.263
  • 16.
    16 SIP Flows -Registration 200 - OK REGISTER: sip 401 - Unauthorized User B sipphone Registrar REGISTER: (add credentials) DB Location sip:chandra@pliv o.com Contact IP
  • 17.
    17 SIP REGISTER REGISTER sip:phone.plivo.comSIP/2.0 Via: SIP/2.0/UDP 192.168.1.120:5062;branch=z9hG4bK.yvX0~BYQ6;rport From: <sip:inbound170412123914@phone.plivo.com>;tag=azPOuWU4j To: sip:inbound170412123914@phone.plivo.com CSeq: 20 REGISTER Call-ID: O2NZOkRWpQ Max-Forwards: 70 Supported: replaces, outbound Accept: application/sdp Accept: text/plain Accept: application/vnd.gsma.rcs-ft-http+xml Contact: <sip:inbound170412123914@192.168.1.120:5062;transport=udp>;+sip.instance="<urn:uuid:51253 911f-4f24-a130-71a31e37f19d>" Expires: 60 User-Agent: Linphone/3.10.2 (belle-sip/1.5.0)
  • 18.
    18 SIP REGISTER –401 Response SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP 192.168.1.120:5062;branch=z9hG4bK.yvX0~BYQ6;rport=46219;received=111.93.146.206 From: <sip:inbound170412123914@phone.plivo.com>;tag=azPOuWU4j To: sip:inbound170412123914@phone.plivo.com;tag=378adae1ddc71986618d85886edb3f8b.6ead CSeq: 20 REGISTER Call-ID: O2NZOkRWpQ WWW-Authenticate: Digest realm="phone.plivo.com", nonce="W0X45ltF97pvAyUnhNauEQaleRnTOoJw" Server: Plivo Content-Length: 0
  • 19.
    19 SIP REGISTER withCredentials REGISTER sip:phone.plivo.com SIP/2.0 Via: SIP/2.0/UDP 192.168.1.120:5062;branch=z9hG4bK.FzY3F52HT;rport From: <sip:inbound170412123914@phone.plivo.com>;tag=azPOuWU4j To: sip:inbound170412123914@phone.plivo.com CSeq: 21 REGISTER Call-ID: O2NZOkRWpQ Max-Forwards: 70 Supported: replaces, outbound Accept: application/sdp Accept: text/plain Accept: application/vnd.gsma.rcs-ft-http+xml Contact: <sip:inbound170412123914@111.93.146.206:46219;transport=udp>;+sip.instance="<urn:uuid:512 9-911f-4f24-a130-71a31e37f19d>" Expires: 60 User-Agent: Linphone/3.10.2 (belle-sip/1.5.0) Authorization: Digest realm="phone.plivo.com", nonce="W0X45ltF97pvAyUnhNauEQaleRnTOoJw", username="inbound170412123914", uri="sip:phone.plivo.com", response="a1b449a5de1913f3616b6bcea1041552"
  • 20.
    20 SIP Standards Just asampling of IETF standards work… IETF RFCs http://ietf.org/rfc.html • RFC3261 Core SIP specification – obsoletes RFC2543 • RFC2327 SDP – Session Description Protocol • RFC1889 RTP - Real-time Transport Protocol • RFC2326 RTSP - Real-Time Streaming Protocol • RFC3262 SIP PRACK method – reliability for 1XX messages • RFC3263 Locating SIP servers – SRV and NAPTR • RFC3264 Offer/answer model for SDP use with SIP
  • 21.
    21 SIP Standards (cont.) •RFC3265 SIP event notification – SUBSCRIBE and NOTIFY • RFC3266 IPv6 support in SDP • RFC3311 SIP UPDATE method – eg. changing media • RFC3325 Asserted identity in trusted networks • RFC3361 Locating outbound SIP proxy with DHCP • RFC3428 SIP extensions for Instant Messaging • RFC3515 SIP REFER method – eg. call transfer • RFC4474 Authenticated Identity Management • SIMPLE IM/Presence - http://ietf.org/ids.by.wg/simple.html
  • 22.
    22 • “Hard phones” •“Soft phones” Soft and Hard SIP Clients
  • 23.
  • 24.