(rev. 01/21/2008) 
 
Notes On Chapter Twenty-Eight
-- Client-Server Interaction
 
-  28.1 Introduction 
     
     -  This section (group of chapters) covers network applications.
	  
      -  It covers principles, techniques, programming interface, and the
	  structure of the software.  
      -   This particular chapter is about the client
	  server paradigm.   The nature of networks engenders the
	  client server paradigm.  
      -  The chapter presents examples 
      
 -  28.2 The Functionality Application Software Provides  
     
     -  Applications are what users really care about: programs that send
	  and receive e-mail, browse the WWW, games, etc.  
      -  It is important that  applications allow users
	  to deal with information using the language and symbols that are
	  most natural and convenient.  
      -  Applications define names for hosts and services. 
      
 -  28.3 The Functionality An Internet Provides 
     
     -   Internet service is similar to telephone
	  service  in that it provides the means to communicate.
	  However it is the responsibility of a pair of processes to establish
	  contact.  
      -  The protocol software does not provide services to clients or
	  initiate contact with processes.  These are roles of application
	  software. 
      
 -  28.4 Making Contact (The raison d'etre of
     the client-server paradigm) 
      
     -  Interestingly,  internet service does not have
	  the analogue of a telephone  bell,   and
	  remarkably that makes a big difference in determining what style of
	  communication tends to work well in this medium. 
      -   QUESTION: What works well?   ANSWER: An application (a  server) informs the
	  protocol ahead of time that a certain  form  of message is
	  desired and expected.   
      
 -  28.5 The Client-Server Paradigm 
     
     -   The passive listener is the server and
	  the active initiator of communication is the  client. 
	  
      
 -  28.6 Characteristics Of Clients And Servers 
     
     -   The typical client: 
          
          -  arbitrary process, temporary client
          
 -  invoked by user
          
 -  executes one-shot service request
          
 -  runs on the user's PC
          
 -  initiates contact with server
          
 -  contacts one server at a time
          
 -  does not require special hardware or OS
          
 
 
      -   The typical server: 
          
          -  special purpose
          
 -  privileged process
          
 -  dedicated to providing one service to multiple clients 
               concurrently
          
 -  starts up at boot-time
          
 -  executes continually 
          
 -  runs on a special shared computer
          
 -  waits passively for client contact
          
 -  requires special hardware
          
 -  requires sophisticated OS
          
 
      
 
 -  28.7 Server Programs And Server-Class Computers 
      
     -  The  server  is the process that waits, offering a service.
	   The host (machine) on which the server process
	  runs is not the server.   It's the  server machine.  A
	  server-class computer is a powerful computer suitable for use
	  to run server software. 
      
 
 -  28.8 Requests, Responses, And Directions Of Data Flow 
     
     -  Client-server interaction is not limited just to a simple
	  request/reply format. 
      -  Large amounts of information can and do pass between client and
          server in both directions. 
      
 -  28.9 Transport Protocols And Client-Server Interaction 
     
     -  
          Both client and server use a transport service like TCP/IP to
	  communicate. 
      -  TCP can be the virtual network used by applications. 
      
 -  28.10 Multiple Services On One Computer 
     
     -  
           It's quite simple for a computer with a
	  multiprogramming operating system to run multiple clients and
	  servers  over a single physical network connection. 
      -   Often it is practical and cost effective
	   to run many servers on a single host.  Hardware is shared
	  and excess traffic may not be a problem. 
      
 -  28.11 Identifying A Particular Service 
     
     -  There are 16 bit 
           
          port numbers (64K of port numbers) to identify services.
          
      -   We say a server "waits on a port number"
	   or "listens on a port number."  That
	  means it specifies the service it offers by registering a service
	  number (port number)  with the protocol software.  
      -   In its request message, the client includes the
	  port number of the desired service.  
      -   Software on the server uses the port number to
	  "route" the message to the appropriate server -- the one "listening"
	  on that port number.  
      
 -  28.12 Multiple Copies Of A Server For A Single Service 
     
     -   To have lower average wait time for clients, it
	  is usually desirable to allow several clients to obtain service
	  concurrently.  The effect is much as if the clients take
	  turns sending packets. 
      -  For example, if you have 12 combines it is better to let them do
	  work for 12 different farmers than to have all 12 combines work for
	  the same farmer at any given time.  Even though the throughput of
	  the combines is about the same either way, if one farmer has a huge
	  amount of crop to bring in, all the other farmers may have to wait
	  for the entire time that it takes to bring in the large harvest.
	  
      
 -  28.13 Dynamic Server Creation 
     
     -  Often there is a  main server thread that does
	  the waiting  and spawns  service threads
	   to service one client request.  
          A service thread may be a "one-shot" - created just to serve one
	  client and then "die". 
      
 -  28.14 Transport Protocols And Unambiguous Communication 
     
     -   The "full" address of a client consists of the
	  combination of its IP address and port number.  
      -  Similarly the  "full" address of a server thread
	  consists of the combination of its IP address and port number.
	   
      -  The protocol  software can direct client packets
	  to the correct server thread based on the full client and server
	  addresses.   
      
 -  28.15 Connection-Oriented And Connectionless Transport 
     
     -  User Datagram Protocol (UDP) is a member of the TCP/IP suite.   UDP is a tool for doing connectionless
	  communication. 
      -   TCP is connection-oriented.  
      -   Programmers create some client-server
	  applications that use TCP to communicate.  Others use UDP. Some are
	  able to use either or both.  
      -  When using connectionless transport an application must send the
	  destination address with each message.  For one-shot or small
	  sequences of messages this may involve less overhead than
	  connection setup would. 
      
 -  28.16 A Service Reachable Through Multiple Protocols 
     
     -  The same service may be made available to clients over two or
	  more transport protocols.  
      -  This multi-protocol service might be implemented with separate
	  servers for separate transport protocols, or a single server may
	  be willing to "speak" one of many protocols to a client -- like a
	  bilingual salesperson in a department store.  
      
 -  28.17 Complex Client-Server Interactions 
     
     -   Client-server interaction is flexible: A
	  process or thread is not locked into one role.  
      -  For example, clients can request different services at different
	  times from any server that offers the service.  
      -   A server S with client C can become a client of
	  another server  in order to obtain part of the data that C
	  has requested. 
      -  We can set up a network with lots of clients and servers and let
	  them interact in many different ways -- like a huge flea market.
	  
      
 -  28.18 Interactions And Circular Dependencies 
     
     -  Unfortunately, circular dependencies can arise when servers can act
	  as clients of other servers.  (The woman who sells spices goes to
	  the shop of the man who sells soup and orders spicy soup.  This
	  causes the man to go to the woman's shop to buy spice.  Each waits
	  for the other to return.)  
      
 -  28.19 Summary