Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Chapter 8 Storage, Networks and Other Peripherals 1998 Morgan Kaufmann Publishers 1 Introduction • • I/O Design affected by many factors (expandability, resilience) Three characteristics for organizing I/O devices – Behavior: input (read once), output (write only), or storage – Partner: Either a human or a machine is at the other end of the I/O device – Data rate: the peak rate at which data can be transferred between the I/O device and the main memory or processor. 1998 Morgan Kaufmann Publishers 2 I/O Devices Device Keyboard Mouse Voice input Scanner Voice output Line printer Laser printer Graphics display Modem Network/LAN Floppy disk Optical disk Magnetic tape Magnetic disk Behavior input input input input output output output output input or output input or output storage storage storage storage Partner human human human human human human human human machine machine machine machine machine machine Data rate (KB/sec) 0.01 0.02 0.02 400.00 0.60 1.00 200.00 60,000.00 2.00-8.00 500.00-6000.00 100.00 1000.00 2000.00 2000.00-10,000.00 1998 Morgan Kaufmann Publishers 3 I/O Performance • Performance: — access latency — throughput — connection between devices and the system — the memory hierarchy — the operating system • A variety of different users (e.g., banks, supercomputers, engineers) each has different requirements. 1998 Morgan Kaufmann Publishers 4 Typical Collection of I/O Devices Processor Interrupts Cache Memory– I/O bus Main memory I/O controller Disk Disk I/O controller I/O controller Graphics output Network 1998 Morgan Kaufmann Publishers 5 Importance of I/O in a Networked Society • Processors are being built from the same basic technology. • I/O becomes one of the most distinctive features of the machines. • As the importance of networking and information infrastructure grows, I/O plays an increasing important role. 1998 Morgan Kaufmann Publishers 6 Impact of I/O on System Performance • Suppose we have a benchmark that executes in 100 seconds of elapse time, where 90 seconds is CPU time and the rest is I/O time. If the CPU improves by 50% per year for the next five years but I/O time doesn’t improve, how much faster will our program run at the end of five years? Amdahl’s Law again! 1998 Morgan Kaufmann Publishers 7 Assessing I/O Performance • Depends on the application • • System throughput I/O bandwidth – how much data can we move through the system in a certain time? – How many I/O operations can we do per unit of time? Response time • 1998 Morgan Kaufmann Publishers 8 I/O Performance Measures • • • • • • • Examples from Disk and File Systems affected by disk technology, how disk are connected, the memory, the processor, and the file system provided by the OS. Benchmark relatively primitive compared with those for the CPU. Note: transfer rate: 1 MB = 10^6 bytes, not 2^20 bytes Supercomputer I/O benchmarks: dominated by access to large files on magnetic disks. Data throughput, # of bytes per second that can be transferred between a supercomputer’s main memory and disks. Transaction Processing(TP) I/O benchmarks: – involve both response time requirement and a performance based on throughput. – Concerned with I/O rate, measured as # of disk accesses per second. – TPC has developed several benchmarks. File System I/O benchmarks: five phases --> Makedir, Copy, ScanDir, ReadAll, Make 1998 Morgan Kaufmann Publishers 9 Disk Storage and Dependability • • Disk storage is nonvolatile, meaning that the data remains even when power is removed. Platters in hard disk are metal (or glass), offering several advantages over floppy disks: – can be larger because it is rigid – has higher density because it can be controlled more precisely – Has a higher data rate because it spins faster – can incorporate more platter 1998 Morgan Kaufmann Publishers 10 I/O Example: Disk Drives Platters Tracks Platter Sectors Track • To access data: — seek: position head over the proper track (3 to 14 ms. avg.) — rotational latency: wait for desired sector (.5 / RPM) — transfer: grab the data (one or more sectors) 30-80 MB/sec 1998 Morgan Kaufmann Publishers 11 Example • For a disk rotating at 5400 RPM, • average rotational latency = 0.5 rotation / 5400 RPM = 0.5 rotation/(5400 RPM/ 60) = 5.6ms For a disk rotating at 15,000 RPM, average rotational latency = 2.0ms • • • Note: detailed control of the disk and the transfer between the disk and the memory is usually handled by a disk controller. The controller adds the final component of disk access time, controller time. The average time to perform an I/O operation will consist of these four times plus any wait time incurred because other processes are using the disk. Many recent disks have included caches directly in the disk to speed up the access time. 1998 Morgan Kaufmann Publishers 12 Disk Read Time • What is the average time to read or write a 512-byte sector for a typical disk rotating at 10,000 RPM? The advertised average seek time is 6 ms, the transfer rate is 50MB/sec, and the control overhead is 0.2ms. (Assuming no waiting time) 1998 Morgan Kaufmann Publishers 13 Dependability, Reliability and Availability • • • • • • A system alternating between states: 1. Service accomplishment: where the service is delivered as specified 2. Service interruption: where the service is different from the specified service Transitions from state 1 to state 2 are caused by failures Transitions from state 2 to state 1 are called restorations. Reliability is a measure of the continuous service accomplishment. Mean-time-between-failures = Mean-time-to-failure + Mean-time-torepair Availability = MTTF/(MTTF+MTTR) 1998 Morgan Kaufmann Publishers 14 How to Increase MTTF • • • Fault avoidance Fault tolerance Fault forecasting 1998 Morgan Kaufmann Publishers 15 RAID • • • • • • • • Leveraging redundancy to improve the availability of disk storage is captured in the phrase: Redundant Array of Inexpensive Disks No redundancy (RAID 0): allocation of logically sequential blocks to separate disks to allow higher performance than a single disk can deliver Mirroring (RAID 1): writing the identical data to multiple disks to increase data availability. Error Detecting and Correcting Code (RAID 2) Bit-Interleaved Parity (RAID 3): Add enough redundant information to restore the lost information on a failure. Block-interleaved Parity (RAID 4) Distributed Block-interleaved Parity (RAID 5) P+Q redundancy (RAID 6) 1998 Morgan Kaufmann Publishers 16 RAID 1-6 1998 Morgan Kaufmann Publishers 17 Small Write Update on Raid 3 vs. Raid 4 1998 Morgan Kaufmann Publishers 18 Networks • • • • • • Key characteristics of typical networks: – distance: 0.01 to 10,000 kilometers – speed: 0.001 MB/sec to 1GBit/sec – topology: bus, ring, star, tree – shared lines: none (point-to-point) or shared RS232: slow but cheap LAN (ethernet): up to 1GBit/sec Ethernet is a bus with multiple masters and a scheme for determining who gets bus control. ATM: scalable network technology (155 Mbits/sec to 2.5 Gbits/sec) Example: Performance of two networks 1998 Morgan Kaufmann Publishers 19 The OSI Model Layers 1998 Morgan Kaufmann Publishers 20 TCP/IP Packet Format 1998 Morgan Kaufmann Publishers 21 Performance of Two Networks • • • • • • Bandwidth 100 Mbit/s vs. 1000 Mbit/s Interconnect latency: 10us HW latency from/to network: 2 us SW overhead sending to network: 100 us SW overhead receiving from network: 80 us Question: Find the host-to-host latency for a 250 byte message using each network. 1998 Morgan Kaufmann Publishers 22 I/O Example: Buses • • • Shared communication link (one or more wires) Difficult design: — may be bottleneck — length of the bus — number of devices — tradeoffs (buffers for higher bandwidth increases latency) — support for many different devices — cost Types of buses: — processor-memory (short high speed, custom design) — backplane (high speed, often standardized, e.g., PCI) — I/O (lengthy, different devices, standardized, e.g., SCSI) 1998 Morgan Kaufmann Publishers 23 Bus: Connecting I/O Devices to Processor and Memory • • • • • • • • A bus generally contains a set of control lines and a set of data lines. Control lines are used to signal requests and acknowledges, and to indicate what type of information is on the data lines Data lines carry information between the source and the destination. The information may consist of data, complex commands or addresses. Bus transaction includes two parts: sending the address and receiving or sending the data. Read transaction == transfers data from memory Write transaction == writes data to the memory Input operation: input to memory so the processor can read it Output operation: output to device from memory 1998 Morgan Kaufmann Publishers 24 Input Operation 1998 Morgan Kaufmann Publishers 25 Different Machines using Different Types of Buses 1998 Morgan Kaufmann Publishers 26 Synchronous and Asynchronous Buses • Synchronous buses – use a clock and a synchronous protocol, fast and small – but every device must operate at same rate – clock skew requires the bus to be short – processor-memory buses are often synchronous • Asynchronous buses – don’t use a clock and instead use handshaking – can accommodate a wide variety of devices 1998 Morgan Kaufmann Publishers 27 Asynchronous Protocol • ReadReq 1 3 Data 2 2 4 6 4 Ack 5 7 DataRdy • Let’s look at some examples from the text “Performance Analysis of Synchronous vs. Asynchronous” “Performance Analysis of Two Bus Schemes” 1998 Morgan Kaufmann Publishers 28