320 likes | 532 Views
Session Initialization Protocol (SIP). Presented by: Aishwarya Gurazada CISC856: TCP/IP and upper l ayer protocols May 5 th 2011 Some slides borrowed from the presentations of Lei Luo Che -Yu Kuo. What is SIP?.
E N D
Session Initialization Protocol (SIP) Presented by: AishwaryaGurazada CISC856: TCP/IP and upper layer protocols May 5th 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 request-response model, text-based protocol, URL (SIP uses URI’s) and SMTP for header style such as To, From, and Subject
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
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
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 SIP Enabled-IP Network Request : Invite Request : Invite Response: OK Response :OK Acknowledgment Acknowledgment IP Network Media Gateway Control Protocol (MEGACO) for controlling gateways RTP (real time protocol) defines a standardized packet format for delivering audio and video over IP networks SIP/PSTN Gateway PSTN Network
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
SIP Client-Server Architecture User Agent – Softphone User Agent – Hard phone Register- my IP address Registrar Server Location to find kate Kate’s & Sam’s location Sam INVITE Kate Mike INVITE kate Servers Register- my IP address Redirect Server INVITE from mike INVITE jim INVITE jim Proxy Server Gateway Kate User Agent – Softphone SIP Gateway PSTN Network Jim
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-to-device • 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)
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 know the CURRENT IP address of Jane to send request Jim needs to call Jane Location service Locates Jane Request Request Sip:jim@xyz.com xyz.com proxy Server jane@xyz.com Server can locate Jane by looking up its “location service” database provided that Jane is registered
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.high-voltage.org:5060;branch=z9hG4bKfw19b Max-Forwards: 70 To: G. Marconi <sip: Marconi@radio.org> From: Nikola Tesla <sip:n.tesla@high-voltage.org>;tag=76341 Call-ID: j2qu348ek2328ws CSeq: 1 INVITE Subject: About That Power Outage... Contact: <sip:n.tesla@lab.high-voltage.org> Content-Type: application/sdp Content-Length: 158 v=0 o=Tesla 2890844526 2890844526 IN IP4 lab.high-voltage.org s=Phone Call c=IN IP4 100.101.102.103 t=0 0 m=audio 49170 RTP/AVP 0 a=rtpmap:0 PCMU/8000 Message body Header fields
Request Line • Request-Line = Method SP Request-URI SP SIP-Version CRLF • REGISTER • registering contact information • INVITE, ACK, CANCEL • setting up sessions • BYE • terminating sessions • OPTIONS • querying servers about their capabilities SIP version User to which the request is addressed INVITEash@xyz.comSIP/2.0
Status Line • Status-Line = SIP-Version SP Status-Code SP Reason-Phrase CRLF SIP/2.0 The Reason-Phrase is intended to give a short textual description of the Status-Code. 1xx: Provisional -- request received, continuing to process the request; 2xx: Success -- the action was successfully received, understood,and accepted; 3xx: Redirection -- further action needs to be taken in order to complete the request; 4xx: Client Error -- the request contains bad syntax or cannot be fulfilled at this server; 5xx: Server Error -- the server failed to fulfill an apparently valid request; 6xx: Global Failure -- the request cannot be fulfilled at any server. SIP/2.0180Ringing
Marconi Accepted Marconi Tesla INVITE 180 Ringing 200 OK ACK Media Session BYE 200 OK Simple SIP session establishment example
Proxy Server Bob Alice INVITE INVITE 180 Ringing 180 Ringing 200 OK 200 OK ACK Media Session BYE 200 OK SIP call example with proxy server
Alice Registrar Server REGISTER Contact: sip:alice@128.175.13.16 200 OK SIP registration example
SUBSCRIBE 200 OK NOTIFY 200 OK … NOTIFY 200 OK MESSAGE 200 OK MESSAGE 200 OK SIP presence and instant message example
SIP/2.0 REGISTER sip:registrar.udel.edu Via: SIP/2.0/UDP 128.175.13.50:5060; branch=z9hG4bKus19 Max-Forwards: 70 To: Alice <sip:alice@eecis.udel.edu> From: Alice <sip:alice@eecis.udel.edu>;tag=3431 Call-ID: 843817637684230@998sdasdh09 CSeq: 1 REGISTER Contact: sip:alice@128.175.13.50 Content-Length: 0 SIP Registration Server SIP/2.0 407 AUTHORIZATION REQUIRED Via: SIP/2.0/UDP 128.175.13.50:5060; branch=z9hG4bKus19 To: Alice <sip:alice@eecis.udel.edu> From: Alice <sip:alice@eecis.udel.edu>;tag=3431 Call-ID:843817637684230@998sdasdh09 CSeq: 1500 REGISTER Contact: <sip:alice@128.175.13.50>; Proxy-Authenticate: Digest realm=“eecis.udel.edu", nonce="4db894763e920f6ec021e68a3e87b098dc4ac8f9" Content-Length: 0 SIP/2.0 REGISTER sip:registrar.udel.edu Via: SIP/2.0/UDP 128.175.13.50:5060; branch=z9hG4bKus19 To: Alice <sip:alice@eecis.udel.edu> From: Alice <sip:alice@eecis.udel.edu>;tag=3431 Call-ID:843817637684230@998sdasdh09 CSeq: 1 REGISTER Contact: <sip:alice@128.175.13.50>;expires=3600 Proxy-Authorization: Digest username=“alice", realm=“eecis.udel.edu, nonce="4db894763e920f6ec021e68a3e87b098dc4ac8f9”, uri= alice@eecis.udel.edu, “response="d4456069e70376940998daae084cd5b5”, Content-Length: 0 Registrar Server Alice SIP/2.0 200 OK Via: SIP/2.0/UDP 128.175.13.50:5060; branch=z9hG4bKus19 To: Alice <sip:alice@eecis.udel.edu> From: Alice <sip:alice@eecis.udel.edu>;tag=3431 Call-ID:843817637684230@998sdasdh09 CSeq: 1 REGISTER Contact: <sip:alice@128.175.13.50>;expires=3600 Content-Length: 0
Simple Call Establishment INVITE sip:alice@udel.comSIP/2.0 Via: SIP/2.0/UDP 100.101.102.103:5060; branch=z9hG4bKmp17a To: Bob <sip:bob@yahoo.com> From: Alice <sip:alice@udel.edu>;tag=42 Call-ID: j2qu348ek2328ws Cseq: 1 IINVITE Contact: sip:alice@pc.udel.edu Subject: Where are you exactly? SIP/2.0 180 Ringing Via: SIP/2.0/UDP 100.101.102.103:5060; branch=z9hG4bKmp17a To: Bob sip:bob@yahoo.com;tag=75 From: Alice <sip:alice@udel.edu>;tag=42 Call-ID: j2qu348ek2328ws Cseq: 1 INVITE Contact: <sip:bob@tower.yahoo.com> Alice Bob SIP/2.0 200 OK Via: SIP/2.0/UDP 100.101.102.103:5060; branch=z9hG4bKmp17a To: Bob sip:bob@yahoo.com;tag=75 From: Alice <sip:alice@udel.edu>;tag=42 Call-ID: j2qu348ek2328ws Cseq: 1 INVITE Contact: <sip:bob@tower.yahoo.com> Inserts a “From” tag and sets the session parameters SIP/2.0 ACK Via: SIP/2.0/UDP 100.101.102.103:5060; branch=z9hG4bK321g To: Bob sip:bob@yahoo.com;tag=75 From: Alice <sip:alice@udel.edu>;tag=42 Call-ID: j2qu348ek2328ws Cseq: 1 ACK Inserts a “To” tag and sets the session parameters v=0 o=alice 2890844526 2890844526 IN IP4 alice.udel.edu s=Phone Call c=IN IP4 100.101.102.103 t=0 0 m=audio 49170 RTP/AVP 0 a=rtpmap:0 PCMU/8000 v=0 o=bob 2890844528 2890844528IN IP4 tower.yahoo.com s=Phone Call c=IN IP4 200.201.202.203 t=0 0 m=audio 60000 RTP/AVP 0 a=rtpmap:0 PCMU/8000 Call ID, from and to tags identify a dialog
SIP Proxy Server INVITE sip:bob@yahoo.com SIP/2.0 Via: SIP/2.0/UDP proxy.udel.com:5060; branch=z9hG4bK83842.1 Via: SIP/2.0/UDP 100.101.102.103:5060; branch=z9hG4bKmp17a 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> INVITE sip:bob@yahoo.com SIP/2.0 Via: SIP/2.0/UDP proxy.yahoo.com:5060; branch=z9hG4bKtiop3 Via: SIP/2.0/UDP proxy.udel.com:5060; branch=z9hG4bK83842.1 Via: SIP/2.0/UDP 100.101.102.103:5060; branch=z9hG4bKmp17a 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> Location server DNS server INVITE sip:bob@yahoo.com SIP/2.0 Via: SIP/2.0/UDP 100.101.102.103:5060; branch=z9hG4bKmp17a 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> Outbound proxy server Inbound proxy server 100 Trying 180 Ringing 200 OK 100 Trying 180 Ringing 200 OK 180 Ringing 200 OK Media (RTP) BYE ACK Alice Bob 200 OK SIP Trapezoid
SIP Proxy Server Location Service INVITE Bob INVITE Bob Bob’s Phone 486 Busy Here Proxy Server Alice INVITE Bob Bob’s voicemail Proxy servers can make flexible “routing decisions” to decide where to send a request.
SIP Redirect Server SIP/2.0 301 Moved Permanently Via: SIP/2.0/UDP 100.101.102.103:5060; branch=z9hG4bKmp17a To: Bob <sip:bob@yahoo.com>;tag=64 From: Alice <sip:alice@udel.edu>;tag=42 Subject: Where are you exactly? Contact: sip:bob@200.201.202.203 INVITE sip:bob@yahoo.com SIP/2.0 Via: SIP/2.0/UDP 100.101.102.103:5060; branch=z9hG4bKmp17a 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> INVITE sip:bob@200.201.202.203 SIP/2.0 Via: SIP/2.0/UDP 100.101.102.103:5060; branch=z9hG4bKmp17a 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 ACK Alice Bob
Terminal Mobility- Pre-call Mobile -JIM JANE Home Proxy/registrar REGISTER 200 OK INVITE INVITE 200 OK 200 OK ACK Media Session
Terminal Mobility- Mid Call ACK Media Session 200 OK Home Network INVITE Visited Network
Personal Mobility Bob’s Cell Phone INVITE Bob 200 OK Location Service INVITE Bob Bob’s Office Phone INVITE Bob CANCEL Alice 200 OK Proxy Server Bob’s Home Phone INVITE Bob CANCEL In parallel search, a proxy issues several requests to possible user locations upon receiving an incoming request.
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
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 • Adevice has a unique URI and registers a separate contact URI for itself
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
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
References • J. Rosenberg, SIP: Session Initialization Protocol, RFC 3261, 2002 • A. Johnston, SIP: Understanding the Session Initialization Protocol, 2nd edition