This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Voice Channels
The T1 carrier versus VoIP
The T1’s 24 DS0 channels are each never-ending streams of digitized voice informa-
tion. In reality though, the T1 circuit itself is one big stream of binary digits that uses
TDM to divide the T1 into those 24 DS0 channels. Each is assigned a time slice of
the big stream, and each time slice is further divided into frames, as shown in
Figure 6-1. All voice T1s use the same amount of bandwidth no matter how many
calls are in progress—roughly 1.54 mbps. Trunking with T1s is very stable and pre-
dictable as a result.
VoIP frees the system builder from requirements traditionally imposed on the lower
OSI layers of the network. In a T1, the transport and data link layers are defined
together as a bundled carrier, and you have to use the G.711 PCM codec on all the
channels, yielding 24 simultaneous voice channels in the available bandwidth. VoIP
lets you pick and choose the codec, packet interval, and transport technologies you
want and thus gives you ultimate control. Using the G.729A codec and a T1, you
could conceivably trunk hundreds of calls at once.
Unlike G.711 traffic on a T1, VoIP’s “carrier” is TCP/IP. So VoIP can traverse Ether-
net, T1s, DSL lines, cable internet lines, POTS lines, frame relay networks, virtual
private networks (VPNs), microwave radio, satellite connections, ATM, and just
about any other link. If IP can go there, VoIP can go there—just with varying levels
of quality.
Table 6-1. VoIP codec characteristics
Codec Algorithm
Bandwidth used
for sound
Packet interval
Voice bits per
G.711 PCM 64 kbps 20 ms 1,280 bits Low
G.726 ADPCM 32 kbps 20 ms 640 bits Medium
G.728 CELP 16 kbps 10 ms 160 bits High
G.729A CELP 8 kbps 10 ms 160 bits High
Regular pulse excitement, yet another sound encoding/compression technique.
13 kbps 20 ms 160 bits Depends upon
algorithm used;
CELP is higher
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Chapter 6: Replacing the Voice Circuit with VoIP
All VoIP systems to date use equal-sized frames of the same fidelity
during each call. You’ll never have a sample rate of 8 kHz change to 12
kHz during a single session the way you could with a variable-rate
MP3, for example.
Voice packet structure
The layered appearance of a VoIP packet is similar to that of other types of net-
worked applications that run within the TCP/IP protocol: the lower layers encapsu-
late the higher layers recursively.
The lowest layer, shown leftmost in Figure 6-3, is the Internet Protocol (IP) packet
header. It contains routing information so that the packet can be handled correctly
by the devices responsible for carrying it across the network. It also contains a flag
that indicates which protocol of the TCP/IP suite this packet is carrying: TCP, UDP,
or something else. Voice packets are almost always UDP. Among other things, the IP
header may include a Type of Service flag that allows routers and switches to treat it
with a certain priority based on its sensitivity to delay. At a minimum, the IP packet
header is 160 bits in length.
The payload of the IP packet is the UDP packet, whose header is 64 bits long. Its first
32 bits contain the source and destination ports of the UDP traffic it carries in its
payload, along with 8 bits for optional error checking and 8 bits for describing the
length of its payload in multiples of 8 bits.
The payload of the UDP packet is the RTP packet, whose header is 96 bits long. It
contains information about the sequence and timing of the packet within the greater
data stream.
Real-Time Transport Protocol
The Real-Time Transport Protocol (RTP) defines a simple way of sending and receiv-
ing encoded media streams
in connectionless sessions. It provides headers that
afford VoIP systems an easy way of discriminating between multiple sessions on the
same host. Remember that the codec merely describes how the digitized sample is
encoded, compressed, and decoded. RTP is responsible for transporting the encoded
sound data within a UDP datagram. RTP was designed for use outside the realm of
telephony, too: streaming audio and video for entertainment and education are com-
mon with RTP.
RTP supports mixing several streams into a single session in order to support appli-
cations like conference calling. It doesn’t, however, provide adequate controls for
defining multiplexed voice pathways that are normally associated with telephony,
like trunks. This is the responsibility of the softPBX and its signaling protocols.
* When certain signaling protocols, such as IAX, are used, RTP may not be employed to packetize the voice
stream. IAX has its own built-in voice-packetization capability.

Get Switching to VoIP now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.