Implementing CIFS 199
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.
But who likes CIFS? (Score:3, Funny)
Re:But who likes CIFS? (Score:3, Insightful)
It's all very well saying 'let it die', but just what would you replace it with?
Re:But who likes CIFS? (Score:4, Funny)
Re:But who likes CIFS? (Score:5, Interesting)
Re:But who likes CIFS? (Score:3, Informative)
Re:But who likes CIFS? (Score:3, Informative)
Re:But who likes CIFS? (Score:5, Informative)
Download Windows Services for UNIX [microsoft.com] for free from Microsoft, it contains a NFS client and server. I use this on my home network, no more Samba and its confusing config file (even with SWAT it is a nightmare). You can even choose to just install the nfs services and continue to use Cygwin for the rest of your Unix-on-Windows goodness.
What about patching? (Score:4, Insightful)
There will be bugs in the M$ nfs server code. Will Windows Update patch them?
The patch against SQL Slammer had been out for six months before Slammer took down South Korea and invaded a nuclear power plant. I don't want to install anything that requires special patching procedures.
Re:What about patching? (Score:2)
Of course, auto apply/reboot is not acceptable - but Windows Update ought to handle patches for all M$ products. It ought to automatically download patches for any installed products, and prompt to apply. RedHat up2date certainly could handle this.
M$ was roundly criticised for "hiding" the Slammer patch so well. Why install software that a) will not be patched and b) is sure to be abused?
Re:What about patching? (Score:2)
I'm an Oracle man myself, so I don't know beans about SQL Server. However, I would think that these [theregister.co.uk] people would.
Re:But who likes CIFS? (Score:2)
Re:But who likes CIFS? (Score:2)
While I certainly agree that setting up the advanced features of Samba (Samba as Domain controller) can be a little hairy for the uninitiated, if you're doing a simple implementation it isn't hard at all assuming you understand the concept of files shares in Windows and how to abstract it using text instead of the little hand.
In fact, samba was the first application I installed and configured on Linux and I am just as happy wi
Re:But who likes CIFS? (Score:2)
Re:But who likes CIFS? (Score:2)
Re:But who likes CIFS? (Score:2)
Wrongo! Just like Win2k (which finally met OS/2's standards from 1994), Win2k and WinXP are now modern OS's supporting NFS with the free Unix Services for Windows Addon [microsoft.com] (which of course is appropriately titled 'Windows Services for Unix')
Re:But who likes CIFS? (Score:3, Insightful)
Linus Torvalds himself said "Linux's NFS 'sucks rocks.'"
It's not as if it's better than smb or anything
Wow, you're right on the money!
Re:But who likes CIFS? (Score:2)
NFS isn't even good for Unix file sharing. Why would anyone want to use it on Windows?
NFS is popular on Unix for exactly one reason: Sun gave it away for free, whereas AT&T wanted money for RFS (which, unlike NFS, actually supported Unix file system semantics).
Re:But who likes CIFS? (Score:3, Informative)
http://www.microsoft.com/windows/sfu
It has sounded very promising. Still on the look into list (I am actually more going to be using the auth sharing features to have our unix boxes publish password changes to AD).
I will say I'm not the biggest NFS fan -- mainly becuase of portmap (for some of the reasons, see Steven TCP/IP Illustrated Vol I comments in the dicussion on NFS) --
WS-Discovery (Score:2)
Re:But who likes CIFS? (Score:2)
Re:But who likes CIFS? (Score:1)
Re:But who likes CIFS? (Score:4, Insightful)
Exactly the point I was trying to make above.
As much as the slashdot crowd would probably hate to admit that Microsoft got something right, SMB/CIFS is the 'killer app' for sharing files and printers over a LAN.
If there's another application that does the same job as SMB/CIFS and is:
Re:But who likes CIFS? (Score:1)
Re:But who likes CIFS? (Score:2, Interesting)
Just wondering (Score:2)
Re:Just wondering (Score:1)
Re:But who likes CIFS? (Score:5, Insightful)
Re:But who likes CIFS? (Score:2)
Samba in Linux vs Windows (Score:4, Interesting)
Re:Samba in Linux vs Windows (Score:2, Funny)
Re:Samba in Linux vs Windows (Score:1, Informative)
Re:Samba in Linux vs Windows (Score:1, Funny)
Considering that the Windows machines are running upwards of 50 instances of netsky.d, this just shows the robustness of Windows Compared to Linux (which can't even run netsky.a)
Windows XP network problems: Underlying sloppiness (Score:3, Informative)
MOD PARENT UP!
I notice that, too. Also, Windows XP machines newly added to a Windows 98 peer-to-peer network have trouble seeing the Win 98 machines. Posting to official Microsoft newsgroups provides no answers to this quirky behavior. Of course, that may be because Chang, Li, Wu, Zhang and others have been told not to discuss it.
I put some of the fixes for quirkiness together so that I could ask Microsoft if there was anything I am missing: Possible Solutions to Slow Network Browsing or Inability t [hevanet.com]
Re:Windows XP network problems: Underlying sloppin (Score:4, Informative)
Otherwise, eventually one of the 9x machines with think it's won the browse election even when that should be impossible. This screws the network neighborhood. Very longstanding bug going back to WfW. You can check the state of your network using the "browstat" tool that comes with the resource kit.
(Also, yer correct that NetBIOS or IPX will be faster than NBT for whatever reason. Make sure to adjust the "binding order" so that these protocols come ahead of TCP/IP. Can't recall exactly how to do this, sorry.)
This might not be realistic for a home net, but install WINS/DHCP if possible and put the clients into p-mode. (no NetBIOS broadcasts)
Re:Windows XP network problems: Underlying sloppin (Score:2)
I agree it is unfortunate... (Score:2)
I certainly agree that it is unfortunate that installing NetBEUI or IPX sometimes solves Windows network problems. However, it is a solution that sometimes works, for whatever reason, and it is a solution that is sometimes suggested by Microsoft staff. There are some failures that are not easy to troubleshoot, so we just have to go with a kluge solution.
In my experience, quirky behavior is generally caused by sloppy code; I'm only guessing when I say that is true in this case. I have not seen any Micros
No, please don't do that! (Score:2, Informative)
If you use NetBEUI, then use *only* NetBEUI.
If you use NWLINK, then use *only* NWLINK.
etc.
See the heading "Prolific Protocol Bindings" in Section 3.7.1 [ubiqx.org] of the online version of the book.
O'Reilly Safari (Score:5, Informative)
Network Neighborhood (Score:4, Interesting)
The post suggests that this book tells the answer, but do any enlightened here know some typical causes of the ridiculously poor performance?
-fren
Re:Network Neighborhood (Score:5, Informative)
If you add a samba server and tell it to run WINS (with wins=yes), and then tell EVERY windows machine that the wins server is at (IP address of Samba Server), things usually speed up considerably.
Also, there is (I believe), a C:\winnt\system32\drivers\etc\lmhosts file that works as a hosts file for WINS).
Re:Network Neighborhood (Score:1)
Re:Network Neighborhood (Score:3, Informative)
WINS is dying.
Re:Network Neighborhood (Score:4, Informative)
MS is trying to kill it off, but since 9x and NT boxes don't understand DNS for anything but internet name resolution, its demise is still a long way off.
Re:Network Neighborhood (Score:3, Informative)
With 2k/2003 MS took a HUGE step back in networking. In a technical sense AD in better in every single way. But in terms of ditching old things like WINS its a total failure. Back in the old days networking
Re:Network Neighborhood (Score:3, Informative)
WINS is only really dead in an all Win2k enviroment, and then only if you turn it off.
Re:Network Neighborhood (Score:1)
Most implementations will be in written in C... (Score:3, Insightful)
Obviously there'd be a speed hit, but it seems like it'd be a lot faster to develop in, and time-critical bits could be written in C and accessed via Ruby/DL [ttsky.net] or whatever.
Ditto for Python, of course... same sort of advantages/issues.
Re:Most implementations will be in written in C... (Score:4, Insightful)
Now Java or C# is a real option. Microsofts next implementation will be written in C# as a matter of fact.
Re:Most implementations will be in written in C... (Score:1, Offtopic)
Oh, the usual scripting language reasons: easier to program, easier to debug, reduces dangers of stack smashing and suchlike... all that.
> Ruby is an esoteric language that
> hardly anyone uses and less people will
> use as the years goes on
Ruby is a general purpose language that lots of people use and it will continue to grow in popularity.
There, now we've both made assertions. So where do we go from here?
Re:Most implementations will be in written in C... (Score:2, Insightful)
The same principles apply to Eiffel, et al.
Re:Most implementations will be in written in C... (Score:3, Insightful)
Re:Most implementations will be in written in C... (Score:2)
Personally, I prefer programming in Perl - partly due to familiarity and the amazing CPAN (truly creates a very high level language where the primitives are thi
My Take (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.
Book is open source as well (Score:4, Informative)
Re:Book is open source as well (Score:2)
I see it's published under the Open Publication License but it appears I cannot download it and read it on my Palm on the train -- it's a web-only affair. Sure, I could spider the site but I haven't done that yet; I prefer entire books (I use MobiPocket).
At any rate, enjoy the link!
MacOSX Samba (Score:3, Interesting)
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.
Re:MacOSX Samba (Score:4, Informative)
Re:MacOSX Samba (Score:2)
Re:MacOSX Samba (Score:2)
When pulling/pushing (making requests) with a Win2k workstation: narry a problem. Works much better than a setup with windows windows interacting.
When pulling/pushing (making requests) with the linux system on any of the workstations: quite often the Windows machine will choke
Code examples? (Score:3, Interesting)
Re:Code examples? (Score:3, Informative)
jCIFS is one example, Samba is another.
One code example is getting a browse list from another networked machine.
Re:Code examples? (Score:2)
Re:Code examples? (Score:2)
But, yeah, if you don't know what you'd do with the information, it probably won't be very useful.
But if you want to work on the Samba project, for example, it'll be very useful.
Re:Code examples? (Score:2)
Re:Code examples? (Score:2)
However, a Samba implementer can gain knowledge from it and begin to understand in more depth what the level 10 error logs are saying, which can help increase time-to-solve on new issues. That's where I place the value of this book. Helps a g
Re:Code examples? (Score:2)
overgeneralisation (Score:2, Informative)
Except for the people whose Windows boxes weren't hooked up to a network, or who instead used Netware for file/print sharing, or whose only loaded network components were TCP/IP and the adapter device. And even though it's installed by default, that doesn't mean everybody who failed to deinstall it actually used it.
This book is under an Open Source license (Score:5, Informative)
Thanks
Bruce
Re:This book is under an Open Source license (Score:2, Insightful)
It would be interesting to hear about how well the books sell after being made freely available on the net. My guess is not very well, but I am a fervent anti-open source guy. Please let us know.
Thanks
Re:This book is under an Open Source license (Score:5, Informative)
But the fact is that technical book authors are generally writing for some other reason than to get direct income from the book. Most do it for the intangibles - promotion of their own careers or projects they support, etc.
What I like about this series is that the books need never die, since anyone can edit and print them. They don't get into that state where the publisher sells a few hundred copies a year on order and doesn't revert the rights to the author for years. Authors hate that.
But we are careful with timing. We make sure the "pipeline" between the publisher and bookstores is full before the electronic copy is available. So, clone publishers don't have much incentive, as the stores have already filled their orders.
I have to admit that this would not work as well if people liked to curl up with e-books. If that day ever comes, we'll change the strategy, but the end product will still be Open Source books.
If you are very anti-open-source, it's probably because you don't yet understand the ways that Open Source works well for business and business people. I have a paper on the economic basis of Open Source that I'm working on, that you will probably find of interest. It should be out in a week or two.
Thanks
Bruce
Re:This book is under an Open Source license (Score:2, Interesting)
Re:This book is under an Open Source license (Score:5, Insightful)
Thanks
Bruce
Think about this one facet... (Score:2)
Now the business has to pay for all this extra coding, coding that anyone can do - then they discover outsourcing.
Had you been building things the business needed on top of robust OS packages, there would be no need to outsource you as productivity would
Re:Think about this one facet... (Score:2)
Of course you have pointed out the biggest failing (from my perspective) of OSS economics: less code needs to be written since there is code out there available for zero cost. This means less engineers (inhouse or outsourced) are needed. Thats great for the corporations, but bad for you and I.
Re:Think about this one facet... (Score:2)
Big Company X that used to have 50 engineers suddenly only needs 40 because of OSS, so they let 10 go. But Little Company Y wants to do a project they think will require 20 engineers, but can't afford to hire 20. Some OSS tool is discovered that will help with the project, making it feasible to do with only 15 engineers. So company Y, rather than bagging the project and hiring 0 engineers, hires 15. Net change for the "industry" is +5, and now Small Company Y is able to
Re:Think about this one facet... (Score:2)
I think you are totally missing the point. Even with some free software available, it will still be in companies' best interests to get the code they want, written right now, by paying someone to write it.
The OP
Code needed is infinite, frameworks are not (Score:2)
What you are failing to realize is that corporations have an almost infinite thirst for code to be produced. The constraint? There are only so many developers to go around, and people to help explain what the develo
Re:Code needed is infinite, frameworks are not (Score:2)
Re:This book is under an Open Source license (Score:2, Interesting)
Re:This book is under an Open Source license (Score:3, Informative)
Thanks
Bruce
How come you have time to shill for your books... (Score:2, Funny)
Re:How come you have time to shill for your books. (Score:5, Funny)
Bruce
Re:Sure it has never been posted (Score:3, Funny)
Thanks
Bruce
Apprentice Hell?... (Score:1)
M$ hides other half of knowledge (Score:4, Funny)
Re:M$ hides other half of knowledge (Score:4, Informative)
He finally put a sniffer on the network and analyzed the traffic between a Windows server, a Windows workstation and a workstation running our implementation. Turns out that the RFC instructs implementers to NEVER place anything other than zero into a certain location (LONGINT). However, that field was almost always non-zero when it was passed between the two Windows machines.
The engineer put the length of the data transfer in bytes into the field and it has worked ever since.
That incident cemented my negative attitude toward Microsoft. They don't try to win by looking good; they try to win by making everyone else look bad--even if that includes themselves. If you're uncertain about something that Microsoft is doing, use that premise as a reference point and you can't go wrong.
This is a great book for implementors (Score:4, Interesting)
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?
Re:This is a great book for implementors (Score:2, Informative)
"Network Neighborhood" - what's that? (Score:2)
Was "Network Neighborhood" too technical. Of course the computers might not be physically near you.
Re:"Network Neighborhood" - what's that? (Score:2)
Re:"Network Neighborhood" - what's that? (Score:2)
The "my" part was apparently intended to match the hard-to-refer-to-over-the-phone label "My Computer" ("OK, now double-click on your 'My Computer'...") The "network places" part can only be explained by an attempt to stick to phonetically-spelled words, no matter how odd a phrase that required.
Why CIFS/Samba at all? (Score:2)
I've heard of Linux-only networks that used Samba, and for the life of my I can't figure out why.
Re:Why CIFS/Samba at all? (Score:4, Informative)
So when I log into my friend's machine with his password, I'd be able to access my files on my machine as long as our UID is the same. Big trouble.
CIFS, on the other hand, has authentication, so I can put my SAMBA server on the wide-open internet and be somewhat sure that someone would need my password to get my files. Try that with NFS and you'd be owned (or fileless) in minutes.
Granted, there ARE ways to lock NFS down, and there are good arguments that maybe the modern file server SHOULDN'T authenticate, it should rely on another layer to handle that, but until it's easy as pie to get a Kerberos/PAM/NFS system working (no small task today), I'll stick to CIFS.
Re:Why CIFS/Samba at all? (Score:2)
Re:Why CIFS/Samba at all? (Score:2)
Samba is a snappy name but (Score:4, Funny)
I mean, it would give the right impression about the Windows native file sharing protocol, and would be great for PHB's.
PHB: "Did you get that Samba thingy working on the server?"
IT Guy: "No, the server has CIFiliS"
PHB: "Oh. I'm sorry. You should run one of those virus checker things."
-- Len
Not Andrew Tridgell (Score:2, Informative)
He put on a pretense of being some other authoritatian figure ("John Nagle") in some other article (and got modded into oblivion there)
http://slashdot.org/comments.pl?sid=91307&cid=786
Knock him down.
Re:Not Andrew Tridgell (Score:1)
-dk
Re:Network Neighborhood.... (Score:2)
RIP DEC.
Troll? (Score:2)