csit 320 (blum)1 client-server interaction based on appendix 1 in computer networks and internets,...

30
CSIT 320 (Blum) 1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

Upload: thomasine-blankenship

Post on 24-Dec-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 1

Client-Server Interaction

Based on Appendix 1 in Computer Networks and

Internets, Comer

Page 2: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 2

Network Applications

All of the lower layers of the network communication protocol stack exist so that applications on different computers can interact.

Applications are high-level software used directly by users.

The applications (e.g. Excel) sit on top of the application layer which provides various network-related services (e.g. FTP) to the applications.

The basic paradigm for this application-to-application interaction on an internet is the client-server model.

Page 3: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 3

Application Software

Applications and the application layer hide all of the details of the network from the user. • Information hiding

In most cases the user does not have to know the IP address (let alone the MAC address) of the computer he or she is communicating with.

The application provides a user-friendly symbolic name, which is then translated into the corresponding number.

• E.g. a domain name service

Page 4: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 4

Connection-Oriented

While TCP is in part responsible for establishing a session between two computers, the TCP does not establish a connection on its own volition.

The source application layer must direct its transport layer to do so.

The destination application layer must direct its transport layer to “listen for” others trying to connect to it.

In the phone analogy, the source must dial the number, the destination must hear the phone ring and answer it.

Page 5: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 5

The client-server paradigm

The approach in which the source initiates contact with a listening destination is said to adhere to the client-server paradigm.

The initiating source is called the client.

• Clients are “active.” The listening destination is called the server.

• Servers are “passive.”

Page 6: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 6

Two meanings

In one sense, client-server is used to refer to the communication model • Client: Active requester

• Server: Passive listener/responder

In another sense, client-server is used to refer to machines which are designed to act as clients or as (dedicated) servers • In this sense, a server is a machine capable of offering

a such service to a number of clients.

Page 7: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 7

What is a Server?

A server can refer to a program that passively waits for communication.

A server can refer to a computer dedicated to running server programs.

Sometimes the term “server class computer” is used for the latter case. • But most of the world uses the term “server” in both

cases.

• Servers or server-class computers are typically powerful machines which run server software.

Page 8: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 8

Not the only paradigm in town

Client-server is not the only model for computer-to-computer communication.

• Peer-to-peer: A type of network in which each workstation has equivalent capabilities and responsibilities. Peer-to-peer networks are generally simpler, but they usually do not offer the same performance under heavy loads.

• Master/slave: master polls the slaves to see if they have anything to transmit.

Page 9: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 9

Mainframe architecture

Mainframes are an example of the master-slave model.

Most of the data storage and computing power lies in the mainframe (a central computer).

Users interact with the mainframe via terminals (“dumb terminals”) which is little more than a monitor and keyboard.

In the early days of PCs, they were often disabled to work as dumb terminals in a mainframe.

Page 10: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 10

Thin and fat clients

There was an idea of returning to some extent to the notion of a dumb terminal.

In client/server applications, a client designed to be especially small so that the bulk of the data processing occurs on the server is called a thin client.

A client that performs the bulk of the data processing operations is called a fat client.

Although the term usually refers to software, it can also apply to a relative abilities of a network computer.

Page 11: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 11

Client/Server Operating Systems

Often the version of the operating system one loads on a computer that mainly plays the client role will be different from the version of the operating system loaded on the server

• E.g. Windows 7 is different from Windows 2008 Server

Page 12: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 12

The client Client software

• Requests service but also performs its own computations.

• Is invoked directly by a user and executes only for one session

• as opposed to starting automatically and running continuously

• Usually runs locally on a user’s PC

• Initiates contact with a server.

• May access multiple services, but only communicates with one server at a time.

• Does not require special hardware (beyond standard communications hardware) or Operating System.

Page 13: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 13

The Server

Server software• Is a special-purpose, privileged program dedicated to

providing one service.

• Can handle multiple remote clients at the same time.

• Is invoked automatically (typically when a system boots) and continues to execute through many sessions.

• Waits passively for contact from arbitrary remote clients.

• Accepts contact from arbitrary clients, but offers a single service.

• Requires powerful hardware and a sophisticated operating systems.

Page 14: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 14

Application Software

Applications (as opposed to services provided by the application layer) that communicate with other applications are often written with either the client role or server role specifically in mind.

Thus one talks about “client-side scripting” and “server-side scripting.”

Page 15: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 15

Scripting

Client-side scripting is code written for the client end of a client-server system. • For example, JavaScript scripts are client-side

because they are executed by your browser (the client).

Server-side scripting is code written for the server end of a client-server system.• For example, PHP scripts are server-side because

they run on the Web server. Java applets can be either server-side or client-

side depending on which computer (the server or the client) executes them.

Page 16: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 16

Client-Server Interaction

Information between client-server passes in both directions.

Clients request, servers respond. Sometimes the server’s response is an ongoing

communication based on one initial request. Client-server applications lead the protocol suite

to establish the session and send/receive information.

A computer needs all stacks of the software protocol suite to run as a client or server.

Page 17: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 17

Client-Server

Page 18: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 18

One connection/Many services

A computer with multiple servers still requires only a single physical connection for communication.• Different services will be associated with different ports.

Since servers are often in passive modes, having one computer offer many services can help reduce administrative overhead and cost without a significant reduction in performance.• Virtualization

However, if many clients are expected for a particular service it may be worthwhile having a machine dedicated to it.

Page 19: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 19

Some Server Types

A file server is a computer and storage device dedicated to storing files. Any user on the network can store files on the server.

A print server is a computer that manages one or more printers.

A network server is a computer that manages network traffic.

A database server is a computer system that processes database queries.

Page 20: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 20

Multiple services

Page 21: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 21

A thread for each request

In order to handle concurrency, that is, dealing with many clients at once, the server-class computer uses “threads.”

Certain services being associated with well-known ports.

Actually the main thread or listener (usually a daemon) is located at this port, but as soon as a request is made, a new thread is spun off (forked) for it.

This allows the main listening thread to await the next client.

Page 22: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 22

Thread

A thread is the information needed to serve one individual user or a particular service request.

If multiple users are using the program or concurrent requests from other programs occur, a thread is created and maintained for each of them.

Page 23: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 23

Types of Transport Protocols

The application services may be connection-oriented or connectionless.

Connection-Oriented

• The applications must first establish the connection and then send the data across the connection. TCP requests the connection and once established the communication begins. Session must be terminated.

Page 24: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 24

Types of Transport Protocols

Connectionless Interface

• The application sends a message to the destination at any time. The sending application needs to specify the destination with each message sends. The UDP is the connectionless support mechanism in the TCP/IP protocol.

• For a client request using the connectionless interface, servers often require the request to be sent in a single message. The server responds in a single message.

Page 25: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 25

Service Connections Choice Servers may provide a service through both connection

methods. The choice of transport is dependent on the client. This choice requires the server to provide both transport

implementations. This may be implemented by

• Setting up 2 servers for the same service, one for connectionless transport and one for connection-oriented transport.

• Setting up a single server that is able to interact with either type of transport protocol simultaneously.

Page 26: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 26

Client-Server Interactions A client application is not restricted to accessing

a single service. A single application can become the client of several servers over time.

A client application is not restricted to accessing a single server for a given service. A client might send a request to multiple servers to improve performance.

A server is not restricted from performing further client-server interactions . A server for one service can become a client of another.

Page 27: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 27

Two-tier

The term two-tier refers to client/server architectures in which the user interface runs on the client and the database is stored on the server.

The actual application logic can run on either the client or the server.

Page 28: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 28

Three tier

A special type of client/server architecture consisting of three well-defined and separate processes, each running on a different platform:

1. The user interface, which runs on the user's computer (the client).

2. The functional modules (business rules) that actually process data. This middle tier runs on a server and is often called the application server.

3. A database management system (DBMS) that stores the data required by the middle tier. This tier runs on a second server called the database server.

Page 29: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 29

Three tier (Cont.)

The three-tier design has many advantages over traditional two-tier or single-tier designs, mainly:

• The added modularity makes it easier to modify or replace one tier without affecting the other tiers. (Remember Layering and information hiding.)

• Separating the application functions from the database functions makes it easier to implement load balancing, i.e. spreading the processing out

Page 30: CSIT 320 (Blum)1 Client-Server Interaction Based on Appendix 1 in Computer Networks and Internets, Comer

CSIT 320 (Blum) 30

References

Computer Networks and Internets, Comer

http://www.whatis.com http://www.webopedia.com