International Scientific Conference Computer Science’2015

USB research – transfer rate dependency on

Sergey Nedev, Vladimir Kamenov Technical University, Sofia, Bulgaria, e-mail: [email protected], Technical University, Sofia, Bulgaria, e-mail: [email protected]

Abstract: Flash memory is a type of energy independent reprogrammable computer mem- ory, which can be electrically erased and pre-programmed. Flash memory offers fast read rate and better endurance to kinetic shock than hard drives. The purpose of the current paper is to determine the dependency of the transfer rate of USB flash memories on the used operating system and using different file systems. The tests are made using two of the most popular soft- ware products developed for such tasks - HDTune Pro v5.0 and ATTO Disc Benchmark. Keywords: USB Flash Memory, Operating system, transfer speed, testing.

1. INTRODUCTION - USB FLASH MEMORY TECHNOLOGY

Fig.1: General view of a USB flash memory

Flash memory (fig.1) stores the information in a group of memory cells, made from transistors with floating gate. In traditional SLC (single-level cell) devices, each cell keeps only one bit of information. Some newer Flash memory, known as MLC (multi- level cell) devices can store more than one bit in a cell, choosing between several levels of electric charge. Flash memory cells can endure vast number of storage cycles (from 100,000 to 1 million) depending upon the design of the cell and the precision of manufacturing qual- ity. The main reason for cell damage is the cumulative damage of the floating gate of the memory cell due to the repeated cycles of high voltages (used to erase the cell). The damage effect is partially compensated using proprietary software, which su- pervises the storage process and dynamically changes the used blocks in order to spread evenly the process upon all sectors. Another technique is checking sectors’ stored data in case of write failure. This method is called “bad block management” (BBM). These anti wear methods usually make the portable flash memory last longer than the device itself.

International Scientific Conference Computer Science’2015

2. TYPES OF USB FLASH MEMORY – NOR AND NAND CHIPS NAND types of Flash memory are mainly used in memory cards, USB Flash mem- ory, SSD (Solid State Drives) and similar products, mainly for data storage and transfer of files. NOR memory types, which allow true random access, are used as a substitute of the older EPROM and as an alternative of other types of ROM.

2.1. NAND Flash

Fig.2: NAND flash architecture

8 transistors are connected serially (Фиг.2). Reading of the bits is also done serially and is several times slower than the process in NOR. This type of memory works ex- actly like the block devices (hard drives or memory cards). Each block contains a num- ber of pages. Typical block sizes are:

• 32 pages containing 512 + 16 bytes for each block size of 16 kB • 64 pages containing 2048 + 64 bytes for each block size of 128 kB • 64 pages containing 4096 + 128 bytes for each block size of 256 kB • 128 pages containing 4096 + 128 bytes for each block size of 512k

Programming is done one page at a time and erasing is possible a full block at a time only. NAND devices also need supervision upon faulty blocks – using the manufac- turer’s software or using a separate control chip. When the software enters into the logi- cal block, it connects to a physical block using the devices drivers or controller. The total memory capacity is constantly decreasing as more and more block are marked faulty. The fault correction and detection software will usually detect errors, when one bit of every 256 bytes (2048 bits) is faulty. When this happens, the block is marked faulty in the logical blocks table and the unaffected data is copied onto new block and then the table is updated. If more than one bit of every 2048 bits is faulty, the contents will be partially lost – it can’t be reproduced in its original form. If this happens during writing of a block, the content can still be saved. The first physical block (block 0) is always guaranteed to work without errors. Con- sequently all important parameters and drivers should be stored on this block. If the de- vice is used to boot an operating system, this block must contain the boot record. When given software is started from the NAND memory, virtual memory strategies are used: the content of the memory must first be copied in RAM and then started from it. Memory management unit (MMU) in the system assists this process but it can also

International Scientific Conference Computer Science’2015

be done using layering techniques. Because of these factors, some systems utilize a combination of NOR and NAND memory, where the NOR is smaller and is used as ROM, and the bigger NAND memory, which connected to the , is used as a random access memory. NAND is better suited for flash devices, requiring large storage capacity. This flash architecture combines large storage capacity with fast read/write and erase rates, sacrificing the random access to each bit advantage of NOR memory.

2.2. Useful life of flash memory The useful life of NAND flash memory is much longer than NOR flash memory (usu- ally 1 000000 cycles against 100 000 cycles). This is so, because programming and erasing of NOR flash depends on various sub-microscopic processes (hot electron in- jection and quantum displacement), which are totally symmetrical in NAND flash mem- ory.

2.3. Firmware storage Regarding the ever growing speed of modern processors, parallel flash devices are often much slower, when executing program codes, stored on them. On the other side, modern SRAM offers access times under 10 ns, while DDR2 SDRAM offers 20 ns. Be- cause of that very often the code, stored on the flash memory, has to be copied on RAM; this is done so the code could work at full speed. Company software (firmware) can be stored in the USB flash device, and then copied onto SDRAM or SRAM, when the device is powered.

3. FLASH FILE SYSTEM Most USB flash devices come preformatted with FAT32 file system. The universal character of this system permits the device to be used on almost any computer with USB slot. Nevertheless, because the USB flash memory is seen as a USB by the sys- tem, it can be reformatted using any file system, supported by the OS. Some file systems are developed as to spread the written data across the entire memory, avoiding clustering data in any particular area (directories for example); this process greatly preserves the lifetime of ordinary devices with flash memory. Some de- vices have this functionality embedded in its own controller, others don’t, thus the cus- tomer has to check the device’s specifications before changing its file system.

4. TYPES OF FILE SYSTEMS There are three types of FAT file systems: FAT12, FAT16 and FAT32. FAT dates from DOS systems. The problem is that it was developed for 16-bit OS, with 16-bit ad- dressing and it is not capable of working with a drive bigger than 32 megabytes. FAT16 is used for the first time in Windows 95. The maximum size of partitions here is 2GB. FAT32 is the successor of the older FAT16. The development of FAT32 is con- nected to Windows 95 OSR2. The difference is that it uses 32-bit addressing and now it is possible to achieve partitions with sizes of 2TB (terabytes). NTFS (New Technology File System) is the standard file system in Windows NT. It replaces FAT file system and is the preferred file system in Windows operat-

International Scientific Conference Computer Science’2015

ing systems. NTFS is greatly improved compared to FAT. The improvements include support of metadata and more complex structures of data leading to improvement in productivity, security and disc space management. The additions also include Access Control Lists – ACL and file system logging. exFAT is a file system, specially developed by Microsoft for flash memories. It can be used in places, where NTFS file system is not an option.

5. RESEARCH OBJECTIVES AND METHODS The objective of this research is to determine the dependency of transfer rate of USB flash memories on the used operating system, using different file systems in the course of the tests. The tests are made using two of the most popular software products in this field: HDTune Pro v5.0.0 (fig.3, fig.4 and fig.5) and ATTO Disk Benchmark (fig.6). The research is structured in the following manner:

• A benchmark test with HDTune Pro v5.0.0 using flash memory data reading, which determines the minimum, average and maximum read transfer rate and proc- essor load. The process is visualized graphically. • Using HDTune Pro v5.0.0 the maximum and average access time is calculated, as well as average rate and operations per second when random reading data blocks placed on random locations on the flash memory (random access test). • Using HDTune Pro v5.0.0 the read and write process of large 500МВ and 64МВ is tested. • Using ATTO Disk Benchmark the transfer rate is tested again, but with 256МВ files.

The dependency of transfer rate on the operating system is research, using three USB flash memory devices. The tested operating systems are: Windows 7, Windows Vista and Windows XP. The flash drives are formatted with NTFS, FAT32 and exFAT file systems. The dependency is examined using results from tests with HDTune Pro v5.0.0 and ATTO Disk Benchmark software for NTFS, FAT32 and exFAT file systems (tables.1, 2 and 3). Because of space limitations in this paper, only test results with Windows 7 Ultimate using 8GB Lexar JD FireFly Flash drive and FAT32 file system are given in its full graphical form. The results from all tests are summarized in tables 1, 2 and 3.

International Scientific Conference Computer Science’2015

Fig. 3: Read/write benchmark test of USB flash memory Fig. 4: Random access test

Fig. 5: Read/write test with 500МВ and 64МВ files Fig. 6: Read/write transfer rate with 256МВ files

6. TEST RESULTS Dependency of the transfer rate on the operating system used with different file sys- tems:

Tab. 1: 8GB Lexar JD FireFly Flash drive read/write transfer speed test results Windows Xp MB/s Windows Vista MB/s Windows 7 Ultimate MB/s Test HDTune Pro v5.0.0 HDTune Pro v5.0.0 HDTune Pro v5.0.0 NTFS FAT32 exFAT NTFS FAT32 exFAT NTFS FAT32 exFAT read 21.7 21.4 21.7 19.6 20 19.6 20.5 20 20.6 Windows Xp MB/s Windows Vista MB/s Windows 7 Ultimate MB/s Test ATTO Disk Benchmark ATTO Disk Benchmark ATTO Disk Benchmark NTFS FAT32 exFAT NTFS FAT32 exFAT NTFS FAT32 exFAT read 22.83 22.79 22.79 21.34 21.61 21.29 22.11 22.18 22.17 write 12.98 10.6 12.47 10.42 10.38 12.23 12.38 10.41 12.4

International Scientific Conference Computer Science’2015

Tab. 2: 4GB Apacer Flash drive read/write transfer speed test results Windows Xp MB/s Windows Vista MB/s Windows 7 Ultimate MB/s Test HDTune Pro v5.0.0 HDTune Pro v5.0.0 HDTune Pro v5.0.0 NTFS FAT32 exFAT NTFS FAT32 exFAT NTFS FAT32 exFAT read 25.8 25.8 25.8 26.9 26.7 26.9 28.2 28.1 28.1 Windows Xp MB/s Windows Vista MB/s Windows 7 Ultimate MB/s Test ATTO Disk Benchmark ATTO Disk Benchmark ATTO Disk Benchmark NTFS FAT32 exFAT NTFS FAT32 exFAT NTFS FAT32 exFAT read 27.53 26.29 26.19 28.92 28.86 28.92 30.57 29.86 30.1 write 9.68 9.71 10.01 9.52 9.44 9.81 10.55 9.53 9.92

Tab. 3: 1GB RunDisk Flash drive (pre 2005 model) read/write transfer speed test results Windows Xp MB/s Windows Vista MB/s Windows 7 Ultimate MB/s Test HDTune Pro v5.0.0 HDTune Pro v5.0.0 HDTune Pro v5.0.0 NTFS FAT32 exFAT NTFS FAT32 exFAT NTFS FAT32 exFAT read 13.4 13.4 13.4 12.6 12.6 12.6 12.9 12.8 12.8 Windows Xp MB/s Windows Vista MB/s Windows 7 Ultimate MB/s Test ATTO Disk Benchmark ATTO Disk Benchmark ATTO Disk Benchmark NTFS FAT32 exFAT NTFS FAT32 exFAT NTFS FAT32 exFAT read 14.08 14.08 14.08 13.39 13.34 13.4 13.73 13.69 13.77 write 7.94 7.94 8.73 8.54 8.63 8.58 8.2 8.59 8.66

7. CONCLUSIONS After the tests no defined dependency of the transfer rate on the operating system was determined, because all tested operating systems are developed by the same manufacturer – Microsoft, consequently the way they address the USB interface is the same. USB as a whole is very software dependant. For bigger efficiency one should use file system, which doesn’t require much processor power. Based upon the conducted tests, definite conclusions are hard to make, but still FAT32 file system works best with flash memories with small capacity. On of its flaws is its inability to save files with sizes greater than 4GB. NTFS file system transfer rate is much higher, but its biggest flaw is the fragmenta- tion of data, which makes it suitable for hard drives. еxFAT is a file system, specifically developed for flash memories, but a substantial transfer rate difference is hard to observe when using small capacity flash drives.

8. REFERENCES [1] http://www.attotech.com – ATTO Disk Benchmark software. [2] http://www.flashmemorytoolkit.com – Flash Memory Toolkit software. [3] http://www.ntfs.com – File system NTFS [4] http://www.project9.com – The FAT32 resource page. [5] http://www.sans.org – Reverse engineering the Microsoft exFAT file system.