contents
Blogs / What Protocol Should You Choose For Your NAS?
October 13, 2023 • Matthew Duong • Self Hosting; • 6 min read
Some of you know I run a YouTube channel covering on premises hosting and homelab. Over time, my raw video footage has really grown in size, now exceeding a whopping 4 Terabytes. To manage this deluge of data, I recently embarked on a mission to build my own Network Attached Storage (NAS). I opted for TrueNAS, a powerful open-source software that integrates seamlessly with multiple storage protocols. For this setup, I am upgrading my Dell T20 (originally only with a 2TiB ssd) to 3 x 10TiB drives dedicated to housing my large video files,as well as the existing SSD for the operating system. The important moment in my NAS journey was deciding on the right file sharing protocol, weighing the pros and cons of AFP, SMB, NFS, and iSCSI.
Apple Filing Protocol, or AFP, originated from the Apple ecosystem and has been the go-to for macOS users for a long time. It offers features like Time Machine backups and supports Apple’s native Spotlight search. However, its relevance has declined due Apple dropping support for this protocol. AFP was deprecated in macOS 10.9 Mavericks and AFP server support was removed in macOS 10.11 Big Sur.
AFP operates over TCP/IP and uses a client-server model similar to SMB. However, it was optimised for macOS, allowing for unique Apple features. Clients make requests for files or services, and the AFP server responds accordingly. One distinguishing feature is its strong metadata handling, enabling efficient Spotlight searches and seamless Time Machine backups.
Time Machine Backup: If you’re a graphic designer working on a Mac, you could use AFP to effortlessly backup your large design files via Time Machine.
Content Search: An academic researcher with a large dataset stored on a Mac can use Spotlight search over AFP to quickly locate specific data points or files.
Media Library: If you have an old Mac serving as a media centre, AFP would allow easy access to your library for other Mac devices on the same network.
Effortless Backups: Time Machine backups are seamless, particularly useful for Mac-centric environments.
Fast Searching: Spotlight search capabilities mean you can quickly locate the files you need.
Apple-Specific Features: Strong support for Apple-specific file attributes and metadata handling.
Native Integration: Being built for macOS, it generally requires less configuration.
Given that AFP is deprecated and lacks cross-platform support, it’s best to avoid it for a modern, versatile NAS setup.
SMB is a file-sharing protocol originally created by IBM and later adopted mainly by Microsoft. It is widely used for its broad cross-platform compatibility, making it a go-to choice in mixed OS environments.
SMB operates over TCP/IP and uses a client-server model. The client requests files or services, and the server provides them. Samba works by translating SMB protocol calls into Linux/Unix calls, enabling seamless interoperability between Windows and non-Windows systems. File locking, access control, and other features are handled transparently, often requiring little to no special configuration.
For the vast majority of people, especially those just getting started with NAS, SMB provides a blend of ease and performance that is hard to beat.
NFS is a Unix-based file-sharing protocol known for its high performance and efficiency. While it offers advantages like reduced network overhead and multi-threading support, it demands a nuanced setup and is best-suited for environments with Unix-like systems.
NFS excels in high-performance, Unix-like environments but demands technical expertise for setup and management. If your use-case prioritises speed and you’re equipped to handle its complexities, NFS is a strong candidate.
iSCSI is a block-based storage networking protocol that provides high performance and low latency, ideal for applications like databases that require quick read/write access. It’s commonly used in Storage Area Networks (SANs) for efficient storage utilisation.
iSCSI works by sending traditional SCSI commands over an IP network. The iSCSI protocol encapsulates these SCSI commands into packets for the TCP/IP layer. This allows two endpoints — the iSCSI initiator (usually a server) and the iSCSI target (the storage array) — to communicate. The initiator treats the remote storage as if it were a local SCSI disk, enabling direct read and write operations at the block level.
iSCSI is best suited for specialised high-performance, low-latency scenarios.
Selecting the appropriate protocol for your NAS is pivotal and largely dictated by your specific use-case. SMB is generally sufficient for most, balancing ease and performance. If speed is crucial, NFS or iSCSI are your go-to options. AFP, once popular in macOS circles, is now outdated and not recommended.
Hardware should also align with your protocol choice to eliminate bottlenecks:
In summary, protocol choice is just one piece of the puzzle. Ensuring your hardware is on par with your protocol can significantly boost your NAS performance.