Sunday, 22 December 2019

Democratization of truth

America elected Trump. The UK elected a prime minister who had already been tried by the courts and found guilty of an abuse of power. Both election campaigns seem to have involved a great deal of "fake news" (attributed, amongst others, to foreign states).

This week (among other excitement) I've been working on an infrastructure plan for a target architecture which will also allow progressive migration of legacy systems. Actually, this is taking a bit longer than a week, but the question of shared file access has bubbled up to the top of my list. I'd like to think I've learned a few things over the years, but I always like to check my facts - and to check if there are new facts to be discovered. So I hit the search engines, starting off with a comparison of NFS and SMB.

The first page of results searching for "NFS vs SMB in the datacentre" in both Google and DuckDuckgo was pitiful. Biased and misinformed blog postings and marketing SEO spam. I spent a very long time trudging through misinformation and idiot guides before realizing that the internet, formerly the definitive source for technology guides and (informed) opinions was a mere shadow of its former self. While most institutions dwindle due to under-subscription, it is the exact opposite which has harmed the internet's utility to me. I don't think the Kremlin is behind this, indeed I think the poor quality information is mostly published with good intentions, but I wish Google and Duckduckgo provided the a facility where I could easily feedback on the quality of articles they index.

It seemed like a more productive use of my time might be to record what I already know about the protocols rather than try to find out something new.

So, for the record....SMB was not invented by Microsoft. They did develop the technology. CIFS is also based on the same technology but forked the protocol to implement support for POSIX hard/symbolic links and large files. This was then added to the SMB 2.0 specification.

Both exist in multiple iterations. Both are intended for file sharing, but SMB also supports a lot of other network oriented operations.

The key differences between (most) NFS and SMB installations are that the former uses UDP while the latter uses TCP with in-band authentication and session handling. This has a lot of impact on data transfer speeds - a LAN, the internet and a datacentre are each very different network environments - so benchmarks from one will be misleading in another.

NFS doesn't (normally) use passwords on encryption - it is based on trust between the existing devices. Enforcing authentication for every operation makes implementing some security models easier.

But a flip side of this, is that once an SMB connection is lost (i.e. if the client, the server, or the network in between fail at any point) it is upt to the client to renegotiate the connection. Although that technology exists within smbmount (used on Linux and other POSIX systems) it is not the most reliable.

OTOH the intrinsic authentication but absence of network-based user identifiers means that it is a lot simpler to align client users with the permissions on the files in the remote filesystem of SMB than NFS. Until NFSv4 it was not enough to have the same user configured on multiple machines - to get the same access they needed to have same (numerical) user id.

I'm not going to tell you that one is better than the other, because, despite trying to fulfill the same goal of providing shared access to remote files, they are different.