Download RTP: Real-Time Transport Protocol for Multimedia Applications and more Study notes Computer Systems Networking and Telecommunications in PDF only on Docsity!
1
Multimedia
Requirements RTP RTCP Session Control
2
Audio and Video
- audio and video data use variable rate coding to represent data
- sample rate dictates the playback rate
- buffer received data
3
RTP
- A general-purpose protocol designed to support multimedia applications.
- Originated from MBONE applications
4
RTP
- Provides common end-to-end functions to a number of applications
- RTP carries application specific data
- runs on top of a transport protocol, typically UDP
- more general that the previous application layer protocols.
5
Applications
- Categories
- Streaming - RealAudio
- Conferencing – user interaction
Chapter 9, Figure 8
Chapter 9, Figure 9
Application
RTP
UDP
IP
Subnet
8
RTP Requirements
- Protocol must allow similar applications to interoperate
- Need to establish a coding scheme
- Bandwidth
- Computational cost
- Delay
- quality
9
RTP Requirements
- Timing mechanism
- Relationship among received data
- Synchronization
- Playback point
10
RTP Requirements
- Packet Loss – what to do?
- Playback last packet
- Reconstruct the packet with interpolation
- Reduce encoding rate
11
RTP Requirements
- Congestion – what to do?
- UDP doesn’t have flow control
- Use loss rate, adapt
- Framing - Which packets correspond to a frame?
- Frames help identify talkspurts
- Use silence periods for playback adjustment
- Sender identification
12
RTP Requirements
- Efficient bandwidth utilization
- Audio packets are small
- Header of the RTP packet can’t be too large
Chapter 9, Figure 11
Pad count bytes
UDP header RTP header RTP payload Padding Pad count
Length as carried in UDP header
20
Header
- CC is a 4 bit field that lists the number of contributing sources
- M denotes the marker bit which can be used to indicate particular frames of interest (talkspurts)
- 7 bit payload type indicates the type of multimedia data in the packet. - This field can be used in an alternative way, it can be used to indicate a change in encoding type. - How this field and the M bit are used will be specified by the application profile.
21
Demultiplexing
- The payload field is not used as a demultiplexing key to direct data to different applications.
- This service is provided by the transport layer protocol.
- Note: two different types of media streams using RTP will use two different UDP ports.
22
Header
- Sequence Number
- detect missing and miss-ordered packets.
- if a packet is lost the application must handle it (or not)
- Time stamp
- detect missing and miss-ordered packets.
- timestamp represents when the first sample in the packet was generated.
- The differences between timestamps are important
23
Header
- synchronization source (SSRC) is a 32 bit number that uniquely identifies a single source of the stream.
- A random number is generated for each sender and this number becomes the SSRC
- By not using the IP address, RTP is independent from the lower layer protocol - Can also distinguish multiple sources from the same node 24
Header
- contributing source (CSRC) is used only when a number of RTP streams go through a mixer. - Mixers help reduce bandwidth. - it can receive multiple streams (say audio) and mix them together and encode them as a single stream. - The mixer then becomes the synchronization source, but also lists the contributing sources that were mixed for that particular packet
25
RTCP
- RTCP provides a control stream that does the following three things: 1. Gives feedback on the performance of the application and the network, 2. Provides a way to synchronize media streams from the same sender 3. Conveys the identity of the sender for display on a user interface.
26
RTCP
- RTCP Packet Types
- Sender reports : enable active senders to report transmission and reception statistics
- Receiver reports : used by receivers to indicate reception statistics
- Source descriptions : carry the CNAMEs and other sender description info
- Application specific control packets
27
RTCP
- RTCP packets are sent via UDP
- Several can be sent together in one UDP packet
- Don’t want too much control data
- Limit RTCP traffic to 5% of the RTP traffic
- Periodic reports are sent
28
RTCP
- Sender and receiver report contain:
- timestamp with the actual time of day the report was generated
- The RTP timestamp corresponding to the time the report was generated
- Cumulative counts of the packets and bytes sent by this sender since the start of the transmission
29
RTCP
- Also contain a block of data per source with:
- Its SSRC
- The fraction of data packets that were lost since the last report was sent
- Total number of packets lost from this source since the start of transmission
- Highest sequence number received from the source
- Estimated inter-arrival jitter for the source
- Last actual timestamp received via RTCP for this source
- Delay since last sender report received via RTCP for this source
30
RTCP
- Use all this to evaluate the condition of the network and estimate the receiver’s quality of service
- If a large % of packets are lost, decrease encoding rate
- Loss rates of 5-30% are common over the Internet
- 30% loss is intolerable by listeners
Chapter 9, Figure 12
terminal^ H.
gatekeeperH. terminalH.
gatewayH.
Conventional telephonenetwork
38
H.
- H.323 terminal
- originates the call (phone or PC)
- Gatekeepers
- translate among address formats (phone # to IP address)
- control how many calls can be placed based on bandwidth available
- Gateways
- Connect H.323 networks to other types of networks like the PSTN
39
H.
- The control protocol allows negotiation of the properties of the call - encoding types - signal the UDP port number that will be used by RTP and RTCP for the media streams. - Once this is established, the call proceeds with only RTP and RTCP carrying the relevant information
40
Compression Overview
- Encoding and Compression
- Lossless
- data received = data sent
- used for executables, text files, numeric data
- Lossy
- data received does not != data sent
- used for images, video, audio
41
Lossless Algorithms
- Run Length Encoding (RLE)
- example: AAABBCDDDD encoding as 3A2B1C4D
- good for scanned text (8-to-1 compression ratio)
- can increase size for data with variation (e.g., some images)
- Differential Pulse Code Modulation (DPCM)
- example AAABBCDDDD encoding as A
- change reference symbol if delta becomes too large
- works better than RLE for many digital images (1.5-to-1)
42
Dictionary-Based Methods
- Build dictionary of common terms
- Transmit index into dictionary for each term
- Lempel-Ziv (LZ) is the best-known example
- Commonly achieve 2-to-1 ration on text
- Variation of LZ used to compress GIF images
- first reduce 24-bit color to 8-bit color
- treat common sequence of pixels as terms in dictionary
- not uncommon to achieve 10-to-1 compression (x3)
43
Image Compression
- JPEG: Joint Photographic Expert Group (ISO/ITU)
- Lossy still-image compression
- Three phase process
- process in 8x8 block chunks (macroblock)
- greyscale: each pixel is three values (YUV)
- DCT: transforms signal from spatial domain into and equivalent signal in thefrequency domain (loss-less)
- apply a quantization to the results (lossy)
- RLE-like encoding (loss-less)
Sourceimage JPEG compression DCT Quantization Encoding Compressedimage
44
Quantization and Encoding
- Quantization Table 3 5 7 9 11 13 15 17 5 7 9 11 13 15 17 19 7 9 11 13 15 17 19 21 9 11 13 15 17 19 21 23 11 13 15 17 19 21 23 25 13 15 17 19 21 23 25 27 15 17 19 21 23 25 27 29 17 19 21 23 25 27 29 31
- Encoding Pattern
45
MPEG
- Motion Picture Expert Group
- Lossy compression of video
- First approximation: JPEG on each frame
- Also remove inter-frame redundancy
46
MPEG (cont)
- Frame types
- I frames: intrapicture
- P frames: predicted picture
- B frames: bidirectional predicted picture
- Example sequence transmitted as I P B B I B B
Frame 1 Frame 2 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7
I frame B frame B frame P frame B frame B frame I frame
compressionMPEG predictionForward
Bidirectionalprediction
Compressedstream
Inputstream
47
MPEG (cont)
- B and P frames
- coordinate for the macroblock in the frame
- motion vector relative to previous reference frame (B, P)
- motion vector relative to subsequent reference frame (B)
- delta for each pixel in the macro block
- Effectiveness
- typically 90-to-
- as high as 150-to-
- 30-to-1 for I frames
- P and B frames get another 3 to 5x
48
Problem
- Suppose we want returning RTCP reports from receivers to amount to no more than 5% of the outgoing primary RTP stream.
If each report is 84 bytes, and the RTP traffic is 20KBps, and there are 1000 recipients, how often do individual receivers get to report? What if there are 10,000 recipients?