From tridge@samba.anu.edu.au Sun Jan 18 20:54:25 1998 Date: Fri, 16 Jan 1998 22:52:35 +1100 From: Andrew Tridgell Reply-To: Common Internet File System To: CIFS@discuss.microsoft.com Subject: Re: virtual circuits (was Re: new CIFS I-D) Christian wrote: > A generalized solution would either have to redefine the reboot detection in > the server to something more tcp-friendly (is there such a possibility?) or yes, there is such a possibility! It brings us neatly back in a circle to the start of this discussion :-) I proposed to Paul a couple of years ago that their servers send a netbios keepalive on the "dead" connection when they get to the point in their current code where they would drop the client. As the clients TCP/IP stack is definately alive (you've just received a session connect from it after all!) you can guarantee that you will either get a TCP reset or an ack within a fraction of a second, at least on a local LAN. To play it safe you would wait say 2-5 seconds. If you don't get a TCP reset in that time then you know the connection is OK and you should leave it alone. If you do get a TCP reset then you don't even need to drop the connection as the client has done it for you :-) For those systems (probably including NT, I don't know) where it is easy for the NBT layer to ask the TCP layer whether a ack has been received you could obviously tune this by waiting for a ack or a reset. That would make the positive case (where you don't drop the connection) quite a bit faster. I'm not sure how to do this portably under Unix and I actually suspect that it isn't generally possible from user space. This discussion partly started because I obviously didn't make myself clear to Paul at the time. He thought that what I was describing was what Samba did. Actually what I meant is that this is what NT *should* do. I'm sure Isaac commented at the time that he thought it would be a good idea. > would have to define a "netbios daemon" that handles all netbios connections > through _one_ tcp connection. That would be quite tricky with embedded clients. You may well end up with CIFS clients built into all sorts of things. People have already proposed building it into emacs! Anyway, now we've come full circle, do people think that sending a keepalive is a good idea? As I said before, Samba doesn't drop connections based on VcNumber so this isn't really relevant for us, but I thought it would be helpful for those servers that do drop connections in this way. Note that this doesn't solve a different (but related) problem, that of killing dead clients who have locked files preventing other clients from continuing. Sending a keepalive to those won't necessarily generate a instant response so it doesn't provide a "quick fix". I actually don't think there is a quick fix for this problem as there is no way to tell the difference between a slow and a dead connection without waiting for quite a while. The solution we suggest to Samba users is that they set "keepalive=30" so that Samba sends keepalives on all idle connections every 30 seconds. This seems to be a reasonable compromise. Anyone have anything better? Cheers, Andrew ---------------------------------------------------------------- Users Guide http://www.microsoft.com/sitebuilder/resource/mailfaq.asp contains important info including how to unsubscribe. Save time, search the archives at http://discuss.microsoft.com/archives/index.html