Conspect of Lecture 8
Conspect of Lecture 8
External Memory.
The goal of the lecture: analyze and study types of external memory, data organization and formatting, RAID (Six levels of
RAID), Optical memory.
Contents
Literature.
1.http://home.ustc.edu.cn/~leedsong/reference_books_tools/Computer%20Organization%20and%20Architecture
%2010th%20-%20William%20Stallings.pdf.
2. Pustovarov V. I. Assembler. Programming and analysis of machinery programs correctness, - Kiev: “Irina”, 2010. -
476
3. Э. Таненбаум. Т. Остин. Архитектура компьютера. 6-е изд. Издательство: Питер, 2016. — 816 стр.
Keywords.
External memory, magnetic disk, track, combined read-write mechanism, SSD, tunnel effect, optical disk, RAID.
External memory (secondary storage) differs from internal one(primary storage) in that it is not directly accessible by the
CPU. The computer usually uses its input/output channels to access secondary storage and transfer the desired data to primary
storage. Secondary storage is non-volatile (retaining data when its power is shut off). Modern computer systems typically
have two orders of capacity more secondary storage than primary storage because secondary storage is less expensive.
In modern computers, hard disk drives (HDDs) or solid-state drives (SSDs) are usually used as secondary storage. The access
time per byte for HDDs or SSDs is typically measured in milliseconds (one thousandth seconds), while the access time per
byte for primary storage is measured in nanoseconds (one billionth seconds). Thus, secondary storage is significantly slower
than primary storage.
Types of External memory.
There are 10 digital Data Storage Devices for Computers:
1. Hard Drive Disks
2. Floppy Disks
3. Tapes
4. Compact Discs (CDs)
5. DVD and Blu-ray Discs
6. USB Flash Drives
7. Secure Digital Cards (SD Card)s
8. Solid-State Drives (SSDs)
9. Cloud Storage
10. Punch Cards
Concentric rings or tracks (between 500 and 2000 tracks on one side)
Tracks divided into sectors (data are read by blocks = sectors; there can be between 10 and 100 sectors)
Adjacent tracks are separated by gaps. This prevents errors due to misalignment (несоосность) of the head (conducting
coil).
To simplify the electronics, the same number of bits are typically stored on each track.
Figure 1. Disk Data Layout.
Figure 2. Addressing a specific location on a disk track.
In Fig. 3 Winchester Disk Track Format each track contains 30 fixed-length sectors of 600 bytes each. Every sector holds 512 bytes data, plus control
information useful to the disk controller.
The ID field is a unique identifier or address used to locate a particular sector.
The SYNCH byte is special bit pattern that determines the beginning of the field.
The track number identifies a head, since this disk has multiple surfaces.
The ID and data fields contain an error-detecting code (CRC).
Figure 4. Combined Read-Write mechanism.
Characteristics of Disk Systems
Characteristic Set of
Parameters/Possible
meanings
Head Motion Fixed head (one per track)
Movable head (one per
surface)
Disk Portability Non-removable disk
Removable disk
Sides Single-sided
Double-sided
Platters Single-platter
Multiple-platter
Head Mechanism Contact (floppy)
Fixed gap
Aerodynamic gap
(Winchester)
Disk Access Time
If removable heads are used and disk drive is operating, then to read/write, the head must be positioned at the desired track
and at the beginning of the desired sector on that track. The time it takes to position the head at the track is known as seek
time. In either case, once the track is selected, the system waits until the appropriate sector rotates to line up with the head.
The time it takes for the sector to reach the head is known as rotational latency.
Redundant disk capacity is used to store parity information (контрольная информация), which guarantees data
recoverability in case of a disk failure.
RAID systems of different levels differ by methods of realisation the second and the third characteristics.
Logical Physical Physical Physical Physical
Disk Disk 0 Disk 1 Disk 2 Disk 3
0
Strip 1
0
Strip 4
1 Strip 5
2
Strip 6
3
Strip 7
1
Strip 2
4
Strip 8
5 Strip 9
6
Strip 10
7
Strip 11
2
Strip 3
8
Strip 12
9 Strip 13
1
Strip 14
1
Strip 15
3
1
Strip 4
1 1 1 1
4
Strip 5
0 1
5
3
Strip 6
2Management3Array 4 5
6
Strip 7
7
Strip 8 Software
8
6
Strip 9
9
Strip 10
1
8
Strip 11
1
Strip 12
1
0
8
Strip 13
1
Strip 14
1
2
Strip 15
1
3
4
5 Figure 5. RAID organization.
RAI D, Level 0
No redundancy (is not a true member of the RAID family)
Data is striped across all disks
Round Robin stripe organization (циклическая ленточная организация)
All the user and system data is viewed as being stored on a logical disk; the disk is divided into
strips, these strips may be physical blocks, sectors or some other units. The strips are mapped
round—robin to consecutive array members. A set of logically consecutive strips that maps exactly
one strip to each array member is referred to as a stripe. In an n-disk array the first n logical
strips are physically stored as the first strip on each of the n disks, the second n strips are
distributed as the second strips on each physical disk, and so on.
3
Strip
3
Strip
3
Strip
3
Strip
7
Strip
7
Strip
7
Strip
7
Strip
1
Strip
1
Strip
1
Strip
1
Strip
1 1 1 1
1 1 1 1
RAI D 1
Mirrored
Mirrored Disks
Data is striped across disks
2 copies of each stripe on separate disks
Read from either
Write to both
Recovery is simple
Swap faulty disk & re-mirror
No down time
Strip 0Expensive
Strip 1 Strip 2 Strip 3 Strip 0 Strip 1 Strip 2 Strip 3
3
Strip 4
3Strip 5
3
Strip 6
3
Strip 7
3
Strip 4
3
Strip 5
3
Strip 6
3
Strip 7
7
Strip 8
7Strip 9
7
Strip 10
7
Strip 11
7
Strip 8
7
Strip 9
7
Strip 10
7
Strip 11
1
Strip 12
1
Strip 13
1
Strip 14
1
Strip 15
1
Strip 12
1
Strip 13
1
Strip 14
1
Strip 15
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
RAI D 2
Redundancy Through Hamming Code
Disks are synchronized
Very small stripes
Error correction calculated across corresponding bits on disks
Multiple parity disks store Hamming code error correction in corresponding positions.
Lots of redundancy
Expensive
Not used
7
Strip 8
7Strip 9
7
Strip 10
7
Strip 11 P(8-11)
1
Strip 12
1
Strip 13
1
Strip 14
1
Strip 15 P(12-15)
1 1 1 1
RAI D 5
Block-Level Distributed Parity
Like RAID 4 RAI D 6
Parity striped across all disks Redundancy Through 2 Different Codes
Round robin allocation for parity stripe The scheme of functioning suggests calculation of 2 control codes stored in different
Avoid RAID 4 botl-neck at parity disk blocks distributed through all disks.
Commonly used in network servers Control codes P and Q are calculated by different algorithms, it allows to restore lost
data when even two disks have been failed.
The hardware is more complicated.
Strip 0 Strip 1 Strip 2 Strip 3 P(0-3)
3 3 3 3
Strip 0 Strip 1 Strip 2 Strip 3 P(0-3) Q(0-3)
Strip 4 Strip 5 Strip 6 P(4-7) Strip 7
7 7 7 7 3 3 3 3
Strip 8 Strip 9 P(8-11) Strip 10 Strip 11 Strip 4 Strip 5 Strip 6 P(4-7) Q(4-7) Strip 5
1 1 1 1 7 7 7 7
Strip 12 P(12-15) Strip 13 Strip 14 Strip 15 Strip 8 Strip 9 P(8-11) Q(8-11) Strip 8 Strip 9
1 1 1 1 1 1 1 1
P(16-19) Strip 16 Strip 17 Strip 18 Strip 19 Strip 12 P(12-15) Q(12-15) Strip 15 Strip 12 Strip 13
1 1 1 1 1 1 1 1
5 5 5 5 1 1 1 1
Optical Memory
Optical Disk Products:
CD
A nonerasable disk that stores digital audio information. The standard system uses 12-cm disks and can record more than 60
minutes of uninterrupted playing time.
CD-ROM
A nonerasable disk used for storing computer data. The standard system uses 12-cm disks and can hold more than 550
Mbytes.
DVD
Digital video disk. The technology of video-signals recording and other data of a large volume is used and it’s based on
methods of information (data) compression.
WORM
Write-Once Read Many is more easily written than CD-ROM, making single-copy disks commercially feasible; holds
from 200 to 800 Mbytes of data.
Erasable Optical Disk
A disk that uses optical technology but that can be easily erased and rewritten. A typical capacity is 650 Mbytes.
Blu-ray Discs
A Blu-ray disk can store 25 GB (gigabytes) of data on a single-layer disk and 50 GB on a dual-layer disk.
Both the audio and the CD-ROM share similar technology. The main difference is in the formats of data
presentation.
Optical Storage CD-ROM
Originally for audio
650 (775) Mbytes giving over 70(73.2) minutes audio
Poly-carbonate coated with highly reflective coat (aluminum)
Data stored as pits
Reads by reflecting laser
Constant packing density
Constant linear velocity (1.2 m/s)
2352 bytes
Mode 0 = blank data field
Mode 1 = 2048 bytes data+ error correction
Mode 2 = 2336 bytes data
When charge is placed on the gate electrode, the semiconducting purple region
becomes conductive, and the source and drain are connected. When charge is
removed from the gate electrode, the purple region becomes insulating, and the
source and drain are disconnected. Note that when the power to a MOSFET is
turned off, charge drains from the gate through the circuit it's connected to, and it
reverts to being "off" (non-conducting).
A floating gate transistor has an additional electrode between the gate and the
semiconductor. Unlike the other electrodes, however, the floating gate is not
connected to anything (hence the name 'floating').
Figure 5. Flash memory operation.
SSDs are based on flash memory technologies that enables data to be written, read,
and erased multiple times. Flash memory comes in two varieties: NOR and
NAND. Although each offers advantages and disadvantages, NAND has emerged
as the favored technology because it delivers faster erase and write times. Most
contemporary SSDs are based on NAND flash. An enterprise SSD contains
multiple NAND flash chips for storing data. Each chip contains one or more dies,
and each die contains one or more planes. A plane is divided into blocks, and a
block is divided into pages.Of these, the blocks and pages are the greatest concern,
not because you configure or manipulate them directly, but because of how data is
written, read, and erased on a NAND chip. Data is read and written at the page
level, but erased at the block level, as illustrated in Figure 6.
https://www.red-gate.com/simple-talk/sql/database-administration/
storage-101-understanding-the-nand-flash-solid-state-drive/
SSD Read and Write operation.
Reading and writing data occur at the page level. Reading data is a fairly
straightforward operation. When the drive receives a request for data, the controller
locates the correct cells, determines the charge states, and ensures that the data is
properly returned, using buffer memory as necessary. The entire process has little
long-term impact on the drive itself.
Writing data is a programming operation that sets the data bits to the desired
charge state, a process orchestrated by the controller. – Writing data to a page for
the first time is nearly as straightforward as reading data. The process grows more
complex when modifying that data, which requires that it first be erased and then
rewritten, a process commonly referred to as a program/erase cycle (P/E cycle).
During a typical P/E cycle, the entire block containing the targeted pages is written
to memory. The block is then marked for deletion and the updated data rewritten to
another block. The actual erase operation occurs asynchronously in order to
optimize performance.
The controller coordinates the erase and write processes, using advanced data
management algorithms. Even if only a single change on a single page needs to be
recorded, an entire P/E cycle is launched. The block is marked for deletion and all
its data rewritten.
The controller erases the block when it’s needed or as part of an optimization
process. When erasing the block, the controller sets every bit in every cell to 1.
After that, data can be written to any page in the block. However, if any bits in a
page are set to 0-even if only one-the entire page is off-limits to writing data.
As an SSD starts filling up, the writing and rewriting operations become more
complex and start to slow down. The controller must find places to store the data,
which can involve erasing blocks marked for deletion, moving and consolidating
data, or performing multiple P/E cycles. The fuller the drive, the more extensive
these operations, which is why performance can start to degrade as a drive reaches
capacity.
Because of the many P/E cycles, more data is routinely written to the drive than the
amount being modified, a characteristic commonly called write amplification. For
example, updating a simple 25-KB text file might result in 250 KB of data being
written, causing additional wear on the cells.
A flash SSD can support only a limited number of P/E cycles before it fails. The
more bits squeezed into each cell, the fewer that number and the faster the time to
failure. For example, an MLC drive might support up to 6,000 P/E cycles per
block, but a TLC drive might max out at 3,000.
As P/E cycles start adding up, cells start failing. For this reason, SSDs employ
several strategies to extend a drive’s lifespan, assure reliability, and maintain data
integrity, including:
SSD firmware updates might also address performance, reliability, and integrity
issues, along with other types of issues. Whenever you install a new SSD, one of
the first steps you should take is to ensure that you’re running the latest firmware.
These are not necessarily the only tactics that a drive will employ, but they
represent some of the most common.
Problems.
1. Why RAID 0 cannot be considered as a true member of RAID family? Compare RAID 5 and
RAID 6 (illustrate the answer by pictures).
2. List the well-known Optical Disk products and describe their characteristics.
3. Give an example of CD-ROM block formats.
4. List the major characteristics of Disk System.
5. How is evaluated the Disk Access Time? What does the Disk Access Time characterize?
What is RAID? List three common characteristics of RAID.
6. Describe the typical Disk data layout (draw a picture).
7. How are sector positions within a track identified? Give an example of disk track format
(describe the meaning of each field).
8. What is tunnel effect?
9. Describe SSD read and write operations.