Академический Документы
Профессиональный Документы
Культура Документы
Overview
www.huawei.com
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page1
Objectives
Upon completion of this course, you will be able to:
Know the function and workflow of SIP protocol
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page2
Contents
1. SIP Overview
2. SIP Protocol
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page3
Whats SIP?
SIP: Session Initiation Protocol
Request/Reply protocol
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page4
Session Related Protocols
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page5
Simplified SIP Network Architecture
Request Proxy Server
Determines Where to
Send the Signaling
Messages
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page6
Logical Entities of SIP
SIP use client/server architecture
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page7
Transaction and Dialog
Transaction Dialog
comprises all messages Composed with more
from the 1st request and all
transactions
the response.
INVITE is the only command
At least includes one final
to create a Dialog.
response (not 1xx
Response) Identified by Call-ID, Local
Tag and Remote Tag
Use branch field in Via
header and Cseq header to
identify
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page8
Transaction and Dialog (Cont.)
Transaction Dialog
A request and all its Consist of several
response transactions
Invite
Invite T1
183
183 PRACK T2
200
T1
180 Ringing
180 Ringing 200
ACK T3
200 ok Bye T4
200
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page9
SIP URI
SIP URI : A SIP URI is in the same format as an E-mail
address
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page10
Contents
1. SIP Overview
2. SIP Protocol
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page11
Contents
2. SIP Protocol
2.1 Message type
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page12
SIP Message Type -- Request
Basic Request Extended Request
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page13
SIP Message Type -- Response
SIP response type:
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.
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page14
SIP Basic Flow
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page15
Contents
2. SIP Protocol
2.1 Message type
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page16
SIP Message Structure
SIP is a Text-
based protocol
and comprise
by 3 parts:
Request-Line
Header
Body
Request-line in SIP Request Message
Request-line = Method SP Request-URI SP SIP-Version CRLF
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page18
Start-line in SIP Response
Message
Status-line
Example: SIP/2.0 200 OK
SIP-version
Status-code
1xx
2xx
3xx
4xx
5xx
6xx
Reason-phase
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page19
SIP Message Header
Message-header:
Format: field-name: field-value
REGISTER sip:registrar.huawei.com SIP/2.0
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page20
SIP Message Body
Optional, can be any protocol
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page21
SIP Message Body -- SDP Example
v=0
o=HuaweiSoftX3000 868 868 IN IP4 10.216.9.200
s=Sip Call
c=IN IP4 10.216.6.108
t=0 0
m=audio 17368 RTP/AVP 8
a=rtpmap:8 PCMA/8000
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page22
Contents
2. SIP Protocol
2.1 Message type
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page23
Header Fields Basic Headers
INVITE sip:66500002@191.169.1.110 SIP/2.0
From: <sip:44510000@191.169.1.116>;tag=1ccb6df3
To: <sip:66500002@191.169.1.110>
CSeq: 1 INVITE
Call-ID: 20973e49f7c52937fc6be224f9e52543@sx3000
Via:SIP/2.0/UDP server9.example.com;branch=z9hG4kb77ef4c23
Via: SIP/2.0/UDP 191.169.1.116:5061;branch=z9hG4bkbc427dad6
Record-Route:<sip:server9.example.com.lr>
Route:<sip:server10.example.com.lr>
Contact: <sip:44510000@191.169.1.116:5061>
Supported: 100rel,
Max-Forwards:70
User-agent: Flexit-IMS softphone V1.2D301SP03
Expires:120
Content-Length:230
Content-Type: application/sdp
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page24
Header Fields From & To
TO: the target of this request
Example:
INVITE sip:bob@huawei.com SIP/2.0
To: Bob <sip:bob@huawei.com>
From: Alice <sip:alice@atlanta.com>;tag=1928301774
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page25
Header Fields From & To (Cont.)
Request URI & From & To
REGISTER
destination
REGISTER sip:registrar.huawei.com SIP/2.0
subscriber
To: Bob <sip:bob@huawei.com>
From: Bob<sip:bob@huawei.com>;tag=456248
INVITE
callee
INVITE sip:ice@huawei.com SIP/2.0
To:Ice <sip:ice@huawei.com>
caller
From: Bob<sip:bob@huawei.com>;tag=456248
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page26
Header Fields Contact
Contact
Provide an address for direct communication with the user.
Example:
INVITE sip:bob@huawei.com SIP/2.0
Contact: <sip:44510000@191.169.1.116:5061>
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page27
Header Fields Call-ID & Cseq
Call-ID: a globally unique identifier
Call-ID and tags are used to identify a dialog.
Cseq: as a way to identify and order transactions
Consists of a sequence number and a method
Example:
INVITE sip:bob@huawei.com SIP/2.0
Call-ID: a84b4c76e66710
CSeq: 314159 INVITE
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page28
Header Fields Record-Route and Route
Record-Route
Added by a proxy in a request to force subsequent requests in the
session to be routed through the proxy
Is used to create the Route header field in subsequent requests
Route
Is used to forcibly route a request through the listed set of proxies
Example: Example:
INVITE sip:bob@huawei.com SIP/2. INVITE sip:bob@huawei.com SIP/2.
Record-Route:<scscf.huawei.com.lr> Route:<scscf.huawei.com.lr>
Record-Route:<pcscf.huawei.com.lr>
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page29
Header Fields - Via
Via:
Identifies the route for the response
Example:
SIP/2.0 200 OK
Via: SIP/2.0/UDP server10.huawei.com; branch=z9hG4bKnashds8;
Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;
branch=z9hG4bK77ef4c2312983.1;
Via: SIP/2.0/UDP pc33.atlanta.com;
branch=z9hG4bK776asdhds ;received=192.0.2.1
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page30
Header Fields - Supported
Supported
100rel extension provides an appropriate mechanism for the
reliable transportation of the 100 response
Example:
INVITE sip:bob@huawei.com SIP/2.0
Supported: 100rel,
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page31
Header Fields - Content-length/Content-Type
Content-length
Indicates the size of the message body
If a message does not contain a message body, the value of the
Content-Length header field must be set to 0.
Example:
INVITE sip:bob@huawei.com SIP/2.0
Content-Length: 142
Content-type
Indicates the media type of the message body sent to the recipient
Example:
INVITE sip:bob@huawei.com SIP/2.0
Content-Type: application/sdp
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page32
Header Fields - Expires
Expires
Gives the relative time after which the message (or content) expires
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page33
Header Fields - Max-Forwards & User-Agent
Max-Forwards: to limit the number of hops a request can
transit on the way to its destination
The error response is 483 (too many hops).
In request message
User-agent
contains information about the UAC originating the request
Example:
INVITE sip:bob@huawei.com SIP/2.0
Max-Forwards: 70 Example:
INVITE sip:bob@huawei.com SIP/2.0
User-agent: Flexit-IMS softphone V1.2D301
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page34
Header Fields - Extension Headers
Example
REGISTER sip:registrar.bplace.com SIP/2.0
Via: SIP/2.0/UDP 8.27.2.102:10226;branch=z9hG4bod840d0w
Via: SIP/2.0/UDP 8.27.22.224:5061;branch=z9hG4bKnashds7 ;received=192.0.2.4
To: B <sip:b@bplace.com>;
From: B <sip:b@bplace.com>;tag=456248
P-Access-Network-Info: 3GPP-UTRAN-TDD;utran-cell-id-3gpp=234151D0FCE
P-Visited-Network-ID: "8.27.2.102"
P-Charging-Vector: icid-value="8.27.2.102.3348465999.3157.14"
Call-ID: 217944815@8.27.22.224
CSeq: 1826 REGISTER
Contact: <sip:b@8.27.22.224:5061>;
Expires: 7200
Content-Length: 0
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page35
Some Extension Header Examples in
IMS
Extension Header Examples Function
P-Access-Network-Info Is used by the SIP UA to transfer access network
technologies to the service proxy
P-Visited-Network-ID Is used to relay the identification of the visited
domain to the registrar and proxy in the home realm
P-Charging-Vector Cooperates with the P-Charging-Function-Address
header field to transfer charging information over
the network
P-Asserted-Identity Formally indicate the calling party ID
Service-Route Used to inform the S-CSCF IP for P-CSCF during
Register
Path Used to inform the P-CSCF IP for S-CSCF during
Register
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page36
Contents
1. SIP Overview
2. SIP Protocol
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page37
Main Procedures in IMS Application
Registration
UA Registrar Server
register
200OK
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page38
Main Procedures in IMS Application
Session Setup/Release flow
Proxy
Server
UA1 UA2
INVITE
100 Trying
INVITE
100 Trying
180 Ring
180 Ring
200 OK
200 OK
ACK
ACK
RTP
BYE BYE
200 OK
200 OK
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page39
Main Procedures in IMS Application
Media negotiation
caller UE callee UE
INVITEprovided by the first SDPrequired media type and all the codec
200 OK( the second response from SDPconfirm to the media type and the codec negotiated)
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page40
Main Procedures in IMS Application
Media negotiation
Offer & Answer example
Offer: Answer:
v=0 v=0
o=alice2890844526 2890844526 o=bob 2890844730 2890844730IN
IN IP4 host.anywhere.com IP4 host.example.com
s= s=
c=IN IP4 host.anywhere.com c=IN IP4 host.example.com
t=0 0 t=0 0
m=audio 49170 RTP/AVP 0 m=audio 49920 RTP/AVP 0
a=rtpmap:0 PCMU/8000 a=rtpmap:0 PCMU/8000
m=video 51372 RTP/AVP 31 m=video 0 RTP/AVP 31
a=rtpmap:31 H261/90000 m=video 53000 RTP/AVP 32
m=video 53000 RTP/AVP 32 a=rtpmap:32 MPV/90000.
a=rtpmap:32 MPV/90000
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page41
Route in IMS Session Signaling Flow
Important header
Route
Via
For response message routing
Record-route
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page42
Route in IMS Session Signaling Flow
Example -- Request
P-CSCF1 P-CSCF2
1.Invite 6.Invite
tom@home1.com ice@home2.com
(IP: 10.10.1.196) (IP: 10.10.1.197)
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page43
Route for the INVITE Request (1)
Request
1.invite (Caller---Calling PCSCF)
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page44
Route for the INVITE Request (2)
Request
2.invite (calling PCSCF------calling SCSCF)
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page45
Route for the INVITE Request (3)
Request
3.invite (calling SCSCF-----called ISCSF)
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page46
Route for the INVITE Request (4)
Request
4.invite (called ICSCF----called SCSCF)
INVITE sip:ice@home2.hu SIP/2.0
Via:SIP/2.0/UDP icscf2.home1.fr;branch=geagi3
Via:SIP/2.0/UDP scscf1.home1.fr;branch=agega1
Via:SIP/2.0/UDP pcscf1.visited1.fr;branch=9pctb
Via:SIP/2.0/UDP 10.10.1.196 :5060;branch=8uetb
Record-Route:<sip:scscf1.home1.fr;lr>
Record-Route:<sip:pcscf1.visited1.fr;lr>
Route:<sip:scscf2.home2.hu;lr>
Max-Forwards:67
From:<sip:tom@home1.com>;tag=veli
To: <sip:ice@home2.hu SIP/2.0
Call-Id:sdgweituoweruoiweur
Cseq:12 INVITE
Contact:< sip: tom@10.10.1.196 :5060; transport=udp>
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page47
Route for the INVITE Request (5)
Request
5.invite (called SCSCF---called PCSCF)
INVITE sip:ice@home2.hu SIP/2.0
Via:SIP/2.0/UDP scscf2.home2.hu;branch=cscth7
Via:SIP/2.0/UDP icscf2.home1.fr;branch=geagi3
Via:SIP/2.0/UDP scscf1.home1.fr;branch=agega1
Via:SIP/2.0/UDP pcscf1.visited1.fr;branch=9pctb
Via:SIP/2.0/UDP 10.10.1.196 :5060;branch=8uetb
Record-Route:<sip:scscf2.home2.hu;lr>
Record-Route:<sip:scscf1.home1.fr;lr>
Record-Route:<sip:pcscf1.visited1.fr;lr>
Route:<sip:term@pcscf2.home2.hu;lr>
Max-Forwards:66
From:<sip:tom@home1.com>;tag=veli
To: <sip:ice@home2.hu SIP/2.0
Call-Id:sdgweituoweruoiweur
Cseq:12 INVITE
Contact:< sip: tom@10.10.1.196 :5060; transport=udp>
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page48
Route for the INVITE Request (6)
Request
6.invite (called PCSCF----callee)
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page49
Route in IMS Session Signaling Flow -
Response
Example -- Response
P-CSCF1 P-CSCF2
6.183 1.183
tom@home1.com ice@home2.com
(IP: 10.10.1.196) (IP: 10.10.1.197)
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page50
Route in IMS Session Signaling Flow
Response
1.183 (callee---CalledPCSCF)
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page51
Route in IMS Session Signaling Flow
Response
2.183 (Called PCSCF----called SCSCF )
SIP/2.0 183 Session in Progress
Via:SIP/2.0/UDP scscf2.home2.hu;branch=cscth7
Via:SIP/2.0/UDP icscf2.home1.fr;branch=geagi3
Via:SIP/2.0/UDP scscf1.home1.fr;branch=agega1
Via:SIP/2.0/UDP pcscf1.visited1.fr;branch=9pctb
Via:SIP/2.0/UDP 10.10.1.196:5060;branch=8uetb
Record-Route:<sip:pcscf2.home2.hu;lr>
Record-Route:<sip:scscf2.home2.hu;lr>
Record-Route:<sip:scscf1.home1.fr;lr>
Record-Route:<sip:pcscf1.visited1.fr;lr>
From:<sip:tom@home1.com>;tag=veli
To: <sip:ice@home2.hu SIP/2.0
Call-Id:sdgweituoweruoiweur
Cseq:12 INVITE
Contact:<sip:ice@10.10.1.197:5060; transport=udp>
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page52
Route in IMS Session Signaling Flow
Response
3.183 (Called SCSCF-----called ICSCF)
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page53
Route in IMS Session Signaling Flow
Response
4.183 (Called ICSCF-----calling SCSCF)
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page54
Route in IMS Session Signaling Flow
Response
5.183 (Calling SCSCF------calling PCSCF)
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page55
Route in IMS Session Signaling Flow
Response
6.183 (Calling PCSCF-----caller )
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page56
Route in IMS Session Signaling Flow --
The Following Request
Example The following request
3.PRACK
S-CSCF1 S-CSCF2
2.PRACK 4.PRACK
I-CSCF2
P-CSCF1 P-CSCF2
1.PRACK 5.PRACK
tom@home1.com ice@home2.com
(IP: 10.10.1.196) (IP: 10.10.1.197)
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page57
Route in IMS Session Signaling Flow
Step 3
PRACK (calling SCSCF---- Called SCSCF )
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page58
Summary
SIP is used to establish, modify and terminate a multimedia
conference, such as conference call over Internet. SIP can be
used to initiate sessions as well as inviting members to sessions
that have been advertised and established by other means.
SIP request messages: SIP messages sent by a client to the
server on the basis of designated operation for activation, which
include such messages as INVITE, PRACK, ACK, BYE, CANCEL,
UPDATE, etc.
SIP Response Messages: Used to display the status of the
requests sent by clients to the server, including the 1xx, 2xx, 3xx,
4xx, 5xx and 6xx.
The functions of each command in SIP call process should be
mastered as the key points.
Copyright 2009 Huawei Technologies Co., Ltd. All rights reserved. Page59
Thank you
www.huawei.com