Samba has been called Linux's stealth weapon -- the killer app that allows Linux to replace Windows file servers. Samba's creator, Andrew Tridgell, talks about the origins of Samba and the future of Open Source.
Andrew Tridgell embodies everything that’s great about Australia. Friendly, unpretentious, and, above all, dauntless, he has spent the last 10 years leading the Samba team in its international development effort to reverse-engineer Microsoft’s ubiquitous SMB (Server Message Block) filesharing protocol. This project, which initially was nothing more than an idle attempt to make a Sun, Digital Equipment Corp. (DEC), and Windows machine talk to each other, has turned Linux into one of the best fileservers for Windows clients. Though Tridgell (who recently jumped ship from Linuxcare to work at VA Linux Systems) had a cold and was jetlagged after spending the previous week on a trade show floor explaining how he network-enabled Tivo in his spare time, he graciously agreed to be interviewed by Linux Magazine’s Robert McMillan.
|PHOTOS © GARY WAGNER |
Linux Magazine: The most interesting thing about Samba is the amount of detective work that goes into trying to reverse engineer SMB.
AndrewTridgell: Yeah, I love it. Whenever we find a spec for something, a little part of me is disappointed. I know we’ll get more work done and produce better code with the spec, but in some ways it’s more fun discovering things.
LM: Has that always been the case with you?
AT: My parents would say so. I don’t remember doing a lot of that as a child, but there’s this running joke in the family about me and clocks, trains, and radios. I used to get these little electric train sets and pull them all to pieces so that none of them worked. I rarely got them back together again. I’m not much good at physical things. I used to find clocks in the dump — old style mechanical clocks — and try to get them working again. I had very little success.
LM: When you started working on Samba, did you have any idea what a big deal it would become?
AT: I didn’t even know it supported Windows because I didn’t know it used the SMB protocol. I thought it was a Pathworks-specific proprietary DEC protocol. Pathworks was Digital’s big fileserver product. I thought a good way of wasting some time and avoiding my thesis would be to try and work out what the protocol was.
LM: Why did you stick with Samba? Was it because of the technical challenges or because more and more people started to use it?
AT: People didn’t start using it for a couple of years, and there was a period of twelve to eighteen months when I didn’t do any work on it. I posted a note on the Web site saying, “If anyone wants to take over any of this project, will they please contact me?”
Occasionally people would e-mail me and say, “Somebody’s discussing your NBServer [Samba's original name -Ed ] product over here,” and I pretty much ignored it. People would say, “It works with Windows.” I didn’t believe them. I thought they were on drugs or something. It couldn’t work because it was a proprietary Pathworks protocol.
Then I got a home LAN. And I remembered that somebody had said my software would work with Windows, so I said, “Why not?” I didn’t have a copy of it, so I actually downloaded my own code. Luckily, it was still on the FTP site. I tried it, and lo and behold, it actually worked. I was a bit stunned and thought, “Maybe these people weren’t on drugs after all.”
Then I started getting grandiose. I announced the “NetBIOS for Unix Project.” I didn’t know I was actually working on SMB, so I got the name wrong. I’ve got the announcement somewhere. It’s this great grandiose announcement of grand plans to do all sorts of amazing things. When I read it now, it’s embarrassing how inaccurate some of it is.
LM: You didn’t initially release Samba under the GPL (GNU General Public License), did you?
AT: The very first license was basically, “You may use this for anything you like. If you want to use it for commercial purposes, please contact me.” It was a really common type of license. But that was for NBServer. That was before I’d heard of Linux. By the time the name was changed to Samba, it was GPLed.
LM: What convinced you to use the GPL?
AT: Well, embarrassingly enough, the reason I changed was my awe of Linux. I didn’t properly understand the GPL at the time. Now that I understand the GPL, I love it. I am so glad I put it under the GPL. I think it was most definitely the right license to put it under and I think it was one of the best aspects of doing the whole project. But that wasn’t the reason I chose it. The reason I chose it was because I was becoming part of the Linux community, and within the community, the GPL was it.
Why Linux Worked
LM: That was an interesting time. Do you ever wonder what would have happened if Unix had been open sourced in the early 1990s?
AT: If Unix had been open sourced at that stage, we wouldn’t have ended up with anything like what we have with Linux, because Unix was big by the time Linus came around. The Linux source code was tiny. It was small enough that you could read it. It was small enough that you could actually get your hands on it and was buggy enough that you could contribute.
I’d find bugs in it and within a few weeks I’d have sent in the patches and they’d be accepted. If you’d been using the commercial Unix at the time, it would have taken a long, long time to fix these bugs. And the community spirit wouldn’t have grown quite as much; that’s offset a bit by what happened with the BSD [Berkeley Software Distribution Unix -Ed.] world, but I think the fact that anyone could participate set the tone for what happened in the Linux community.
LM: And there were so many interesting jobs to do. Linux hackers could take Unix as the roadmap and see what needed to get done.
AT: Exactly. There were all these devices to support and that sort of thing. In those days, Linus was a lot more accepting of changes. He became stricter and stricter, which is a good thing. He really needs to be strict these days; but, it used to be much easier to get something in, and because it was easy to get something in, it was easy to become part of the kernel community, which is really the sexy thing to work on.
LM: If the kernel is the sexy part of Linux, where is the real innovation coming from? What are the really innovative open source projects you’ve seen?
AT: There are a lot less new things happening than the press releases would have you think. There are some innovative things. I’ve done one innovative thing — rsync [a fast file transfer program -Ed.]. That was a new type of algorithm — a new way of doing things. There is a lot of innovative stuff in Linux, like the Tux2 filesystem. I consider that really innovative. A lot of the stuff that Stephen Tweedie and Dave Miller have been doing on the TCP stack is really interesting work.
LM: But do you think that the open source community can really lay claim to being the heartbeat of innovation for computer technology, or do you think the really innovative work is happening in research labs and academia?
AT: In methods of getting programming done, in ways groups of programmers work together, yes, it’s extremely innovative. The actual code…some of it is really innovative; most of it isn’t. One of the things I like about the Linux community is that we’re willing to choose the best solution to a problem. We don’t go to the extreme of, “Not invented here, therefore we can’t use it.” And we don’t go to the other extreme of saying, “Okay, we’ll only use the one out of the textbook.” We’re willing to try and fail and try again. It is a meritocracy where the best technology wins nearly all the time, and that’s quite unusual. Personalities have a lot less to do with technical decisions in the Linux community, and that’s a really, really good thing.
LM: What about GNOME’s object model, Bonobo? Is that innovative?
AT: Bonobo is basically a clone of the Microsoft object-sharing model. What impresses me about Bonobo and the whole GNOME project is the code quality. They’re extremely strict on coding standards, and that’s relatively unusual, particularly for a project in its early days. Projects normally start off as crap code. Samba was crap code when it started. You can download it and look at it. It was a joke.
LM: When did it stop being crap code, by the way?
AT: In some ways it still is, but there was a vast improvement in the 2.0 rewrite. Samba is a lot better than some other software. It is far more security-conscious than most, and far more tested, but the structure of individual modules of Samba leaves a lot to be desired. I’m highly impressed by the care that’s being taken in GNOME. One of the main jobs of the code’s maintainer is to reject bad code, and that’s hard. If somebody sends you a patch that works, but it’s badly coded, you have two choices — re-code it yourself or reject it. That’s hard to do because it offends people.
LM: So do you accept more of that kind of questionable code than you reject or vice versa?
AT: Oh, we reject more code than we accept. We reject a lot of code. Very few things go in without being rewritten to some extent. It’s fantastic when somebody sends you a patch and you look at it and go, “Wow, that’s better than I could have done.” It’s rare. It happens maybe once a year. But my standards are lower than Linus’s and Bonobo’s. Basically, it’s because I don’t have as much time and energy as those guys. It takes a hell of a lot of time and energy to reject stuff. You end up exchanging dozens of e-mails, where you say, “That’s bad because of this and this,” and they say, “Oh no, this programming style is great.” Then you have got to teach them a couple of years of computer science so they can understand why it’s crap.
The End of SMB
LM: How long do you think you’ll be doing Samba?
AT: I think SMB will go away eventually, due to one of two reasons. I’d love it to be that nobody uses Windows anymore, but that’s unlikely. The other reason would be that Microsoft drops SMB, which is a distinct possibility. It’s a massive maintenance hurdle.
The protocol is so incredibly convoluted and bloated and badly designed — there are ten ways of doing everything. You end up with these massive exchanges going on the wire between Windows 95 and NT, just because they are trying to work out exactly which sets of bugs the other guy has so they can figure out how to actually stat a file or find its size or date or something. And we’ve found from talking to people who work at Microsoft how much of a headache it is to maintain the damned thing and keep it secure. So, they’ve got to be thinking of dropping it at some stage.
LM: If that happens, what will become of Samba? Will it support some new protocol?
AT: It depends how related it is. If Microsoft does a completely new protocol, it would make far more sense to have a second package. Whether I do that package or not depends on how stupid I feel at the time.
LM: How stupid do you feel right now?
AT: I’m enjoying hacking on a bunch of other stuff. I’ve actually had a couple of months off from Samba. I’ve been working on other projects and I’ve only done the occasional commit to Samba in the last couple of months.
LM: Did you just get tired of working on the project?
AT: No, I do this periodically. During my PhD, I launched about 15 new open source projects — one of which was Samba — and some of them are still around and widely used. I’m still doing that. I’ve launched four or five open source projects in the last year. When I do that, I tend to pour all my energy into the project — you know, staying up until 3:00 AM working frantically. I get a high out of coding.
LM: Are there any really significant tasks that you’ve been thinking about undertaking?
AT: Yes, there are a few that I’ve talked about for a while. I want to write a network filesystem where the core idea is to combine leases, which is a really good feature of SMB; it’s a terrible implementation, but the concept is fantastic. Plus there’s the rsync algorithm. The two mesh together beautifully to potentially make an incredibly good WAN (Wide Area Network) filesystem. The closest thing to this going on at the moment is Intermezzo, Peter Braam’s stuff.
Open Source: The Next Generation
LM: Do you think all the interesting jobs in Linux are already taken?
AT: Well, not entirely. The barrier to entry is much, much higher. The amount you have to know and the tolerance of newbies has changed. The patches that I sent to Linus all those years ago would be rejected now, for good reason. They were accepted then. So the standards have gone way up, and you have to be a hell of a lot better a programmer now.
LM: But do you worry that the next Linus Torvalds might not get involved in an open source project today because his first tentative submissions would simply be ignored?
AT: I do worry about that. I think a lot of the basis of the open source movement comes from procrastinating students, and now that the standards have been raised so much in the open source community, those students are far less likely to release stuff. Some of them will throw it up on SourceForge, but I’m sure there is a group of them who might feel intimidated by the quality and bulk of code out there and think, “No one will want my little thing.”
A year or so ago, when I first left academia to join a Linux company, I was quite worried about this, and I had all these grandiose plans to create a prize that would bribe students to actually push code out. There would probably be a large pile of junky entries, but one or two of those could wind up being the next Apache.
But now I am seeing a lot of projects being done. In part because of tools like Glade, which allow the easy creation of small but decent apps, the existence of far better documentation, and the adoption of Linux at universities as a teaching tool. I think that combination might offset some of my fears. Or, it might just be that I’m trying to justify why I haven’t gone ahead with my own plan.
LM: One of the criticisms of Linux companies these days is that they have yet to prove that they’re really able to sell Linux to the enterprise. Does that concern you?
AT: No matter how hard it is to make money out of Linux, it’s much harder to compete against it. If you’re a company that is trying to compete directly against a free product, you’re in trouble. Because of that, it is a hard business model to work out. And I suspect that overall the IT industry will have less money, because the total of the costs applied to businesses using it will be much, much less.
So I suspect that open source will have a negative impact on the total amount of money flowing through the IT industry, and that’s going to affect everyone.
LM: Do you think that might ultimately be the biggest threat that open source poses to companies like Sun Microsystems and Hewlett-Packard? Not that any one technology will render a core business obsolete, but that the whole world will suddenly move toward this smaller margin game?
AT: I’m not sure, but I think on a macroscopic scale that reduction in revenues will be a significant factor. You can talk about the support models and, okay, maybe support will increase, but a lot of people are capable of doing their own support or are able to shop around for it. There will be more competition in support because anyone can do it — which is great for consumers, but more competition implies cheaper prices, which means that total revenues become lower.
LM: How do you feel when you see companies making money off of your software?
AT: Do you mean, am I jealous or resentful? I am delighted. Do I think if I’d sold it, I could have made a fortune? If I had charged one dollar for Samba, it would have never been successful. The way I was doing stuff was not about money, and I am not at all resentful of companies that have made money from Samba. At the same time, if they all went away, we would still have a great community to work on stuff. I think of the last year or two as being the biggest private investment in public works in decades.
Robert McMillan is editor at large with Linux Magazine. He can be reached at email@example.com.