5. O Kodovanju

Embed Size (px)

DESCRIPTION

bvc hxht

Citation preview

  • The codec selection is the largest factor in audio quality and normally depends upon bandwidth availability. For optimal voice quality, use the G.711 codec. Where bandwidth is at a premium, use a compressed codec like G.729.

    G.711 produces uncompressed audio to 64000 bps*

    G.729 produces compressed audio to 8000 bps*

    *This is not to be confused with required network bandwidth; this is the raw codec bandwidths and does not include layer 2 and 3 header overhead.

    The following calculations are used to help make an informed bandwidth choice.

    Voice payload The codec selection and encapsulation rate determine the voice payload. For example, since audio is encapsulated in 10 ms frames, and there are 100 of these frames in a second (100 * 10 ms = 1sec), each 10 ms G.711 frame contains 640 bits (64000 / 100) or 80 Bytes of voice payload. Experience has shown that a 20 ms packet is a good compromise between audio quality and bandwidth usage. The table below indicates the voice payload for G.711 and G.729.

    Header overhead The smaller the codec frame size, the less efficient that it will be. For example, If you compare g.729 on Ethernet, you can see how much overhead will play into the final bandwidth consumption. To understand how overhead is added to voice traffic, the OSI Reference Model can be used.

    Here is an illustration of how Ethernet overhead compares to actual voice payload.

    In this case, the total packet size will be 76 Bytes, with only 10 Bytes, or 13%, being voice payload.

  • In this next case, the total packet size will be 86 Bytes, with only 20 Bytes, or 23%, being voice payload.

    In this last case, the total packet size will be 96 Bytes, with only 30 Bytes, or 31%, being voice payload.

    Packet rate The voice payload rate must remain constant so the number of voice frames determines the packet rate. As the number of frames per second increases, the number of packets per second decreases to maintain a steady rate of 100 voice frames per second (64000 bps or 8000 bps). The table below shows the packet rate.

    VoIP Bandwidth calculation Each voice packet inherits a fixed overhead of 40 Bytes (20-Bytes IP, 8-Bytes UDP and 12-Bytes RTP). So the bandwidth calculations using a 20ms encapsulation rate for VoIP are:

    G.711: (160 voice payload + 40 overhead)B/packet * 8b/B * 50packets/s = 80 Kbps

    G.729: (20 voice payload + 40 overhead)B/packet * 8b/B * 50packets/s = 24 Kbps

    The calculations above do not include Layer 2 encapsulation overhead. Layer 2 overhead must be added to the VoIP bandwidth calculation and this varies with the protocol being used (Ethernet, PPP, HDLC, ATM, frame relay, etc).

    Ethernet overhead The overhead for Ethernet is calculated just like VoIP, by determining the size of the Layer 2 encapsulation and figuring it into the calculation. Ethernet overhead adds another 26 Bytes (7- Byte preamble, 1-Byte start of frame delimiter, 14-Byte header and 4-Byte trailer). The new bandwidth calculations with Layer 2 overhead are:

    G.711: (160 voice payload + 66 overhead)B/packet * 8b/B * 50packets/s = 90.4 Kbps

    G.729: (20 voice payload + 66 overhead)B/packet * 8b/B * 50packets/s = 34.4 Kbps

  • WAN overhead WAN overhead varies in size depending upon the protocol being used, but are typically much smaller than the Ethernet overhead. A typical overhead associated with frame relay is 7 Bytes, so the WAN bandwidth calculations for frame relay are:

    G.711: (160 voice payload + 47 overhead)B/packet * 8b/B * 50packets/s = 82.8 Kbps

    G.729: (20 voice payload + 47 overhead)B/packet * 8b/B * 50packets/s = 26.8 Kbps

    Example:

    In the current scenario, imagine we are using Packet over Sonet (POS) which has 7 bytes of layer-2 overhead (assuming 2-Byte FCS), so x-27b. Now we test G.729 against the different frame sizes of 10 ms, 20 ms, and 30 ms.

    10 ms = 1 frame/packet = 100 pps

    G.729: (10 voice payload + 27 SONET overhead + 40 IP)B/packet * 8b/B * 100packets/s = 37.6 Kbps

    20 ms = 2 frame/packet = 50 pps

    G.729: (20 voice payload + 27 SONET overhead + 40 IP)B/packet * 8b/B * 50packets/s = 22.8 Kbps

    30 ms = 3 frame/packet = 33 pps

    G.729: (30 voice payload + 27 SONET overhead + 40 IP)B/packet * 8b/B * 33packets/s = 17.7 Kbps

    In this case, G.729 using at 30 ms packing will yield the best results. During calls, 77-Byte packets will be sent at 33 packets per second.

    Header compression In some topologies the IP, UDP, and RTP headers can be compressed to nearly eliminate them as a source of overhead because VoIP packets are composed of one or more speech codec samples or frames encapsulated in 40 bytes of IP/UDP/RTP headers. 40 bytes is a relatively large amount of overhead for the typical 20-byte VoIP payloads, particularly over low-speed links. Compressed RTP (cRTP), which is designed to reduce the IP/UDP/RTP headers to two bytes for most packets in the case where no UDP checksums are being sent, or four bytes with checksums.

    So to illustrate the difference with a 30 ms G.729 PPP example:

  • 30 ms = 3 frame/packet = 33 pps

    G.729: (30 voice payload + 26 Ethernet overhead + 40 IP/UDP/RTP)B/packet * 8b/B * 33packets/s = 20.5 Kbps

    30 ms = 3 frame/packet = 33 pps

    G.729: (30 voice payload + 26 Ethernet overhead + 4 cRTP)B/packet * 8b/B * 33packets/s = 11.1 Kbps

    This compression offers significant VoIP bandwidth savings. Because cRTP compresses VoIP calls on a link-by-link basis, both ends of the IP link need to be configured for cRTP.