Voice over IP
Introduction VoIP Voice over IP The use of IP networks, namely the LAN and WAN, to carry voice Voice was originally carried over circuit switched networks PSTN (Public Switch Telephone Network) The use of the Internet that was originally designed to carry computer data A packet switched network
Comparison Network Features PSTN (Voice) Internet (Data) Switch Circuit Switched Packet Switched Connection Connection Oriented Connectionless Bit Rate Fixed and low <=64kb/s Wide variation to Gb/s Bursts Nonexistent High (100/1000:1) Error tolerance User error control Error free Retransmission Can not (real time) Can be done very fast Delay Must be low and stable Can be high and vary
Big Picture
Components Terminals Packetized voice Soft switch Media server Gateway Network Standards
Terminals Computer functions Connected via LAN Device on IP network IP telephone functions Microphone and speaker Codec, packetization, transmission protocols, QoS Registration with softwitch Call setup/teardown Video, data, display, keyboard
Voice in IP Packets
Voice Packetization Microphone creates analog Analog-digital conversion Stream of raw 16-bit samples Codec Codes raw stream into standardized format Segmentation Chops stream into blocks ~ 20 ms long
Soft switch Hard switch and soft switch Main functions: Terminal control Registration: authentication, directory entry Admission: permission to make/receive calls Status: call disposition Call control Call signaling: address resolution, setup, teardown Call routing Call accounting, call detail records Open source server Asterisk opensips
Media Server What is media? Integrated messaging Voicemail, email, fax Text-to-speech, speech-to-text Web-style user interface Video server
Gateway and key VoIP standards Gateway acts as protocol converter IETF RFC 3261 SIP RFC 2327 SDP RFC 1889 RTP ITU-T H.323: Historical G.700: voice coding G.711: 64 kb/s PCM
VoIP classification Classified by call agents Computer-Computer call Computer-phone call Phone-computer call Phone-phone call
Computer-Computer call Principle components to make calls Computer Internet access Software: skype, gtalk, MSN,Yahoo,.. Directory, call setup/control Sound card, headset, USB telephone Pros and Cons: Free (with internet connection) Interoperability: standards Less user-friendly than PSTN Variable quality of voice
Computer-phone call Internet connection at one end POTS at the other end VoIP Service Provider (VSP) in middle DS0 circuit-switched connection to PSTN VSP s costs: Per-minute, per-ds0 Gateway, softswitch Headset, tech skills SkypeOut
Phone-* calls VSP supplies adapter Variable quality Internet in middle Runtime during power failure (UPS?) Lower-cost service Avoid switched-access charges at origination Avoid regulatory fees
Measuring Voice Quality Mean Opinion Score (MOS) Five-level scale Score Opinion Scale Listening effort scale 5 Excellent Complete relaxation possible, no effort required 4 Good Attention necessary, no appreciable effort required 3 Fair Moderate effort required 2 Poor Considerable effort required 1 Bad No meaning understood with any reasonable effort
Factors affect quality Coding technique Compression Variable-rate vs. constant bit rate Delay and Jitter Packet loss
Codecs Voice coding and compression Codec Bit rate (kb/s) Method Algorithmic delay (ms) Quality (MOS) G.711 64 PCM 0.125 4.0 G.723.1 5.3 ACELP 37.5 3.6 G.723.1 6.3 MP-MLQ 37.5 3.9 G.722/6/7 16-40 ADPCM 0.125 2.4-4.0 G.728 16 LD-CELP 0.625 3.61 G.729 8 CS-ACELP 15.0 3.9
Delay Delay caused by codec Network delay Propagation delay Delay caused by buffering Ethernet switches Routers Jitter buffers Total end-to-end delay Recommended maximum value ~ 150ms
Packet loss Some packets are lost during transmission Buffer overflow Real-time applications cannot utilize the same packet loss avoidance protocols The communication between the two ends take too long Retransmission time is very long VOIP is highly sensitive to packet loss Loss Rates as low as 1% can garble communications Five percent loss is tolerable Latency and Jitter can contribute to virtual packet loss as packets arriving after their deadline are as good as lost
Examples 10 percent packet loss/g.711 G71110.wav 20 percent packet loss/g.711 G71120.wav 50 percent packet loss/g.711 G71150.wav 10 percent packet loss/g.723.1 G72310.wav 20 percent packet loss/g.723.1 G72320.wav 50 percent packet loss/g.723.1 G72350.wav
Tips for maximizing voice quality Design the network with no bottlenecks LAN switches: hierarchy Generous WAN bandwidth Loading: simulate, test QoS methods VLANs segregate voice, data Network-level QoS:MPLS Keep packet loss below 1% Network design, QoS methods Jitter buffer sizing Choose appropriate codec which suits for the network condition Minimize end-end delay
Session Initiation Protocol Tool for creating, modifuing and terminating sessions Locate the called party Determine and report availability of called party Call progress tones Enable call type negotiation Manage calls: setup, modification and teardown of communication sessions
Relationship to other protocols SIP is a utility for establishing sessions Complements other protocols RFC 2327 session description protocol (SDP) for describing media type, coding, address etc. UDP, IP and DNS G.700 series codecs RTP for managing timing variations
SIP URIs SIP telephone numbers is SIP URIs Address of Record Your public SIP address Like an email address Sip:user@domain Uniform Resource Indicator Identifies a communication resource Sufficient information to initiate and maintain a session with the resource Communications resources: A person A particular line on a multi-line phone A voice mail box Traditional telephone number A group in an organization, e.g. reception
SIP URI Examples Sip:user@host:port;parameters?headers 1. Sip:zack@zulu.com 2. Sip:aaron@alpha.com;transport=tcp 3. Sips:aaron@alpha.com?subject=911&priotiry=urgent 4. Sip:+61-2-88888888:1234@verizon.com;user=phone 5. Sips:1650@att.com 6. Sip:aaron@192.168.0.1
SIP network elements User agents Redirect servers Proxy servers Registrars Location servers
SIP Messages Each message consist of first line, message header, and message body. First line identifies type of the message Requests Responses
SIP Request INVITE -- This message is used to establish a session. ACK This message acknowledges receipt of a final response to INVITE. BYE -- Bye messages are used to tear down multimedia sessions. CANCEL -- Cancel is used to cancel not yet fully established session. REGISTER -- Purpose of REGISTER request is to let registrar know of current user s location.
SIP Request example A typical SIP request looks like this: INVITE sip:7170@iptel.org SIP/2.0 Via: SIP/2.0/UDP 195.37.77.100:5040;rport Max-Forwards: 10 From: "jiri" <sip:jiri@iptel.org>;tag=76ff7a07-c091-4192-84a0-d56e91fe104f To: <sip:jiri@bat.iptel.org> Call-ID: d10815e0-bf17-4afa-8412-d9130a793d96@213.20.128.35 CSeq: 2 INVITE Contact: <sip:213.20.128.35:9315> User-Agent: Windows RTC/1.0 Proxy-Authorization: Digest username="jiri", realm="iptel.org", algorithm="md5", uri="sip:jiri@bat.iptel.org", nonce="3cef753900000001771328f5ae1b8b7f0d742da1feb5753c", response="53fe98db10e1074 b03b3e06438bda70f" Content-Type: application/sdp Content-Length: 451
SIP Response The reply code is an integer number from 100 to 699 and indicates type of the response, there are 6 classes of responses. 100-199 are provisional responses. 200-199 are positive final responses. 300-399 are used to redirect a caller 400-499 are negative final responses. 500-599 are the problem is on server s side. 600-699 means that the request can t be fulfilled at any server.
SIP Response Example SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.1.30:5060;received=66.87.48.68 From: sip:sip2@iptel.org To: sip:sip2@iptel.org;tag=794fe65c16edfdf45da4fc39a5d2867c.b713 Call-ID: 2443936363@192.168.1.30 CSeq: 63629 REGISTER Contact: <sip:sip2@66.87.48.68:5060;transport=udp>;q=0.00;expires=120 Server: Sip EXpress router (0.8.11pre21xrc (i386/linux)) Content-Length: 0 Warning: 392 195.37.77.101:5060 "Noisy feedback tells: pid=5110 req_src_ip=66.87.48.68 req_src_port=5060 in_uri=sip:iptel.org out_uri=sip:iptel.org via_cnt==1"
Typical SIP Scenarios -- Registration
Session Invitation
SIP BYE
References SIP -- Understanding the Session Initiation Protocol IP Telephony Cookbook SIP Demystified Understanding VoIP