Appendix B. Protocols for VoIP

Table of Contents

The Need for VoIP Protocols
VoIP Protocols
IAX (The “Inter-Asterisk eXchange” Protocol)
History
Future
Security considerations
IAX and NAT
SIP
History
Future
Security considerations
SIP and NAT
H.323
History
Future
Security considerations
H.323 and NAT
MGCP
Proprietary Protocols
Skinny/SCCP
UNISTIM
Codecs
G.711
G.726
G.729A
GSM
iLBC
Speex
G.722
MP3
Quality of Service
TCP, UDP, and SCTP
Transmission Control Protocol
User Datagram Protocol
Stream Control Transmission Protocol
Differentiated Service
Guaranteed Service
MPLS
RSVP
Best Effort
Echo
Why Echo Occurs
Managing Echo on DAHDI Channels
Hardware Echo Cancellation
Asterisk and VoIP
Users and Peers and Friends—Oh My!
Users
Peers
Friends
register Statements
VoIP Security
Spam over Internet Telephony (SPIT)
Encrypting Audio with Secure RTP
Spoofing
What Can Be Done?
Basic network security
Encryption
Physical security
Conclusion

The Internet is a telephone system that’s gotten uppity.

Clifford Stoll

The telecommunications industry spans over 100 years, and Asterisk integrates most—if not all—of the major technologies that it has made use of over the last century. To make the most out of Asterisk, you need not be a professional in all areas, but understanding the differences between the various codecs and protocols will give you a greater appreciation and understanding of the system as a whole.

This appendix explains Voice over IP and what makes VoIP networks different from the traditional circuit-switched voice networks that were the topic of Appendix A, Understanding Telephony. We will explore the need for VoIP protocols, outlining the history and potential future of each. We’ll also look at security considerations and these protocols’ abilities to work within topologies such as Network Address Translation (NAT). The following VoIP protocols will be discussed (some more briefly than others):

Codecs are the means by which analog voice can be converted to a digital signal and carried across the Internet. Bandwidth at any location is finite, and the number of simultaneous conversations any connection can carry is directly related to the type of codec implemented. We’ll also explore the differences between the following codecs in regard to bandwidth requirements (compression level) and quality:

We will then conclude the appendix with a discussion of how voice traffic can be routed reliably, what causes echo and how to deal with it, and how Asterisk controls the authentication of inbound and outbound calls.