The Session Initiation Protocol (SIP)
The Session Initiation Protocol (SIP)
Overview
design alternatives
mobility
future directions
3
SIP Basics
4
set up session
“forking” of calls
SIP features
SIP
redirect server
128.119.40.186
Internet
RTP audio
128.59.19.141
CATV
Ethernet
8
wonderland.com macrosoft.com
REGISTER sip:macrosoft.com SIP/2.0
To: sip:[email protected]
From: sip:[email protected]
Contact: sip:[email protected]
outbound registrar
wonderland.com
INVITE sip:[email protected] SIP/2.0 INVITE sip:[email protected] SIP/2.0
[email protected]
[email protected]
INVITE sip:[email protected] SIP/2.0
9
(10.0.0.2)
128.59.16.1/5678 −> 216.32.74.51/80
(216.32.74.51)
NAT
128.59.16.1/5678 <− 216.32.74.51/80
10.0.0.1 128.59.16.1
bob.example.com
(10.0.0.3)
location server
TRIP
SLP?, TRIP−GW?
sip:[email protected]
sip:1−212−555−1234@domain
SIP
H.248
tel:+1−212−555−1234
outbound proxy
IP
010
11
enum database
DNS
4.3.2.1.5.5.5.2.1.2.1.e164.arpa
SCP enum
INVITE sip:[email protected]
IP
010
12
SIP–DNS interaction
1. try SRV DNS record for “ sip. udp” and “ sip. tcp” in domain, with
priority and weights for randomized load balancing
3. may try SMTP EXPN command to get new address; goto (1)
cs.columbia.edu
? location server
1
4
INVITE
cs.tu-berlin.de INVITE hgs@play 5
hgs@play
henning
[email protected] 2
3
200 OK
200 OK
[email protected] 6
7 play
tune 9
8
ACK hgs@play
ACK
[email protected]
10 media stream
15
ieee.org
? location
server
columbia.edu
1
tu-berlin.de INVITE [email protected] 2
henning
3
5 ACK [email protected]
columbia.edu
6 INVITE [email protected]
7 200 OK
Alice Bob
(g.b.org, port 3456)
(h.a.com, port 49170)
SIP/2.0 200 OK
(as before)
v=0
m=audio 3456 RTP/AVP 0
RTP audio
BYE sip:[email protected]
Via: SIP/2.0/UDP g.b.org:5060
From: Bob <[email protected]>
To: Alice <[email protected]>
CSeq: 1 BYE
SIP/2.0 200 OK
(as before)
UAC UAS
17
INVITE [email protected]
ACK
INVITE [email protected]
100 Trying
180 Ringing
200 OK
ACK
8
SIP/2.0 180 Ringing
proxy
INVITE sip:[email protected]
To: sip:[email protected] c.macrosoft.com
10 6
SIP/2.0 200 OK
7
SIP/2.0 180 Ringing
9
SIP/2.0 200 OK
From: sip:[email protected]
To: <sip:[email protected]>;tag=17
Call−Id: [email protected]
Cseq: 1 INVITE
Contact: sip:[email protected]
11
ACK sip:[email protected] SIP/2.0
12
BYE sip:[email protected] SIP/2.0
Cseq: 2 BYE
13
SIP/2.0 200 OK
19
Invitation modes
signaling media
unicast multicast
unicast telephony multicast session
multicast reach first dept. conference
➠ SIP for all modes, SAP also for multicast/multicast
20
HTTP look-alike
v=0
c=IN IP4 128.59.16.191
m=audio 1848 RTP/AVP 0
23
SIP requests
SIP URLs
sip:[user:pw@]host:[port]
;transport=UDP;maddr=224.2.0.1
example: sip:[email protected]
25
“Internet binary”
ASN.1
textual
efficient if aligned
fewer ambiguities
not self-describing
30
random textual: ftp, POP, IMAP, gopher, . . . ➠ new parser for each
protocol
SMTP, HTTP, SIP, RTSP
– C ! S : method, object, attribute: value;parameter, [body]
– S ! C : status code, message, [body]
binary data not important
extensions: PEP, JEPI, PICS, . . .
easy to parse & generate for Tcl, Perl, Python, . . .
overhead (space, time)? unidirectional?
but 6= HTTP: not object retrieval, state (RTSP), . . .
32
cost of entry?
performance?
tools (binary)?
SIP Corba
data optional fields versioning hard
two-level hierarchy general, C-like
hiding dynamic directory-based
multiple forking proxy no
transport UDP, TCP, . . . TCP
strength inter-domain intra-domain
generality session set-up RPC, events, . . .
34
SIP Details
35
SIP syntax
request response
message header
To: user <sip:to_user@destination>
Call−ID: localid@host
CSeq: seq# method
Content−Length: length of body
Content−Type: media type of body
Header: parameter ;par1=value ;par2="value"
;par3="value folded into next line"
blank line
message body
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
36
SIP syntax
field names and some tokens (e.g., media type) are case-insensitive
SIP methods
1xx provisional
100 continue
180 ringing
2xx success
200 OK
3xx redirect
300 multiple choices
301 moved permanently
302 moved temporarily
39
Tagging To
each proxy checks for loop, prepends a Via header with own address
P P
– firewalls
– anonymizer proxies
– proxies controlling PSTN gateways
A PA PB B
Record-Route:
Alice <sip:[email protected];maddr=216.112.6.38>,
<sip:[email protected];maddr=216.112.6.39>
Content description
P
INVITE, 100, 200, ACK, BYE, 200 1500 bytes
1.5 s of 8 kb/s voice
gzip compression improves by about 25%
55
SIP headers
requests contain
1. C ! S : INVITE
2. S ! C : 100, user location, ringing, . . .
3. S ! C : 200
4. C ! S : ACK
Initial
INVITE
1xx
INVITE
1xx status change
Proceeding 1xx
terminated
487
failure callee picks up
>= 300 2xx
n
min(T1*2 , T2)
status
INVITE INVITE
status Failure Success 2xx
32s
−
ACK
−
ACK event
− Confirmed message sent
32s
−
Completed
62
Initial
−
INVITE
n
T1*2
INVITE Calling
1xx
event
request sent
63
UAC UAS
INVITE
Supported: 100rel
183 Proceeding
Require: 100rel
RSeq: 776655
CSeq: 1 INVITE
PRACK
RAck: 776655
CSeq: 2 PRACK
64
PRACK
200 OK (PRACK)
reservation
COMET
200 (COMET)
180 Ringing
PRACK
200 OK (PRACK)
200 OK (INVITE)
ACK (INVITE)
UAC UAS
65
REGISTER
registration one (common) way of letting local proxy know where you are
on startup, send REGISTER to sip.mcast.net via multicast
or pre-configured address
registrations expire – determined by server
cancel all registrations with Expires: 0 or individual registrations in
Contact header
returns list of current registrations
registrations should be authenticated
registrations may be proxied ➠ mobility
67
REGISTER example
SIP/2.0 200 OK
Via: SIP/2.0/UDP there.com:5060
From: LittleGuy <sip:[email protected]>
To: LittleGuy <sip:[email protected]>
Call-ID: [email protected]
CSeq: 1 REGISTER
Contact: LittleGuy <sip:[email protected]>
Contact: sip:[email protected];user=phone
Contact: tel:+1-972-555-2222
Contact: mailto:[email protected]
Content-Length: 0
70
typically:
described by:
Accept media type
Accept-Language language of response
Content-Type type of media (text/html, application/sdp, . . . )
Content-Length length of message body
MIME: multipart/mixed
73
media address may not be same as signaling address ➠ PINT with PSTN
addresses
74
a=rtpmap:0 PCMU/8000
a=rtpmap:97 G723/8000
RTP format and
m=video 4180 RTP/AVP 98
video
clock rate
a=rtpmap:98 H263/90000
c=IN IP4 128.59.16.2
76
Security
SIP authentication
Certificate: sign non-Via parts of request headers, body with PGP, PKCS #7
Basic authentication
Challenge by UAS:
Digest authentication
A tries again:
Digest authentication
PGP authentication
retry request:
PGP authentication
PGP encryption
hQEMAxkp5GPd+j5xAQf/ZDIfGD/...
here, encrypt
Subject: Mr. Watson, come here.
Content-Type: application/sdp
v=0
...
85
Anonymous calls
Via hiding
can have third-parties vouch for calls (“caller-id”) ➠ proxy signs request
with (phone) company id
86
Anonymous calls
INVITE INVITE
Via: P1 Via: P2
Via: e1(caller);hidden Via: e2(P1) ;hidden
caller P1 Hide: route P2 Via: e1(caller);hidden callee
Hide: route
200 OK 200 OK
Via: P1 Via: P2
Via: e1(caller);hidden Via: e2(P1) ;hidden
Via: e1(caller);hidden
encrypt with “salt”
88
SIP billing/charging
Preferences
caller: help guide routing (“no home number”) and order of attempts when
forking (“try videophone first, then phone, then answering service”)
q location preference
class business, residence
description show to caller
duplex full or half-duplex
feature call handling features
language languages spoken
media audio, video, text/numeric, . . .
mobility fixed or mobile
priority “only in case of emergency”
scheme URL schemes (tel, http, . . . )
service IP, PSTN, ISDN, pager, . . .
93
Contact example
Reject-Contact: ;class=personal
95
Request-Disposition
proxy or redirect
allow forking?
search recursively?
Status
SIP implementations
Ethernet phones
SIP-H.323 translators
unified messaging
99
3Com
Hughes Software Systems
AudioTalk Networks ObjectSoftware
Indigo Software
Broadsoft Nortel
Iwatsu Electric
Catapult Nuera
Komodo
Cisco Pingtel
Lucent
Carnegie-Mellon University RaveTel
MCI Worldcom
Columbia University Siemens
Mediatrix
Delta Information Systems Telogy
Microappliances
dynamicsoft Ubiquity
Netergy
Ellemtel Vegastream
Netspeak
Ericsson Vovida
Nokia
Hewlett-Packard
100
SIP-H.323 gateway
PSTN gateway
language:
hide timers
CPL example
busy
location proxy timeout
url: sip:jones@ timeout: 10s failure
Call String-switch example.com
field: from
match:
*@example.com
otherwise
location
url: sip:jones@
voicemail. redirect
example.com
merge: clear
105
examples (not all SIP yet): 3Com/S4, Columbia University, e-tel, Mitel,
Nortel, Pingtel, Siemens, Symbol Technologies, . . .
Columbia e*phone
DSP for voice coding and signaling ➠ limited memory (e*phone: 512 kB
SRAM)
only need minimal IP stack (IP/UDP/RTP, DHCP, SIP, tftp, DNS), not TCP
Columbia e*phone
108
SIP Services
109
SIP services
IN services
server NOTIFY
SIP “fan-out”
Branching requests
1
INV U@P1
C P1
200 (H1)
200 (H2)
INV U@H2
482
2
200 (H2) 200 (H2)
P3 H2
INV U@P3 INV U@H2
response (Location)
113
INVITE bob@portal
100 Trying
180 Ringing
200 OK
Contact: bob@home
200 OK
CANCEL bob@work
200 OK (CANCEL)
ACK bob@work
ACK bob@home
Sequential search
INVITE [email protected]
INVITE alice
ACK
INVITE bob
180 Ringing
200 OK
ACK
don’t ring for new additional participant in existing call ➠ call transfer
URL = conference-id@mcu-host
Mesh
difficulty: synchronization
122
Mesh
A B A B A B
1
Also: B 2 3
2
D C D C D 1
C
Also: A,B
MCU MCU
1 2
Also: B Replace: A
3
A B A B
6 5
D C D C 4
Replace: A,B
BYE INVITE session
124
tion, with time limit
login-based via NFS
recursive “finger”-traversal
REGISTER + Contact sets
new location
name translation: Alexan-
der.G.Bell ➠ agb
list aliases
active badges
125
rwhois
alternatives:
Hold
music-on-hold ➠
Camp-on service
Choices:
Three-party setups:
operator services
telemarketer
T INVITE(Also:)
BYE(Also:)
3
2(C) 4
5
A C
auto-dialer 1 customer
131
H.323 SIP
Architecture stack element
Origin ITU IETF
Conference control yes no
Protocol mostly TCP mostly UDP
Encoding ASN.1, Q.931 HTTPish
Emphasis telephony multimedia, multicast, events
Address flat alias, E.164, email SIP, E.164 URLs
Both SIP and H.323 are evolving: SIP additions, H.323v2 implemented, v3 to
be decided.
133
SETUP
port 1720, 1300
CALL PROCEEDING
ALERTING
CONNECT
2 dynamic ports
audio
137
Services
H.323v1 v2 v3 SIP
Call setup delay 6-7 RTT 3-4 1.5-2.5 1.5
Loss recovery TCP TCP better better
Fault detection yes yes yes yes
Mid-call failure fail fail fail live
Registrar failure fail fail backup multicast
GK/Proxy redundancy no no backup SLP, DNS, DHCP
Loop detection no no PathValue Via, hops, time
141
H.323v1 v2 v3 SIP
Admission control yes yes yes no (RSVP)
Policy control yes yes yes ob proxy
Resource reservation local local local no (RSVP)
142
H.323v1 v2 v3 SIP
Complexity more more more+ less
Server processing SF SF SF/SL, TSF SL, TSF/TSL
Inter-server no no yes yes
TS: transaction state; SF: call statefull; SL: call stateless
143
H.323v1 v2 v3 SIP
Transport protocols TCP TCP TCP/UDP any
Extensibility unlabeled vendor extensions IANA, labeled
Customization harder easier
Version compatibility N/A yes yes N/A
SCN interoperability good good good TBD
protocol encoding binary (ASN.1, Q.931) text
144
Overview
SIP
mobile applications
performance
future work
146
Mobility in an IP environment
Terminal mobility
– handover performance
– handover failure due to lack of resources in new network
– authentication of redirection
148
Personal mobility
[email protected]
(also used by [email protected])
yahoo.com
tel:12128541111
[email protected]
columbia.edu tel:12015551234
[email protected]
Personal mobility
switch between PDA, cell phone, PC, Ethernet phone, Internet appliance,
...
several “generic” addresses, one person/function, many terminals
e.g., tel:2129397042, [email protected],
[email protected] or [email protected]
SIP is designed for that – proxying and redirection does translation
but: need mapping mechanisms to recognize registrations as belonging to
the same person
some possible solutions:
– dip into LDAP personnel database or /etc/passwd to match phone
number and variations of name (J.Doe, John.Doe, Doe)
150
register at home
152
Hotel California
[email protected]
DHCP
server
SIP: sip.hotelca.com
DNS: hotelca.com
IP: 128.59.16.1
sip.hotelca.com home.com
REGISTER sip:sip.hotelca.com
To: eagles%[email protected]
From: eagles%[email protected]
REGISTER sip:home.com
REGISTER sip:home.com
To: [email protected]
To: [email protected]
From: [email protected]
From: [email protected]
Contact: sip:128.59.16.1
Contact: sip:128.59.16.1
153
may want to use home services – e.g., lawyer per-client billing, third-party
authentication
Service mobility
Examples:
media preferences
buddy lists
Service mobility
Separate issue: how does the payphone (or colleague’s phone) recognize you?
PDA (IR)
i-button
fingerprint
156
speech recognition, . . .
correspondent host
but: little deployment CN
HA
CH
Mobile IP Issues
encapsulation
dog-legged routing
MH
home network MH mobile host
binding updates still CN
HA
CH correspondent host
router with home agent
through HA CH
HA
functionality
data HA router with foreign agent
functionality
may fail with IP address fil- FA
tunnelled
data
ters data
stack/infrastructure MH
data
foreign
changes network
162
CH 2 1 SIP INVITE
3
SIP 302 moved temporarily
SIP INVITE
server 5 4 4 SIP OK
5 data
MH
foreign
optimization: hierarchical network
LR (later)
164
redir
MH MH mobile host
home CH correspondent host
network
redir
SIP redirect server
CH 1 SIP INVITE
2 SIP OK
2 3 data
1
3
MH
foreign
MH
network
165
From: alice@NY
Contact: 193.1.1.1
From: alice@NY
Contact: alice@CA
San Francisco CA NY
From: alice@NY
Contact: 192.1.2.3
REGISTER
INVITE
Los Angeles
166
Handoff Performance
MH BS DHCP CH
beacon interval
handoff interval
beacon
Discover
Offer
INVITE
Request
Ack
200
169
Open Issues
Conclusion
Programming services
Examples
proxying of requests
returning responses
use DB_File;
sub fail {
my($status, $reason) = @_;
print "SIP/2.0 $status $reason\n\n";
exit 0;
}
$destination = $addresses{$to};
if (! defined( $destination )) {
fail("404", "No such user");
}
Jonathan Lennox
Columbia University
[email protected]
May 5, 2000
181
Purpose
Abstract structure
busy
location proxy timeout
Address-switch url: sip:jones@ timeout: 10s
Call field: from failure
example.com
subfield: host
subaddress-of:
example.com
otherwise
Voicemail
location
url: sip:jones@ redirect
voicemail.
example.com
183
Textual representation
<cpl>
<subaction id="voicemail">
<location url="sip:[email protected]">
<redirect />
</location>
</subaction>
185
Textual representation
<incoming>
<address-switch field="origin" subfield="host">
<address subdomain-of="example.com">
<location url="sip:[email protected]">
<proxy>
<busy> <sub ref="voicemail" /> </busy>
<noanswer> <sub ref="voicemail" /> </noanswer>
<failure> <sub ref="voicemail" /> </failure>
</proxy>
</location>
</address>
<otherwise>
<sub ref="voicemail" />
</otherwise>
</address-switch>
</incoming>
</cpl>
186
Textual representation
Switch nodes
Conditions:
<time timeofday="1310-1425,1440-1555,1610-1725"
day="2,4">
1:10 – 2:25 PM, 2:40 – 3:55 PM, and 4:10 – 5:25 PM, Tuesdays and
Thursdays, every week
Location nodes
Only one output; cannot fail. Don’t use an explicit output node in the URL.
195
merge:
Redirect the call to the currently-specified set of locations. This has no specific
parameters, and causes the script to terminate.
199
status: “busy,” “notfound,” “reject,” or “error”, or a 4xx, 5xx, or 6xx code (for
SIP).
Subactions
Subactions are defined at the top level of the script, outside other actions.
for acyclicity, top-level actions and subactions may only call subactions
which were defined earlier in the script.
Anywhere a node is expected, you can instead have a sub tag, with a ref
parameter which refers to a subaction’s id.
203
<cpl>
<incoming>
<location url="sip:[email protected]">
<redirect />
</location>
</incoming>
</cpl>
204
<cpl>
<subaction id="voicemail">
<location url="sip:[email protected]" >
<proxy />
</location>
</subaction>
<incoming>
<location url="sip:[email protected]">
<proxy timeout="8s">
<busy>
</busy>
<noanswer>
<sub ref="voicemail" />
</noanswer>
</proxy>
</location>
</incoming>
</cpl>
205
<cpl>
<incoming>
<address-switch field="origin" subfield="user">
<address is="anonymous">
<reject status="reject"
reason="I don’t accept anonymous calls" />
</address>
</address-switch>
</incoming>
</cpl>
206
<cpl>
<incoming>
<time-switch timezone="US/Eastern">
<time day="1-5" timeofday="0900-1700">
<lookup source="registration">
<success>
<proxy />
</success>
</lookup>
</time>
<otherwise>
<location url="sip:[email protected]">
<proxy />
</location>
</otherwise>
</time-switch>
</incoming>
</cpl>
207
<cpl>
<incoming>
<lookup source="http://www.example.com/cgi-bin/locate.cgi?user=jones"
timeout="8">
<success>
<proxy />
</success>
<failure>
<mail url="mailto:[email protected]&Subject=lookup%20failed" />
</failure>
</lookup>
</incoming>
</cpl>
208
SIP Future
209
resource reservation
SIP Corba
data optional fields versioning hard
two-level hierarchy general, C-like
hiding dynamic directory-based
multiple forking proxy no
transport UDP, TCP, . . . TCP
strength inter-domain inter-domain
generality session set-up RPC, events, . . .
SIP servers can benefit from Corba locally for user location and service creation
212
touch-tone transmission
See http://www.cs.columbia.edu/sip