Professional Documents
Culture Documents
Tutorial Sip
Tutorial Sip
May 2001
hgs/SIP Tutorial
Overview
protocol architecture typical component architectures protocol operation reliability features security
May 2001
hgs/SIP Tutorial
Introduction
core protocol for establishing sessions in the Internet transports session description information from initiator (caller) to callees allows to change parameters in mid-session terminate session
May 2001
hgs/SIP Tutorial
Protocol architecture
Languages/APIs JAIN CPL voiceXML servlets Parlay sipcgi Directory/Discovery DNS/enum LDAP TRIP SLP Signaling SIP SDP MGCP H.248 PINT
SPIRITS
peertopeer
RTSP
masterslave
May 2001
hgs/SIP Tutorial
SIP applications
setting up voice-over-IP calls setting up multimedia conferences event notication (subscribe/notify) IM and presence text and general messaging signaling transport
May 2001
hgs/SIP Tutorial
Personal mobility
SIP uses email-style addresses to identify users
alice@columbia.edu (also used by bob@columbia.edu)
yahoo.com
tel:12128541111
alice@host.columbia.edu
May 2001
hgs/SIP Tutorial
SIP addressing
typically, same as users email address: alice@example.com 12125551212@gateways-r-us.com written as URL, e.g., sip:alice@example.com also can use tel URLs for telephone numbers, e.g., tel:+12125551212 or fax:+358.555.1234567
May 2001
hgs/SIP Tutorial
Building blocks
SIP user agent SIP redirect server SIP stateless proxy SIP (forking) proxy
A@ B@ C@
IP phone, PC, conference bridge returns new location for requests routes call requests routes call requests maintains mappings from names to addresses
SIP registrar
May 2001
hgs/SIP Tutorial
Back-to-back UA (B2BUA)
two (or more) user agents, where incoming calls trigger outgoing calls to somebody else also, third-party call control (later) useful for services and anonymity
200 OK
May 2001
hgs/SIP Tutorial
10
May 2001
hgs/SIP Tutorial
11
May 2001
hgs/SIP Tutorial
12
Internet
RTP audio
128.119.40.186
128.59.19.141
CATV Ethernet
May 2001
hgs/SIP Tutorial
13
outbound proxy
Internet
registrar proxy
wonderland.com
INVITE sip:bob@macrosoft.com SIP/2.0 INVITE sip:bob@macrosoft.com SIP/2.0
alice@ph7.wonderland.com
bob@p42.macrosoft.com
INVITE sip:bob@p42.macrosoft.com SIP/2.0
May 2001
hgs/SIP Tutorial
14
TRIP
SIP H.248
tel:+12125551234
outbound proxy
IP 010
May 2001
hgs/SIP Tutorial
15
SCP
enum sip:alice@wonderland.com
IP 010
INVITE sip:alice@wonderland.com
May 2001
hgs/SIP Tutorial
16
? location server
1 2
hgs@play
henning
cs.tuberlin.de
INVITE hgs@play 5
3
200 OK
6
cz@cs.tuberlin.de
play
tune
8
ACK hgs@play
media stream
May 2001
hgs/SIP Tutorial
17
?
2 columbia.edu
location server
columbia.edu
hgs
hgs/SIP Tutorial
18
location server
INVITE alice@example.com INVITE alice@pc17.example.com
proxy
May 2001
hgs/SIP Tutorial
19
May 2001
hgs/SIP Tutorial
20
May 2001
hgs/SIP Tutorial
21
Outbound proxies
normally, proxy serves one or more domains outbound proxies are used for all outbound requests from within a domain typically, for managing corporate rewalls and policy enforcement may also provide dial plans or route tel/fax URLs other uses: lawyer client billing, . . .
May 2001
hgs/SIP Tutorial
22
SIP: use a newer record for general-purpose mapping, SRV (RFC 2782) mapping from service and transport protocol to one or more servers, including protocols
_sip._tcp _sip._udp SRV SRV SRV SRV 0 1 0 1 0 0 0 0 5060 5060 5060 5060 sip-server.cs.columbia.edu. backup.ip-provider.net. sip-server.cs.columbia.edu. backup.ip-provider.net.
hgs/SIP Tutorial
23
a*@example.com
s1.example.com
s2.example.com
b*@example.com sip:bob@a.example.com
sip:bob@example.com
s3.example.com
b1.example.com, b2.example.com
May 2001
hgs/SIP Tutorial
24
IP signaling meets media only at end systems, while PSTN out-of-band intersects at every switch
May 2001
hgs/SIP Tutorial
25
May 2001
hgs/SIP Tutorial
26
MGCP/SIP architecture
STP call agent MG controller
SIP H.323
SIP H.323
TCAP
SS7 gwy
ISUP
SCP
MGCP/Megaco
MGCP/Megaco
SS7
Internet
PSTN
May 2001
hgs/SIP Tutorial
27
May 2001
hgs/SIP Tutorial
28
SIP syntax
request method URL SIP/2.0 response SIP/2.0 status reason
Via: SIP/2.0/ protocol host:port user <sip:from_user@source> From: To: user <sip:to_user@destination> CallID: localid@host CSeq: seq# method ContentLength: length of body ContentType: media type of body Header: parameter ;par1=value ;par2="value" ;par3="value folded into next line" blank line
V=0 o= origin_user timestamp timestamp IN IP4 host c=IN IP4 media destination address t=0 0 m= media type port RTP/AVP payload types
message
message body
message header
May 2001
hgs/SIP Tutorial
29
SIP syntax
eld names and some tokens (e.g., media type) are case-insensitive everything else is case-sensitive white space doesnt matter except in rst line lines can be folded multi-valued header elds can be combined as a comma-list
May 2001
hgs/SIP Tutorial
30
SIP methods
INVITE ACK BYE CANCEL OPTIONS REGISTER INFO COMET PRACK SUBSCRIBE NOTIFY initiate call conrm nal response terminate (and transfer) call cancel searches and ringing features support by other side register with location service mid-call information (ISUP, DTMF) precondition met provisional acknowledgement subscribe to event notify subscribers
May 2001
hgs/SIP Tutorial
31
Tagging To
after forking and merging, hard to tell who responded UAS responds with random tag added to disambiguate To: "A. G. Bell" <sip:agb@bell-telephone.com> ;tag=a48s future requests are ignored if they contain the wrong tag
May 2001
hgs/SIP Tutorial
32
May 2001
hgs/SIP Tutorial
33
SIP responses
Informational
100 Trying 180 Ringing 181 Call forwarded 182 Queued 183 Session Progress
Success
200 OK
Redirection
300 Multiple Choices 301 Moved Perm. 302 Moved Temp. 380 Alternative Serv.
Request Failure
400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 405 Bad Method 415 Unsupp. Content 420 Bad Extensions 486 Busy Here
500 Server Error 501 Not Implemented 503 Unavailable 504 Timeout
600 Busy Everwhere 603 Decline 604 Doesnt Exist 606 Not Acceptable
Server Failure
Global Failure
May 2001
hgs/SIP Tutorial
34
May 2001
hgs/SIP Tutorial
35
bob@columbia.edu
INvITE
Via: a.example.com Via: y1.yahoo.com Via: a.example.com
Via: sip.columbia.edu Via: y1.yahoo.com Via: a.example.com Via: sip.columbia.edu Via: y1.yahoo.com Via: a.example.com
bob@cs.columbia.edu 200 OK
Via: cs.columbia.edu Via: sip.columbia.edu Via: y1.yahoo.com Via: a.example.com
bob@pc42.cs.columbia.edu
May 2001
hgs/SIP Tutorial
36
May 2001
hgs/SIP Tutorial
37
a.wonderland.com
INVITE sales@macrosoft.com
INVITE bob@b
ACK
200 OK
BYE carol@c.macrosoft.com
200 OK
May 2001
hgs/SIP Tutorial
38
May 2001
hgs/SIP Tutorial
39
May 2001
hgs/SIP Tutorial
40
used for BYE, OPTIONS, SUBSCRIBE, NOTIFY, . . . 1xx sent by UAS or proxy only if no nal answer expected within 200 ms if provisional response, retransmit with T 2 (4) seconds
1s
May 2001
hgs/SIP Tutorial
41
INVITE reliability
INVITE is special long time between request and nal response 100 (by proxy) indicates request has been received proxy usually forwards 1xx from all branches only retransmit until 100 ACK conrms receipt of nal response
status ACK event request sent T1*2 INVITE
n
Initial
INVITE
Calling
1xx
status ACK
Call proceeding
status ACK
Completed
May 2001
hgs/SIP Tutorial
42
Extending SIP
extension new headers new headers new method new body type new status code new URL type behavior ignored mandatory determine? Supported OPTIONS Accept ?
class-based
May 2001
hgs/SIP Tutorial
43
S->C:
S->C:
May 2001
hgs/SIP Tutorial
44
Invitation modes
signaling unicast multicast media unicast multicast telephony multicast session reach rst dept. conference
May 2001
hgs/SIP Tutorial
45
SIP-based services
Call forwarding: basic INVITE behavior (proxy/redirect) Call transfer: REFER method (see later) DTMF carriage: carry as RTP payload (RFC 2833) Calling card: B2BUA + voice server Voice mail: UA with special URL(s) + possibly RTSP
May 2001
hgs/SIP Tutorial
46
SIP security
layer/mechanism network layer transport layer SIP INVITE SIP REGISTER SIP general approach IPsec TLS basic/digest basic/digest S/MIME characteristics adjacent nodes, all or nothing, hard to congure adjacent nodes, all or nothing shared secrets with random parties securing headers? in progress
Basic (plaintext password) and digest (challenge-response) are very similar to HTTP security mechanisms.
May 2001
hgs/SIP Tutorial
47
May 2001