You are on page 1of 24

U5 part 1

• Transfer of real-time data, such as voice and


video over IP network
Digitizing and Encoding
• Before voice or video can be sent on packet
network, hardware codec (coder/decoder)
must be used to the convert the analog signal
to digital form (coder part is used)
• Most common type of codec , a waveform
coder
Waveform coding
 Coding
Measures the amplitude of input signal at
regular intervals and converts each sample
into a digital value (i.e., an integer) [encoding]
 Decoding
Accepts a sequence of integers as input and
creates a continuous analog signal
• Encoding standards
 Main tradeoff being between quality of
reproduction (decoding) and size of digital
representation of sample (how many bits to
use?)
 Example - Digital telephone exchange
PCM (Pulse Code Modulation) standard is
used
PCM
• 8 KHz sampling rate
• Every 125 us a sample is produced
• Each sample is encoded as 8-bit number
(byte)
• Digital telephone call produces – 64 kbps

• How many bytes for 1 ms duration analog


signal? Ans – 8 bytes
• Three ways to reduce amount of data
generated
 Take fewer samples per second
 Use fewer bits to encode each sample
[ Above two lead to lower quality of audio on
decoding / reproduction]
 Compress encoded data – Causes delay /
faster CPU needed to reduce delay
Audio and Video
Transmission and Reproduction
• Many audio and video applications are
classified as real-time -
Require timely transmission and delivery
Examples – Interactive telephone calls and streaming videos

Audio and video must be delivered without


significant delay or users find result
unsatisfactory
Audio and Video
Transmission and Reproduction
• Timely transfer means
 Low delay
 Receiving end – signal must be presented in
the same order as the original and with
exactly same timing
Audio and Video
Transmission and Reproduction
• Original US telephone system used
isochronous architecture – Output delivered
with exactly same timing as was used to
generate input
Audio and Video
Transmission and Reproduction
• IP network
 not isochronous
 Datagrams can be duplicated, delayed, or
arrive out of order
 Delay is to be expected in IP network and
delay can vary from packet to packet
Variance in delay is known as jitter
Audio and Video
Transmission and Reproduction
• So we need additional protocol support (app
layer)
 Each voice/video packet must contain a
sequence number ( allows detection of
duplicate or out of order packets)
 Each voice/video packet must contain a time
stamp (Allows to handle jitter)
• More info on timestamp –
Tells the receiver at which time the data in the
packet should be played back
If datagram is lost or sender stops encoding
during the period of silence – it allows
receiver to pause during playback
Jitter and Playback delay
• Receiver uses playback buffer (jitter buffer)

.................................

Items Items
K time units of data Extracted
inserted
K is Playback point At
At
A variable A fixed rate
rate
Jitter and Playback delay
• When a session begins, receiver delays
playback and places incoming items in the
buffer
• When items in the buffer reach a
predetermined threshold – playback point K,
playback begins
• Suitable value of K has to be chosen
If K is too small, playback buffer will be exhausted quickly
If K is too large, system remains immune to jitter, but extra delay introduced
will add to transmission delay in the network
Jitter and Playback delay
• Streaming audio or video -
A graphical representation of playback buffering
is shown to user
Fig 26.2 in T1
VoIP Call
• Call set up (VoIP Signaling)
• Call active (VoIP media phase)
• Call tear down (VoIP Signaling)
RTP
• Real-time Transport Protocol
• App layer protocol used to carry voice/video
packets after VoIP call is setup (call is active or
media phase of the call)
• RTP (RTP/RTCP) - VoIP media protocol
• Uses UDP as transport layer protocol

[ We will discuss later protocols used to set up and


tear down VoIP calls – VoIP Signalling protocols]
RTP packet

Header Payload

Audio / Video data

Important note – Audio/video data when reaches PHY layer


will have overhead due to RTP header, UDP header, IP header, and
Layer 2 header – N byes of payload becomes N+overhead bytes

This is true for normal data application protocol also but matters for
audio/video data as overhead causes additional delay in the network
RTP header

2 1 1 4 1 7 16

VER P X CC M PTYPE SEQ NUMBER


12
TIME STAMP bytes

SYNC SOURCE IDENTIFIER


CONTRIBUTING SOURCE ID
……

32

Note 1 - Numbers are length in bits of the corresponding fields


Note 2 - Standard RTP header length 12 bytes
RTP header fields
• VER ( 2 bits) – Version of protocol used
• P ( 1 bit) - zero padding follows payload or not
• X ( 1 bit) – Header extension present or not
• CC (4 bits) – Count of contributing sources
• M (1 bit) – Marker, mark points in the data stream
( Ex – Video frame may be carried in more than one RTP
packets. Which RTP packet has beginning of each video
frame? Receiver needs this info)
• PTYPE (7 bits) – Payload type – What encoding used ?
[Ex – PCM, Compression method (VoIP codec) ]
RTP header fields
• Sequence number (16 bits) – Sequence
number of the packet in current RTP session
First sequence number chosen at random
• Timestamp (32 bits) –
Conceptually , time at which the first octet of
digitized data was sampled and initial
timestamp chosen at random
Incremented even during silence
RTP header fields
• More on Timestamp header field –
PTYPE affects the interpretation of this field
Example – Every 10 ms second of voice sent in one RTP packet and
PTYPE is PCM

RTP payload size = 10 ms / 125 us = 80 bytes

Let us say time stamp for first RTP packet is - 20


For next (second) RTP packet – 20+80 =100
RTP Encapsulation

Soft phone App / H.323 or SIP/ RTP Soft phone App/H.323 or SIP/RTP

Transport (TCP,UDP) Transport (TCP,UDP)

Network (IPv4 / IPv6) Network (IPv4 / IPv6)

Data link (Ethernet) Data link (Ethernet)

Physical Physical

Node A Node B

Network

You might also like