VoIP / Internet Telephony Peter Gradwell FBCS www.gradwell.com 01225 800 800 26 Cheltenham St, Bath, BA2 3EX
Gradwell dot com Ltd Founded 1998 whilst an Undergrad Now...30 Staff in Bath 3rd largest UK VoIP Provider for SMEs 30,000 lines on a VoIP platform gives us some interesting lessons to explore
Where does VoIP fit in?
Messaging + Talk
Different Types of VoIP
Voice Protocols All systems use some kind of application protocol to communicate SIP H323 IAX (Inter Asterisk eXchange) Skinny (Cisco Protocol) Audio is transported as RTP
TCP/UDP/Ports Traffic is either TCP or UDP MTU on Ethernet typically 1500 bytes 100 bytes of headers, 1400 bytes of data Lots of packet overhead Socket = IP Address + Port MTU = Max Transfer Unit/A Packet
Good book: If you're interested in more details You can read most of it on amazon
H.323 Point to Point Protocol H.323 is actually a family of protocols H.323 is used a lot on trunk routes, as it's signalling reflects ISDN, but is becoming obsolete Modem over IP Conferencing Fax
Inter-Asterisk eXchange Asterisk is a major OpenSource phone system IAX was invented by Mark Spencer/Digium Single UDP stream – port 4569 Handles the Media inband on the same socket Can support multiple RTP streams Single signalling link Far more bandwidth efficient Also much friendlier for firewalls Pronounced “eeks”
Skinny / SCCP Skinny is a lightweight protocol which allows for efficient communication with Cisco CallManager Not many other people use it, but there is a big Cisco install base Signalling via TCP, Media via RTP/UDP
SIP – Session Initiation Protocol SIP is the dominant VoIP protocol It's a peer to peer protocol, unlike H.323
SIP Addressing SIP is very similar to Email and HTTP URI Address format: sip:peter@gradwell.com sip:100@sip.gradwell.net:5060 sip:441225800800@sip.gradwell.net
Types of SIP Message INVITE—An INVITE method indicates that the recipient user or service is invited to participate in a session. ACK - An ACK request confirms that the UAC has received the final response to an INVITE request. ACK is used only with INVITE requests. ACK is sent end to end for a 200 OK response. OPTIONS—A UA uses the OPTIONS request to query a UAS about its capabilities BYE—A UA uses BYE to request the termination of a previously established session. CANCEL—The CANCEL request enables UACs and network servers to cancel an in-progress request, such as INVITE. This does not affect completed requests in which the UAS had already sent final responses. REGISTER—A client uses a REGISTER request to register its current location information corresponding to the AOR of the user with SIP servers.
SIP Registration Phone registers periodically to tell the SIP server where it is
SIP Call Flow
A Complete Call Often we'll draw SIP call path diagrams out like this for debugging
Debug using wireshark
You can also do redirects
SIP – Just for signalling Register – Hello Invite – Ringing ACK – Please hold OK – Connecting you caller BYE – Nice to talk to you But no sound!
Codecs “Nyquist theorem states that if you sample an analog signal at twice the rate of the highest frequency of interest, you can accurately reconstruct that signal back into its analog form” Audio is sampled at 8k or 16k times per second (Hertz) – Pulse Code Modulation Codecs trade off quality, bandwidth and CPU to produce an RTP data packet Narrow Band (8k) or Wide Band (16k) We waste loads of Bandwidth on packet overhead Codec BR NEB G.711 64 Kbps 87.2 Kbps G.729 8 Kbps 31.2 Kbps G.723.1 6.4 Kbps 21.9 Kbps G.723.1 5.3 Kbps 20.8 Kbps G.726 32 Kbps 55.2 Kbps G.726 24 Kbps 47.2 Kbps G.728 16 Kbps 31.5 Kbps iLBC 15 Kbps 27.7 Kbps BR = Bit rate NEB = Nominal Ethernet Bandwidth (one direction) Skype uses iLBC and ISAC
RTP RTP is used to send packets and re- assemble them What if? Time stamp Sequence Payload type What if? They arrive out of order - Jitter Or not at all? - Packet Loss
Jitter “Jitter is the variation of packet interarrival time” Jitter is a major problem The internet is asymmetrical Manage the problem with a Jitter buffer ~ 20ms
Packet Loss Typically, each packet is 20ms of voice If we loose one packet, it's not a major problem Cisco implementation replays previous packet
Quality of Service QoS is needed if a network link is congested Routers need to enforce traffic prioritisation across their links How do they decide? Trust the user? - DiffServ, Expedited Forwarding and Low Delay bits in IP header Trust the network – all traffic on port X or from IP address Y is special
QoS Example http://myvoipspeed.visualware.com/servers/lhr.html
Phone numbers 00 44 1225 80 0 800 Typically BT will route/transit the calls inbound from the world, to smaller Telcos Could buy the service from C&W/Kingston Call comes down an ISDN line (SS7 signalling) into a Server and we convert it to SIP BT network is statically routed Customer Intl Country Area Telco
ENUM Phone numbers as domain names My VoIP server can now decide how to route the call 01225 800 810 becomes 0.1.8.0.0.8.5.2.2.1.4.4.e164.arpa. When I look this up I find TEL: 079700NNNNN SIP: 1000200@sip.gradwell.net
ENUM Conceptually Public ENUM is about publishing how you want to receive your phone calls Carrier ENUM is telcos getting a dynamic routing table
SRV Records Can you dial sip:peter@gradwell.com Yes – just do a lookup for the ENUM Records on gradwell.com and make a call to “peter”. Peter = 1000200
Lets make a test call http://www.vaxvoip.com/WebDemo/SoftphoneA/Softphone.HTM login: 2443800 password: Jup5jojo sip proxy: newsip.gradwell.net Outbound proxy: natproxy.gradwell.net:5082 Display name: “test” Then call your mobile – cli should be 02031372331 Now dial inbound, everyones phone should ring! This demo uses an ActiveX control, so only works on windows
Conclusions SIP – Signalling, RTP – Audio But SIP isn't the only game in town RTP is dependent on Network Quality Routing information can be stored in ENUM
Useful Resources www.trixbox.org www.voip-info.org www.asterisk.org www.voip-info.org Great VoIP wiki www.nominet.org.uk/enum Good Enum Primer Cisco Book