22

SATA M.2 SSDs use SATA on the physical layer and ATA as software protocol for data transmission.

NVMe M.2 SSDs use PCIe on the physical layer and NVMe as software protocol for data transmission.

I was told that in this question.

Of course PCIe is faster than SATA so NVMe SSDs have a higher speed.

But why does it require a new software protocol? Why can't we have PCIe M.2 SSDs talking ATA? (*)

I think the higher speed comes from PCIe and not from the NVMe protocol. Why do we need NVMe?

(*) I think AHCI wouldn't be necessary as the SSD can be addressed by its PCI address. Also ATA can transmit meta data like the disk size.

4
  • 1
    The answer to your previous question contains an answer to this. Jan 29, 2023 at 20:06
  • 2
    It's not that it is better, it's better for SSD. If you happen to find (or, build) a rotating rust that speaks NVMe, you'll find that it doesn't perform any better than the same rust speaking AHCI. Jan 30, 2023 at 9:40
  • 5
    We had PCIe SSDs not using NVMe, the very first I owned didn't use NVMe and finding an external enclosure which would support that a two years ago was a pain. It was a SSD from Samsung, made for OEM use. I think that must have been ~2015 or something like that.
    – Arsenal
    Jan 30, 2023 at 13:53
  • 1
    @NikitaKipriyanov Actually, it would perform a very tiny bit better than an equivalent device connected via SATA to an AHCI controller, but this really has to do with how poorly designed AHCI was more than how good NVMe is. Realistically though, if you had dozens of platters each with an independently actuated set of heads, you could probably get a benefit from using NVMe instead of ATA. Jan 30, 2023 at 18:26

1 Answer 1

32

While I can't find the references anymore, the one specific difference I remember is that NVMe was designed to be highly parallel. I might be misremembering this, but:

  • ATA via legacy IDE had no support for parallel commands at all.

  • ATA via AHCI supports NCQ which allows up to 32 commands to be issued (which may return data in any order), although not all commands are "queue-able". SCSI also supports "tagged queuing" which allows up to 16 commands to be issued.

    If I understand correctly, this means that with a solid-state disk (with no "seek time"), such numbers are low enough that even a max-size queue is processed instantly and the disk returns to doing nothing until the host notices and issues more requests.

  • NVMe, on the other hand, was designed to allow up to 64,000 queued commands, allowing the SSD to remain continuously busy if needed.

A similar comparison may be found at Phison (an SSD controller manufacturer)'s blog, specifically this table, which says:

  • AHCI only supports a single command queue; NVMe supports multiple queues in parallel.
  • AHCI uses a single interrupt for all ports connected to the same controller; NVMe allows multiple interrupts.
  • As I understand it, this implies that a single CPU core must handle all I/O from/to all disks attached to an AHCI controller, whereas NVMe allows different cores to simultaneously read or write data. (But perhaps it also helps that most NVMe disks bring their own controllers while the AHCI controller is usually one per system, or rarely two.)

See also:

Why can't we have PCIe M.2 SSDs talking ATA? (*)

(*) I think AHCI wouldn't be necessary as the SSD can be addressed by its PCI address.

Even if the SSD brings its own controller (which some early pre-NVMe SSDs actually did!), you still need something like AHCI, as it defines how the disk needs to be accessed by its PCI address and so on. AHCI already has nothing to do with obtaining disk-specific information – that's always done through ATA "IDENTIFY DEVICE" and similar commands. But there needs to be an agreement on how to submit those commands to the disk and how to receive responses (in particular things like DMA and queues) – that's what AHCI is about.

Of course, the SSDs could use ATA with something else than AHCI, as long as the OS had the corresponding drivers (just like many did before AHCI existed), but eventually such "nonstandard" devices would converge towards a new standard protocol, whether it is named NVMe or otherwise.

(Though ATA can already be used without AHCI either via legacy PCI IDE interface, or over the network such as AoE (ATA over Ethernet), but it's not as popular as SCSI for such uses – which can also be used over different transports like SAS, FireWire, Infiniband, and iSCSI; and finally NVMe can be used over network using NVMe-oF.)

6
  • Just to add that ATA (and even ACHI) were written back when all hard disks used spinning platters. The complexity of parallelism didn't seem necessary at the time. Jan 30, 2023 at 9:37
  • 7
    "Why can't we have PCIe M.2 SSDs talking ATA?" > We can and we have! Apple used to integrate PCIe SSDs talking ATA/AHCI, which led to the availability of M.2 PCIe SSDs with AHCI protocol.
    – Manawyrm
    Jan 30, 2023 at 9:37
  • Isn't the "655336 commands" a typo? Shouldn't it be 65536? (In the Phison link).
    – Raf
    Jan 30, 2023 at 12:41
  • 4
    Adding to this, NVMe beats the pants off of ATA in terms of bandwidth as it’s typically used. ‘Classic’ SATA-3 peaks around 600 MB/s effective bandwidth. SATA Express peaks somewhere around 1.9 GB/s currently (but that never really took off in consumer devices, so it’s not super relevant here). NVMe, as typically used on a PCI-e x4 connection, peaks around 3.94 GB/s on PCIe 3.0 or 15.76 GB/s on PCIe 5.0. Jan 30, 2023 at 18:23
  • 1
    en.m.wikipedia.org/wiki/NVM_Express#Comparison_with_AHCI Funny thing is, the source actually reminds us that NVMe was/is an option in SATA Express (which is somewhat...forgotten/dead?)
    – Tom Yan
    Jan 31, 2023 at 11:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .