Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 414 - Spring 2009 CS 414 – Multimedia Systems Design Lecture 28 – Media Server (Part 3) Klara Nahrstedt Spring 2009.

Similar presentations


Presentation on theme: "CS 414 - Spring 2009 CS 414 – Multimedia Systems Design Lecture 28 – Media Server (Part 3) Klara Nahrstedt Spring 2009."— Presentation transcript:

1 CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 28 – Media Server (Part 3) Klara Nahrstedt Spring 2009

2 Administrative MP3 – deadline April 6, 5-7pm demonstrations CS Spring 2009

3 Outline Disk Scheduling SCAN-EDF Group Sweeping Mixed Scheduling Admission Control File System Metadata/Indexing Block Size Issues CS Spring 2009

4 EDF Example CS Spring 2008 Note: Consider that block number Implicitly encapsulates the disk track number

5 SCAN-EDF Scheduling Algorithm Combination of SCAN and EDF algorithms Each disk block request tagged with augmented deadline  Add to each deadline perturbation Policy:  SCAN-EDF chooses the earliest deadline  If requests with same deadline, then choose request according to scan direction CS Spring 2008

6 Implementation of SCAN-EDF Notation:  D i be deadline of disk block request ‘i’  N i be track position on disk  N max be maximum number of disk tracks Deadline Modification:  D i + f(N i )  f(N i ) converts track number of ‘i’ into a small perturbation of deadline  Perturbation small enough so that D i + f(N i ) ≤ D j + f(N j ) for D i ≤ D j Possible f(N i ) = N i /N max CS Spring 2008

7 SCAN EDF Example (N max = 100) CS Spring 2008

8 Enhanced SCAN-EDF (1) Use more accurate perturbation of deadline Consider  Actual track position of disk head ‘N’  N max – max number of disk tracks  N i – next track to be considered CS Spring 2008 Head Moves Upwards

9 Enhanced SCAN-EDF (2) Algorithm:  If head moves upwards (towards N max ), then  (a)  (b) CS Spring 2008

10 Enhanced SCAN-EDF (3) If head moves downwards (towards 1), then (a) (b) CS Spring 2008

11 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 Spring 2009

12 Group Sweeping Example CS Spring 2009

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

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

15 Admission Control CS Spring 2009 Client 1 retrieves K1 blocks in one round Client 2 retrieves K2 blocks Client 3 retrieves K3 blocks Client 4 retrieves K4 blocks Server

16 Admission Control 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, r dt – data transfer of disk CS Spring 2009

17 Admission Control CS Spring 2009 α – 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 K i – number of blocks retrieved by client ‘i’ η i – Block granularity retrieved for client ‘i’ R i – playback rates of client ‘i’

18 Admission Control 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 Spring 2009

19 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 2 32 bytes Multiple Correlated Data Streams  Retrieval of a movie requires processin g and synch of audio and video streams CS Spring 2009

20 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 Spring 2009

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

22 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 Spring 2009

23 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 3 rd, or 5 th 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 Spring 2009

24 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, text) belonging to this time frame CS Spring 2009 AV VT Frame index Movie Time line AV VT ……… V A V

25 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 CS Spring 2009 AV V V AAA V VV Block Index

26 Tradeoffs 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 Spring 2009

27 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 Spring 2009


Download ppt "CS 414 - Spring 2009 CS 414 – Multimedia Systems Design Lecture 28 – Media Server (Part 3) Klara Nahrstedt Spring 2009."

Similar presentations


Ads by Google