Slashdot Mirror


Implementing CIFS

Bombcar writes "Anyone who has used Microsoft products in the last ten years has used the SMB protocol (now known as CIFS). Some have become experts in the usage of Windows file sharing, Samba, and more. We know that there can be a 15 minute delay before new machines appear in 'Network Neighborhood'. We've read the Official Samba 3 book, and follow the Samba mailing list once in a while, perhaps even answering questions. But there is a limit to the knowledge given by these sources." Read on for Bombcar's review of Implementing CIFS from Prentice Hall. Implementing CIFS author Christopher R. Hertel pages 642 publisher Prentice Hall rating 8 of 10 reviewer Tom Dickson ISBN 013047116X summary In-depth (but not too deep) coverage of the CIFS/SMB protocol

It is one thing to be able to use Samba, Windows, and the Common Internet File System (CIFS) protocol. It is another thing entirely to understand CIFS with sufficient depth to begin coding using it. This is where Christopher Hertel's Implementing CIFS begins.

This thick book (over 600 pages) begins with a history of NetBIOS in the DOS era. It quickly progresses to NetBIOS over TCP/IP (which evolved into the current CIFS protocol). Hertel documents the beginnings of quirks that will last throughout the life of the protocol. There is an RFC that was proposed in 1987, but many vendors have added extensions to this. (It might surprise you to learn that Samba has added extensions, which are covered in Chapter 24).

After the basic overview, he quickly dives into real coding of an actual (though simple) implementation. This will be his style for the rest of the book (except for humorous asides now and then). An aspect of the protocol, such as Name Resolution, will be explained in some detail, and then expounded in actual code (and in a few cases pseudocode).

The detail is good but not overwhelming. Some people (with names like Jerry Carter or Andrew Tridgell) will want more depth than this book provides, but for with a protocol as varied as CIFS, choices have to be made. As the Samba website mentions, this book is written in "Geekish." The book covers aspects of older and newer SMB/CIFS implementations, including a description of the NTLM2 challenge/auth system.

One thing that should be noted is that the code examples work, but as the author points out, they usually have little or no error handling. This is common to many books, but it is something to remember.

Now, should you get this book? If you're just a user, you probably don't need it. But if you've ever wished you could understand the Samba technical mailing list, or wanted to know why it takes up to 15 minutes to see a new machine, then you'll enjoy this book. If you want to utilize CIFS in any manner (even if just implementing Samba for clients), I'd highly recommend reading this. It will help you to understand what is going on on your network, even if you're not writing the code yourself. And if you want to be a Samba coder, it is required reading.

What didn't I like? I first read the book in an airport, and found that it relies heavily on having access to a computer. I would have preferred more explanations of code fragments than was given. However, this is a minor issue; most people who are implementing CIFS will be using a computer! I was also left with a desire for more information, but the large Appendix D along with many sources recommended provide for further study.

As a bonus, Appendix A tells you how to make a good cup of Earl Grey tea! That alone to some would be worth the price of admission.

You can purchase Implementing CIFS from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

12 of 199 comments (clear)

  1. Samba in Linux vs Windows by mauriatm · · Score: 4, Interesting

    Maybe a bit offtopic, but on my network I notice that Windows machines in the Network Neighborhood are slower to access than samba shares on linux machines. Go figure.

  2. Network Neighborhood by frenetic3 · · Score: 3, Interesting

    I've always wondered why on some machines it takes so damn long to browse the network on everything from 95 to XP -- most of the time I simply whimper and mumble incoherently waiting for it to eventually finish, but have never been able to diagnose the problem. Over the 'net it's even more agonizingly slow -- minute-long delays when pings are 30ms or less.

    The post suggests that this book tells the answer, but do any enlightened here know some typical causes of the ridiculously poor performance?

    -fren

    --
    "Where are we going, and why am I in this handbasket?"
  3. My Take by 110010001000 · · Score: 5, Interesting


    This book is simply the best reference available for CIFS. I only say that because I have spent $$$ getting everything on the subject I can. With the recent changes in Microsoft licensing every sensible IT professional should be exploring alternatives. A SAMBA server is a great alternative. This book is all you need to go from knowing next to nothing to knowing enough to impress your geeky Network Admin friends.

    This book is well written, clear and expansive. I didn't read it cover to cover (not at first anyway) I found pieces I needed, applied it, digested it, reviewed it and then went on to the next morsel I needed. If I missed something it was easy to find. By the way, it works with Win2K and WinXP neither of which is well documented by anyone anywhere.

  4. MacOSX Samba by selderrr · · Score: 2, Interesting

    what never ceases to amaze me is that my 400Mhz iMac can pull files faster from my AMD 1800xp than my P4@3GHz can...

    Both PCs run XP pro, the iMac runs panther. Go figure.

    As far as those 15 minutes concern, I got one solution for ya : rende-vous/zeroconf. Since iTunes/win can find macs using this protocol, a win port is allready done, so we can only hope MS sees the light and uses it for network scanning one day.

  5. Code examples? by gpinzone · · Score: 2, Interesting

    Could someone please explain what kind of code examples the book covers? I thought the whole point of modern OSes was to "abstract" everything for the user, including the method of networking.

  6. Re:But who likes CIFS? by Kethinov · · Score: 4, Interesting

    Replace it with nfs unix file sharing maybe? Oh I forgot. We're talking about Windows here. God forbid Microsoft should support nfs. It's not as if it's better than smb or anything and it's not as if Mac and the rest of the Unix world already support it

    --
    You're right, I wouldn't steal a car. But if it were possible, I sure as hell would download one!
  7. This is a great book for implementors by dslamguy · · Score: 4, Interesting
    I read this book on Chris's web site even before it was published (yes, I have bought a copy) and it was an invaluable guide for me as I wrote a CIFS implementation. The book is fairly easy to read, even though it is highly technical. What it does cover, it covers extremely well.

    However, I did need the sniffer method of reverse engineering for much of what the book did not cover. One complaint I had is that I needed more information on the higher level protocols such as LANMAN for handling printer queues and this information was either non-existent or schetchy in the book. Although the book is long, much of it is taken up by a CIFS document which you could download for free on the internet. So I do think that the description part of the book could be more extensive (Sorry Chris). Maybe in the next revision.

    You might ask why I was implementing CIFS from scratch? Its a valid question, since Samba would/should be anyone's implementation of choice. I did it because we are developing a printer which is not GPL (and unfortunately not based on Linux). We are not using any GPL code in it, and so this was really the only choice besides buying it from someone (but where's the fun in that). I am planning on releasing this code under a BSD license, but it's not ready for prime time yet and I need to get back to it (in a couple of months).

    So this was a really good book for CIFS implementors, but how many of those could there be?

  8. Re:This book is under an Open Source license by 110010001000 · · Score: 2, Interesting

    I am interested in your paper on the economics of OS. I am personally convinced that the economics of Open Source are damaging to the software industry and to the software developer. Perhaps your paper will give me insight into this. I hope it will be available via your website.

  9. Re:This book is under an Open Source license by LetterJ · · Score: 2, Interesting

    Is there a timeline for the digital versions of "Rapid Application Development with Mozilla" and "C++ GUI Programming with Qt 3"? I noticed that neither has links for the digital downloads. Just curious if it's because those are new titles and it just hasn't happened yet. Not that it matters much, my copy of RAD with Mozilla should be delivered today and I can enjoy it on paper. I would just love to have a copy on my Zaurus instead of having to lug the paper copy around.

  10. Re:But who likes CIFS? by MCZapf · · Score: 2, Interesting

    NFSv4 looks promising to me. Of coure, that's what I thought two years ago as well. In any case, the goal for NFSv4 seems to be to take the best of NFS and AFS (and probably some other systems) and combine them.

  11. Re:But who likes CIFS? by Anonymous Coward · · Score: 1, Interesting

    They didn't get anything right. It's a horrible protocol. Given that, the Samba team are the ones who got it as right as was possible. Which has turned out to be a mixed blessing in that SMB is now more used as a result. The world is pretty much aching for a well-designed, open, cross-platform network filesystem protocol. SMB is a stopgap until it arrives. And "Common Internet File System" is a laughable designation - particularly given how poorly suited SMB really is to use on the wider Internet.

  12. Re:What to Replace CIFS With? by Anonymous Coward · · Score: 1, Interesting

    Maybe WebDAV. It's part of IE5+, and it's an open standard. In IE go File|Open|As Web Folder to open one and then it's available like a windows share. The main problem is that you can't map drives to it without 3rd party addons (WebDrive, etc.), but it's very fast.