Curriculum / Part 2 · Flash and NVMe deep dive
Lesson 8

The NVMe protocol

Submission and completion queues, doorbells, namespaces, and how NVMe over Fabrics carries the same commands across RDMA or TCP.

⏱ 40 min5-question quiz

The simple version

NVMe is a restaurant with a ticket rail. The waiter (the CPU) pins order tickets on a rail (the submission queue) and rings a bell (the doorbell). The kitchen (the SSD) cooks, then puts finished plates on a counter (the completion queue) and rings back. Lots of waiters can have their own rails at once.

Queue pairs and doorbells

The host writes commands into a submission queue (SQ) in host memory and writes the new tail position to a doorbell register on the controller. The controller fetches commands, executes them, posts entries to the paired completion queue (CQ) and usually raises an interrupt. Linux creates I/O queues per CPU (or groups of CPUs) so submission scales across cores.

$ ls /sys/block/nvme0n1/mq/        # one directory per hardware queue
$ cat /sys/block/nvme0n1/queue/nr_requests

Controllers and namespaces

A controller is the NVMe interface; a namespace is a set of logical blocks it exposes. /dev/nvme0 is controller 0; /dev/nvme0n1 is its namespace 1. Drives that support namespace management can be split into several namespaces with different sizes or LBA formats.

$ sudo nvme id-ctrl /dev/nvme0 | grep -E '^(mn|fr|nn) '
$ sudo nvme list-ns /dev/nvme0

NVMe over Fabrics

NVMe-oF carries NVMe commands over a network instead of PCIe. Transports include RDMA (RoCE or InfiniBand), TCP and Fibre Channel. The host sees a normal /dev/nvmeXnY block device.

TransportStrengthCost
RDMALowest latency and CPU useNeeds RDMA NICs and, for RoCE, a well-tuned (often lossless) network
TCPRuns on any EthernetMore CPU per I/O and somewhat higher latency
$ sudo nvme discover -t tcp -a 10.0.0.20 -s 8009
$ sudo nvme connect -t tcp -a 10.0.0.20 -s 4420 -n nqn.2026-01.io.example:pool1
$ sudo nvme list-subsys

Port 4420 is the IANA-assigned NVMe-oF port; 8009 is the discovery port for NVMe/TCP. Lesson 22 revisits RDMA for storage in depth.

Tools

nvme id-ctrl / id-ns
Identify data for controller and namespace.
nvme list-ns, create-ns, attach-ns
Namespace management on drives that support it.
nvme discover / connect / list-subsys
NVMe-oF discovery, connection and path view.

Quiz

Lab

No graded lab yet

The simulator doesn't model NVMe-oF connections yet. Use the try-it command below to see the local NVMe controllers and namespaces this lesson describes.

Try it now in the simulator (opens with the command ready; press Enter):

$ nvme list