Chapter 23 - Client-Server Interaction
Last modified: Wed Feb 17 12:57:34 1999
Page number Title
1 Introduction
2 Internet protocols and network applications
3 Establising contact through internet protocols
4 Client-server paradigm
5 Characteristics of client
6 Characteristics of server
7 ``Server-class'' computers
8 Message exchanges
9 Transport protocols and client-server paradigm
10 Multiple services on one computer
11 Identifying a service
12 Multiple servers for one service
13 Master-slave servers
14 Selecting from multiple servers
15 Connection-oriented and connectionless transport
16 Client-server interactions
17 Summary
Top of Telecom Lecture notes Labs Assignments Project
Introduction
• Application-level protocols provide high-level services
o DNS
o Electronic mail
o Remote login
o FTP
o World Wide Web
• All of these applications use client-server architecture
Previous Next Top of chapter Lecture notes Top of Telecom
Internet protocols and network applications
• Internet protocols provide
o General-purpose facility for reliable data transfer
o Mechanism for contacting hosts
• Application programs
o Use internet protocols to contact other applications
o Provide user-level services
Previous Next Top of chapter Lecture notes Top of Telecom
Establising contact through internet protocols
• Application must interact with protocol software before contact is made
• Listening application informs local protocol software that it is ready to accept
incoming messages
• Connecting application uses internet protocol to contact listener
• Applications exchange messages through resulting connection
Previous Next Top of chapter Lecture notes Top of Telecom
Client-server paradigm
• Server application is ``listener''
o Waits for incoming message
o Performs service
o Returns results
• Client application establishes connection
o Sends message to server
o Waits for return message
Previous Next Top of chapter Lecture notes Top of Telecom
Characteristics of client
• Arbitrary application program
o Becomes client when network service is needed
o Also performs other computations
• Invoked directly by user
• Runs locally on user's computer
• Initiates contact with server
• Can access multiple services (one at a time)
• Does not require special hardware or sophisticated operating system
Previous Next Top of chapter Lecture notes Top of Telecom
Characteristics of server
• Special purpose application dedicated to providing network service
• Starts at system initialization time
• Runs on a remote computer (usually centralized, shared computer)
• Waits for service requests from clients; loops to wait for next request
• Will accept requests from arbitrary clients; provides one service to each client
• Requires powerful hardware and sophisticated operating system
Previous Next Top of chapter Lecture notes Top of Telecom
``Server-class'' computers
• Shared, centralized computers that run many server applications are sometimes
called ``servers''
• More precisely, the applications are the ``servers'' and the computer is a ``server-
class computer''
• Servers can run on very simple computers...
Previous Next Top of chapter Lecture notes Top of Telecom
Message exchanges
• Typically, client and server exchange messages:
o Client sends request, perhaps with data
o Server send response, perhaps with data
• Client may send multiple requests; server sends multiple responses
• Server may send multiple response - imagine video feed
Previous Next Top of chapter Lecture notes Top of Telecom
Transport protocols and client-server paradigm
• Clients and servers exchange messages through transport protocols; e.g., TCP or
UDP
• Both client and server must have same protocol stack and both interact with
transport layer
Previous Next Top of chapter Lecture notes Top of Telecom
Multiple services on one computer
• Sufficiently powerful computer - fast enough processor, multi-tasking OS - may
run multiple servers
• Servers run as independent processes and can manage clients simultaneously
• Can reduce costs by sharing resources among multiple services
• Reduces management overhead - only one server-class computer to maintain
• One server can affect others by exhausting server-class computer resources
• Failure of single server-class computer can bring down multiple servers
Previous Next Top of chapter Lecture notes Top of Telecom
Identifying a service
• Each service gets a unique identifier; both client and
• server use that identifier
o Server registers with local protocol software under the identifier
o Client contacts protocol software for session under that identifier
• Example - TCP uses protocol port numbers as identifiers
o Server registers under port number for service
o Client requests session with port number for service
Previous Next Top of chapter Lecture notes Top of Telecom
Multiple servers for one service
• Responding to a client request may require significant time
• Other clients must wait while earlier requests are satisfied
• Multiple servers can handle requests concurrently, completing shorter requests
without waiting for longer requests
Previous Next Top of chapter Lecture notes Top of Telecom
Master-slave servers
• One way to run concurrent servers is to dynamically create server processes for
each client
• Master server accepts incoming requests and starts slave server for each client
• Slave handles subsequent requests from its client
• Master server then waits for next request
Previous Next Top of chapter Lecture notes Top of Telecom
Selecting from multiple servers
• How do incoming messages get delivered to the correct server?
• Each transport session has two unique identifiers
o (IP address, port number) on server
o (IP address, port number) on client
• No two clients on one computer can use same source port
• Thus, client endpoints are unique, and server computer protocol software can
deliver messages to correct server process
Previous Next Top of chapter Lecture notes Top of Telecom
Connection-oriented and connectionless transport
• Which to choose?
• TCP - connection-oriented
o Client establishes connection to server
o Client and server exchange multiple messages of arbitrary size
o Client terminates connection
• UDP - connectionless
o Client constructs message
o Client sends message to server
o Server responds
o Message must fit in one UDP datagram
• Some services use both
o DNS, chargen, motd
o Can be provided by single server
Previous Next Top of chapter Lecture notes Top of Telecom
Client-server interactions
• Clients can access multiple services sequentially
• Clients may access different servers for one service
• Servers may become clients of other servers
• Circular dependencies may arise...
Previous Next Top of chapter Lecture notes Top of Telecom
Summary
• Client-server paradigm used in almost every distributed computation
o Client requests service when needed
o Server waits for client requests
• Servers usually run on server-class computer
• Clients and servers use transport protocols to communicate
• Often, but not always, there is an application protocol
Previous Top of chapter Lecture notes Top of Telecom