• Save
Introduction to VoIP using SIP
Upcoming SlideShare
Loading in...5
×
 

Introduction to VoIP using SIP

on

  • 14,760 views

 

Statistics

Views

Total Views
14,760
Views on SlideShare
14,672
Embed Views
88

Actions

Likes
35
Downloads
133
Comments
5

3 Embeds 88

http://isatemelci.wordpress.com 49
http://www.slideshare.net 38
http://www.slideee.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • why this is not for download
    Are you sure you want to
    Your message goes here
    Processing…
  • Thank you mp Juliet!
    Are you sure you want to
    Your message goes here
    Processing…
  • Oh!. i'm find some problem but when i see then read this slide make me clear. Thank you so much.
    Are you sure you want to
    Your message goes here
    Processing…
  • VOIP abbreviates Voice Over Internet Protocol. This is a application of software which is using for communication technologies using SIP. There are many VOIP providers over the world. They are offering several features with there own facilities. I am also using one of them. I am using that because i liked their features such as quick start guide, online manual feature list, online support etc. If you want, you can also check on it



    Working with RTP in VoIP SIP calls



    Are you sure you want to
    Your message goes here
    Processing…
  • Tags sip voip
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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 email 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 email, 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.

Introduction to VoIP using SIP Introduction to VoIP using SIP Presentation Transcript

  • Introduction to Internet telephony (VoIP) Kundan Singh Columbia University
  • 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, voicemail?
    • 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
    Audio Packet Transfer …
  • Sampling, Quantization, Encoding 10101111…01101101 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) 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 +127 +0 -127
  • Problems with UDP
    • Unreliable UDP
    • Packet loss
    • Out-of-order (very rarely)
    • Jitter (delay variation)
    1 2 3 5 7 6 1 2 3 4 5 6 7 timeline Sender Receiver (a) (b)
  • Receive buffer (playout buffer or circular buffer) playout buffer while (true) { buf = read (au,20ms); //blocks if (!silence) sendto (remote, buf); … buf = get (20 ms); write (au, buf); } while (true) { buf = recvfrom(...); // blocks put(buf); } 20 ms packet microphone sendto(remote IP:port) read speaker 20 ms packet write get Received packet recvfrom() put
  • 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 Receiver 1 2 3 5 7 6 1 2 3 4 5 6 7 8 9 0 2 3 4 8 9 0 1 2 3 4 3 2 1 1 2 1 2 1 2 3 5 7 5 7 6 8 7 9 8 0 9 0 2 3 2
  • Timestamp vs sequence number
    • Silence suppression
    • Variable length packets
    1 2 3 4 1 2 3 4 Sender Receiver 5 6 7 5 6 7 Silence … t1 t2 t3 t4 t5 t6 t7 t8 t9 Playout time vs packet loss detection
  • Real-time Transport Protocol (RTP) Encoded Audio RTP Header UDP header IP header msg sendto(…, msg, …) recvfrom(…, msg, …) Sequence number Optional contributors’ list (CSrc) Source identifier (SSrc) Timestamp (proportional to sampling time) Payload type CC M V P X RTP: media transport RTCP: QoS feedback 8 bits 8 bits 16 bits
  • RTP-based conference 224.1.2.3:8000 ssrc=5263 ssrc=7182 ssrc=2639 ssrc=9844 Session identified using receive IP address + port
  • RTP-based conference   Mixer Transcoder  -law  -law G.729 G.729  -law  -law Mixer mixes multiple streams, and puts rtp.ssrc s of contributors in the mixed packet as rtp.csrc Transcoder converts one encoding to another. Typically to accommodate heterogeneous bandwidth links.
  • Why do we need signaling? Alice 128.59.19.194 Bob 202.16.49.27 Sam 154.28.32.112 Henry 125.33.2.81
    • Locate destination user
    • Negotiate session parameters
    Bob=>192.1.2.3 Sam 154.28.32.112 Henry=>125.33.2.81 Alice=>128.59.19.194 Where is Alice? 128.59.19.194 INVITE for a call using µ -law and G.729 at 202.16.49.27:8000 OK using µ-law at 128.59.19.194
  • Session Initiation Protocol (SIP)
    • Address similar to email sip:alice@home.com
    • Two stage lookup:
      • DNS: uses naming authority pointer and service records
      • Database or service logic: within a domain
    columbia.edu yahoo.com home.com office.com Alice Bob 128.59.19.194 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
  • SIP message format INVITE sip:alice@home.com SIP/2.0 From: “Bob” <bob@office.com> To: “Alice” <alice@home.com> Subject : How are you? ... SIP/2.0 200 OK From: “Bob” <bob@office.com> To: “Alice” <alice@home.com> Subject: How are you? ... Request Response
  • Session Description Protocol (SDP) Alice Bob INVITE alice@home.com I can support  -law and G.729 Send me audio at 202.16.49.27:6780 OK; I can support  -law Send me audio at 128.59.19.194:8000 202.16.49.27 128.59.19.194 ACK To port 8000 RTP To port 6780 RTP
  • SDP message format and offer answer INVITE sip:alice@home.com 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 t=0 0 m= audio 6780 RTP/AVP 0 8 5 m= video 6790 RTP/AVP 31 Request Response 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
  • 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, voicemail?
  • 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
  • Addressing
    • Personal mobility:
    • Examples:
      • “ Alice Smith” <sip:alice@columbia.edu>
      • sip:alice@128.59.19.194:5070
      • sip:alice@columbia.edu;user=phone;transport=tcp
    tel:12125551234 tel:19172223333 pc12.columbia.edu yahoo.com columbia.edu [email_address] [email_address] [email_address] [email_address]
  • SIP message format
    • Very similar to HTTP/1.1
      • 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, …
  • Building blocks
    • SIP user agent
      • IP phone, PC, conference bridge,…
    • SIP redirect server
      • returns new location for requests
    • SIP stateless proxy
      • routes call requests
    • SIP (forking) stateful proxy
      • routes call requests
    • 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, . . .
    Typically implemented in a single software or box Other entities: outbound proxy, back-to-back user agent (b2bua), application-level-gateway (ALG), …
  • Message routing
    • Response follows the reverse request path
      • Via header in SIP message records the request path
    • 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
    q=1.0 q=0.7 q=0.2 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_address] [email_address] [email_address] [email_address] Via: a.home.com Via: b.example.com Via: a.home.com Via: c.yahoo.com Via: b.example.com Via: a.home.com INVITE 302 moved 486 busy 200 OK
  • Example call setup (3) invite (4) moved (5) @school.edu Bob @home.com (6) (6) (6) unavailable (7) Alice (8) (11) cancel (12) ok (1) invite (2) moved @yahoo.com @residence.net @visiting.com @lab.school.edu (9) ok (10) (13)
  • 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
  • NAT traversal
    • Problem:
    • Solutions:
      • Smart servers
        • (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
    L=10.1.2.3:5060 iptel.org REGISTER alice@iptel.org Contact: sip:alice@10.1.2.3:5060 . . . E=128.59.19.194:8123 INVITE alice@
  • NAT traversal (ICE)
    • Address gathering
    • Negotiation
    • Connectivity check
    L=10.1.2.3:8000 192.168.1.2:6000 example.net STUN server stun01.sipphone.com E=128.59.19.194:8123 R=192.1.2.3:7002 Gather addresses (L,E,R) 10.1.2.3:8000 (local) 128.59.19.194:8123 (external) 192.1.2.3:7002 (relay) Gather addresses 192.168.1.2:6000 (local) 135.59.22.99:6000 (external) 192.1.2.4:9004 (relay) INVITE (offer) OK (answer) 10.1.2.3:8000
  • 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, voicemail?
  • 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
    IP-telephony can’t win by just providing what PSTN has
  • 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 email, IM alert for new voicemails
    Programmability of services
  • Where do the services reside? Make call when boss is online … Enter your authentication PIN for billing… B2BUA Double ringing sound when boss calls… Endpoint Forward to office phone during day, and home phone during evening… Proxy/registrar Endpoint Service control on client vs server Use finger for locating user…
  • 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=&quot;online_call&quot;
    • require=&quot;generic presence ui&quot;>
    • <notification status=&quot; online &quot; priority=&quot;0.5&quot;>
    • <address-switch field=&quot;origin&quot;>
    • <address is=“ [email_address] &quot;>
    • < call />
    • < alert sound=“ring.au&quot;
    • text=&quot;Calling …&quot; />
    • </address>
    • </address-switch>
    • </notification>
    • </less>
  • 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 Voicemail Phone if (defined $ENV{SIP_FROM} && $ENV{ SIP_FROM } =~ /sip: boss@ mycompany.com/) { foreach $reg (get_regs()) { print &quot;CGI-PROXY-REQUEST $reg SIP/2.0 &quot;; print &quot; Priority: urgent &quot;; } }
  • Call transfer
    • REFER
    • Blind/ consultation/ attended
    active call REFER C Referred-By: B INVITE C Referred-By: B BYE A A B C active call
  • B2BUA and third-party call control
    • Back-to-back UA
      • Incoming call triggers outgoing call
    • Services
      • Calling card
      • Anonymizer
    INVITE A B C OK (SDP1) ACK INVITE (SDP1) OK (SDP2) ACK INVITE (SDP2) OK ACK SIP SIP
  • Voicemail
    • Various design alternatives
    vmail.pl SIP_FROM SIP_TO stdin CGI-PROXY-REQUEST stdout If no response Proxy controls accept after 15s Voicemail acts like a phone [email_address] Redirect after 10s Endpoint based
  • Interactive voice response using VoiceXML Telephone PSTN IVR platform
    • Voice and telephony functions
    • (ASR, TTS, DTMF)
    • Service logic (application specific)
    VXML Browser Gateway Voice gateway Web server
    • Service logic (CGI, servlet, JSP)
    • Voice and telephony functions
    • VoiceXML browser
    Internet user VXML HTML Internet
  • 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, …
  • DTMF Telephone SIP/PSTN gateway PSTN Internet Internet user D D Audio SIP INFO RTP/ RFC2833
  • Interworking with telephone network
    • 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
    Telephone network SIP/PSTN gateway SIP server IP endpoint Telephone subscriber +1-415-123-4567 sip:bob@home.com
    • IP to telephone
    • Static mapping
      • 1-212854xxxx=>@gw1.columbia.edu
    • 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
      • +1212 @nyc.gw.com at 1¢/min
      • +1212939 @itgw1.columbia.edu free
    • Telephone to IP
    • Gateway knows the SIP server
      • <sip:4567@gateway2.example.com;user=phone>
    • ENUM – E164 numbering (using DNS)
      • +1 212 9397042 => 2.4.0.7.9.3.9.2.1.2.1.e164.arpa => sip:hgs@cs.columbia.edu
      • Suitable for relatively “static” contacts
  • Summary
    • Introducing VoIP
      • 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, voicemail, interactive voice response, telephone interworking, …
  • 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, …
  • 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