# PowerPoint Presentation

Document Sample

CS 414 – Multimedia Systems Design
Lecture 28 –
Media Server (Part 3)

Klara Nahrstedt
Spring 2009

CS 414 - Spring 2009
   MP3 – deadline April 6, 5-7pm
demonstrations

CS 414 - Spring 2009
Outline
   Disk Scheduling
   SCAN-EDF
   Group Sweeping
   Mixed Scheduling

 File System Metadata/Indexing
 Block Size Issues

CS 414 - Spring 2009
EDF Example

Note: Consider that block number
Implicitly encapsulates the disk track number
CS 414 - Spring 2008
SCAN-EDF Scheduling Algorithm
 Combination of SCAN and EDF algorithms
 Each disk block request tagged with
   Policy:
 SCAN-EDF     chooses the earliest deadline
 If requests with same deadline, then choose
request according to scan direction

CS 414 - Spring 2008
Implementation of SCAN-EDF
   Notation:
 Di be deadline of disk block request ‘i’
 Ni be track position on disk
 Nmax be maximum number of disk tracks

 Di+ f(Ni)
 f(Ni) converts track number of ‘i’ into a small
 Perturbation small enough so that
   Di + f(Ni) ≤ Dj + f(Nj) for Di ≤ Dj
   Possible f(Ni) = Ni/Nmax

CS 414 - Spring 2008
SCAN EDF Example (Nmax = 100)

CS 414 - Spring 2008
Enhanced SCAN-EDF (1)
   Use more accurate perturbation of deadline
   Consider
 Actual track position of disk head ‘N’
 Nmax – max number of disk tracks
 Ni – next track to be considered

CS 414 - Spring 2008
Enhanced SCAN-EDF (2)
   Algorithm:
 If head moves upwards (towards Nmax), then
 (a)
Ni  N
N i ; N  N i  N m ax, f ( N i ) 
N m ax
 (b)

N m ax  N i
N i ;1  N i  N , f ( N i ) 
N m ax

CS 414 - Spring 2008
Enhanced SCAN-EDF (3)
 If head moves downwards (towards 1),
then
Ni
(a) N i ; N  N i  N m ax : f ( N i ) 
N m ax
N  Ni
(b) N i ;1  N i  N : f ( N i ) 
N m ax

CS 414 - Spring 2008
Group Sweeping Algorithms
   Policy:
 Each  Request consists of (Deadline, Block
Number )
 Disk Block Requests served in cycles
 Requests served in Round-Robin manner
 In one cycle, requests divided into groups
 As we retrieve blocks, we may need
smoothing buffers to ensure continuity

CS 414 - Spring 2009
Group Sweeping Example

CS 414 - Spring 2009
Mixed Scheduling
(uses SSTF – Shortest Seek Time First)
Example of SSTF

CS 414 - Spring 2009
Mixed Scheduling
SSTF (Shortest Seek Time First) + Balanced Strategy

CS 414 - Spring 2009
Client 1 retrieves
K1 blocks in one
round

Client 2 retrieves
K2 blocks
Server

Client 3 retrieves
K3 blocks

Client 4 retrieves
K4 blocks

CS 414 - Spring 2009
   Disk block requests are timed
 Media      server must determine
   admit a stream
   serve (schedule) a stream without having negative effect on
other streams already serviced.
   Deterministic Guarantees
   Admission control considers worst case scenario when admitting
new stream
   Constrained Disk Placement Example: M - size of blocks, G –
size of gabs, rdt – data transfer of disk

M (sec tors)  G (sec tors)
Tplay   
rdt (sec tors / s )
CS 414 - Spring 2009
 (   )  min
i
i   ( K i  ( ) / R )
i   i
pl

α – overhead switching from one round (‘j-1’)
To another round (j), and the transmitting the
First block of the ‘j’ round
β – transmission time of (Ki-1) blocks in ‘j’ round, i=1,..4
Ki – number of blocks retrieved by client ‘i’
ηi – Block granularity retrieved for client ‘i’
Ri – playback rates of client ‘i’

CS 414 - Spring 2009
   Statistical Guarantees
 Deadlines   are guaranteed with certain
probability
 Admission control considers statistical
behavior of the disk system while admitting
new stream (average performance)
   Best effort Service
 No   guarantees

CS 414 - Spring 2009
Multimedia File Systems
   Real-time Characteristics
 Read  operation must be executed before well-defined
deadline with small jitter
   Additional buffers smooth data
   File Size
 Can  be very large even those compressed
 Files larger than 232 bytes

   Multiple Correlated Data Streams
 Retrieval   of a movie requires processing and synch
of audio and video streams
CS 414 - Spring 2009
Placement of Mapping Tables
 Fundamental Issue: keep track of which
disk blocks belong to each file (I-nodes in
UNIX)
 For continuous files/contiguous placement
 don’t   need maps
   For scattered files
 Need    maps
 Linked lists (inefficient for multimedia files)
 File allocation tables (FAT)

CS 414 - Spring 2009
Indexing and FAT
Higher Level
Index Table      File Allocation Table
Per File
Block I1 Location PTR
I Frame
Block I2 Location PTR
P Frame
Block I3 Location PTR
B Frame
Block P11 Location PTR
P Frame
Block P12 Location PTR
………..
Block B1 Location PTR
Block P21 Location PTR
Block P22 Location PTR
…………..

CS 414 - Spring 2009
Constant and Real-time Retrieval of
MM Data
   Retrieve index in real-time
   Retrieve block information from FAT
   Retrieve data from disk in real-time
   Real-time playback
   Implement linked list

   Random seek (Fast Forward, Rewind)
 Implement      indexing
   MM File Maps
 include   metadata about MM objects: creator of video,
sync info
CS 414 - Spring 2009
Fast Forward and Rewind
(Implementation)
   Play back media at higher rate
   Not practical solution
   Continue playback at normal rate, but skip
frames
   Define skip steps, e.g. skip every 3rd, or 5th frame
   Be careful about interdependencies within MPEG frames
   Approaches for FF:
   Create a separate and highly compressed file
   Categorize each frame as relevant or irrelevant
   Intelligent arrangement of blocks for FF

CS 414 - Spring 2009
Block Size Issues in File Organization
   Small Block Sizes
   Use smaller block sizes, smaller than average frame size
   Organization Strategy: Constant Time Length
   Need Metadata structure, called Frame Index
 Frame   means a time frame within a movie
 Under the time frame read all blocks (audio, video,                  Movie
text) belonging to this time frame                                   Time
line
Frame
………
index

A V      A V V     A

V T      V T       V
CS 414 - Spring 2009
Block Size Issues
   Large Block Size
 Use   large blocks (e.g., 256 KB) which include multiple
audio/video/text frames
   Organization Strategy: Constant Data Length
   Need Metadata structure, called Block Index
 Each   block contains multiple movie frames

Block
Index

A V     A V     A V
A       V V     V
CS 414 - Spring 2009
   Frame index : needs large RAM usage while
movie is playing, however little disk wastage
   Block index (if frames are not split across
blocks): need low RAM usage, but major disk
wastage – internal disk fragmentation
   Block index(if frames are split across blocks):
need low Ram usage, no disk wastage, extra
seek times

CS 414 - Spring 2009
Conclusion
 The data placement, scheduling, block
size decisions are very important for any
media server design and implementation.
 Still need to consider caching – next
lecture

CS 414 - Spring 2009

DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 0 posted: 8/31/2012 language: Latin pages: 27
How are you planning on using Docstoc?