Download presentation
Presentation is loading. Please wait.
1
Introduction to Internet telephony (VoIP)
Kundan Singh Internet telephony or Voice over IP involves transport of telephone calls over the Internet. Most of the interest in Internet telephony is motivated by cost savings and ease of integrating new services. In a way, Internet telephony is closer to the Internet services such as and web, than to traditional telephony. It employs a variety of protocols, including RTP (Real-time Transport Protocol) for transport of multimedia data and SIP (Session Initiation Protocol) for signaling, i.e., establishing and controlling sessions. SIP is designed to integrate with other Internet services such as , web, voice mail, instant messaging, presence, multi-party conferencing and multimedia collaboration. In this presentation, I give a brief tutorial of Internet telephony services using SIP.
2
Inside Session Initiation Protocol (SIP) VoIP services using SIP
Agenda Introducing VoIP What does it take to build simple audio telephony? Inside Session Initiation Protocol (SIP) What are the main features of SIP VoIP services using SIP How do we implement various services like call transfer, auto-attendant, voic ? Introduction to VoIP
3
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
4
Sampling, Quantization, Encoding
+127 +0 -127 … Encode each quantized sample into 8 bit code word PCM: 8000 x 8 bits = 64 kb/s Other techniques (differential coding, linear prediction) 2.4 kb/s to 64 kb/s 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
5
Problems with UDP 1 2 3 5 7 6 4 Unreliable UDP Packet loss
timeline Sender Receiver (a) (b) Why is TCP not used? Reliability property of TCP requires acknowledgement, which introduces unbound delay. This is not desirable for real-time communication. Unreliable UDP Packet loss Out-of-order (very rarely) Jitter (delay variation) Introduction to VoIP
6
Receive buffer (playout buffer or circular buffer)
20 ms packet microphone sendto(remote IP:port) read speaker 20 ms packet write get Received packet recvfrom() put while (true) { buf = read(au,20ms); //blocks if (!silence) sendto(remote, buf); … buf = get(20 ms); write(au, buf); } Tradeoff in buffer size, streaming vs interactive. Advanced methods to adapt the buffer size to keep it small enough for lowest delay, and large enough to accommodate most (say 98%) of the packets. playout buffer while (true) { buf = recvfrom(...); // blocks put(buf); } Introduction to VoIP
7
Receive buffer (playout buffer or circular buffer)
Receive buffer: to absorb jitter Tradeoff in buffer size Adaptive delay adjustment Sequence number: to detect packet loss; Just ignore the loss! Sender 1 2 3 5 7 6 4 8 9 Tradeoff in buffer size, streaming vs interactive. Advanced methods to adapt the buffer size to keep it small enough for lowest delay, and large enough to accommodate most (say 98%) of the packets. Receiver 3 2 1 1 2 3 5 7 6 8 9 Introduction to VoIP
8
Timestamp vs sequence number
Silence suppression Variable length packets Sender t1 t2 t3 t4 t5 t6 t7 t8 t9 1 2 3 Silence … 4 5 6 7 1 2 3 4 5 6 7 Receiver Playout time vs packet loss detection Introduction to VoIP
9
Real-time Transport Protocol (RTP)
IP header 8 bits bits bits V CC M Payload type Sequence number P X UDP header Timestamp (proportional to sampling time) RTP Header Source identifier (SSrc) Encoded Audio Optional contributors’ list (CSrc) msg RTP: media transport RTCP: QoS feedback RFC 3550, 3551 sendto(…, msg, …) recvfrom(…, msg, …) Introduction to VoIP
10
Session identified using receive IP address + port
RTP-based conference ssrc=5263 ssrc=7182 :8000 ssrc=2639 Session identified using receive IP address + port ssrc=9844 Introduction to VoIP
11
RTP-based conference Mixer Transcoder
Mixer mixes multiple streams, and puts rtp.ssrcs of contributors in the mixed packet as rtp.csrc Transcoder converts one encoding to another. Typically to accommodate heterogeneous bandwidth links. -law Mixer Transcoder -law G.729 G.729 -law -law Introduction to VoIP
12
Why do we need signaling?
INVITE for a call using µ-law and G.729 at :8000 OK using µ-law at Bob=> Where is Alice? Alice=> Sam Henry=> Bob Alice Sam Locate destination user Negotiate session parameters Henry Introduction to VoIP
13
Session Initiation Protocol (SIP)
Address similar to Two stage lookup: DNS: uses naming authority pointer and service records Database or service logic: within a domain office.com Bob home.com Alice columbia.edu yahoo.com Jane $ dig –t naptr columbia.edu columbia.edu IN NAPTR 1 0 "s" "SIP+D2U" "" _sip._udp.columbia.edu. columbia.edu IN NAPTR 2 0 "s" "SIP+D2T" "" _sip._tcp.columbia.edu. $ dig –t srv _sip._udp.columbia.edu _sip._udp.columbia.edu IN SRV cocoa.cc.columbia.edu. _sip._udp.columbia.edu IN SRV eclair.cc.columbia.edu. $ dig –t a cocoa.cc.columbia.edu cocoa.cc.columbia.edu IN A Introduction to VoIP
14
SIP message format INVITE sip:alice@home.com SIP/2.0
Request INVITE SIP/2.0 From: “Bob” To: “Alice” Subject: How are you? ... Response SIP/ OK From: “Bob” To: “Alice” Subject: How are you? ... SIP messages look very similar to HTTP/1.1 requests. Text (instead of binary) format. Requests and responses are similar except the first line. The structure of the message has first line, followed by any number of headers, followed by an optional message body. The request method name is the operation to perform on the request URI. Proxies typically use the first like to route a request. Introduction to VoIP
15
Session Description Protocol (SDP)
INVITE I can support -law and G.729 Send me audio at :6780 Bob Alice OK; I can support -law Send me audio at :8000 ACK To port 8000 RTP To port 6780 RTP Introduction to VoIP
16
SDP message format and offer answer
Request INVITE SIP/2.0 ... v=0 o=bob IN IP s=SIP call c=IN IP t=0 0 m=audio 6780 RTP/AVP 0 8 5 m=video 6790 RTP/AVP 31 Response SIP/ OK ... c=IN IP t=0 0 m=audio 8000 RTP/AVP 0 8 m=video 0 RTP/AVP 31 Introduction to VoIP
17
Inside Session Initiation Protocol (SIP) VoIP services using SIP
Agenda Introducing VoIP What does it take to build simple audio telephony? Inside Session Initiation Protocol (SIP) What are the main features of SIP VoIP services using SIP How do we implement various services like call transfer, auto-attendant, voic ? Introduction to VoIP
18
SIP is…, SIP is not … SIP = core protocol for establishing sessions in the Internet (peer-to-peer) Transports session description information from initiator (caller) to receiver (callee) Allows change of parameters in mid-session Terminate session NOT for distribution of multimedia data NOT suitable for media gateway control . . . SIP applications typically fall in following categories: setting up voice-over-IP calls setting up multimedia conferences event notification => IM and presence text and general messaging signaling transport Introduction to VoIP
19
Addressing Personal mobility: Examples:
“Alice Smith” tel: tel: pc12.columbia.edu yahoo.com columbia.edu Introduction to VoIP
20
SIP message format Very similar to HTTP/1.1 Headers: Syntax: 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 Syntax: White-space doesn’t matter except in first line Lines can be folded Multi-valued header fields can be combiled as a comma-list Requests: INVITE, ACK, BYE, CANCEL: related to call setup and tear down OPTIONS, INFO, COMET, PRACK, SUBSCRIBE, NOTIFY, PUBLISH, REFER, … Responses: 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, … Introduction to VoIP
21
Building blocks SIP user agent SIP redirect server SIP stateless proxy
IP phone, PC, conference bridge,… SIP redirect server returns new location for requests SIP stateless proxy routes call requests SIP (forking) stateful proxy SIP registrar accepts name to address mapping Location server maintains name to address mapping Maintaining state stateless: each request and each response handled independently Fast load balancing proxies; robust (transaction) stateful: remember a whole request/response transaction Enterprise servers, . . . call stateful: remember a call from beginning to end Billing, NAT traversal, . . . Other entities: outbound proxy, back-to-back user agent (b2bua), application-level-gateway (ALG), … Typically implemented in a single software or box Introduction to VoIP
22
Message routing Response follows the reverse request path
Via header in SIP message records the request path Via: a.home.com Via: b.example.com Via: c.yahoo.com Via: a.home.com Via: b.example.com Via: c.yahoo.com Request routing decision at each hop Usually direct end-to-end transport after initial request Forcing request path: Record-route and Route headers. Request forking: parallel vs sequential (use q-value in Contact) Caller and callee info: further govern request routing INVITE q=1.0 302 moved 486 busy 200 OK q=0.7 q=0.2 Introduction to VoIP
23
Example call setup (9) ok (8) (10) (13) (6) unavailable (7) (6) (5)
Alice (8) @residence.net (10) @visiting.com (6) unavailable (7) (6) (5) (3) invite (4) moved @school.edu (12) ok (6) Bob (2) moved (11) cancel @home.com (1) invite @lab.school.edu @yahoo.com Introduction to VoIP
24
Transport SIP can operate on any packet network, reliable or unreliable UDP: most common Low state overhead But small max packet size TCP: Use with SSL Connection setup overhead Head of line blocking for trunks (use SCTP instead) Transport reliability Request retransmissions, exponential back-off interval INVITE different than other methods Retransmit INVITE response after provisional response was sent Introduction to VoIP
25
NAT traversal Problem: Solutions: Smart servers SIP Signaling Media
(open)SER allows detecting nodes behind a NAT Use application level gateway and media-proxy SIP Signaling 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 iptel.org INVITE REGISTER Contact: . . . E= :8123 L= :5060 Introduction to VoIP
26
NAT traversal (ICE) Address gathering Negotiation Connectivity check
STUN server stun01.sipphone.com R= :7002 example.net INVITE (offer) OK (answer) E= :8123 L= :8000 :6000 :8000 Gather addresses :6000 (local) :6000 (external) :9004 (relay) Gather addresses (L,E,R) :8000 (local) :8123 (external) :7002 (relay) Introduction to VoIP
27
Inside Session Initiation Protocol (SIP) VoIP services using SIP
Agenda Introducing VoIP What does it take to build simple audio telephony? Inside Session Initiation Protocol (SIP) What are the main features of SIP VoIP services using SIP How do we implement various services like call transfer, auto-attendant, voic ? Introduction to VoIP
28
IP telephony services (PSTN)
Call routing services: pre-call, one party speed dial call forwarding “follow me” call filtering/blocking (in/out) do not disturb distinctive ringing Call handling features autoanswer Multi-party features call waiting call transfer (blind, consultative) conference call call park call pickup music on hold call monitoring Services modify call behavior. Can be invoked by user, pre-programmed or programmable feature logic. PSTN its typically pre-subscribed or built-in, but not programmable. IP telephony can’t win by just providing what PSTN has. IP-telephony can’t win by just providing what PSTN has Introduction to VoIP
29
IP telephony services (Internet)
Presence-enabled calls place call only if callee is available Presence-enabled conferencing call conference participants when all are online and not busy IM conference alerts receive IM when someone joins a conference Unified messaging receive , IM alert for new voic s Anything that deals with media becomes media services. Usually media and signaling services closely interact with each other, e.g., interactive voice response can invite new participants to join a conference. Programmability of services Introduction to VoIP
30
Where do the services reside?
Double ringing sound when boss calls… Enter your authentication PIN for billing… Use finger for locating user… B2BUA Endpoint Make call when boss is online … Proxy/registrar Fits in basic SIP model or defined as extensions presence, instant messaging, caller preference, callee capabilities, ... Integration of web, , IM Endpoint Forward to office phone during day, and home phone during evening… Service control on client vs server Introduction to VoIP
31
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, 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 <call /> <alert sound=“ring.au" text="Calling …" /> </address> </address-switch> </notification> </less> Introduction to VoIP
32
Network call control Common gateway interface -- SIP-CGI (RFC 3050)
Call processing language -- CPL (XML-based, allows GUI) SIP servlets (Java) Priority.pl SIP_FROM SIP_TO stdin CGI-PROXY-REQUEST stdout SIP proxy Urgent Low-priority Voic Phone if (defined $ENV{SIP_FROM} && $ENV{SIP_FROM} =~ { foreach $reg (get_regs()) print "CGI-PROXY-REQUEST $reg SIP/2.0\n"; print "Priority: urgent\n\n"; } SIP-CGI: Programming language independent. Maintains state via an opaque token. For SIP proxies and endpoints: call routing, controlling forking, call rejection, call modification (Priority, Call-Info). RFC Upload via web or REGISTER Introduction to VoIP
33
Call transfer REFER Blind/ consultation/ attended A B C active call
REFER C Referred-By: B INVITE C Referred-By: B BYE A active call Introduction to VoIP
34
B2BUA and third-party call control
Back-to-back UA Incoming call triggers outgoing call Services Calling card Anonymizer B SIP A C INVITE OK (SDP1) ACK INVITE (SDP1) OK (SDP2) ACK INVITE (SDP2) OK ACK Introduction to VoIP
35
Voicemail Various design alternatives Endpoint based Proxy controls
Redirect after 10s Endpoint based Various design alternatives vmail.pl SIP_FROM SIP_TO stdin CGI-PROXY-REQUEST stdout If no response Proxy controls accept after 15s Voic acts like a phone CFB=call forward busy Problems in PSTN: Voice mail system tied to PBX or phone company Integration of video, fax, whiteboard? How to integrate with Internet telephony? How to integrate with , web and other user applications? Existing solutions Voice Profile for Internet Messaging (VPIM) Web-based unified messaging systems with personalized PSTN voice mail number Issues Call reclaiming Deleting voice/video mail Integration with PSTN phone Integration with VPIM, IMAP, POP3 Introduction to VoIP
36
Interactive voice response using VoiceXML
Gateway VXML Browser PSTN Voice gateway Web server Service logic (CGI, servlet, JSP) Voice and telephony functions VoiceXML browser Internet user VXML HTML Internet Telephone IVR platform Voice and telephony functions (ASR, TTS, DTMF) Service logic (application specific) Introduction to VoIP
37
VoiceXML contd. <form> <field name=‘id’> <prompt> Your ID, please. </prompt> </field> <block> <submit next=“url”/> </block> </form> <form action=“url”> Enter your Id: <input name=‘id’> <input type=‘submit’> </form> Telephony, speech synthesis or audio output, user input and grammar, program flow, variable and properties, error handling, … Introduction to VoIP
38
DTMF PSTN D D Internet Telephone SIP/PSTN Internet user gateway Audio
SIP INFO D RTP/ RFC2833 Introduction to VoIP
39
Interworking with telephone network
Telephone to IP Gateway knows the SIP server ENUM – E164 numbering (using DNS) => e164.arpa => Suitable for relatively “static” contacts IP to telephone Static mapping Gateway information is dynamic: Overlapping networks Multiple providers Load balancing Telephony routing over IP (TRIP) Route advertisement Can be implemented in outbound proxy Suitable for current hierarchical network +1 @service.mci.com at 4¢/min at 1¢/min free Telephone network Telephone subscriber SIP/PSTN gateway SIP server IP endpoint Translating audio (µ-law/A-law) Translating signaling (PRI/T1,ISUP) Overlap signaling Advanced features in SIP are lost in PSTN Translating identifiers (phone number) Determining transition points Introduction to VoIP
40
Summary Introducing VoIP Inside SIP VoIP services using SIP
Basic audio transfer, why we need RTP and SIP/SDP?… Inside SIP Message format, addressing, building blocks, routing, transport, NAT traversal, … VoIP services using SIP Types of services, programmability, call transfer, third-party, voic , interactive voice response, telephone interworking, … Introduction to VoIP
41
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, ETSI-Tiphon, IMTC, sip-forum, VON, … Introduction to VoIP
42
References SIP: RFC 3261-3265 http://www.cs.columbia.edu/sip
RTP: RFC 3550, 3551, My thesis: (part III: Enterprise IP telephony) Open source SIP server: Free SIP accounts: Introduction to VoIP
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.