Q

Block and file I/O

What is the difference between block I/O and file I/O and what are the advantages of both.

Block I/O is the basic mechanism for DISK access using the SCSI protocol as the command set. Block I/O is fast and data can be transmitted in various block sizes like 2K, 4K, 8K, 16K, 64K, 128K, etc. Block I/O can be done over various transports. Parallel SCSI cables, copper fiber, optical fiber and even encapsulated and transmitted over IP networks.

  • Block I/O is what is used to talk to DISKS.
  • File I/O is what is used to talk to FILES.

File I/O usually uses either NFS or CIFS/SMB access protocols over TCP/IP Ethernet. File I/O has locking mechanics so that data may be shared between different OS types. (Like Unix and NT) File I/O usually uses TCP/IP as the transport mechanism and thus must conform to the seven-layer "stack." This means each piece of data needing transport must traverse the entire IP stack before going "over the wire." This causes overhead and slows things down a bit. IP stack latency can be minimized by using a TOE- (TCP/IP offload engine) based network adapter card. The "TOE" offloads the CPU cycles needed to transmit the data through the IP stack from the server CPU to the NIC itself.

Advantages of file I/O are ease of implementation, cost and the ability to "share" files. The disadvantages are speed and latency and the fact that many applications cannot be "installed" on a network share.

Advantages of block I/O are speed, minimal latency and high availability. The disadvantages of block I/O are no inherent file sharing capability, complexity and cost.

Chris

This was last published in April 2002

Dig Deeper on NAS management

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

2 comments

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

Thanks for sharing this knowledge, this is a very enriching article.
Cancel
I have some questions:What is the case when using ISCSI or FCOE for block? In Iscsi the scsi is running using IP, even in that case IP stack needs to be completed for data transfer. How is this different from file? Also in ISCSI mtu is 1500/9000, doesn't it mean the blocksize is fixed, how can you say it is variable 2k,8k,16k......?
Cancel

-ADS BY GOOGLE

SearchSolidStateStorage

SearchConvergedInfrastructure

SearchCloudStorage

SearchDisasterRecovery

SearchDataBackup

Close