> > Hello
> > I a little confused as to the defintion of certain terminology. What
> > exactly is a stateless or stateful client server? What is a connection or
> > connectionless oriented protocol? If I am thinking correctly, FTP would
> > be a connection oriented protocol correct?
> Correct about ftp. Stateful connections keep the connection open
> between the client and the server. FTP is a login service and maintains
> an open connection between the client and the server - until you type
> "wuit" or "bye" or "exit" or whatever. http is a stateless protocol -
> when the client asks for a resource (URL) the server sends the resource
> (document, whatever) packet by packet untill all of it is sent and then
> hangs up the socket and goes back to a wait state. The client waits for
> the packets to come over the net and then it too closes it's socket
> connection at the client machine. What these mean is that for an ftp
> connection the server knows exactly who the client is (as far as it is
> meaningful to a machine) for the duration of the session but the http
> server forgets about you the moment it has delivered the document. Your
> next request for a document
> is treated as brand new and establishes a new socket to socket
> connection between the client and server hosts.
Statelessness of a protocol has nothing to do with the transport
implementation. Whether a socket gets closed or not, or whether there is
a socket at all is irrelevant to the issue.
A protocol in which a response to request n is influenced by the requests
m, where m < n is a stateful protocol, since the server must implement a
state machine. Potentially, the server has to preserve the state.
FTP protocol is stateful. An example:
ftp> pwd #request is print working directory
ftp> cd junk #directory change was requested
ftp> pwd #again the same request from step 1
/pub/junk #DIFFERENT response. The server keeps notion of its current
#working directory. It is one piece of its state.
HTTP is a difficult example since there is not a defined set of requests
nor actions to them. Since it is possible to implement state with some
CGI magic, it should be considered stateful.
NFS file serving is stateless, though. NFS file locking is not.
> The upshot of all this is that http is theoretically lighter on networks
> that ftp but there are such additions to the http protocol as keep-alive
> connections, client pull and server push that establish longer sessions
> than the simple model above.
Actually, HTTP is much heavier on networks than FTP because of constant
connection establishment/tear down which requires name resolutions every
time a request is sent unless the client caches the resolved address. Even
in that case establishment/tear-down are expensive operations which is
exactly the reason why multiple requests per session were introduced.
As far as networking load is concerned, HTTP was(is) a pig. But it sure
was relatively easy to implement (in comparison with protocols which
would be more friendly to the network).
As far as the differences between BSD and Systems V, that's
simple. System V sucks and BSD doesn't. :)