Spring 2001CS Multimedia, QoS Multimedia (7.2, 9.3) Compression RTP Realtime Applications Integrated Services Differentiated Services Quality of Service (6.5)
Spring 2001CS 5852 Compression Overview Encoding and Compression –Huffman codes Lossless –data received = data sent –used for executables, text files, numeric data Lossy –data received does not != data sent –used for images, video, audio
Spring 2001CS 5853 Lossless Algorithms Run Length Encoding (RLE) –example: AAABBCDDDD encoding as 3A2B1C4D –good for scanned text (8-to-1 compression ratio possible,fax) –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)
Spring 2001CS 5854 Dictionary-Based Methods Build dictionary of common terms (LZ algorithm) –variable length strings Transmit index into dictionary for each term –Compression 11*7=77bits 4978th of world dictionay(15bits) Static dictionary vs tailored dictionary 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 ( x 3)
Spring 2001CS 5855 Image Compression JPEG: Joint Photographic Expert Group (ISO/ITU) Lossy still-image compression Three phase process –process in 8x8 block chunks (macroblock) –grayscale: each pixel is given by a 8 bit value –DCT: transforms signal from spatial domain into and equivalent signal in the frequency domain (loss-less) –apply a quantization to the results (lossy) –RLE-like encoding (loss-less) Source image JPEG compression DCTQuantizationEncoding Compressed image
Spring 2001CS 5856 Discrete Cosine Transform(DCT) 8*8 matrix spatial domain 8*8 matrix frequency domain DC coefficient located at (0,0) indicates average value of 64 pixels AC coefficients (rest), variations
Spring 2001CS 5857 Quantization and Encoding Quantization Table Encoding Pattern
Spring 2001CS 5858 MPEG Motion Picture Experts Group Lossy compression of video First approximation: JPEG on each frame Also remove inter-frame redundancy
Spring 2001CS 5859 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 1Frame 2Frame 3Frame 4Frame 5Frame 6Frame 7 I frameB frame P frameB frame I frame MPEG compression Forward prediction Bidirectional prediction Compressed stream Input stream
Spring 2001CS 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-1 –as high as 150-to-1 –30-to-1 for I frames –P and B frames get another 3 to 5 x
Spring 2001CS RTP (9.3) Real-time Transport Protocol Application-Level Framing Data Packets –sequence number –timestamp (app defines “tick”) Smooth out jitter and synchronization of multiple streams Control Packets (send periodically, RTCP) –loss rate (fraction of packets received since last report) –measured jitter
Spring 2001CS Quality of Service (6.5) Realtime Applications Integrated Services Differentiated Services
Spring 2001CS Realtime Applications Require “deliver on time” assurances –must come from inside the network Example application (audio) –sample voice once every 125us –each sample has a playback time –packets experience variable delay in network –add constant factor to playback time: playback point Microphone Speaker Sampler, A D converter Buffer, D A
Spring 2001CS Playback Buffer Sequence number Packet generation Network delay Buffer Playback Time Packet arrival
Spring 2001CS Example Distribution of Delays Packets (%) 90%97%98%99% Delay (milliseconds)
Spring 2001CS Taxonomy Applications Real time Tolerant AdaptiveNonadaptive Delay- adaptive Rate- adaptive Intolerant Rate-adaptiveNonadaptive Interactive bulk Asynchronous Elastic
Spring 2001CS Integrated Services Service Classes –guaranteed –controlled-load Mechanisms –signaling protocol –admission control –policing –packet scheduling
Spring 2001CS Flowspec Rspec: describes service requested from network –controlled-load: none –guaranteed: delay target Tspec: describes flow’s traffic characteristics (leaky bucket) –average bandwidth + burstiness: token bucket filter –token rate r –bucket depth B –must have a token to send a byte –must have n tokens to send n bytes –start with no tokens –accumulate tokens at rate of r per second –can accumulate no more than B tokens
Spring 2001CS Per-Router Mechanisms Admission Control –decide if a new flow can be supported –answer depends on service class –not the same as policing Packet Processing –classification: associate each packet with the appropriate reservation –scheduling: manage queues so each packet receives the requested service
Spring 2001CS Reservation Protocol Proposed Internet standard: RSVP Consistent with robustness of today’s connectionless model Uses soft state (refresh periodically) Designed to support multicast Receiver-oriented Two messages: PATH and RESV –Source transmits PATH messages every 30 seconds –Destination responds with RESV message In case of Multicast –Merge requirements in case of multicast –Can specify number of speakers
Spring 2001CS RSVP Example
Spring 2001CS RSVP versus ATM (Q.2931) RSVP –receiver generates reservation –soft state (refresh/timeout) –separate from route establishment –QoS can change dynamically –receiver heterogeneity ATM (Asynchronous Transfer Mode) –sender generates connection request –hard state (explicit delete) –concurrent with route establishment –QoS is static for life of connection –uniform QoS to all receivers
Spring 2001CS Differentiated Services Problem with IntServ: scalability –Per flow state information Idea: support two classes of packets –premium –best-effort P(drop) 1.0 MaxP Min in Max in Max out Min out AvgLen Mechanisms –packets: ‘in’ and ‘out’ bit –edge routers: tag packets –core routers: RIO (RED with In and Out)