Sie sind auf Seite 1von 27

Lehrstuhl für Informatik 4

Kommunikation und verteilte Systeme

Chapter 2: Representation of Multimedia Data


Chapter 3: Multimedia Systems – Communication Aspects and Services
Chapter 4: Multimedia Systems
– Storage Aspects
• Optical Storage Media
4.2: Multimedia File Systems
• Multimedia File Systems
• Traditional File Systems
• Multimedia File Systems
• Disk Scheduling

Chapter 4.2: Multimedia File Systems Page 1


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Why Multimedia File Systems?

Heterogeneous data types including digital audio, animations and video…


• Consuming enormous storage space
• Media are delay-sensitive: when user plays out or records a time dependent
multimedia data object, the system must consume or produce at a constant data rate
• High demands to access to hard disc
→ A new multimedia enabled file system is needed in two means:
 Organization of media content on the server
 Scheduling strategies for access to the data

Chapter 4.2: Multimedia File Systems Page 2


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Layout
The layout of a disk determines
• the way in which content is addressed
• how much storage space on the media is actually addressable and usable
• the density of stored content on the media
Tracks and sectors
• A hard disk consists of one or more heads
• A hard disk is divided into tracks
and further into sectors (512 Byte)
• The same track on all heads is called cylinder
• Storage of a file is done in terms of sectors
• Unused space of a sector is wasted
• Easy mapping of file location information
to head movement and disc rotation
• Constant angular velocity (CAV),
i.e. same access time to inner/outer tracks
• Access to a sector by a movable disk arm
Chapter 4.2: Multimedia File Systems Page 3
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Layout

Zone Bit Recording


• In the “normal” way, a sector at an outer radius has
the same (sector) data amount, but more raw
capacity. In principle, by this space is lost.
• Current approach for solution is zone bit recording
• Different read/write speeds, depending on the
radius, allowing uniform sector size
• Place more popular media (movies)
on an outer track to reduce average seek time,
less popular media on an inner track. This saves
disk arm movements.

Now: how to place files on such a disc?


Chapter 4.2: Multimedia File Systems Page 4
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Use of Storage Medium

Important: reduce read and write times by


• fewer seek operations
• lower rotational delay or latency
• high actual data transfer rate (can not be improved by placement)
Method: store data in a specific pattern
• Divide file in blocks (can be bytes, or of larger size)
• Store blocks in certain patterns
• Larger block size
• Fewer seek operations
• Smaller number of requests
• But higher loss of storage space due to internal fragmentation (last block used only
50% on its sector on the average)

Chapter 4.2: Multimedia File Systems Page 5


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Traditional File Systems - File Structure

How to place the records of a file?

Contiguous Placement

1st file 2nd file 3rd file

Non-contiguous Placement

1st file
2nd file
3rd file

Chapter 4.2: Multimedia File Systems Page 6


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Performance Consideration of File Structure


Contiguous Placement:
• Disk access time for reading and writing is minimized
• Major disadvantage: file creation, deletion and size modification makes this
sequential storing difficult

Non-Contiguous Placement (two main approaches):


1. Linked Allocation:
• Using pointers for (first block is 1)
addressing the next block (next block is 2)
• Fine for sequential access beginning pointer
• Random access is costly
• Long seek operations during playback 1 2 3 4 5 6 7 8
2. Indexed Allocation:
• Links are stored in an index-block 1
2
• Complex 3
• Performance depends on the index 8
1 2 3 4 5 6 7 8 6
structure and size of the file
Chapter 4.2: Multimedia File Systems Page 7
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Traditional File Systems: Disk Management


Disk access is slow and costly - major bottleneck
Techniques reducing overall disk access time:
• Block caches Interleaved Storage
 Keep blocks in memory for future use
 Reduces the number of disk access
• Reduce disk arm motion Non-interleaved Storage
 Blocks to be accessed in sequence are
placed on the same cylinder
 Reduces the time for one disk access
 Take rotation into account by placing Heads may read
consecutive blocks in an interleaved in parallel
manner
• Placement of mapping tables
 Mapping tables are placed
in the middle of the disk
 Tables and the corresponding
blocks are placed on the same cylinder
Chapter 4.2: Multimedia File Systems Page 8
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Traditional File Systems: Disk Scheduling

In traditional file systems, efficient usage of storage capacity is the main goal. The total
time to service a request to a file in such a system consist of:
• Seek time, head positioning to appropriate track (diameter)

Delay
• Latency (rotation time), time to find the block in the track
• Actual data transfer time
Technique to reduce delay:
• Seek operation → Scheduling algorithms
• Latency → File allocation methods
Next, we will consider strategies for minimizing the seek time, i.e. for the positioning time
of the head to the appropriate track. Tracks are numbered 0, ..., N - 1. Here, 0 is the
innermost and N - 1 the outermost track.

Chapter 4.2: Multimedia File Systems Page 9


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Scheduling: First-Come-First-Served (FCFS)


Serve requests in order of arrival
133
0 13 31 51 63 69 108 130 173 198
Queue
i
(51)
108 i

successive requests
i+1 173 i+1
31 i+2
130
i+2 13
133

order of
63
69

+ Easy to implement Overall movement counted in number of


+ Fair algorithm tracks visited for FCFS (in an example
- Not optimal → High average seek time scenario): 673
Chapter 4.2: Multimedia File Systems Page 10
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Scheduling: Shortest-Seek-Time First (SSFT)


SSFT = Serve “nearest“ request
133
0 13 31 51 63 69 108 130 173

Queue
(51)
108
173
31
SSTF movement: 243 130
13
133
63
Optimal overall 69
movement: 198

+ Substantial improvement over FCFS


- Still not optimal
- Starvation
Chapter (of some
4.2: Multimedia Filetracks
Systemsif there is always a track with shorter seek time available)
Page 11
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Scheduling: SCAN

• SCAN = serve requests in one direction; then reverse the movement


• Move from one end to the other, serving each request on the way
69 133
0 13 31 51 63 108 130 173 198
Queue

Head Start (51)


108
173
31
130
13
Overall movement 133
SCAN: 224 63
69

Chapter 4.2: Multimedia File Systems Page 12


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Scheduling: Circular-SCAN (C-SCAN)


C-SCAN is similar to SCAN but returns immediately to the beginning if the end is reached;
one idle head movement from one edge to the other between two consecutive scans
0 13 31 51 63 69 108 130133 173 198
Queue
(51)
108
173
31
130
13
133
63
69
Overall Movement
C-SCAN: 376

+ Fair service
- More uniform waiting time
- Performance not as good as SCAN
+Chapter
Middle4.2: Multimedia
tracks a better service than edge tracks (such as with SCAN or withPage
File Systems
don’t get 13
SSTF)
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Multimedia File System

Requirements of continuous data:


• File size:
 Highly structured data units (e.g. video and associated audio)
→ New organization policies of the data on disk
 Efficient usage of limited storage is necessary
• Multiple data stream:
 For example: retrieval of a movie requires the processing and synchronization
of audio and video data
• File access:
 High, continuous throughput
 Short maximum (not average) response times
• Real-time characteristic:
 Stream play-out in constant, gap-free rate → additional buffers

Chapter 4.2: Multimedia File Systems Page 14


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

“Multimedia” Disk Scheduling Algorithms

G S+G

6 Milliseconds for 3 blocks of data


→ play back rate: 0.5 ms/block
Restrictions of data placement
How to place media blocks? e.g.
Parameters G=3
rD = 2
• The size of a media block (granularity parameter G) rC = 0,5
• # blocks: separation between successive blocks results in…
(scattering parameter S) playback duration (S+G)/2 ≤ G/0.5
Continuity requirement S +G G S+G ≤ 12
≤ S≤9
rD data transfer rate from disk rD rC
rC playback rate
i.e. time to skip over a gap and to read the
next media block is smaller than or equal
to the duration of the playback
Chapter 4.2: Multimedia File Systems Page 15
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Scheduling Algorithms

To fulfill the requirements of multimedia data, scheduling has another focus than in
traditional file systems:
• Goals in Traditional File Systems:
 Reduce cost of seek time (effective utilization of disk arm)
 Achieve fair throughput
 Provide fair disk access
 Achieve short average response times
• Goals in Multimedia File Systems are different:
 Meet deadlines of all time-critical tasks
 Keep the necessary buffer space requirements low
 Find balance between time constraints and efficiency

Chapter 4.2: Multimedia File Systems Page 16


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Scheduling: Earliest Deadline First (EDF)


3 24 track no.
In EDF the block with the nearest
t deadline
deadline is read first.
3 30
Equal deadlines → FCFS
2 16

3 50

2 42

1 45

1 12 1 12 1 45 2 42 3 50 2 16 3 30

2 40 2 40 1 12 1 45 2 42 3 50 2 16
1 22 2 40 2 40 2 40 2 42 3 50
1 22

22 12 45 40 42 16

• Poor throughput due to excessive seek time. Only deadlines are taken into account, but
not track number.
Chapter
• Very4.2: Multimedia
similar File Systems
to FCFS: Page 17
inefficient. Does not reflect the geographical position of tracks.
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Scheduling: SCAN-EDF

SCAN-EDF is a combination of:


• Deadline scheduling (as in EDF earlier deadlines are served first)
• Scanning (tasks with same deadline are served according to the actual scan direction)
Problem: SCAN (i.e. use of scanning directions for tie break among equal deadlines) does
not make much sense if too many different deadlines exist
Thus:
• It has to be enforced that many requests have the same deadline
• In order to do so, all requests are grouped in a few groups which can be scanned
together
• We require that deadlines Di are multiples of a common period p → Di ∈ {1, 2, 3, ...}
• Then deadlines with the same period can be grouped and served together by SCAN

Chapter 4.2: Multimedia File Systems Page 18


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Scheduling: SCAN-EDF

Implementation of SCAN-EDF by Perturbation of deadlines (in order to apply EDF)


• Let Di the deadline of task i and Ni be the track number (0 ≤ Ni < Nmax , e.g. Nmax = 100)
• Assume that Di ∈ »
• Modify Di towards Di’ (Di’ = perturbed deadline)
Di’ = Di + f(Ni)
• f(Ni) converts the track number of i into a small perturbation of the deadline such that
for equal deadlines the scanning is automatically applied
If we choose (for example) f ( Ni ) = Ni
N max
⇒ 0 ≤ f(N ) <1
i

• Thus if the deadline for a task on track 42 is equal to 3 then the perturbed deadline is
3 + 100
42
= 3,42
• This deadline is given to the task at arrival time

Chapter 4.2: Multimedia File Systems Page 19


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Scheduling: SCAN-EDF

t Perturbed Deadline Track number


2.16 16

3.50 50 2.16 16
3.50 50
2.42 42 3.50 50
2.42 42
1.45 45 2.42 42 2.42 42

2.40 40 2.40 40 16
1.12 12 1.45 45
2.40 40 1.45 45
2.40 40 1.12 12 40
deadline 2, i.e. ∈ [2:3]
2.40 40 1.22 22
1.22 22 45
1.22 22
22
deadline 1, i.e. ∈ [1:2]
12
• Optimization only applies for requests with
• Among the same deadline SCAN is applied the same deadline before the comma
• Request with the earliest deadline is served • Increase this probability by grouping the
• Chapter
Sensible4.2:only
Multimedia File Systems
for a large number of requests requests Page 20
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Scheduling: EDF, SCAN-EDF

0 10 20 30 40 50

SCAN-EDF EDF
Deadlines

Chapter 4.2: Multimedia File Systems Page 21


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Disk Scheduling

A small variation of “deadline perturbation“:


• The actual deadline given to the task is refined by:
 Taking into account the actual movement of the head at arrival time (i.e. upwards
from 0 to Nmax - 1 or downwards from Nmax - 1 to 0)
 Considering the actual position N of the head
• The perturbed deadline for a task which resides on track Ni is given by: Di’ = Di + f(Ni)
where: ⎧ Ni − N
⎪ N if Ni ≥ N and "head moves upwards"
⎪ max
⎪ Nmax − Ni
⎪ N if Ni < N and "head moves upwards"

f ( Ni ) = ⎨
max

⎪ Ni if Ni > N and "head moves downwards"


⎪ Nmax

⎪ N − Ni if Ni ≤ N and "head moves downwards"

⎩ Nmax

• This allows to serve new requests as soon as possible


Chapter 4.2: Multimedia File Systems Page 22
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Group Sweeping Scheduling (GSS)


3.4 24
3.3 30
Deadline 1.1 2.0 16
Deadline 3.3
3.3 50
1.2 12 Deadline 2.0
2.2 42
2.0 16 3.4 24
1.4 45 1.2 45
2.2 42 3.3 30
1.1 22 1.4 12
2.4 40 3.3 50
Group 1 SCAN 2.4 40
12, 22, 45 1.1 22 Group 2 SCAN Group 3 SCAN
(ascending order)
42, 40, 16 24, 30, 50
[in next cycle: descending order] Cycle
(descending order) (ascending order)
t
• Requests are served in cycles in a round-robin manner
• In one cycle requests are divided into groups. A group is served according to SCAN
• Service in a group may be in ascending or in descending order depending on the
other groups
Chapter
• Thus4.2: Multimedia File
a smoothing Systems
buffer may be needed (to assure continuity) Page 23
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Group Sweeping Scheduling (GSS)

• A particular stream can be


 the first one in its group in a given cycle, but
 the last one in its group in the next cycle
• This happens if the scan order is reversed, i.e. if we have an odd number of groups
• Thus we need a smoothing buffer in order to achieve continuity of play-out
• GSS is a trade-off between optimization of buffer space and arm movements

Chapter 4.2: Multimedia File Systems Page 24


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Group Sweeping Scheduling (GSS) - Mixed Strategy

• The „mixed strategy“ is a compromise between


 Shortest seek (“greedy“)
 Balanced strategy
• Data retrieved from disk are placed into buffers. Different queues are used for
different data streams.
• “Shortest seek” serves the stream whose data block is nearest
• “Balanced” serves the stream which has the lowest utilization of buffers (since this
stream risks to run out of data)

Chapter 4.2: Multimedia File Systems Page 25


Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Group Sweeping Scheduling (GSS) - Mixed Strategy

• Filling status of buffers indicate when to switch from SSTF to “Balanced“ and vice
versa
1
• “Urgency“ criterion: Urgency = ∑
( all streams i ) Fullness i

• Fullness i = small → Urgency = high


Chapter 4.2: Multimedia File→Systems
Balanced strategy should be used Page 26
Lehrstuhl für Informatik 4
Kommunikation und verteilte Systeme

Conclusion

Multimedia Systems…
• … is not only about the media format (MPEG, PCM, …)
• … also needs considerations how to store and access the media
• … can be distributed: how to transmit the media over a network
• (… needs new user interfaces and programming concepts)

Multimedia in the future


• Distributed applications are becoming more important
• Need of portability and system independence
• Better support for user interactivity

Variety of new (still undiscovered) application domains?

Chapter 4.2: Multimedia File Systems Page 27

Das könnte Ihnen auch gefallen