Session Initiation Protocol
description
Transcript of Session Initiation Protocol
Session Initiation ProtocolThe department of Information &
Communications EngineeringDong-uk, kim
Table of Contents• Introduction• Transaction• Transport• Registration• Dialog • Initiating a session• Terminating a session• Headers
Introduction• Many Applications that require the creation and
management of a session.▫The Session initiation Protocol
Can enabling UA to discover one another General-purpose tool for creating, modifying and
terminating session Works independently of underlying transport protocols
SIP URIs• Two URI schemes
▫Similar to the form of an e-mail address: user@domain
• SIP URI - introduced in RFC 2543▫example: sip:[email protected]
• Secure SIP URI - introduced in RFC 3261▫example: sips:[email protected]▫Requires TLS over TCP as transport for security
SIP URIs (cont’d)• Several types of SIP URIs:
▫Address of Record (AOR) (identifies a user) example: sip:[email protected] Need DNS records to locate SIP Servers for
“domain.com”
▫Fully Qualified Domain Name (FQDN) (identifies a specific device) sip:[email protected] sip:[email protected] sip:[email protected];user=phone
Functionality
Operation
SIP Message structureINVITE sip:[email protected] SIP/2.0 <CRLF>INVITE sip:[email protected] SIP/2.0 <CRLF>
Via: SIP/2.0/UDP 169.130.12.5Call-ID: [email protected]: <sip:[email protected]>To: Bob<sip:[email protected]>CSeq: 1 INVITEMax-forwards: 70Content-Type: application/sdpContent-Length:885
Via: SIP/2.0/UDP 169.130.12.5Call-ID: [email protected]: <sip:[email protected]>To: Bob<sip:[email protected]>CSeq: 1 INVITEMax-forwards: 70Content-Type: application/sdpContent-Length:885
v=0o=xener 53655765 2353687 IN IP4 169.130.12.5s=hello sessionc=IN IP4 169.130.12.5m=audio 3456 RTP/AVP 0 3 4 5
v=0o=xener 53655765 2353687 IN IP4 169.130.12.5s=hello sessionc=IN IP4 169.130.12.5m=audio 3456 RTP/AVP 0 3 4 5
<CRLF><CRLF>
Start Line
Headers
Blank Line
Content
Request MethodBasic Extention
• INVITE• ACK• BYE• CANCEL• OPTIONS• REGISTER
• REFER• PUBLISH• SUBSCRIBE• NOTIFY• MESSAGE• INFO• UPDATE
Response 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
Transaction• A SIP Transaction consists of
▫A single request▫Zero or more provisional responses ▫One or more final responses
• i.e.>▫An INVITE request▫Final response (which is not 2xx response)
The final ACK is part of the transaction
Transaction Process
UA
TCP,UDP,TLS/IP
Trasnport
Transaction
Transaction User
ApplicationStateful Proxy
Stateless Proxy
Stateful Proxy
UA
UAS UAC
S C
S C
TCP,UDP,TLS/IP TCP,UDP,TLS/IP TCP,UDP,TLS/IP TCP,UDP,TLS/IP
Proxy Core
Proxy Core
Proxy Core
Application
UAS UAC
S C
S C
S C
S C
S C
S C S C
INVITEClient Transaction
• Timer A▫ At each retransmit.▫ T1 = 500ms(default)
• Timer B▫ 64 * T1
• Timer D▫ At least 32sec. In unreliable transport▫ The duration, the server transaction
can remain in the Complete state == at INV. Server trans.
• Timer C ?▫ Managed by TU
Update at recv 101 ~199 Reset to different value
▫ But At least 3 min. If Fires
CANCLE / treat like 408
TransactionTransport Transport
Transaction
UAC UAS
INVITE
TU TU
Calling
Timer A expires---------Reset ASend INVITE
Proceeding
Recv. 1xx ---------1xx to TU
Complete
Recv. 3xx ~ 6xx ---------Send ACKSet Timer D
INVITE from TU---------Send INVITESet Timer A , B
Recv. 1xx ---------1xx to TU
Recv. 3xx ~ 6xx ---------Send ACK requestSet Timer D
Terminated
Timer D expires---------
Timer B expiresOr Transport Err.
-------------Inform TU
Recv. 2xx ---------2xx to TU
Recv. 2xx ---------2xx to TU
Transport Err.-------------
Inform TU
Recv. 3xx ~6xx ---------Send ACK
INVITE Server Transaction• Timer G
▫ At each retransmit.▫ T1 = 2 * T1▫ T1 = 500ms(default)
• Timer H▫ 64 * T1
== timer B• Timer I
Proceeding
Recv. INVITE ---------Send response
Complete
Confirmed
Recv. INVITE ---------INVITE to TUSend 100, if 200ms condition
3xx~6xx from TU---------Send responseSet Timer G & H
ACK--------Set Timer I
Terminated
Timer I expires---------
Transport Err.-------------
Inform TU
2xx form TU---------
Send response
1xx from TU---------Send response
Recv. INVITE ---------Send response
Timer G expires---------Send responseG = min(2*T1, T2)
Timer H expiresOr Transport Err.
-------------Inform TU
TransactionTransport Transport
Transaction
UAC UAS
INVITE
TU TU
• Non-INVITE transaction do not make use of ACK▫ Simple req-res
interactions
Non-INVITE Client Transaction
TransactionTransport Transport
Transaction
UAC UAS
Non- INVITE
TU TU
Trying
Timer E expires---------E = min(N*T1, T2)Send Req.
Proceeding
Complete
Req. from TU---------Send Req.Set Timer E, F
Recv. 1xx ---------1xx to TU
Recv. 2xx ~ 6xx ---------Response to TU
Terminated
Timer K expires---------
Timer F expiresOr Transport Err.
-------------Inform TURecv. 2xx ~6xx
---------Response to TU
Timer F expiresOr Transport Err.
-------------Inform TU
Timer E expires---------E=T2Send Req.
Recv. 1xx ---------1xx to TU
Non-INVITEServer Transaction Trying
Proceeding
Complete
Recv. Req. ---------Pass to TU
1xx from TU---------Send response
2xx ~ 6xx from TU--------Send responseSet Timer J
Terminated
Timer J expires---------
2xx form TU---------
Send response
Recv. Req.---------Send response
1xx from TU---------Send response
Transport Err---------Inform to TU
Transport Err---------Inform to TU
TransactionTransport Transport
Transaction
UAC UAS
Non- INVITE
TU TU
Transport Layer• Mandatory
▫UDP & TCP
• If Message size is larger than Path MTU – 200 1300 (at unknown path MTU)
▫Must be sent using an RFC 2914 (such as TCP)
Overview• SIP offers a discovery capability• Registration creates bindings in a location service
▫Associates AoR ∈ Contact addresses
Registration Msg.
Registrar.biloxi.com
Location Server
Proxy.biloxi.com
Bob’s PC
Proxy.atlanta.com
Alice Softphone
REGISTER sip:registrar.biloxi.com SIP/2.0Via: SIP/2.0/UDP bobspc.biloxi.com:5060; branch=z9hG4bKnashds7Max-Forwards: 70To: Bob <sip:[email protected]>From: Bob <sip:[email protected]>;tag=456248Call-ID: 843817637684230@998sdasdh09CSeq: 1826 REGISTERContact: <sip:[email protected]>Expires: 7200Content-Length: 0
Discover a Registrar• UA can use three ways to determine the address
to which to send registrations▫Configuration
With a registrar address
▫Using AoR A UA should use the host part of the AoR as the
Request-URI and address the request there, using the normal SIP server locations mechanisms
▫Multicast Well-known (by all SIP servers)
“sip.mcast.net”(224.0.1.75)
RegistrarStart
Receive Request
Inspects the Request-URI
Check Require-h. &Authenticate Act as a Proxy
Check UAC modify right
403 Forbidden
Inspect theAoR(To header)
404 Not Found
The Index.Which indicates a binding of the list
The AoR(“To:”) convert to
Canonical form
Contains the Contact header
One exist/w “*” & expire
400 Invalid RequestAdditional header or
positive expires
Call-ID agree with binding
Req
uest fail
Expires interval1) param.2) header3) local policy
Less thanmin-Expire
423 Interval Too Brief/w Min-expire
Update or Add Bindings
A Fail
200 Ok/w bindings & expire
500 Server Error
Y
Y
Y
Y
Y Y
Y
Remove the binding
Check CSeq
Y
Y
Y
REGISTER sip:registrar.biloxi.com SIP/2.0Via: SIP/2.0/UDP bobspc.biloxi.com:5060;branch=z9hG4bKnashds7Max-Forwards: 70To: Bob <sip:[email protected]>From: Bob <sip:[email protected]>;tag=456248Call-ID: 843817637684230@998sdasdh09CSeq: 1826 REGISTERContact: <sip:[email protected]>Expires: 7200Content-Length: 0
Dialog• Represents a Peer to Peer SIP relationship
between two user agents▫Facilitates sequencing of messages between
the UAs and proper routing of requests
• A dialog is identified at each UA with a dialog IDwhich consists of▫Call-ID value▫A local tag ▫A remote tag
Creating A Dialog
INVITE [email protected]
[email protected] [email protected] Server Redirect Server
INVITE [email protected]
302 Moved Temporarily/w Contact: [email protected]
INVITE [email protected]
180 Ringing
200 Ok
ACK
100 Trying
180 Ringing
200 Ok
Early DialogRecv .101~199Start with INVITE
DialogRecv .2xxStart with INVITE
Record-Route /w params., orderAdd Contact headerTarget = Request.ContactDialog.Call-ID = Request.Call-ID
Add Record-Route
Route set: Reverse order of Record-Route
ACK
Cseq: a INVITE
Cseq: a ACK (CANCEL)
Requests within a Dialog
RTP
[email protected] [email protected] Server
200 Ok
ACK200 Ok
DialogRecv .2xxStart with INVITE
ACK
BYE
Route: <sip:proxy;lr>Cseq: a+1
BYE
BYE
Route: <sip:proxy;lr>Cseq: a
400 Bad request
DialogTerminated
200 Ok200 Ok
Overview
Agent(Offerer)
Agent(Answerer)
OfferAnswer
INVITE
200
INVITE
200
INVITE200
200
RFC 3264
UAC Processing• Initial Offer MUST be in either
▫An INVITE Answer : 2xx Msg.
▫Final 2xx response Answer : ACK
• Send INVITE Msg.▫UAC waits for response for the INVITE
“Expire:” Transaction returns a timeout
Treat as if “408”
UAC Processing • 1xx Response
▫Early dialog• 3xx Response
▫Using Contact Addr. Depend on Response Code• 4xx ~ 6xx Response
▫Terminating early dialog
UAS Processing• “Expires:” in INVITE Request
▫ If fires 487 (Request Terminated)• Progress
▫Can not answer the invitation immediately Provisional response To prevent cancelation
▫UAS must send a non-100 provisional response at every min.
• Redirected ▫300, 301, 302▫“Contact : ”
• Rejected▫488 response should include a warning header
Why the offer was rejected
UAS Processing• Accepted
▫The UAS core generates a 2xx response.▫ INVITE contains offer msg.
2xx response should contain answer
Terminating a Session• Each session is Associated with a single dialog
▫When a BYE is received on a dialog Any session associated with the dialog should
terminated
A UA must not send BYE outside of a dialog
Caller Callee
INVITE
100
180
Early DialogRecv .101~199Start with INVITE
BYE
Caller Callee
INVITE100180200
Confirmed Dialog
BYEACK
UAs Behavior• UAC
▫Creates a new non-INVITE client transaction• UAS
▫UAS receiving BYE msg. Must check if it matches an existing dialog
If not, responses 481 (Call/Transaction does not exists)
Summary of SIP headersHeader field Where Proxy ACK BYE CAN INV OPT REG Compact
Accept R - o - o m* o
Accept 2xx - - - o m* o
Accept 415 - c - c c c
Accept-Encoding R - o - o o o
Accept-Encoding 2xx - - - o m* o
Accept-Encoding 415 - c - c c c
Accept-Language R - o - o o o
Accept-Language 2xx - - - o m* o
Accept-Language 415 - c - c c c
Alert-Info R ar - - - o - -
Alert-Info 180 ar - - - o - -
Allow R - o - o o o
Allow 2xx - o - m* m* o
Allow r - o - o o o
Summary of SIP headers(2)Header field Where Proxy ACK BYE CAN INV OPT REG Compact
Allow 405 - m - m m m
Authentication-Info 2xx - o - m m m
Authorization R o o o o o o
Call-ID c r m m m m m m i
Call-Info ar i i i o o o
Contact R o - - m o o m
Contact 1xx - - - o - -
Contact 2xx - - - m o o
Contact 3xx d - o - o o o
Contact 485 - o - o o o
Content-Disposition o o - o o o
Content-Encoding o o - o o o e
Content-Language o o - o o o
Content-Length ar t t t t t t l
Summary of SIP headers(3)Header field Where Proxy ACK BYE CAN INV OPT REG Compact
Content-Type * * - * * * c
CSeq c r m m m m m m
Date a o o o o o o
Error-Info 300-699 a - o o o o o
Expires - - - o - o
From c r m m m m m m f
In-Reply-To R - - - o - o
Max-Forwards R amr m m m m m m
Min-Expires 423 - - - - - m
MIME-Version o o - o o o
Organization ar - - - o o o
Priority R ar - - - o - -
Proxy-Authenticate 407 ar - m - m m m
Proxy-Authenticate 401 ar - o o o o o
Summary of SIP headers(4)Header field Where Proxy ACK BYE CAN INV OPT REG Compact
Proxy-Authorization R dr o o - o o o
Proxy-Require R ar - o - o o o
Record-Route R ar o o o o o -
Record-Route 2xx,18x ma - o o o o -
Reply-To - - - o - -
Require ar - c - c c c
Retry-After
404,413,
480,486,
500,503,
600,603
- o o o o o
Route R adr c c c c c c
Server r - o o o o o
Subject R - - - o - - s
Supported R - o o m* o o k
Supported 2xx - o o m* m* o
Summary of SIP headers(5)Header field Where Proxy ACK BYE CAN INV OPT REG Compact
Timestamp o o o o o o
To c(1) r m m m m m m t
Unsupported 420 - m - m m m
User-Agent o o o o o o
Via R amr m m m m m m v
Via rc dr m m m m m m
Warning r - o o o o o
WWW-Authenticate 401 ar - m - m m m
WWW-Authenticate 407 ar - o - o o o
▶ In “where”R: in requestsr: in responses2xx, 4xx, etc: response codec: copied from request to response
▶ In “proxy”a: can add/concatenate if not presentm: can modify valued: can delete valuer: must be able to be read (cannot be encrypted)
▶ In methodsc: conditional o: optionalm: mandatory t: should be sent, but can be omittedm*: should be sent, but can be omitted (mandatory in stream-based transport protocol)
IETF WGs• Applications Area• General Area• Internet Area• Operations and Management Area• Real-time Applications and Infrastructure Area• Routing Area• Security Area• Transport Area
WGsWG name Activity and Key wordsavt RTP
bliss Interoperability
drinks Provisioning, orthogonal to ENUM & SPEERMINT
ecrit Emergency
ENUM Telephone number mapping
geopriv Location convey
iptel Ip telephony with “tel” URI
mediactrl Media server control
mmusic SDP
p2psip P2psip
sigtran IP, PSTN interworking
simple IM & Presence, PIDF
SIP SIP
sipping Investigation, Event Package, 3GPP
speechse MRCP, TTS
speermint Session peering
xcom Centrailzed conference
RFC 2543
RFC 3261Overview
RFC 3262PRACK
RFC 3263Locating SIP
RFC 3264Offer / Answer
RFC 3265Event-Noti.
RFC 4575Conference
RFC 3515refer
RFC 3856Presence
RFC 3857winfo
…
RFC 2778Pres & IM
model
RFC 2779Requirement
RFC 3859CPP
RFC 3861locating
IM & pres.
RFC 3863PIDF
RFC 4479Data Model
RFC 4480RPID
RFC 4481Timed ext.
RFC 4482CIPID
RFC 4119PIDF_LO
…
RFC 3860CPIM
RFC 4079arch. of
GEOPROV LO
Protocol Definition
(SIP/SIPPING)
ServiceArchitecture
(SIMPLE)
InformationFormat
(SIMPLE/geopriv)
No. Is RFC WG remark title Rev. Status Abstract
1 RFC GEOPRIV RFC 4079 A Presence Architecture for the Distribution of GEOPRIV Location Object - RFC A protocol that carries PIDF_LO which used [I-D-SIP-location-Conveyance]
2 RFC GEOPRIV RFC 4119 A Presence-based GEOPRIV Location Object Format - RFC Describes a Location-Object(LO) for carrying geographical information on the internet.
3 RFC IMPP RFC 2778 A Model for Presence and Instatnt Messaging - RFC A Logical model for presence and instant messaging architecture
4 RFC IMPP RFC 2779 Instatn Messaging / Presence Protocol Requirements - RFC Defines a minimal set of requirements of IMPP
5 RFC IMPP RFC 3859 Common Profile for Presence (CPP) - RFC Defines common semantics and data formats for preence
6 RFC IMPP RFC 3860 Common Profile for Instant Messaging (CPIM) - RFC Defines common semantics and data formats for IM
7 RFC IMPP RFC 3861 Address Resolution for Instant Messaging and Presence - RFC Provides a guidance for locationg the resources associated with URIs using DNS, SRV
8 RFC IMPP RFC 3863 Presence Information Data Format (PIDF) - RFC A Definition for Presence Information Data Format (PIDF) as an Extension of XML
9 RFC SIMPLE RFC 4482 CIPID: Contact Information for the PIDF - RFC Additional Contact Information to the Presentity
10 RFC SIMPLE RFC 4660 Fuctional Description of Event Notification Filtering - RFCDescribes the opeations a subscriber performs in order to put filtering rules associated with a subscription
11 RFC SIMPLE RFC 4662 A SIP Event Notification Extention for Resource Lists - RFC A Subscribe mechanism for a list of resource, instade of send SUBSCRIBE to each resource
12 RFC SIMPLE RFC 4481Timed Presence Extensions to the PIDF to Indicate Status Information for Pas and Future Time Intervals
- RFC A PIDF extension for timed status information for a time interval fully in the future or the past
13 RFC SIMPLE RFC 5263 SIP Extension for Partial Notification of Presence Information - RFC Describes the partial notification mechanism
14 RFC SIMPLE RFC 5262 PIDF Extension for Partial Prescnce - RFC A Definition for using PIDF XML for partial presence
15 RFC SIMPLE RFC 5264 Publication of Partial Presence Information - RFC A mechanism for partial presence information
16 RFC SIMPLE RFC 5196 SIP UA Capability Extension to PIDF - RFC Defines a PIDF extension to represent SIP IA capabilities
17 RFC SIMPLE RFC 4479 A Data Model for Presence - RFC A definition to PIDF for presence and instant messaging
18 RFC SIMPLE RFC 5025 Presecne Authorization Rules - RFC Authorization rules for Presence
19 RFC SIMPLE RFC 3856 A Presence Package for the SIP - RFC Presence extension for the event package
20 RFC SIMPLE RFC 4480 RPID: Rich Presence Extensions to the PIDF - RFC An extension that adds optional elements to the PIDF
21 RFC SIMPLE RFC 3857 A Watcher Information Event Templete-Package for the SIP - RFCAn event templete package for event notification for management watcher information that associated a resource
22 RFC SIMPLE RFC 3858 An XML based Format for Watcher Information - RFC A PIDF Definition for Watcher Information
23 RFC SIMPLE RFC 4825 The XML Configuration Access Protocol(XCAP) - RFC A protocol definition that can read, write, modify application in XML format on a server
24 RFC SIMPLE RFC 4826 XML Formats for Representing Resource Lists - RFC A Definition how to reprensenting resource list with XCAP
25 RFC SIMPLE RFC 4827 An XCAP Usage for Manipulating Presence Document Contents - RFC Describes a usage of the XCAP for manipulating the contents of PIDF
26 Draft SIMPLEinterdomain-scaling-
analysisPresence Interdomain Scalling Analysis for SIP/SIMPLE 5 Publication Requested An analysis for presence and IM traffic as an informational doc.
27 Draft SIMPLE view-sharing Optimizing Federated Presence with View Sharing 1 Active A traffic reduce method with view sharing associated I-D-interdomain-scaling-analysis
28 RFC SIMPLE RFC 3856 A SIP Event Package for the SIP - RFC The usage of the SIP for subscriptions and notifications of presence
29 Draft SIP info-event SIP INFO Method and Package Framework 0 Active Defines a event package for session defining, negotiation and exchanging with INFO method
30 Draft SIP location-conveyance Location Conveyance for the SIP 10 ActiveDefines an extension to the SIP to convey geographic location information from one to another SIP entity
31 RFC SIP RFC 3515 The SIP Refer Method - RFC Defines REFER method, refer event package and refer-to request header
32 Draft SIPPINGpresence-scaling-
requirementsScaling Requirements for Presence in SIP/SIMPLE 1 Active A set of requirements for enabling interdomain scaling on presence
33 Draft SIPPING cc-framework A Call Control and Multi-party usage framework for the SIP 10 Publication Requested Define a framework and requirements for call control and multi party usage of SIP
34 Draft SIPPING cc-transfer Session Initiation Protocol Call Control - Transfer 11 Waiting for AD As a part of SIP Multipart call control - call transfer with REFER
35 Draft SIPPING config-framework A Framework for SIP User Agent Profile Delivery 15 AD Evaluation A Framework ro enable configuratio of SIP UA in SIP deployment
36 Draft SIPPING policy-package A SIP Event Package for Session-specific Session Policies 5 IESG Evaluation Enables UA to subacribe to session policy for a SIP session and to receive notifications, if it change
37 Draft SIPPING rtcp-summary SIP Package for Voice Quaity Reporting Event 5 IESG Evaluation A Definition to enable the collection and reporting that measure the qualituy for VoIP sessions
38 Draft SIPPING gruu-reg-event Registration Event Package Extention for SIP GRUUs 9 Last CallReg. event package (RFC3680) extention to GRUU for frequency unreachable 'contact' information
39 Draft SIPPING pending-additions The SIP Pending Additions Event Package 5 RFC Ed. QueueDefines a event package whereby user agent can subscribe to the consent-related state of the resources[ID-sip-consent-framework] that are being added to a resource list that defines translation
40 RFC SIPPING RFC 4575 A SIP Event Package for Conference State - RFC A SIP Event Package for tightly coupled conferences using the SIP
41 RFC SIPPING RFC 4235 An INVITE-Initiated Dialog Event Package for the SIP - RFC A Dialog event package for INVITE initiated dialog
42 RFC SIPPING RFC 4730 A SIP Event Package for Key Press Stimulus - RFCDescribes a KPML that enables monitoring of DTMF signals and user XML docs refered to as KPML
43 RFC SIPPING RFC 3842 A Message Summary and Message Waiting Infication Event Package for the SIP - RFCA SIP Event Package to carry message waiting status and message summaries form a messaging systm to UA
44 RFC SIPPING RFC 4354A SIP Event Package and Data Format for Various Setting in Support for the PTToCellular Service
- RFCDefines a SIP event package to support publication, subscription, and notification of additional capabilities for PoC
45 RFC SIPPING RFC 3680 A SIP Event Package for Registration - RFC A Event Package for Register event occurred state
46 RFCSPEERMIN
TRFC 5344 Presence and Instant Messaging Peering Use Cases - RFC
Describes several user cases of peering of non-VoIP services between two or more Service Provider
( ㅡ _-)’’
SIP-overload WGRate-based Overload Control• Limit the request rate a server receives from an
upstream element. ▫ Feedback: X requests per second.
Loss-based Overload Control• Reduce the request rate a server receives by a
percentage X.▫ Feedback: reduce load by X%.
Window-based Overload Control• Limit the number of request a server can receive
without confirming a request.▫ Feedback: send X more requests.
Overload Signal-based Overload Control• De-/increase of request rate until a target overload
notification rate is reached. ▫ Feedback: server overloaded (503 response without
Retry–After header)
Any Questions