LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author]
  From: David Newall <davidn@rebel.net.au>
  To  : lloy0076 <lloy0076@senet.com.au>
  Date: Sun, 14 Nov 1999 14:04:23 +1030 (CST)

Re: Differece (http and ftp)

> Can someone tell me the difference between ftp and http downloads?

How can you tell the difference between a weasel and a stoat?  One is
weasely recognised and the other is stoatally different.

HTTP is a very simple protocol.  More or less you open a socket to the web
server, request the document you want using the GET command, optionally
desired indicating features of the document such as the language you
prefer, the file is spat at you and the socket closed.  Later versions of
HTTP provide the option of leaving the socket open so that you can request
more files.

When a file is delivered by HTTP it is preceeded by headers, which indicate
various features such as the language being delivered, the size of the
document, when it was last modified and what have you.  Off hand I don't
know which ones are madatory, but certainly the size is not required.  An
unfortunate feature of HTTP is that there is no acknowledgement that parts
of the file have been correctly received.  If there is no size header on
the file sent to you, then your browser has no way of knowing when the file
has been fully received other than if the remote end closes the connection.
If you are using a version of HTTP that leaves the socket open you have no
way of telling the difference between end of file and a long pause in
transmission.  No doubt this explains why sometimes your browser leaves you
with a truncated file.

FTP is quite a different protocol.  You open a command socket to the server
on which you send, not surprisingly, commands, such as LIST (for a
directory) and RETR (for retrieve).  Data is not generally sent on the
command port.  Before the client can exchange data with the server it must
listen to a data socket, and it must tell the server which port that socket
is bound to.  When the server needs to send data to the client (e.g. a
directory list or a file) it opens a data connection back to the client and
transmits the data on that.  The client knows when the data has been sent,
indeed when every command has been acted upon, because the server sends a
completion code on the command port.  The completion code, a three digit
number and optional description, permits the client to know whether or not
the command succeeded.  Importantly, the client knows that the transfer
completed because of the completion code; it's absence is sufficient to
know the transfer is still in progress.

There are good RFC's explaining all of the standard protocols.  I like to
fetch RFC's from munnari.oz.au (because I keep forgetting other, closer,
places for finding them.)

Regards,

David

-- 
LinuxSA WWW: http://www.linuxsa.org.au/  IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
  mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject


Index: [thread] [date] [subject] [author]
Return to the LinuxSA Mailing List Information Page