The input of m2 ngff enclosure is Command, and the output is Data and Command Status. The SSD front end (Front End) receives user command requests, and outputs the data or status required by the user through internal calculation and processing logic.

The m2 ngff enclosure is mainly composed of three functional modules:

Front-end interface and related protocol modules;

The middle FTL layer (Flash Translation Layer) module;

· Back-end and flash communication modules.

The front end of the m2 ngff enclosure is responsible for direct communication with the host, and receives commands and related data from the host. After the commands are processed by the m2 ngff enclosure, the front end returns the command status or data to the host. The hard disk enclosure is connected to the host through interfaces such as SATA, SAS and PCIe hard disk enclosures to implement corresponding protocols such as ATA, SCSI and NVMe.

Table 1-5 SATA/SAS/PCIe interface protocols

Let's take a look at how SSD reads and writes, taking writing as an example.

The host sends a write command to the SSD hard disk enclosure through the interface, and the SSD executes the command after receiving the command, and receives the data to be written by the host. The data is generally cached in the RAM inside the SSD first, and FTL will assign a flash memory address to each logical data block. When the data reaches a certain amount, FTL will send a write flash request to the backend, and then the backend will respond to the write request. , write the data in the cache to the corresponding flash space.

Since flash cannot be overwritten, flash blocks need to be erased to be written. A certain data block sent by the host, it is not written in a fixed location in the flash memory, and the SSD hard disk box can allocate any possible flash memory space for it to be written. Therefore, something like FTL is needed inside the m2 ngff enclosure to complete the conversion or mapping of logical data blocks to the physical space of flash memory.

For example, suppose the capacity of the m2 ngff enclosure is 128GB and the logical data block size is 4KB, so the SS hard disk enclosure has a total of 128GB/4KB=32M logical data blocks. Each logical block has a map, that is, each logical block has a storage location in the flash space.

m2 ngff enclosure https://www.fideco.net/USB-GEN-2-type-c-m-nvme-ngff-ssd-enclosure.html