On 2006-10-26, Mark Conrad <this-> wrote:
> Michelle Steiner <> wrote:
>
>> > Listening is passive, something a client/customer/guest would likely
>> > do while they are soaking up the services provided by others.
>>
>> Sheesh! Just like a waiter, who listens to his customers to find out
>> what they want, and then delivers it, a host computer listens to its
>> clients to find out what they want, and then delivers it.
>
> At least learn to use correct terminology, and call a spade a spade, for
> crying out loud.
>
> A waiter does not just "wait", because the _major_ part of his duties
> are to "serve", therefore he is a "server" with everything that implies.
Michelle gave an excellent example. What you need to understand is
a) What is a TCP/IP connection
b) What is a client-server protocol
In this context, the server is often referred to the host, because
it hosts the service. In any client-server protocol, eg HTTP, or
(less obviously) ssh, the client makes a request and the server acts
on the request and sends a response. On the internet, client-server
protocols are implemented on top of TCP or (less typically, UDP,
but both are themselves implemented on top of IP).
So the server (host) always "listens" on a TCP (or UDP) port for client
connection requests. The client first sends a TCP syn packet, and
in the well known "three way handshake", the server sends a syn/ack
and finally the client responds with an ack. At this point a TCP
connection has been established and the client can then start sending
requests to the server using the appropriate higher level protocol.
In the case of HTTP, the client would typically send an HTTP GET
request over the TCP connection, asking for the resource at a given
URL. The server (a web server) would do some work and send back that
resource (a web page) in an HTTP response, and the client (a web
browser) would render the page.
This is exactly paralled in the waiter example. The waiter is the
server, who listens for client requests. Once the customer gets
the waiter's attention, perhaps just by walking in the door, a
connection is established. The customer then makes requests using
the approriate protocol. For example, "what is the soup of the day?"
The waiter does some work (perhaps goes to ask the chef), and gives
a response (minestrone). The client (who hates minestrone) makes
another request "OK, just bring me a plate of tripe", the waiter
complies, and the customer eats the tripe.
Once this analogy has fully sunk in, you may actually start to make
some progress.
There are of course more complex examples, such as X11 - don't
even think about that until you have understood the basics.
Ian
--
Ian Gregory
http://www.zenatode.org.uk/ian/