Samba – opening Windows to a wider world
Samba began life as ‘a bit of a hack’ and became the route for taking free software into the enterprise. Richard Hillesley tells the story…
Samba allows Linux and UNIX to serve and share files on Windows networks, using Microsoft’s SMB (Server Message Block) protocol. The SMB protocol is derived from NetBIOS, which began as a joint project between Microsoft and IBM. NetBIOS made use of a non-routable protocol, NetBEUI, for small computer networks, and allowed early PCs to talk to one another. Subsequently, NetBIOS was implemented over TCP/IP and became Microsoft’s standard protocol, later known as CIFS (the Common Internet File System). SMB/ CIFS has become the standard implementation within enterprises to allow communication on PC networks running Microsoft systems.
Samba is used to integrate PC-style desktop machines with Linux or UNIX servers and clients, and to replace protocols like NFS, DECnet and NCP, especially when used with PCs.
Samba began life as ‘a bit of a hack’ in late 1991/early 1992 when Andrew Tridgell wanted to get an unsupported beta version of DEC’s eXcursion software working between his DOS PC and a Sun server. The earliest version to
be “influenced by a SMB specification” was version 1.5 released in December 1993. Previous versions were based “purely on sniffer dumps”.
1.5 was also the first to be released under the GNU General Public License.
Previously ‘nbserver’ had “a ‘do what you like’ style of licence” and according to Tridgell, the conversion to the GPL “reflects the fact that I had become a huge fan of Linux and was impressed by the progress being made by the Linux community. I’ve never regretted this decision, and I think the GPL has been very good for Samba.”
In the early days Samba was often the excuse or means by which GNU/Linux was introduced into the enterprise, as a back-room file or print server, often without the knowledge or consent of management. Samba was a groundbreaker that took Linux and free software beyond the world of hackers and geeks and into the data centre, and from the beginning was deployed with Linux on embedded networking devices.
In more recent years Samba has had a lower profile. Samba is an essential part of the infrastructure of the free software stack, and just works. As such, it is “no longer a sexy and glamorous project… and has become part of the plumbing,” says Jeremy Allison, who has been working on Samba since its earliest days.
The spec was a fiction
Samba’s role has been to remove ‘barriers to interoperability’, to force Microsoft into the open and to make interoperability possible. For many years this was hard work. The X/Open specification, which was the publicly available description of the SMB protocol, wasn’t followed, and each new release of Windows brought new deviations and obfuscations which the Samba developers were obliged to re-engineer.
“The spec was a fiction, and made no sense. The complexity of SMB is one of the main reasons that NT was so unstable,” says Allison.
Microsoft has always had an ambivalent relationship with the concept of interoperability and with the standards that make interoperability possible, tending to view the protocols and data formats it uses as ‘de facto’ standards and ‘trade secrets’ which it is free to ‘extend’ with no obligation to share.
This may not always have been deliberate behaviour. Where there is a monopoly, standards become incidental, an option rather an obligation, and Microsoft has often taken that option. This tendency has been at the root of Microsoft’s problems in the US and European courts over the years.
So, for instance, Kerberos, the encryption standard developed by MIT, was extended by Microsoft with the declared objective of enhancing security and the convenient advantage of inhibiting interoperability in the workgroup server space. In the words of Allison, “these changes were treated as trade secrets, patented if possible, and only released under restrictive non-disclosure agreements, if released at all.”
Obfuscation of protocols has been a small price to pay to sustain the monopoly. Some extensions to SMB/CIFS were bugs that went unnoticed because Microsoft was only testing against its own systems. Some were implemented to fulfil new functionality and some were designed to inhibit the competition. Samba survived through clever deduction, subterfuge, sniffer dumps, analysis and conjecture.
But Samba has been around a long time and the key developers now know the ins and outs of SMB/CIFs better than the Microsoft engineers themselves.
“The people who used to work on the SMB server at Microsoft have taken their money and their shares, and they’re all retired now and long gone,” Allison says. “But Tridge and I and Volker are all still here working on it. So we have history with this stuff that few others do, and we do more than anyone else does.”
Since the 2007 judgment of the European Commission, the Samba Team has been able to work directly from up-to-date specs. The Commission’s judgment was a major breakthrough for the Samba project, and free software in general. In essence it required Microsoft to publish its protocols in their entirety and to comply with the commonly understood meaning of open standards. Since then, Samba has gone from strength to strength.
Samba has now reached its version 4 release, which can be seen as a milestone, as it includes support for Microsoft’s Active Directory protocols and cluster support for file servers. Samba can also be deployed as a secure DNS server, an LDAP server, and Kerberos authentication server.
Samba is in the news less, partly because Microsoft is less important and the focus has moved, but remains an integral and important part of the free software landscape. And Samba 4 makes it even easier to substitute large parts of Microsoft’s infrastructure with cheaper Linux and Samba deployments without any loss of productivity, scalability or functionality.
Victory in Europe
Microsoft’s troubles in Europe began as early as 1993, when Novell complained that “onerous licensing conditions” imposed on OEMs by Microsoft was pushing NetWare out of the workgroup market. In this market Novell had been the innovator, but Microsoft had muscled a napping, but still relevant, Novell out of the picture. So began a long history of litigation which culminated in the 17 September 2007 decision of the European Court of First Instance to uphold the European Commission’s decision against Microsoft.
The judgment came at the end of a ten-year case initiated by Real Networks, supported by Sun Microsystems, Novell and others, all arguing that innovative products were being pushed out of the market on the back of Microsoft’s monopoly. Over the years each of these litigants withdrew from the case after doing deals with Microsoft worth billions of dollars, leaving the Samba Team and their allies to fight the case to the finish.
The most important part of the judgment was the Commission’s insistence that Microsoft be forced to publish the protocols used by Windows clients and servers under ‘reasonable’ and ‘non- discriminatory’ terms. For this decision to have any meaning, it was incumbent upon Microsoft to publish the protocols in their entirety, and to reflect the actual behaviour of Microsoft servers and clients in the real world – without evasion, inconsistencies, broken standards, obfuscations, fees or hidden patents – to comply with the commonly understood meaning of open standards and protocols as they have been implemented by other participants in the computing industry.
The result of the judgment has changed many aspects of the game although, as Allison notes, “We now have specs. But we still have to work out what Windows does, so that’s not changed. If we try to figure something out we go to Windows and write a test for it, and see how Windows does it. But it’s a lot easier now, because we can go to the spec and see how it’s supposed to work. At that point we have recourse to go to Microsoft and say, ‘Hey, we think there’s a bug in the spec here’, and they will fix it, and they do.”
“It’s a different kind of work, and we’re hoping it will change the kind of people who work on Samba, because before you had to be weird. You had to have a particular mindset that enjoyed doing that stuff, and most programmers don’t. Most programmers don’t like playing guessing games. They want to be able to write easy code that just works. Most people don’t want to work out how something is supposed to work before they can write a piece of code…”
The common objective
Samba is avowedly free software, and allies itself with the objectives of the Free Software Foundation. Samba was the first major free software project to adopt the GPLv3, and the developers were prepared to go through the courts to force Microsoft to play nicely with the standards…
Allison also works with Software Conservancy to enforce the GPL. This is important because Samba is commonly deployed on embedded and/or small devices for print and file serving, and it these kinds of devices where the terms of the GPL are often ignored.
Most infractions against the GPL are accidental and occur through ignorance, and are quickly remedied. And Samba has only ever had one really serious compliance issue, where “they took the code of Samba and put a proprietary licence on it, and started selling it as their own work…
“They actually had an open NFS server on the internet. So we were able to watch them in real time obfuscating the names of the functions, and periodically burn a CD and say ‘Oh. They’ve got up to here now.’” Eventually they went elsewhere. “Picking on Samba was hard work because we were going to fight back, so they picked on someone else…”
Being free has many advantages. “The copyright in Samba is spread across many, many individuals, all of whom contributed under the GNU GPL ‘v2 or later’, now ‘v3 or later’ licences. You can’t buy that. There’s nothing to sell. There’s no point of agreement for which to say ‘here are the rights to Samba, we’ll go away’. We’re in the, some would say unique, some would say unenviable position, of not being able to sell out. We can’t be bought.”
Samba’s licence regime deliberately does not include copyright assignment, so the code is owned by everyone and no-one. Free software is the common objective.