chap5 VoIP

Embed Size (px)

Citation preview

  • 7/29/2019 chap5 VoIP

    1/39

    Voice and Multimedia over IP

    Voice over IP scenarios

    PC to PC, PC to phone, phone to phone, Corporate, core PSTN

    Digital voice

    Elements of the sampling theory

    PCM and TDM, Classical PSTN architecture

    Quality, Codec, Technical issues

    RTP - Transport of voice

    and other multimedia, soft realtime applications

    The H323 architecture

    SIP signalling

  • 7/29/2019 chap5 VoIP

    2/39

  • 7/29/2019 chap5 VoIP

    3/39

    Phone-to-Phone VoIP

    Use existing telephone with an Analogue Telephone Adapter (ATA) or use anIP phone

    Both connect to Broadband modem

    Called party may be another VoIP user

    Or, via a gateway, a traditional PSTN customer

  • 7/29/2019 chap5 VoIP

    4/39

    Many traditional PSTN calls are carried as VoIP in part

    For efficiency reasons they may travel with other IP traffic Different from normal VoIP

    Invisible to end customer

    Private IP network, not internet

    Controlled quality

    VoIP in the PSTN

  • 7/29/2019 chap5 VoIP

    5/39

    Corporate VoIP

    Increasingly growing popularity

    Inter-site voice carried as IP over leased line or VPN (huge money-saving especially for international communications)

    Additionally, a single desk wiring infrastructure (LAN) may carry bothdata and voice (as VoIP)

    Voice may stay as IP or be converted to PSTN

  • 7/29/2019 chap5 VoIP

    6/39

    Digital voice

  • 7/29/2019 chap5 VoIP

    7/39

    Digital voice

    Sine wave Sampling Quantizing

    Analog Signal Nyquist Fs=2Fc Quantization Noise

  • 7/29/2019 chap5 VoIP

    8/39

    Sampling

    8KHz Sampling Rate One sample each 125 s (8KHz), 8 bits per sample x 8KHz 64Kbps

    Nyquists theorem

    To be able to restore without loss a signal with a cut frequencyfc, weneed to sample it at a frequency of at least 2fc.

    Sampling at 8KHz we loose frequency components above 4KHz. Formusic audio this is not acceptable (MP3:44.1 KHz)

  • 7/29/2019 chap5 VoIP

    9/39

    Quantization

    We choose the quantized value closest to the Analog signal

    The truncation difference is called Quantization Noise

    Linear Digitization leads to a high SNR (Signal-to-Noise Ratio) becausesmall amplitudes suffer the same treatment as big ones

  • 7/29/2019 chap5 VoIP

    10/39

    Logarithmic Quantization Better SNR

    We give more levels (more precision) to small values => better SNR

    A-law (Europ) and -law (USA)

  • 7/29/2019 chap5 VoIP

    11/39

    PCM - Pulse-Code Modulation

    DS0 (Digital Signal level 0

    single digital voice channel in the PCM system

    Synchronously one sample each 125s 64 Kbps total throughput

    A hierarchy of TDM multiplexes (PDH & SDH) used in PSTN core

    Analog only at the local loop

    ADC and DAC at the toll office (a word about Echo here)

  • 7/29/2019 chap5 VoIP

    12/39

    Synchronous Digital Hierarchy

    E1 (or DS1 - Digital Signal level 1)

    Multiplexes synchronously 32 DS0 channels, but channels 0 and 16reserved for signaling (remains 30 voice channels)

    Sample rate must remain 8000 samples (Bytes) /s for all channels =>the frame time must always remain 125s (at all the levels DS2 DS3 etc)

    E1 bit rate: 8bits x 32 / 125s = 2.048 Mbps

  • 7/29/2019 chap5 VoIP

    13/39

    Synchronous Digital Hierarchy E carriers

    Similarly, E2 multiplexes 4 E1 channels, E3=16E1, etc..

    The T-carrier system, similar but different, is used in USA

    Ex: T1 = 24 DS0

  • 7/29/2019 chap5 VoIP

    14/39

    Codec The Encoder-Decoder

    G.711 The classical codec

    Simply what we saw so far.. 8000 Byte samples, 64 Kbps encoded in the

    DS0 format

    Can we achieve the same quality with a smaller bandwidth?

    Silence suppression

    Compression

    Many encoding algorithms and corresponding Codecs havebeen invented and standardized, all seeking the reduce

    bandwidth with a minor (or no) loss of quality.

    Drawback: adding some computational delay

    This is minor compared to bandwidth gain

  • 7/29/2019 chap5 VoIP

    15/39

    Some standardized Codecs

    V i Q li

  • 7/29/2019 chap5 VoIP

    16/39

    Voice Quality

    Subjective: Mean Opinion Score (MOS)

    5 - Perfect. Like face-to-face conversation or radio reception. 4 - Fair. Imperfections can be perceived, but sound still clear.

    3 - Annoying.

    2 - Very annoying. Nearly impossible to communicate.

    1 - Impossible to communicate

    Objective

    Derived from bandwidth, delay and packet loss rate

    Toll (payable) service must be in the 4 to 5 range

    D l

  • 7/29/2019 chap5 VoIP

    17/39

    Delay

    Delay should be

  • 7/29/2019 chap5 VoIP

    18/39

    Jitter

    Voice is a CBR service

    A packet that arrives too late must be dropped

    Continuous playback

    What is Jitter?

    Different packets experience different delays in the network

    Varying queue sizes

    Different paths introduce jitter, but load balancing algorithms work on amicro-flow level, not on packet level (coarse grain)

    TCP transport not suitable

    Congestion window management increases jitter

    retransmitted packets will be dropped anyway. VoIP uses RTP/UDP

    Solution

    Jitter buffer at the receiver

    Deliberately adding some delay to ensure continuous playback

    Jitt B ff

  • 7/29/2019 chap5 VoIP

    19/39

    Jitter Buffer

    The bigger the playback delay, the lesser the jitter

    It is important to have low jitter from the network, otherwisewe need a big jitter delay.

    P k t L t

  • 7/29/2019 chap5 VoIP

    20/39

    Packet Loss rate

    IP network (Best effort service)

    Routers might drop packets (RED: Random Early Detection)

    Packets arriving too late are deliberately droped by receiver Loss rate tolerable up to 5%

    10% if we use Interleaving

  • 7/29/2019 chap5 VoIP

    21/39

    RTP - The Realtime Transport Protocol

  • 7/29/2019 chap5 VoIP

    22/39

    RTP - The Realtime Transport Protocol

    Transport mechanism designed for Soft Realtime applications The most important feature is Timestamping

    Manage jitter

    Synchronize multiple streams, i.e. audio and image in a movie

    RTP

  • 7/29/2019 chap5 VoIP

    23/39

    RTP

    P: padding (multiple of 4 bytes)X: exist extension headers (unused)M: app-specific marker (ex: start of video frame)Payload Type: specifies type and encoding algorithm (ex: G.711 voice)Sequence numbering to detect loss of packetsTimestamp: jitter management and synchronization of streams

    SSRC: identifies a stream (many streams may be multplexed on a RTP stream, such asvideo and audio)CSRC combined with CC: permits many sources to be mixed (CC is the count andSSRC is a list). The mixer would be the SSRC

  • 7/29/2019 chap5 VoIP

    24/39

    H.323 architecture

    H323 A hit t d P t l St k

  • 7/29/2019 chap5 VoIP

    25/39

    H323 Architecture and Protocol Stack

    H 323 ll

  • 7/29/2019 chap5 VoIP

    26/39

    H.323 call sequence

    1. PC discovers Gatekeeper (broadcast discovery request packet)

    2. Gatekeeper responds

    3. Client registers in the Gatekeeper zone (RAS protocol H225)4. Client requests bandwidth (this is to manage call admission and QoS!)

    5. Client establishes TCP session with Gatekeeper for signalling

    6. Client sends SETUP message (Q.931 signalling)

    7. Gatekeeper contacts Gateway and sends CALL_PROCEEDING to client

    8. Gateway Calls destination number

    9. Callee rings, Q.931 ALERT message (GWclient)

    10. Callee responds, Q.931 CONNECT message (GWclient)

    11. H245 messages to negotiate capabilities (codec, video, teleconf)

    12. Data flow proceeds using RTP13. Call terminates (callee hangs), GW alerts client (Q.931)

    14. Client releases Bandwidth to gatekeeper (RAS message)

  • 7/29/2019 chap5 VoIP

    27/39

    SIP

    The Session Initiation Protocol

    SIP S i I iti ti P t l

  • 7/29/2019 chap5 VoIP

    28/39

    SIP - Session Initiation Protocol

    LOOKUP and REPLY methods not specified in SIP (free implementation)

    REGISTER method allows clients to register to proxy and inform of location

    Another option to use SIP is P2P. Caller and callee exchange directly

    INVITE/OK/ACK through a TCP connection and then start exchanging data

  • 7/29/2019 chap5 VoIP

    29/39

    SIP Methods

    The encoding of messages is based on HTTP

    C i f H 323 d SIP

  • 7/29/2019 chap5 VoIP

    30/39

    Comparison of H.323 and SIP

    MP3 (for music audio)

  • 7/29/2019 chap5 VoIP

    31/39

    The masking effectThreshold of audibility asfunction of frequency

    MP3 (for music audio)

    Sampling usually is at 44.1 KHz

  • 7/29/2019 chap5 VoIP

    32/39

    Video Analog Systems

    The scanning pattern used for NTSC video andtelevision.

  • 7/29/2019 chap5 VoIP

    33/39

    The JPEG Standard

    The operation of JPEG in lossy sequential mode.

  • 7/29/2019 chap5 VoIP

    34/39

    JPEG Block Preparation

    RGB input data After block preparation

    Y=.3R+.59G+.11B I=.6R-.28G-.32B Q=.21R-.52G+.31B

  • 7/29/2019 chap5 VoIP

    35/39

    JPEG -- DTC

    One block of the Ymatrix The DTC coefficients

    G

  • 7/29/2019 chap5 VoIP

    36/39

    JPEG

    Computation of the quantized DTC coefficients.

    Th JPEG S d d

  • 7/29/2019 chap5 VoIP

    37/39

    The JPEG Standard

    The order in which the quantized values are transmitted

    Run-length encoding: exploiting repetitions

    Th MPEG St d d

  • 7/29/2019 chap5 VoIP

    38/39

    The MPEG Standard

    Synchronization of the audio and video streams in MPEG-1.

    MPEG F T

  • 7/29/2019 chap5 VoIP

    39/39

    MPEG Frame Types

    I (Intracoded) frames: Self-contained JPEG-encoded still

    pictures.

    P (Predictive) frames: Block-by-block difference with the lastframe.

    B (Bidirectional) frames: Differences between the last and nextframe.

    D (DC-coded) frames: Block averages used for fast forward.