Implementing CIFS
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.
or wanted to know why it takes up to 15 minutes to see a new machine, then you'll enjoy this book
You insensitive clod, that 15 minutes is allocated to my coffee time!
I know this is a difficult topic, but...Can't we just let CIFS to die, already?Alright, barring that, this really is a useful book. I wish I hadn't already learned it in the usual too-much-caffeine-for-rational-thought method.
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.
Linux Resources
And best of all it's available on O'Reilly's Safari service.
I didn't really gain any practical knowldge from this book: I'd say that it would be best read by programmers wishing to understand how to implement an alternative. This book really show why SMB blows so bad
Can I be a Luddite too?
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?"
what to replace it with for quick and dirty peer-to-peer. Not trying to troll, I genuinely don't know any alternatives. NFS isn't exactly easy to set up, and not much use when I go over to a friend's house to share files. Maybe FTP, but what if I want to share a printer? Plus you're still configuring an ftp server (I haven't done it yet, but it looks harder than adding a share to my smb.conf).
Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
...but is there any reason why a CIFS client (or server) couldn't be written in a higher level language like Ruby?
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 or whatever.
Ditto for Python, of course... same sort of advantages/issues.
The Army reading list
This guy isn't Andrew Tridgell.
1 607
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.
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.
The full text of the book is available online as well; I don't want to slashdot the site, but google for "implementing cifs".
Why the hell does windows leave ports 137-9 open all the time? There's nothing I *want* running on there, and I know that I'm not sharing any files/printers/etc. so why the hell is that left open?
Moreover, is there any way to close it? Thanks!
For years, developers and administrators have struggled to understand CIFS, Microsoft's poorly documented standard for Internet file sharing. Finally, there is an authoritative, cross-platform guide to CIFS capabilities and behavior. Implementing CIFS not only delivers the priceless knowledge of a Samba Team member dedicated to investigating the inner workings of CIFS, it also identifies and describes crucial specifications and supporting documents.
- Provides essential information for designing and debugging large Windows(R) and/or Samba networks
- Offers clear, in-depth introductions to Server Message Block (SMB), NetBIOS over TCP/IP (NBT), browser services, and authentication
- Drills down into the internals of CIFS, exposing its behavior on the wire and at the desktop?and its strange quirks
- Presents illustrative code examples throughout
- Reflects years of work reviewing obscure documentation, packet traces, and sourcecode
- Includes the SNIA CIFS Technical Reference
Implementing CIFS will be indispensable to every developer who wants to provide CIFS compatibility?and every administrator or security specialist who needs an in-depth understanding of how it really works.
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.
When will I end this grieving ? When will my future begin ?
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.
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.
http://alternatives.rzero.com/
And networking technologies have proven to be a letdown to what I was taught in early years of school.
I remember being told that we would have clusters of machines that form a large virtual machine that can multitask using the advantages of each machine. Then when processes needed it, the entire force of the machines could be used.
It was essentially a Mainframe with Beowulf clustering as the power behind the mainframe. I listened to so many unique possibilities with this, but now we have reality and I guess that in the 90's, we could not have guessed what we would be doing just 5-8 years later with computers.
I welcome books that give basics to how protocols evolved and how a person's vision of the future was modified over and over to come up with a new vision for the future to be modified again.
Standing on the edge of Tribal's PowWow, who would have guessed that the vision then would take 5 years to be rerealized again by MSN and Yahoo chats?
The neighborhood is not a neighborhood at all, but more like a grid where communication is not me walking next door to say hello, but me calling up my friend on the other side of town and attempting to move his house next to mine.
SP --- Off Topic and Fine with it.
So really, this is a good book for any network administrator who regularly troubleshoots his/her Windows-Linux-Etc hybrid network? I'd like a book that covers common issues between Samba and native Windows hosts, and issues based solely on individual platforms. I sometimes notice CIFS problems that are specific to a platform, and a book that covers the why and the fixes would be really cool IMHO.
Thanks
Bruce
Bruce Perens.
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 to Connect. Some of the problems mentioned are obviously not the fault of Windows XP directly, but the fact that they often occur seems sometimes to be the fault of underlying sloppiness in Windows OS code.
Acronis TrueImage is a Linux-based Windows XP backup utility that never has any problem seeing all machines on a Windows peer-to-peer network.
I've also never had problems with Linux itself.
WARNING: Do not click that link!
For a moment, I thought this title read "Bombcar's review of Implementing CIFS from Apprentice Hell.'
As good as Samba is... you know M$ is always hiding something about their network neighborhood protocol. It wouldn't surprise me if the code reads "If Samba wait 5 minutes"
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?
... but don't have time to answer the Slashdot interview questions from last July?
One thing that should be added to that document is that all the Win9x machines should have the ability to be a Master Browser disabled (so long as there's at least 1 NT machine on the net).
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)
NOT-a-disease???
Definetly not a cure either.
Bruce
Bruce Perens.
people might be interested in my poorly written howto on getting cifs and debian to talk: http://lists.slug.org.au/archives/slug/2003/11/msg 00386.html
This doesn't show whether or not you ever sent them to roblimo, but they never got posted. On the right column, there is Ask Bruce Perens, but no answers.
This is an excellent question. How about Web Services Dynamic Discovery? Sure, it's vaporware at this point and it was proposed by the Beast. OTOH it has a good chance to be an open standard and it isn't limited to file and print sharing.
You just need a simple download lots of people already use nfs in a windows setup
Didn't Microsoft rename "Network Neighborhood" to "Computers Near Me" in XP. That kills me?
Was "Network Neighborhood" too technical. Of course the computers might not be physically near you.
I can understand wanting to use Samba in networks with a bunch of Windows shares. And I realize that the MCSE certification process involved a form of lobotomization. But beyond it's Microsoft-ness, what advantage does CIFS have over NFS and other network filesystems?
I've heard of Linux-only networks that used Samba, and for the life of my I can't figure out why.
Don't blame me, I didn't vote for either of them!
Anyone who has used Microsoft products in the last ten years has used the SMB protocol (now known as CIFS)
Will SAMBA have to change its name to CIFILUS?
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.
Futurepower(R) is a KNOWN anti-MS TROLL. He is an idiot that knows little about Windows and trolls about how is sucks.
dude you have a 3 digit UID. shouldn't you be dead or something?
I was hoping that 3.0 would have been renamed as CIFiliS.
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
underlying sloppiness in Windows OS code
How would you know? Have you seen the code?
Let's pretend we have a Windows/Linux/BSD network. It needs to stay heterogenous, but backwards compatibility is not required... apps that 'only' run on >=Win2K or >=Linux2.6 are fine... heck, let's run the ragged edge and allow Beta software that requires >=2.7 or >=Longhorn.
Is there any well performing and stable replacements for CIFS that allows Windows, Linux, and BSD boxes to all share files to each other? Sharing that only works one way is allowed too (such as when there is a Linux client/server, but only a Windows client).
Everyone hates Samba... what's the alternative? I don't care if it's a compile-it-yourself distro on sourceforge, I wanna start USING the alternative so CIFS and Samba can die the ungraceful death their ancient cludge deserves. Currently, and I'm not joking, I'm using ftp2fs systems for shares with small files. They don't work for random access, so my larger files are literally duplicated on multiple machines. I irrationally refuse to run shares. I'm just tired of dealing with it.
So give me an alternative.
"I will trust Google to 'do no evil' until the founders no longer run it." Hello Alphabet.
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 Microsoft source code.
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 of the online version of the book.
Asshat.
Wow. I guess they are right when they say you don't need an expensive sysadmin to run windows networks!
The best way to support the US war effort is to continue buying American products.
As you go from company to company, if you are not using OS (and many companies are not to any great extent) you are writing the same stuff over and over. Sometimes you are even doing that at the same company, where many groups are writing identical code!!
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 be high. But with a department of people toiling away producing only a few things tangibly valuable to those outside the department - they are at risk.
Using OS as a base lets you write at a higher level, without the approvial you normally have to go through to get budgets approved. It can make your job more secure, if in the end you are more productive and spend less time writing the same thing a million other people have written.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Historically, Samba didn't even exist...
And that says just exactly how bad Linux NFS really is, that someone opted to write SAMBA rather than use it.
I wouldn't pay a lot to have a guy add 1 line to the group policy file, no. (Note: I did NT sysadmin back when it really was expensive :)
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
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 developers should be developing. At work I have well over one hundred projects I could be working on, but they can't because there's only so many developers.
The best case for a project would be a business owner, a guy to translate the business owners ideas into what we call Practical Thoughts, and three developers. If the developers can be efficient enough, I am convinced you could develop ANYTHING - that includes full CRM suites, reseller branded portal, Siebel style salesforce automation, anything you can imagine.
But instead because each company does not want to use OS, they need developers to research platforms to buy (because they need to consider how the spend money), or they decide to build themselves because it is cheaper/faster. So now you have all this overhead of people working on this, removed a bit from the concerns of the business. Enough removal, enough work that does not relate to the business at hand, and as I said outsourcing takes on the appearance of being just as efficient - because outsourcing is no more terribly wasteful than what the company is doing already. If you've worked at a company of any size, have you not always though "with all the meetings and projects that go nowhere and lazy people that are never fired, how does this company make money"? Well that same waste can launch a thousand engineers, which looks on paper if nothing else far more impressive in terms of man hours available.
Someday, some companies will wake to the hyper-efficient use of technical workers and gain a massive edge over the companies that have shifted one form of waste for another.
I know I veered off course there, but to get back to my main point - if companies would use these small teams, they would still want a lot of developers because they have many ideas they want to implement. They would just be able to fuel many more ideas with the same dollars they use today. Such a world would be way better for you and I, because we'd be working on things that really mattered to the business, whole projects with much greater scope than most people get to be involved in now. Instead I'm at work writing another OR-Mapper or whatever I need in order to actually put together the final code that does what the business wants.
You can see OS stuff creeping in everywhere in companies, exactly because it is so easy to put in - stuff like Hybernate, or JBoss, that people just drop in because they do not want to write this same stuff again and again. When the managers finally "get it" as it were and mandate the use of a lot of this stuff that the really good people know to track down, then everyone can get a lot more productive a lot quicker as the mediocre programmers get to start from a better base as well.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
I had a brief look at it and wonder why not submit this to The Linux Documentation Project?
New entries are always welcome.
Perhaps I'll write up a paper, publish it somewhere, and try to get slashdot to publish that. I'm not sure exatly what Bruce is writing about but I feel it is at a tanget to my ideas on the matter.
An interesting discussion anyway, hopefully we'll see some story on it soon to continue discussion.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Well that's depressing. I was serious.
"I will trust Google to 'do no evil' until the founders no longer run it." Hello Alphabet.