The idea: does the client ask for a file or for blocks?
Network storage puts the disk on another machine. There are two ways to ask it for data.
With file-level storage (NFS, SMB) the client says "give me bytes 0 to 8191 of
/data/report.csv". The server runs the filesystem: it knows the
names, the inodes, which blocks are free, and who holds a lock. With block-level
storage (iSCSI, NVMe over Fabrics) the client says "give me 16 blocks starting at LBA 16384". The
client runs the filesystem, and the server only stores numbered blocks.
On the canvas client A's app reads /data/report.csv (16 KB) 8 KB at a time. It opens
the file with O_DIRECT, so no page cache hides a read and every read goes to the network.
The server has one SSD, drawn as five cells of 512-byte LBAs: the inode-table block at LBA 8200, the
two halves of the file at 16384 and 16400, and two free blocks. Every message flies as a box and is
written into the wire trace in the middle. The header counts round trips, messages and time for the
current read; the table at the bottom keeps the result of each protocol.
File level: NFSv4.1 and SMB3
An NFSv4.1 client sends COMPOUND requests over TCP port 2049: several operations in
one message. To read a file it first needs an OPEN, which returns a
stateid, then it sends READ with that stateid, an offset and a count.
The file is named by a file handle (here 0x5A), never by an inode number or
block. On the server, nfsd passes the request to its own filesystem (XFS), which looks up the name,
reads the inode from the SSD, maps the byte range to blocks and reads them. The server also keeps the
open and lock state for every client. (Demo 1)
SMB3, the Windows protocol on TCP port 445, works the same way, with other names:
| step | NFSv4.1 | SMB 3 |
|---|---|---|
| open a file by name | OPEN (in a COMPOUND), returns a stateid | SMB2 CREATE, returns a FileId |
| read a byte range | READ stateid, offset, count | SMB2 READ FileId, offset, length |
| lock a range | LOCK | SMB2 LOCK |
| let one client cache | delegation | oplock / lease |
Block level: iSCSI
iSCSI carries SCSI commands over TCP port 3260. The server is a
target with a name like iqn.2026-11.com.example:store; it exports a
LUN (logical unit) that the client sees as a local disk, /dev/sdb. The
client formats it with its own filesystem (ext4 here). To read the file, ext4 first needs the file's
inode, so it asks for the inode-table block itself: the SCSI disk driver builds a
READ(10) command (an LBA and a length in blocks) and the initiator wraps it in a
SCSI Command PDU. The target answers with a Data-In PDU; its S bit
says the status (GOOD) rides along, so no separate SCSI Response PDU is sent. Then ext4 reads the
inode's extent, works out that bytes 0–8191 are LBA 16384, and sends a second READ(10).
(Demo 2)
NVMe over Fabrics: queues over TCP or RDMA
A local NVMe SSD is driven through queue pairs in memory: the host writes a
command into a submission queue (SQ) and the drive writes a result into a
completion queue (CQ). NVMe over Fabrics keeps exactly that model and
sends the queue entries over a network as capsules. The server exposes a
subsystem (named by an NQN) with namespaces, which the client sees as
/dev/nvme1n1.
- NVMe/TCP (port 4420): the Read command (SLBA, NLB; NLB counts from zero, so 16
blocks is NLB 15) goes in a
CapsuleCmdPDU, the data comes back inC2HData, and the completion entry inCapsuleResp. (Demo 3) - NVMe/RDMA (RoCE v2 or InfiniBand): the command capsule goes in an RDMA SEND; the target's NIC writes the data straight into the host's buffer with an RDMA WRITE, and a SEND brings the response capsule. No CPU copies the data. (Demo 4)
There is no SCSI layer in between, and each CPU can have its own queue pair, so the software path on both ends is much shorter than iSCSI's. That, not fewer messages, is where most of the time goes.
Counting round trips and time
A first read costs two round trips everywhere: NFS needs an OPEN before the READ, and a block client needs the inode block before the data. The second read of an open file costs one. The difference is who fetches the metadata: the NFS server reads the inode from its own disk, while a block client pulls it across the network and parses it itself. The times are toy numbers (the same 80 µs SSD read for all, 10 µs per wire trip over TCP, 3 µs over RDMA, and a thinner software stack for NVMe), but the order matches what people measure.
| protocol | filesystem runs on | 1st read | 2nd read | messages per read |
|---|---|---|---|---|
| NFSv4.1 | server | 2 RT, 310 µs | 1 RT, 155 µs | 2 |
| iSCSI | client | 2 RT, 278 µs | 1 RT, 139 µs | 2 |
| NVMe/TCP | client | 2 RT, 230 µs | 1 RT, 115 µs | 3 |
| NVMe/RDMA | client | 2 RT, 184 µs | 1 RT, 92 µs | 3 |
Sharing: why two clients corrupt a LUN
A block server does not know about files, so it lets two clients use one LUN. But each client's
ext4 believes it is the only one: it keeps its own copy of the free-block map in
memory. In Demo 5 A creates a.log and takes LBA 20480. B's copy of the map still
says 20480 is free, so B takes it too and overwrites A's 4 KB. When A reads its file back, the target
returns B's bytes. Later each ext4 writes its own map and inodes over the other's. Sharing a block
device safely needs a cluster filesystem (GFS2, OCFS2, VMFS) that locks across
clients.
Over NFS the same two writers are safe (Demo 6): both send names and bytes, and the one XFS on the server gives a.log LBA 20480 and b.log LBA 20488. That is the trade: file level shares easily and keeps metadata in one place; block level gives one client a fast raw disk to run any filesystem or database on.
See also NFS vs AFS caching for how file clients cache, the Linux block layer for what happens below ext4 on one machine, SSD reads and writes for the drive itself, and object storage for a third way to store data over a network.
What the page leaves out
- Login and connect: iSCSI login (CHAP, negotiation of ImmediateData, MaxRecvDataSegmentLength), NVMe-oF discovery on port 8009 and Connect commands, NFS mount and the SEQUENCE / session in every NFSv4.1 COMPOUND.
- Client caches and readahead (the app uses O_DIRECT), multipathing, iSCSI R2T for large writes, and NVMe/TCP data digests.
- SCSI and NVMe reservations, which let clients fence each other on a shared device but do not make a normal filesystem safe to share.
- Real latencies depend on NICs, CPUs and load; the page's microseconds are toy values.