session initiation protocol (sip) - 國立臺灣大學acpang/course/voip_2003/slides/chap5... ·...
TRANSCRIPT
Session Initiation Protocol (SIP)
Chapter 5
2Internet Telephony
Introduction
A powerful alternative to H.323More flexible, simplerEasier to implement
Advanced features
Better suited to the support of intelligent user devicesA part of IETF multimedia data and control architectureSDP, RTSP (Real-Time Streaming Protocol), SAP (Session Announcement Protocol)
3Internet Telephony
The Popularity of SIP
Originally Developed in the MMUSIC (Multiparty Multimedia Session Control)
A separate SIP working groupRFC 2543Many developersThe latest version: RFC 3261
SIP + MGCP/MEGACOThe VoIP signaling in the future
“bake-off”Various vendors come together and test their products against each other
to ensure that they have implemented the specification correctlyto ensure compatibility with other implementations
4Internet Telephony
SIP Architecture
A signaling protocolThe setup, modification, and tear-down of multimedia sessions
SIP + SDPDescribe the session characteristics
Separate signaling and media streams
5Internet Telephony
SIP Network Entities [1/4]
ClientsUser agent clientsApplication programs sending SIP requests
ServersResponds to clients’ requests
Clients and servers may be in the same platformProxy
Acts as both clients and servers
6Internet Telephony
SIP Network Entities [2/4]
Four types of serversProxy servers
Handle requests or forward requests to other serversCan be used for call forwarding, time-of-day routing, or follow-me services
7Internet Telephony
SIP Network Entities [3/4]
Redirect serversMap the destination address to zero or more new addresses
8Internet Telephony
SIP Network Entities [4/4]
A user agent serverAccepts SIP requests and contacts the userThe user responds → an SIP responseA SIP deviceE.g., a SIP-enabled telephone
A registrarAccepts SIP REGISTER requests
Indicating that the user is at a particular addressPersonal mobility
Typically combined with a proxy or redirect server
9Internet Telephony
SIP Call Establishment
It is simple, which contains a number of interim responses.
10Internet Telephony
SIP Advantages
Attempt to keep the signaling as simple as possibleOffer a great deal of flexibility
Does not care what type of media is to be exchanged during a session or the type of transport to be used for the media
Various pieces of information can be included within the messages
Including non-standard informationEnable the users to make intelligent decisions
The control of the intelligent features is placed in the hands of the customer, not the network operator.
E.g., SUBJECT header
11Internet Telephony
Call Completion to Busy Subscriber Service
12Internet Telephony
Overview of SIP Messaging Syntax
Text-basedSimilar to HTTPDisadvantage – more bandwidth consumption
SIP messagesmessage = start-line
*message-header CRLF[message-body]
start-line = request-line | status-lineRequest-line specifies the type of requestThe response line indicates the success or failure of a given request.
13Internet Telephony
Message headersAdditional information of the request or responseE.g.,
The originator and recipientRetry-after headerSubject header
Message bodyDescribe the type of sessionThe most common structure for the message body is SDP (Session Description Protocol).Could include an ISDN User Part messageExamined only at the two ends
14Internet Telephony
SIP Requests [1/2]
Method SP Request-URI SP SIP-version CRLFRequest-URI
The address of the destination
MethodsINVITE, ACK, OPTIONS, BYE, CANCLE, REGISTERINVITE
Initiate a sessionInformation of the calling and called partiesThe type of media〜IAM (initial address message) of ISUPACK only when receiving the final response
15Internet Telephony
SIP Requests [2/2]
BYETerminate a sessionCan be issued by either the calling or called party
OptionsQuery a server as to its capabilities
A particular type of media
CANCELTerminate a pending requestE.g., an INVITE did not receive a final response
REGISTERLog in and register the address with a SIP server“all SIP servers” – multicast address (224.0.1.1750)Can register with multiple serversCan have several registrations with one server
16Internet Telephony
“One number” service
17Internet Telephony
SIP INFO Method
Specified in RFC 2976For transferring information during an ongoing session
The transfer of DTMF digitsThe transfer of account balance information
Pre-paid service
The transfer of mid-call signaling information
18Internet Telephony
SIP Responses
SIP Version SP Status Code SP Reason-Phrase CRLF
Reason-PhraseA textual description of the outcomeCould be presented to the user
status codeA three-digit number1XX Informational2XX Success (only code 200 is defined)3XX Redirection4XX Request Failure5XX Server Failure6XX Global FailureAll responses, except for 1XX, are considered final
Should be ACKed
19Internet Telephony
SIP Addressing
SIP URLs (Uniform Resource Locators)user@hostsip:[email protected]:[email protected]
20Internet Telephony
Message Headers
Provide further information about the messageE.g.,
To:header in an INVITEThe called party
From:headerThe calling party
Four main categoriesGeneral, Request, Response, and Entity headers
21Internet Telephony
General Headers
Used in both requests and responsesBasic information
E.g., To:, From:, Call-ID: (uniquely identifies a specific invitation to a session), …
Contact:Provides a URL for use in future communication regarding a particular sessionExamples 1: In a SIP INVITE, the Contact header might be different from the From header.
An third-party administrator initiates a multiparty session.Example 2: Used in response, it is useful for directing further requests directly to the called user.Example 3: It is used to indicate a more appropriate address if an INVITE issued to a given URI failed to reach the user.
22Internet Telephony
Request HeadersApply only to SIP requestsAddition information about the request or the clientE.g.,
Subject:Priority:, urgency of the request (emergency, urgent, normal, or non-urgent)
Response HeadersFurther information about the response that cannot be included in the status lineE.g.,
UnsupportedRetry-After
23Internet Telephony
Entity Headers
Indicate the type and format of information included in the message bodyContent-Length: the length of the message bodyContent-Type: the media type of the message body
E.g., application/sdpContent-Encoding: for message compressionContent Disposition: how a message part should be interpreted
session, alert …
24Internet Telephony
Examples of SIP Message Sequences
RegistrationVia:From: and To:Call-ID:
host-specificContact: (for future SIPmessage transmission)
*Content-Length:
Zero, no msg bodyCSeq:
A response to any request must use the same value of CSeq as used in the request.
Expires:TTL0, unreg
Invitation
A two-party callSubject:
optional
Content-Type:application/sdp
A dialog IDTo identify a peer-to-peer relationship between two user agentsTag in FromTag in ToCall-ID
26Internet Telephony
Termination of a Call
Cseq:Has changed
Redirect Servers
An alternative address302, Moved temporarily
Another INVITESame Call-IDCSeq ++
28Internet Telephony
Proxy Servers
Sits between a user-agent client and the far-end user-agent serverNumerous proxies can reside in a chain between the caller and callee.The last proxy may change the Request-URI.Via:
The path taken by a requestLoop detected, 482 (status code)For a response
The 1st Via: headerCheckedRemoved
Branch: used to distinguish between multiple responses to the same request
Forking Proxy: Issue a single request to multiple destinations
30Internet Telephony
Proxy state
Can be either stateless or statefulRecord-Route:
The messages and responses may not pass through the same proxy
Use Contact:
A Proxy might require that it remains in the signaling pathIn particular, for a stateful proxy
Insert its address into the Record-Route: headerThe response includes the Record-Route: headerThe information contained in the Record-Route: header is used in the subsequent requests related to the same call.The Route: header = the Record-Route: header in reverse order
31Internet Telephony
Forking Proxy
“fork” requestsA user is registered at several locations
;branch=xxx
In order to handle such forking, a proxy must be stateful.