1-1 Client Server Paradigm Objectives: Taxonomy of distributed systems service models point of view Client-server architecture Thin versus thick clients Two and three tier architectures Tradeoffs between these different architectures Software Architectures for Clients and Servers
35
Embed
1-1 Client Server Paradigm Objectives: Taxonomy of distributed systems service models point of view Client-server architecture Thin versus thick.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1-1
Client Server Paradigm
Objectives: Taxonomy of distributed systems
service models point of view Client-server architecture
Thin versus thick clients Two and three tier architectures Tradeoffs between these different
architectures
Software Architectures for Clients and Servers
1-2
Distributed Systems: Service-models Taxonomy
Centralized model Client-server model Cluster-based model Grid-based model Peer-to-peer model
1-3
Distributed Systems: Service-models Taxonomy
Centralized model This the classic mainframe
time-sharing system The computer may contain
more than one CPU Terminals have serial
connections
Drawbacks Single-point of failure Not scalable Resource contention
Are there any advantages?
1-4
Distributed Systems: Service-models Taxonomy
Client-server model A networked model
consisting of three components
• Server• Client• Service
The labels client and server are within the context of a particular service
Advantages? Disadvantages?
The labels client and server are within the context of a particular service
1-5
Distributed Systems: Service-models Taxonomy
Cluster-based model Tightly-coupled Closely linked via LAN networking
Grid-based model Focuses on the ability to support computation across
administrative domains
Peer-to-peer model Example: Gnutella, Kazaa Peers are intermittently connected and change IP
addresses
1-6
Distributed Systems: comparisonparadigm node
ownershipnode management
controlling policies
discovery mechanisms
peer-to-peer computing
local local none centralized or distributed
Cluster computing
global (single ownership)
global global job scheduling
Grid computing
local global management under local policies
single controlling policy
centralized or distributed
Where does a client server computing fit?
1-7
Client Server Architecture It is way of designing an application in which clients
contact well-known servers to access resources What fraction of the task do clients process before
giving the work to the server? Thin clients
• Clients are information appliances • Servers are resource-rich• Must have a resource-rich connectivity
Thick clients• Clients perform the bulk of data processing operations• Servers perform rudimentary tasks
Trade-offs between thin and thick clients?
1-8
Two-tier Client Server Architecture Traditional client-
server architecture A good solution for
small-scale group sizes This architecture has
limitations • Does not scale
• Restricts flexibility – Moving or
repartitioning program functionalities
1-9
Multi-tier Client Server Architectures Example: three-tier
architecture The three-tier design
has many advantages over traditional two-tier
• Added modularity
• Function isolation • Scalability
1-10
Client-server system architecture vs.
Client-server distributed computing
In the client-server system architecture, the terms clients and servers refer to computers
In the client-server distributed computing paradigm, the terms refer to processes
1-11
Client-server, an overloaded term
...
s e rv e r h o s t
clie n t h o s t s
C lie n t h o s t s m a k e u s e o f s e rv ice spro v ide d o n a s e rv e r h o s t .
C l i e nt-Se r ve r Sys te m Ar c hi te c tur e...
s e rvic e r e que s t
a s e r ve r pro c e s s
a c l ie nt pr o c e s s
a s e r vic e
The C l i e nt-Se r ve r P ar adi g m , c o nc e ptual
Se r ve r ho s t
C l i e nt ho s t
C l i e nt-Se r ve r C o m puti ng P ar adi g m
C lie n t pro ce s s e s (o bje ct s ) m a k e u s e o f a s e rv icepro v ide d by a s e rv e r pro ce s s (o bje ct ) ru n n in g o na s e rv e r h o s t .
1-12
Client-server system The interprocess communications and event
synchronization Typically, the interaction of the client and
server processes follows a request-response pattern. clie n t s e rv e r
re qu e s t 1
re qu e s t 2
re qu e s t n
re s po n s e 1
re s po n s e 2
re s po n s e n
1-13
Software Architectures for Clients and
Servers The Software architecture of client-server
application consists of Presentation layer Application layer Service layer
Any client-server software must have the three-layer functionalities
Is this a good approach? Why?
pre s e n ta t io n lo g ic
a pplica t io n lo g ic
s e rv ice lo g ic
a pplica t io n lo g ic
s e rv ice lo g ic
c l i e nt -s i de s o ftw ar e
s e r ve r -s i de s o ftw ar e
1-14
Software Architectures for Clients and Servers: Example
We will look at a Daytime client-server software
Daytime service [RFC867]:Client: Hello, <client address> here. May I have a timestamp please.Server: Here it is: (time stamp follows)
1-15
1-16
1-17
1-18
Software Architectures for Clients and Servers: Separating the layers
Allows each module to be developed by appropriate people People have different skills
Allows modifications to be made in isolation
1-19
Client-Server Paradigm Issues
A service session Same service might be requested by
multiple clients Client sessions need to be kept separated
and isolated The service protocol
How the service is to be located The sequence of the IPC Data syntax and semantics
IPC and event synchronization
1-20
Testing a Network Service
Since network software is notoriously difficult to test Use the three-layered software architecture and
modularize each layer on both the client and the server
Use an incremental or stepwise approach in developing each module
Develop the client first Test the client independent of the server Test the client-server suite on one machine before
We will look at the tradeoffs of these different server types
1-23
Connection-oriented communication
A separate connection is maintained for each session
Once the connection is established, data can be sent until the session is over
The connection needs to be explicitly torn down
Imagine that we have n processes What happens if a connection is established between
a sender and every other process? What happens if all the n processes is a sender?
Connection-oriented servers rely on connection-oriented communication
1-24
Connection-oriented: Daytime Server Example
… theServer = new ServerSocket(thePort);
p = new PrintWriter(System.out); try { p.println("Echo Server now in business on port " + thePort ); p.flush(); theConnection = theServer.accept(); // read a line from the client theInputStream = new BufferedReader (new InputStreamReader (theConnection.getInputStream())); p = new PrintWriter(theConnection.getOutputStream()); while (!done){ theLine = theInputStream.readLine(); if (theLine == null) done = true; else{ p.println(theLine); p.flush(); } } theConnection.close();
Connection acceptance
Protocol processing
1-25
Connectionless-oriented communications Involves no connection Packets are explicitly addressed by the
sender The connection needs to be explicitly torn
down Connectionless communications are
simpler to provide Packets can be delivered out of order
Connectionless-oriented servers rely on connectionless-oriented communication
1-26
Iterative Servers
An iterative server in unable to overlap client sessions
Is a connection-oriented server an iterative server? If yes, why?
Suppose that n clients have requested connection at a given time, and each session is expected to last t time units. What will happen to request n+1?
What is the solution???
1-27
Concurrent Servers
A concurrent server in capable of conducting multiple client sessions at once
A concurrent server can be provided by using Threads or Asynchronous IPC operations
1-28
Stateful servers
A stateful server maintain stateful information on each active client
Stateful information can reduce the data exchanged, and thereby the response time
...
s en d < f ile I D > , b lo c k 0
G E T f ile n am e
f ile I D
d ata f r o m b lo c k 0 o f f ile
s en d < f ile I D > , b lo c k 1
d a ta f r o m b lo c k 1 o f f ile
f ile I D
f ile p o sit io n
FTP s e r ve r
FTP C l i e n t
...
s en d n ex t b lo c k
G E T f ile n am e
r ead y
d ata f r o m b lo c k 0 o f f ile
s en d n ex t b lo c k
f ile I D f ile p o sit io n
FTP s e r ve r
FTP C l i e n t
d ata f r o m b lo c k 1 o f f ile
1-29
Stateful vs. Stateless server Stateless server is straightforward to code, but the
state information maintained by the server can reduce the data exchanged
Are there any problems with stateful servers?
...
s en d n ex t b lo c k
G E T f ile n am e
r ead y
d ata f r o m b lo c k 0 o f f ile
s en d n ex t b lo c k
f ile I D f ile p o sit io n
FTP s e r ve r
FTP C l i e n t
d ata f r o m b lo c k 1 o f f ile
d a ta is lo s t d u e to n e tw o r k f a ilu r e
c lien t r ec e iv es d a ta as b lo c k 0 o f f ile ;th e tr u e b lo c k 0 is m is s ed .
c lien t r es u b m its r eq u es t
1-30
Stateful vs. stateless server
In actual implementation, a server may be Stateless Stateful A hybrid, wherein the state data is distributed on
both the server-side and the client-side
Which type of server is chosen is a design issue
1-31
Global state information
Information maintained by a server for all the clients throughout the lifetime of a service
The global state information needs to be synchronized for mutual exclusion
1-32
Session state information
Information maintained specific to a client session
Two schemes to maintain session information Session information maintained by the client
• The server processes each request in the same manner• The complexity of the server’s application logic is reduced• Such a server is called stateless
Session information maintained by the server• Server keeps track of the session progress of the client• Server is more complex to design and implement• Failure provisions
1-33
Summary You have been introduced to the client-server
paradigm in distributed computing. Topics covered include The difference between the client-server system
architecture and the client-server distributed computing paradigm
Definition of the paradigm and why it is widely adopted in network services and network applications
The issues of service sessions, protocols, service location, interprocess communications, data representation, and event synchronization in the context of the client-server paradigm
1-34
Summary: Con.
The three-tier software architecture of network applications: Presentation logic, application logic, and service logic
Connectionless server versus connection-oriented server
Iterative server versus concurrent server and the effect on a client session
Stateful server versus stateless server In the case of a stateful server: global state
information versus session state information
1-35
Summary: Con.
You are required to read the following: The paper entitled “A taxonomy of distributed
computing” Chapter 5 of the Distributed Computing book Chapter 2 of the Distributed Computing book