Session Initialization Protocol SIP Presented by Aishwarya Gurazada
Session Initialization Protocol (SIP) Presented by: Aishwarya Gurazada CISC 856: TCP/IP and upper layer protocols May 5 th 2011 Some slides borrowed from the presentations of Lei Luo Che-Yu Kuo
What is SIP? � An IETF defined application-layer control (signaling) protocol for creating, modifying and terminating sessions � Sessions are primarily audio and video calls over IP � SIP incorporates elements of HTTP requestresponse model, text-based protocol, URL (SIP uses URI’s) and SMTP for header style such as To, From, and Subject 2
Motivation The telephony applications introduced signaling into IP network � SIP was designed to mimic the call setup and signaling characteristics of the traditional telephone network over an IP infrastructure � What does SIP do? SIP enables Internet endpoints (called user agents) to discover one another and to agree on a characterization of a session they would like to share � As users may move between endpoints, they may be addressable by multiple names, and they may communicate in several different media � 3
Facets of Establishing a Call �User location: SIP enables the creation of an infrastructure of network hosts (called proxy servers) which could find in locating a user �User availability: determination of the willingness of the called party to engage in communications �User capabilities: media and media parameters to be used �Session management: supports transfer, termination, and modification of sessions 4
SIP Protocol Stack SIP is rather a component that can be used with other IETF protocols to build a complete multimedia architecture. SDP( Session Description Protocol) for describing multimedia sessions during signaling t es : In qu Re Re OK e: ns o sp gm d e l qu e Re t en sp Ac k no w o kn c A Re SIP Enabled-IP Network e vit st on wl se : I nv ite : O ed gm K en t IP Network RTP (real time protocol) defines a standardized packet format for delivering audio and video over IP networks Media Gateway Control Protocol (MEGACO) for controlling gateways SIP/PSTN Gateway PSTN Network 5
SIP – Transport Layer � TCP Ø TCP provides a reliable transport layer, but at a cost of complexity and transmission delay over the network. � UDP Ø UDP is the simplest way of transmitting chunks of data from one host to another in an IP network. Provided that the amount of data to be sent at once is not too big � SCTP Ø SCTP preserves boundaries Ø SCTP avoids head of line blocking 6
SIP Client-Server Architecture Re gi ste User Agent – Hard phone add dr es s Kate’s & Sam’s location ad E IT P y. I L Re e gis ter -m t Ka a oc Servers m IT NV I User Agent – Softphone Proxy Server on to d fin ti ka TE Sam te ka I NV I Redirect Server IN VIT E im j E T I INV ke mi s te Registrar Server ro Ef Kate User Agent – Softphone y IP res V IN Mike r- m jim Gateway SIP Gateway PSTN Network Jim 7
SIP Operation � SIP addressing � Locating the end user � SIP messages- methods & responses � Sending SIP requests : SIP transactions
SIP Addressing � SIP clients are identified by SIP URI (Uniform Resource Indicator) � URI’s look like email addresses of the form user@domain � The communication is user-to-user instead of device-todevice � The user@domain needs to be resolved to user@host by using a SIP Proxy server and DNS lookups at the time of call examples sip: alan@wcom. com (user@domain) sip: J. T. Kirk <kirk@starfleet. gov> sip: +1 -613 -555 -1212@wcom. com; user=phone sip: guest@10. 64. 1. 1 (user@host) 9
Locating the End User � When client wants to send a request URI, the client will either send it to Ø Locally configured Proxy server or Ø IP address & port corresponding to the request URI Jim needs to call Jane Location service Jim needs to know the CURRENT IP address of Jane to send request Locates Jane Request - Sip: jim@xyz. com proxy Server can locate Jane by looking up its “location service” database provided that Jane is registered jane@xyz. com 10
SIP Message Format � generic-message = Request-Line / Status-Line (Response) message-header (fields) CRLF [ message-body ] Request-Line INVITE sip: Marconi@radio. org SIP/2. 0 Via: SIP/2. 0/UDP lab. highvoltage. org: 5060; branch=z 9 h. G 4 b. Kfw 19 b v=0 Max-Forwards: 70 o=Tesla 2890844526 IN IP 4 lab. high. To: G. Marconi <sip: Marconi@radio. org> voltage. org From: Nikola Tesla <sip: n. tesla@highs=Phone Call voltage. org>; tag=76341 c=IN IP 4 j 2 qu 348 ek 2328 ws 100. 101. 102. 103 Call-ID: t=0 0 1 INVITE CSeq: m=audio About 49170 That RTP/AVP Subject: Power 0 Outage. . . a=rtpmap: 0 PCMU/8000 Contact: <sip: n. tesla@lab. high-voltage. org> Content-Type: application/sdp Content-Length: 158 Message body Header fields 11
Request Line � Request-Line = Method SP Request-URI SP SIP-Version CRLF • REGISTER ü registering contact User to which the request information is addressed SIP version • INVITE, ACK, CANCEL ü setting up sessions • BYE ü terminating sessions • INVITE ash@xyz. com SIP/2. 0 OPTIONS ü querying servers about their capabilities 12
Status Line � Status-Line = SIP-Version SP Status-Code SP Reason. Phrase CRLF SIP/2. 0 1 xx: Provisional -- request received, continuing to process the request; 2 xx: Success -- the action was successfully received, understood, and accepted; The Reason-Phrase is intended to give a short textual description of the Status-Code. 3 xx: Redirection -- further action needs to be taken in order to complete the request; 4 xx: Client Error -- the request contains bad syntax or cannot be fulfilled at this server; SIP/2. 0 180 Ringing 5 xx: Server Error -- the server failed to fulfill an apparently valid request; 6 xx: Global Failure -- the request cannot be fulfilled at any server. 13
Message Header fields Parameter Description Call-ID Uniquely identifies a particular session Cseq A monotonically increasing sequence number used to identify the sequence of requests associated with a given Call-ID From A SIP URL that identifies the initiator of the request. May include a “friendly name” (e. g John) To A SIP URL that identifies the recipient of the request. May include a “friendly name” Via Indicates the path taken by the request 14
Marconi Accepted Marconi Tesla INVITE g 180 Ringin 200 OK ACK Media Session BYE 200 OK Simple SIP session establishment example 15
Proxy Server Alice INVITE Bob INVITE g 180 Ringin 200 OK ACK Media Session BYE 200 OK SIP call example with proxy server 16
Alice Registrar Server REGISTER Contact: sip : alice@128. 1 7 5. 13. 16 200 OK SIP registration example 17
SUBSCRIBE 200 OK NOTIFY 200 OK … NOTIFY 200 OK MESSAGE 200 OK SIP presence and instant message example 18
SIP/2. 0 REGISTER sip: registrar. udel. edu Via: SIP/2. 0/UDP 128. 175. 13. 50: 5060; branch=z 9 h. G 4 b. Kus 19 Max-Forwards: 70 SIP/2. 0 407 REQUIRED To: AUTHORIZATION Alice <sip: alice@eecis. udel. edu> Via: SIP/2. 0/UDP 128. 175. 13. 50: 5060; From: Alice SIP/2. 0 REGISTER sip: registrar. udel. edu branch=z 9 h. G 4 b. Kus 19 <sip: alice@eecis. udel. edu>; tag=3431 Via: 128. 175. 13. 50: 5060; To: SIP/2. 0/UDP Alice. Call-ID: <sip: alice@eecis. udel. edu> branch=z 9 h. G 4 b. Kus 19 From: Alice <sip: alice@eecis. udel. edu>; tag=3431 843817637684230@998 sdasdh 09 To: Alice <sip: alice@eecis. udel. edu> Call-ID: 843817637684230@998 sdasdh 09 CSeq: 1 REGISTER From: <sip: alice@eecis. udel. edu>; tag=3431 CSeq: Alice 1500 REGISTER Contact: sip: alice@128. 175. 13. 50 Call-ID: 843817637684230@998 sdasdh 09 Contact: Content-Length: <sip: alice@128. 175. 13. 50>; 0 CSeq: 1 REGISTER Digest Proxy-Authenticate: Contact: <sip: alice@128. 175. 13. 50>; expires=3600 realm=“eecis. udel. edu", Proxy-Authorization: Digest username=“alice", nonce="4 db 894763 e 920 f 6 ec 021 e 68 a 3 e 87 b 098 dc 4 a realm=“eecis. udel. edu, c 8 f 9" nonce="4 db 894763 e 920 f 6 ec 021 e 68 a 3 e 87 b 098 dc 4 ac 8 Content-Length: 0 SIP/2. 0 200 OK f 9”, Via: uri=SIP/2. 0/UDP alice@eecis. udel. edu, 128. 175. 13. 50: 5060; “response="d 4456069 e 70376940998 daae 084 cd 5 b 5”, branch=z 9 h. G 4 b. Kus 19 Content-Length: 0 To: Alice <sip: alice@eecis. udel. edu> From: Alice <sip: alice@eecis. udel. edu>; tag=3431 Call-ID: 843817637684230@998 sdasdh 09 CSeq: 1 REGISTER Contact: <sip: alice@128. 175. 13. 50>; expires=3600 Content-Length: 0 SIP Registration Server Alice Registrar Server 19
Simple Call Establishment Alice Inserts a “From” tag and sets the session parameters Inserts a “To” tag and sets the session parameters Call ID, from and to tags identify a dialog INVITE sip: alice@udel. com SIP/2. 0 Via: SIP/2. 0/UDP 100. 101. 102. 103: 5060; branch=z 9 h. G 4 b. Kmp 17 a To: Bob <sip: bob@yahoo. com> SIP/2. 0 180 Ringing From: Alice <sip: alice@udel. edu>; tag=42 Via: SIP/2. 0/UDP 100. 101. 102. 103: 5060; Call-ID: j 2 qu 348 ek 2328 ws branch=z 9 h. G 4 b. Kmp 17 a Cseq: 1 IINVITE SIP/2. 0 200 OKsip: alice@pc. udel. edu To: Bob sip: bob@yahoo. com; tag=75 Contact: Via: SIP/2. 0/UDP 100. 101. 102. 103: 5060; From: Alice <sip: alice@udel. edu>; tag=42 Subject: Where are you exactly? branch=z 9 h. G 4 b. Kmp 17 a Call-ID: j 2 qu 348 ek 2328 ws To: Bob sip: bob@yahoo. com; tag=75 Cseq: 1 INVITE From: Alice <sip: alice@udel. edu>; tag=42 Contact: <sip: bob@tower. yahoo. com> Call-ID: j 2 qu 348 ek 2328 ws Cseq: 1 INVITE SIP/2. 0 ACK Contact: <sip: bob@tower. yahoo. com> Via: SIP/2. 0/UDP 100. 101. 102. 103: 5060; Bob branch=z 9 h. G 4 b. K 321 g v=0 To: Bob sip: bob@yahoo. com; tag=75 o=alice 2890844526 IN From: Alice <sip: alice@udel. edu>; tag=42 IP 4 j 2 qu 348 ek 2328 ws Call-ID: Cseq: 1 ACK alice. udel. edu s=Phone Call v=0 c=IN IP 4 100. 101. 102. 103 o=bob 2890844528 IN IP 4 t=0 0 tower. yahoo. com m=audio 49170 RTP/AVP 0 s=Phone Call a=rtpmap: 0 PCMU/8000 c=IN IP 4 200. 201. 202. 203 t=0 0 m=audio 60000 RTP/AVP 0 a=rtpmap: 0 PCMU/8000 20
SIP Proxy Server DNS server INVITE sip: bob@yahoo. com SIP/2. 0 Via: SIP/2. 0/UDP 100. 101. 102. 103: 5060; branch=z 9 h. G 4 b. Kmp 17 a To: Bob <sip: bob@yahoo. com> From: Alice Outbound <sip: alice@udel. edu>; tag=42 proxy server Subject: Where are you exactly? Contact: <sip: alice@pc. udel. edu> INVITE sip: bob@yahoo. com SIP/2. 0 Via: SIP/2. 0/UDP proxy. udel. com: 5060; branch=z 9 h. G 4 b. K 83842. 1 Via: SIP/2. 0/UDP 100. 101. 102. 103: 5060; branch=z 9 h. G 4 b. Kmp 17 a To: Bob <sip: bob@yahoo. com> From: Alice <sip: alice@udel. edu>; tag=42 Subject: Where are you exactly? Contact: <sip: alice@pc. udel. edu> 100 Trying 180 Ringing 200 OK Media (RTP) INVITE sip: bob@yahoo. com SIP/2. 0 Location Via: SIP/2. 0/UDP proxy. yahoo. com: 5060; server branch=z 9 h. G 4 b. Ktiop 3 Via: SIP/2. 0/UDP proxy. udel. com: 5060; branch=z 9 h. G 4 b. K 83842. 1 Via: SIP/2. 0/UDP 100. 101. 102. 103: 5060; branch=z 9 h. G 4 b. Kmp 17 a Inbound To: Bob <sip: bob@yahoo. com> proxy. Alice server From: <sip: alice@udel. edu>; tag=42 Subject: Where are you exactly? Contact: <sip: alice@pc. udel. edu> 180 Ringing 200 OK BYE ACK Alice Bob 200 OK SIP Trapezoid 21
SIP Proxy Server Location Service INVITE Bob Bob’s Phone Proxy Server 486 Busy Here Alice INVITE Bob Proxy servers can make flexible “routing decisions” to decide where to send a request. Bob’s voicemail 22
SIP Redirect Server SIP/2. 0 301 Moved Permanently Via: SIP/2. 0/UDP INVITE sip: bob@yahoo. com 100. 101. 102. 103: 5060; SIP/2. 0 branch=z 9 h. G 4 b. Kmp 17 a Via: SIP/2. 0/UDP To: Bob 100. 101. 102. 103: 5060; <sip: bob@yahoo. com>; tag=64 branch=z 9 h. G 4 b. Kmp 17 a From: Alice To: Bob <sip: bob@yahoo. com> <sip: alice@udel. edu>; tag=42 From: Alice Subject: Where. INVITE are yousip: bob@200. 201. 202. 203 exactly? <sip: alice@udel. edu>; tag=42 Contact: sip: bob@200. 201. 202. 203 SIP/2. 0 Subject: Where are you exactly? ACK Via: SIP/2. 0/UDP Contact: <sip: alice@pc. udel. edu> 100. 101. 102. 103: 5060; branch=z 9 h. G 4 b. Kmp 17 a To: Bob <sip: bob@yahoo. com> From: Alice <sip: alice@udel. edu>; tag=13473 Subject: Where are you exactly? Contact: <sip: alice@pc. udel. edu> Redirect Server Alice Bob 23
Terminal Mobility- Pre-call Mobile -JIM Home Proxy/registrar JANE REGISTER 200 OK INVITE 200 OK ACK Media Session 24
Terminal Mobility- Mid Call AC K 20 Media Session 0 K O E IT V IN Home Network Visited Network 25
Personal Mobility INVITE 200 Bob OK Location Service Bob’s Office Phone INVITE Bob Alice 200 OK Bob’s Cell Phone INVITE Bob CANCEL Proxy Server INVITE Bob CANCEL Bob’s Home Phone In parallel search, a proxy issues several requests to possible user locations upon receiving an incoming request. 26
Session Mobility � Transfer and Retrieval Ø Transfer means to move the session on the current device to one or more other devices Ø Retrieval means to cause a session currently on another device to be transferred to the local device � Whole Ø and Split Transfer The set of session media may either be transferred completely to a single device or split across multiple devices 27
Transfer Modes � Mobile Node (MN) Control Mode Ø Mobile Node (MN) uses a third party call control Ø It establishes a SIP session with the local device used in the transfer and updates its session with the CN (corresponding node), using the SDP parameters to establish media sessions between the CN and the local device Ø it requires the MN to remain active to maintain the sessions � Session Hands off Mode Ø MN completely transfers the session signaling and media to another device Addressing of Devices Ø All devices are assumed to have dedicated SIP URI’s Ø A device has a unique URI and registers a separate contact URI for itself 28
Local Device Corresponding Node Mobile Node Media Session INVITE 200 OK local Parameters INVITE local Parameters 200 OK CN parameters ACK CN Parameters ACK Media Session 29
Local Device Corresponding Node Mobile Node Media Session REFER , refer-to 200 Accepted INVITE, Replaces 200 OK Media Session ACK Media Session NOTIFY 200 OK BYE 200 OK 30
References �J. Rosenberg, SIP: Session Initialization Protocol, RFC 3261, 2002 �A. Johnston, SIP: Understanding the Session Initialization Protocol, 2 nd edition 31
Questions 32
- Slides: 32