Firestone - Kundan Singh

Download Report

Transcript Firestone - Kundan Singh

Introduction to Internet telephony
(VoIP)
Kundan Singh
Agenda

Introducing VoIP


Inside Session Initiation Protocol (SIP)


What does it take to build simple audio
telephony?
What are the main features of SIP
VoIP services using SIP

How do we implement various services like
call transfer, auto-attendant, voicemail?
Introduction to VoIP
2
Audio Packet Transfer
…




Digitization (e.g., sampling at 8kHz, 16 bits per sample,
i.e, 128 kb/s or 320 bytes per 20 ms)
Real-time compression/encoding (e.g., G.729A at 8 kb/s)
Transport to remote IP address and port number over
UDP (Why not TCP?)
Processing on receiver side is the reverse
Introduction to VoIP
3
Sampling, Quantization, Encoding
+127
10101111…01101101
Encode each quantized
sample into 8 bit code word
+0
PCM: 8000 x 8 bits = 64 kb/s
Other techniques (differential
coding, linear prediction)
2.4 kb/s to 64 kb/s
-127
Sample at twice the
highest voice frequency
2 x 4000=8000 Hz
(interval of 125 µsec)
Round off samples to one
of 256 levels (introduces
noise)
Introduction to VoIP
4
Problems with UDP
timeline
Sender
1
2
3
4
5
6
7
(a)
(b)
1
2
3
5
7
6
Receiver
Unreliable UDP
a) Packet loss
b) Out-of-order (very rarely)
c) Jitter (delay variation)
Introduction to VoIP
5
Receive buffer
(playout buffer or circular buffer)
read
microphone
write
20 ms
packet
20 ms
packet
sendto(remote IP:port)
get
speaker
put
while (true) {
Received
packet
recvfrom()
buf = read(au,20ms); //blocks
if (!silence)
playout buffer
sendto(remote, buf);
while (true) {
…
buf = get(20 ms);
buf = recvfrom(...); // blocks
write(au, buf);
put(buf);
}
}
Introduction to VoIP
6
Receive buffer
(playout buffer or circular buffer)




Sender
1
2
3
1
Receiver
3
2
1
1
Receive buffer: to absorb jitter
Tradeoff in buffer size
Adaptive delay adjustment
Sequence number: to detect packet loss; Just ignore the loss!
4
5
2
2
1
6
8
7
3
5
9
7
0
1
8
6
2
9
3
0
4
2
3
7
2
1
5
2
3
5
7
6
Introduction to VoIP
8
7
9
8
0
9
2
0
3
2
7
4
Timestamp vs sequence number
Silence suppression
Variable length packets


Sender
t1
t2
t3
1
2
3
1
2
t4
t5
t6
Silence …
t7
4
5
3
t8
t9
6
7
4
5
6
7
Receiver
Playout time vs packet loss detection
Introduction to VoIP
8
Real-time Transport Protocol (RTP)
IP header
8 bits
V PX
CC
8 bits
16 bits
M Payload type
UDP header
Sequence number
Timestamp (proportional to sampling time)
RTP Header
Source identifier (SSrc)
msg
Encoded
Audio
Optional contributors’ list (CSrc)
RTP: media transport
RTCP: QoS feedback
sendto(…, msg, …)
recvfrom(…, msg, …)
Introduction to VoIP
9
RTP-based conference
ssrc=5263
ssrc=7182
224.1.2.3:8000
ssrc=2639
Session identified using
receive IP address + port
Introduction to VoIP
ssrc=9844
10
RTP-based conference
Mixer mixes multiple streams,
and puts rtp.ssrcs of
contributors in the mixed packet
as rtp.csrc
-law
Mixer

-law
Transcoder converts one
encoding to another. Typically to
accommodate heterogeneous
bandwidth links.
-law
Transcoder
-law
Introduction to VoIP

G.729
G.729
11
Why do we need signaling?
Bob
202.16.49.27
Sam
154.28.32.112
Alice
128.59.19.194
1. Locate destination user
2. Negotiate session parameters
Introduction to VoIP
Henry
125.33.2.81
12
Session Initiation Protocol (SIP)


Address similar to email sip:[email protected]
Two stage lookup:

office.com

DNS: uses naming authority pointer and service
records
Database or service logic: within a domain
Bob
home.com
columbia.edu
Alice
128.59.19.194
yahoo.com
Jane
128.59.19.61
$ dig –t naptr columbia.edu
columbia.edu. 3600 IN NAPTR 1 0 "s" "SIP+D2U" "" _sip._udp.columbia.edu.
columbia.edu. 3600 IN NAPTR 2 0 "s" "SIP+D2T" "" _sip._tcp.columbia.edu.
$ dig –t srv _sip._udp.columbia.edu
_sip._udp.columbia.edu. 3600 IN SRV 10 10 5060 cocoa.cc.columbia.edu.
_sip._udp.columbia.edu. 3600 IN SRV 10 10 5060 eclair.cc.columbia.edu.
$ dig –t a cocoa.cc.columbia.edu
cocoa.cc.columbia.edu. 3600 IN A 128.59.59.199
Introduction to VoIP
13
SIP message format
Request
INVITE sip:[email protected] SIP/2.0
From: “Bob” <[email protected]>
To: “Alice” <[email protected]>
Subject: How are you?
...
Response
SIP/2.0 200 OK
From: “Bob” <[email protected]>
To: “Alice” <[email protected]>
Subject: How are you?
...
Introduction to VoIP
14
Session Description Protocol (SDP)
INVITE [email protected]
I can support -law and G.729
Send me audio at 202.16.49.27:6780
Bob
202.16.49.27
Alice
128.59.19.194
OK; I can support -law
Send me audio at 128.59.19.194:8000
ACK
RTP
To port 8000
RTP
To port 6780
Introduction to VoIP
15
SDP message format and offer answer
Request
INVITE sip:[email protected] SIP/2.0
...
v=0
o=bob 26172 27162 IN IP4 202.16.49.27
s=SIP call
c=IN IP4 202.16.49.27
Response
t=0 0
m=audio 6780 RTP/AVP 0 8 5
m=video 6790 RTP/AVP 31
SIP/2.0 200 OK
...
c=IN IP4 128.59.19.194
t=0 0
m=audio 8000 RTP/AVP 0 8
m=video 0 RTP/AVP 31
Introduction to VoIP
16
Agenda

Introducing VoIP


Inside Session Initiation Protocol (SIP)


What does it take to build simple audio
telephony?
What are the main features of SIP
VoIP services using SIP

How do we implement various services like
call transfer, auto-attendant, voicemail?
Introduction to VoIP
17
SIP is…, SIP is not …
SIP = core protocol for establishing sessions
in the Internet (peer-to-peer)
 Transports session description information
from
initiator (caller)
(callee)
SIP
applications
typically to
fall receiver
in following
categories:
• setting up voice-over-IP calls
 Allows change of parameters in mid-session
• setting up multimedia conferences
 •Terminate
session
event notification
=> IM and presence
text and
messaging
 •NOT
for general
distribution
of multimedia data
• signaling transport
 NOT suitable for media gateway control
 . . .

Introduction to VoIP
18
Addressing

Personal mobility:
yahoo.com
[email protected]
tel:12125551234
[email protected]
[email protected]
[email protected]
columbia.edu
tel:19172223333
pc12.columbia.edu

Examples:



“Alice Smith” <sip:[email protected]>
sip:[email protected]:5070
sip:[email protected];user=phone;transport=tcp
Introduction to VoIP
19
SIP message format

Very similar to HTTP/1.1



Requests:
Text-based, request-response
Request method operates on the
resource/entity identified in URI


Headers:





To, From, Call-ID, CSeq: transaction
identification
Via: response traverses the reverse
request path
Content-Length, Content-Type:
message body information

Responses:



Syntax:



INVITE, ACK, BYE, CANCEL: related
to call setup and tear down
OPTIONS, INFO, COMET, PRACK,
SUBSCRIBE, NOTIFY, PUBLISH,
REFER, …
White-space doesn’t matter except
in first line
Lines can be folded
Multi-valued header fields can be
combiled as a comma-list



Introduction to VoIP
Provisional: 100 Trying, 180 Ringing,
183 Session progress, …
Success: 200 OK, 202 Pending, …
Redirection: 301 Moved
permanently, 302 Moved
temporarily, …
Request failure: 400 Bad Request,
401 Unauthorized, 404 Not found,
480 Not available, 486 Busy here, …
Server failure: 500 Internal server
error, 501 Not implemented, …
Global failure: 600 Busy everywhere,
603 Decline, …
20
Building blocks

SIP user agent


stateless: each request and each
response handled independently

returns new location for requests

routes call requests

routes call requests
Fast load balancing proxies; robust
(transaction) stateful: remember a
whole request/response transaction

SIP registrar



SIP (forking) stateful proxy


IP phone, PC, conference bridge,…
SIP stateless proxy


Maintaining state
SIP redirect server



Enterprise servers, . . .
call stateful: remember a call from
beginning to end

Billing, NAT traversal, . . .
accepts name to address mapping
Location server

maintains name to address mapping
Typically implemented in a single
software or box
Other entities: outbound proxy, back-to-back
user agent (b2bua), application-levelgateway (ALG), …
Introduction to VoIP
21
Message routing

Response follows the reverse request path

Via header in SIP message records the request path
Via: a.home.com
Via: a.home.com
[email protected]

Via: c.yahoo.com
Via: b.example.com
Via: a.home.com
Via: b.example.com
Via: a.home.com
Via: c.yahoo.com
Via: b.example.com
Via: a.home.com
[email protected]
[email protected]
Via: b.example.com
Via: a.home.com
[email protected]
Request routing decision at each hop




Usually direct end-to-end transport after initial
request
Forcing request path: Record-route and
Route headers.
q=1.0
INVITE
Request forking: parallel vs sequential (use qvalue in Contact)
Caller and callee info: further govern request
routing
Introduction to VoIP
q=0.7
486 busy
q=0.2
22
Example call setup
Alice
(9) ok
@residence.net
(8)
(10)
@visiting.com
(13)
(6)
unavailable (7) (6)
(5)
(3) invite
(4) moved
(12) ok
Bob
@school.edu
(6)
(2) moved
(11) cancel
@home.com
(1) invite
@yahoo.com
Introduction to VoIP
@lab.school.edu
23
Transport


SIP can operate on any
packet network, reliable or
unreliable
UDP: most common




Transport reliability
Low state overhead
But small max packet size
TCP:





Request retransmissions,
exponential back-off interval
INVITE different than other
methods

Retransmit INVITE
response after provisional
response was sent
Use with SSL
Connection setup overhead
Head of line blocking for
trunks (use SCTP instead)
Introduction to VoIP
24
NAT traversal

Problem:

Solutions:

iptel.org
Smart servers


INVITE alice@

SIP Signaling

E=128.59.19.194:8123


REGISTER [email protected]
Contact: sip:[email protected]:5060
...
(open)SER allows detecting
nodes behind a NAT
Use application level gateway
and media-proxy
Symmetric response routing
for UDP (rport)
Connection reuse for TCP/TLS
(sip-outbound)
Media



STUN: Simple traversal of UDP
through NAT
TURN: Traversal using relay
NAT
ICE: Interactive connectivity
establishment
L=10.1.2.3:5060
Introduction to VoIP
25
NAT traversal (ICE)
1.
STUN server
stun01.sipphone.com
2.
R=192.1.2.3:7002
3.
Address gathering
Negotiation
Connectivity check
example.net
INVITE (offer)
OK (answer)
E=128.59.19.194:8123
L=10.1.2.3:8000
192.168.1.2:6000
10.1.2.3:8000
Gather addresses (L,E,R)
10.1.2.3:8000 (local)
128.59.19.194:8123 (external)
192.1.2.3:7002 (relay)
Introduction to VoIP
Gather addresses
192.168.1.2:6000 (local)
135.59.22.99:6000 (external)
192.1.2.4:9004 (relay)
26
Agenda

Introducing VoIP


Inside Session Initiation Protocol (SIP)


What does it take to build simple audio
telephony?
What are the main features of SIP
VoIP services using SIP

How do we implement various services like
call transfer, auto-attendant, voicemail?
Introduction to VoIP
27
IP telephony services (PSTN)

Call routing services: precall, one party








Multi-party features
speed dial
call forwarding
“follow me”
call filtering/blocking
(in/out)
do not disturb
distinctive ringing







call waiting
call transfer (blind,
consultative)
conference call
call park
call pickup
music on hold
call monitoring
Call handling features

autoanswer
IP-telephony can’t win by just providing what PSTN has
Introduction to VoIP
28
IP telephony services (Internet)

Presence-enabled calls


Presence-enabled conferencing


call conference participants when all are online and not busy
IM conference alerts


place call only if callee is available
receive IM when someone joins a conference
Unified messaging

receive email, IM alert for new voicemails
Programmability of services
Introduction to VoIP
29
Where do the services reside?
Double ringing
sound when
boss calls…
Enter your
authentication
PIN for billing…
B2BUA
Make call
when boss is
online …
Endpoint
Use finger for
locating user…
Endpoint
Proxy/registrar
Forward to office phone
during day, and home
phone during evening…
Service control on client vs server
Introduction to VoIP
30
Endpoint call control



Language for End System Services (LESS) for endpoint
service creation
Direct user interaction, direct media control
Handle converged information, e.g., call, presence, email
Example: when buddy is online, make a call
<less name="online_call"
require="generic presence ui">
<notification status="online" priority="0.5">
<address-switch field="origin">
<address is=“[email protected]">
<call />
<alert sound=“ring.au"
text="Calling …" />
</address>
</address-switch>
</notification>
</less>
Introduction to VoIP
31
Network call control

Priority.pl
SIP_FROM
SIP_TO
stdin
CGI-PROXY-REQUEST
stdout


Common gateway interface -SIP-CGI (RFC 3050)
Call processing language -CPL (XML-based, allows GUI)
SIP servlets (Java)
if (defined $ENV{SIP_FROM} &&
Urgent
$ENV{SIP_FROM} =~ /sip:[email protected]/)
{
SIP proxy
foreach $reg (get_regs())
Phone
{
print "CGI-PROXY-REQUEST $reg SIP/2.0\n";
print "Priority: urgent\n\n";
}
Low-priority
}
Introduction to VoIP
32
Voicemail
Call transfer
B
A


C
REFER
Blind/ consultation/
attended
active call
REFER C
Referred-By: B
INVITE C
Referred-By: B
BYE A
active call
Introduction to VoIP
33
B2BUA and third-party call control

Back-to-back UA


Incoming call triggers
outgoing call
Services


Calling card
Anonymizer
B
A
SIP
C
SIP
INVITE
OK (SDP1)
ACK
INVITE (SDP1)
OK (SDP2)
INVITE (SDP2)
ACK
OK
ACK
Introduction to VoIP
34
Voicemail
Endpoint based
Various design alternatives
Redirect after 10s
[email protected]
Proxy controls
Voicemail acts like a phone
vmail.pl
SIP_FROM
SIP_TO
stdin
CGI-PROXY-REQUEST
stdout
If no response
Introduction to VoIP
accept after 15s
35
Interactive voice response
using VoiceXML
Gateway
PSTN
Telephone
VXML Browser
Internet
Voice gateway VXML
• Voice and telephony functions
• VoiceXML browser
IVR platform
• Voice and telephony functions
(ASR, TTS, DTMF)
• Service logic (application specific)
HTML Internet user
Web server
• Service logic (CGI, servlet, JSP)
Introduction to VoIP
36
VoiceXML contd.
<form action=“url”>
Enter your Id:
<input name=‘id’>
<input type=‘submit’>
</form>
<form>
<field name=‘id’>
<prompt>
Your ID, please.
</prompt>
</field>
<block>
<submit next=“url”/>
</block>
</form>
Telephony, speech synthesis or audio output, user input and
grammar, program flow, variable and properties, error
handling, …
Introduction to VoIP
37
Interworking with telephone network
sip:[email protected]
+1-415-123-4567
IP to telephone
Telephone to IP

Static mapping
Telephone

Gateway
the SIP server
Telephone knows
SIP/PSTN
SIP server
network
subscriber
gateway

<sip:[email protected]

;user=phone>


IP endpoint
1-212854xxxx=>@gw1.columbia.edu
Gateway information is dynamic:

Overlapping networks
audio
(µ-law/A-law)
ENUM – Translating
E164 numbering
(using

Multiple providers
DNS) Translating signaling (PRI/T1,ISUP)

Load balancing


+1 212 9397042 =>
 Overlap signaling
2.4.0.7.9.3.9.2.1.2.1.e164.arp
a => sip:[email protected]
 Advanced features in
Suitable for relatively “static” contacts



Telephony routing over IP (TRIP)

Route
advertisement
SIP are
lost in
PSTN
Can be implemented in outbound proxy
Translating identifiers (phone
number)
Suitable
for current hierarchical network
+1
@service.mci.com at 4¢/min
Determining transition points


+1212 @nyc.gw.com at 1¢/min
+1212939 @itgw1.columbia.edu free
Introduction to VoIP
39
Summary

Introducing VoIP


Inside SIP


Basic audio transfer, why we need RTP and
SIP/SDP?…
Message format, addressing, building blocks,
routing, transport, NAT traversal, …
VoIP services using SIP

Types of services, programmability, call transfer,
third-party, voicemail, interactive voice response,
telephone interworking, …
Introduction to VoIP
40
VoIP activities


IETF working groups: sip, sipping, mmusic, xcon,
p2psip, simple, impp, iptel, enum, ecrit, avt, sigtran,
midcom, …
Elsewhere: 3GPP, ITU-T, W3C, Jabber/XSF, ETSITiphon, IMTC, sip-forum, VON, …
Introduction to VoIP
41
References





SIP: RFC 3261-3265 http://www.cs.columbia.edu/sip
RTP: RFC 3550, 3551, http://www.cs.columbia.edu/~hgs/rtp
My thesis: http://www.cs.columbia.edu/~kns10/publication/thesis.pdf
(part III: Enterprise IP telephony)
Open source SIP server: http://www.openser.org
Free SIP accounts: http://iptel.org
Introduction to VoIP
42