Copyright © Curt Hill, Client – Server Computing An important paradigm
Copyright © Curt Hill, Historical Perspective Before the 60s computers were not usually interconnected In the mid 1960s time sharing was developed –One computer –Many terminals –Terminals could be hardwired or communicate over a modem –This has some of the form of client server
Copyright © Curt Hill, History II The 1970s saw the advent of many important computing innovations –UNIX and many other time sharing systems –Personal computers –Computer to computer communication In the 1980s the Internet starts to emerge In the late 1980s the web browser and server are developed –This is a model client server
Copyright © Curt Hill, The Paradigm Server provides one service Waits for requests for that service Client initiates a request Server replies to the request Information may flow in both directions Many clients may make requests with just the one server
Copyright © Curt Hill, Why Client - Server? Specialization –The client handles the user interface using local computational ability –The server manages the data and communication Sharing –One server may support many clients –Services provided are effectively shared –Data may be maintained in only one location
Copyright © Curt Hill, Clients An application program that runs on the local computer Able to use the local computer for doing work When invoked by a user, it initiates communication with a server Handles all the user interface issues Only used for a single session
Example The ubiquitous client is the web browser Several functions: Communicate with server Display HTML/XML Interpret client-side languages, such as JavaScript The trend is for the web browser to be the universal interface to every kind of server on the web Copyright © Curt Hill,
Servers Specialized program that typically provides only one service May handle multiple client requests simultaneously (or pseudo simultaneously) Interacts with users in many sessions –Both simultaneously and over long time periods Waits for a request and then produces the reply
Example The web server Waits for requests using HTTP Produces results in HTML/XML May handle many clients simultaneously Copyright © Curt Hill,
Connection Diagrammed Server Client Request Reply Client Request Reply Request
Copyright © Curt Hill, Interaction Diagrammed Client Server Wait The server is not waiting if it is processing other requests The client may also perform other processing while waiting for the reply RequestReply Time Processing
Copyright © Curt Hill, Notation Not standardized Is it: A) Client Server B) Client/Server C) Client-Server D) Client, Server E) Any of the above
Copyright © Curt Hill, Server Complexity Servers are pretty complicated Usually multi-threaded –Allows concurrent execution –Often one thread generated for each request Often run on multi-CPU computers Security is also of great concern
Copyright © Curt Hill, Transport Protocols Communication between a client and server must conform to a particular protocol Each protocol determines the values of many variables that exist in communications over the Internet These include: –Connection type –Port –TCP or UDP
Copyright © Curt Hill, Connection Type A connection requires the following actions –Connecting –Several requests and replies –Disconnecting The session requires overhead and bookkeeping for the server A message passing protocol requires no session or a very abbreviated session
Copyright © Curt Hill, TCP and UDP The Connection Protocol –Requires the overhead of a connection –Guarantees delivery and in the correct order of messages User Datagram Protocol –A no connection message –Faster but less reliable Both require a port number
Copyright © Curt Hill, Port Every internet request to a server must specify a port number If a machine is not listening on that port the request is denied A request on a valid port may be accepted if the other parts of the protocol are
Copyright © Curt Hill, Port Assignments Ports in the range 0 – 1023 are well known ports –These are publicly agreed upon Ports in the range 1024 – are registered ports –Usually registered to support proprietary services –May be used for other things as well Ports in the range – are called dynamic or private ports –Available for almost anything
Copyright © Curt Hill, Some well known ports 20, 21 – File Transfer Protocol (FTP) 23 – Telnet 25 – Simple Mail Transfer (SMTP) 53 – Domain Name Server (DNS) 80 – Hyper Text Transfer Protocol (HTTP)
Copyright © Curt Hill, Registered and Private Registered –Groupwise uses 1677 –Cisco uses –Lambda MOO often uses 7777 and 7000
Copyright © Curt Hill, Telnet Protocol Used for timesharing on systems such as UNIX –Port 23, TCP A connection is made Usually followed by commands and replies A logoff usually forces a disconnect
Copyright © Curt Hill, Hyper Text Transmission Protocol A lightweight protocol on port 80 TCP but a session only lasts for one request Little bookkeeping on the server end For more involved transaction processing it requires cookies or other such processing on client side
Copyright © Curt Hill, File Transfer Protocol One of the oldest TCPs around and fading Uses 21 for command information Uses 20 for data transfer
Copyright © Curt Hill, Domain Name Service A common UDP, 53 Broadcast a request to resolve a name Any name server may reply to the request If some requests are lost, so what?
Copyright © Curt Hill, Lambda MOO Uses Telnet protocol at port specified by the server only –Here it may be 7777 or 8888 Lambda MOO is a server – only responds to requests However, it may broadcast appropriate messages to any connected client
Copyright © Curt Hill, Quake III A server sends and receives UDP messages A client connects Like Lambda MOO it broadcasts any messages that apply to a client These include player movements, sounds, damage etc.
Copyright © Curt Hill, Multiple tiers The classic client-server is a two tier system The client is one tier and the server another Three or more tiers are also possible The middle server functions as a –Server to the client –Client to other servers –Known as middleware Often used to distribute load
Copyright © Curt Hill, A Three Tier Approach Server Application Server Client Server
Copyright © Curt Hill, Examples of Multi-Tier Authentication server –Maintains a connection to verify user –Funnels all requests to appropriate server Shopping cart –Records purchases –The product lookup/purchase handled by other servers Distributed Database Management System
Copyright © Curt Hill, Horizontal Distribution Multi-Tier is a vertical distribution A Horizontal distribution may also be effective A single server owns the web address: It then distributes all further requests to a rotation of identical web servers –www1.x.com –www2.x.com –…–… –wwwN.x.com
Copyright © Curt Hill, Horizontal Distribution … Client First Request Subsequent Request
Copyright © Curt Hill, Alternatives to Client- Server Group multicast Peer to peer Publish-Subscribe Several types of distributed system Among others
Copyright © Curt Hill, Peer to Peer An alternative to client-server Has a symmetric relationship Each peer provides all the same services and makes all the same requests as any other peer
Finally The importance of the client-server paradigm will only grow This is the model the Internet and WWW is based upon Cloud computing is all about moving applications from the local computing paradigm to the client server paradigm Copyright © Curt Hill,