[go: up one dir, main page]

0% found this document useful (0 votes)
10 views26 pages

Chapter 6

Chapter 6 discusses Client/Server computing, a model where independent processors (clients and servers) interact to provide services over a network. It outlines the architecture, various types of servers (like print, application, mail, and web servers), and the role of middleware in facilitating communication. Additionally, it covers socket programming, multithreading, and the advantages of concurrent execution in improving efficiency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views26 pages

Chapter 6

Chapter 6 discusses Client/Server computing, a model where independent processors (clients and servers) interact to provide services over a network. It outlines the architecture, various types of servers (like print, application, mail, and web servers), and the role of middleware in facilitating communication. Additionally, it covers socket programming, multithreading, and the advantages of concurrent execution in improving efficiency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 26

Chapter 6

CLINT-SERVER COMPUTING
Client/Server computing
 Client/Server: used to describe a computing model for the development of computerized
systems.

 This model is based on the distribution of functions between two types of independent and
autonomous processors: servers and clients.

 Client and server processes can reside in the same computer or in different computers
connected by a network.

 When Client and Server processes on two or more independent computers on a network,
the Server can provide services for more than one Client.
Cont…
 In addition, a client can request services from several servers on the network without
regard to the location or the physical characteristics of the computer in which the
Server process resides.

 These days many web pages are not served from static files on the hard drive. Instead,
the server generates them dynamically to meet user requests.
 The content may be pulled from a database or generated algorithmically by a program.
 In Java, server-side programs are written using servlets or Java Server Pages (JSP).

 They can also be written with other languages, such as C and Perl, or other frameworks,
such as ASP and PHP.
Cont…
Client/Server Architecture
 The client/Server architecture is based on hardware and software components that interacts
to form a system.
 This system includes three main components:
(i) Hardware (client and server).

(ii) Software (which make hardware operational).

(iii) Communication middleware. (associated with a network which are used to link
the hardware and software).
cont…
 The client is any computer process that requests services from server. The client uses the
services provided by one or more server processors.

 The client is also known as the front-end application, reflecting that the end user usually
interacts with the client process.

 The server is any computer process providing the services to the client and also supports
multiple and simultaneous clients requests.

 The server is also known as back-end application, reflecting the fact that the server
process provides the background services for the client process.
Cont…
 The communication middleware is any computer process through which client and
server communicate.
 Middleware is used to integrate application programs and other software components in a
distributed environment.
 Also known as communication layer, that aids the transmission of data and control
information between Client and Server.
 Communication middleware is usually associated with a network.
Cont…

 Client
 Server
 Sometimes on  Always on
 Initiates a request to the server when Not initiate contact with the clients
interested
 Serve services to many clients
E.g., web browser
E.g.,www.dbu.com
 Needs to know the server’s address
 Needs a fixed address
Cont…
 Print Server
 This machine manages user access to the shared output devices, such as printers.
 Print services can run on a file server or on one or more separate print server machines.
 Application Server
 This machine manages access to centralized application software; for example, a shared
database.
 When the user requests information from the database, the application server processes
the request and returns the result of the process to the user.
 Mail Server
 This machine manages the flow of electronic mail, messaging, and communication with
mail server systems on large-scale networks.
Cont…
 Fax Server

 Provides the facility to send and receive the Faxes through a single network connection.
 The Fax server can be a workstation with an installed FAX board designed for Fax
Services.
 This machine manages flow of fax information to and from the network
 Web Server
 This machine stores and retrieves Internet (and intranet) data for the enterprise. Some
documents, data, reside on web servers.
 Web application provides access to documents and other data.
 “Thin” clients typically use a web browser to request those documents.
Cont….
 Database Server
 Data resides on server, in the form of a SQL database. Database server provides access
to data to clients, in response to SQL requests.
 It shares the data residing in a database across a network.
 Transaction Servers
 The Server provides access to high level functions, and implements efficient transaction
processing.
 It shares data and high level functions across a network.
 Transaction servers are often used to implement Online Transaction Processing (OLTP)
in high-performance applications.
Web Technology
 The Internet and expanded network connectivity established Client/Server models as the
preferred form of distributed computing.
 When talking about Client/Server models of network communication using web services
the broadest components of this paradigm become the web browser (functioning as the
client) and web server.

 At the most basic level, the process for web communication works as follows:
 A computer runs a web browser that allows it to request, communicate and display HTML
documents (web pages).

 Web browsers are the software applications that allow users to access and view these web
pages and they run on individual computers.
Cont…
 After typing in the URL and pressing return, the request is sent to a server machine that
runs the web server.
 The web server is the program that delivers the files that make up web pages.

 Every web site or computer that creates a web site requires a web server.

 The most popular web server program is Apache.

 The server machine then returns the requested web page.


Cont…

Information Exchange between User and a Web-based Database


Cont…

Step1: The user types in a URL or fills out a form or submits a search on a Web page and
clicks the Submit button.
Step 2: The browser sends the user’s query from the browser to the Web server, which
passes it on to a CGI script.
Step 3: The CGI script loads a library that lets it talk to an SQL database server, and it uses
that library to send SQL commands to the database server.
Step 4: The database server executes the SQL commands and sends the request information
to the CGI script.
Step 5: The CGI(common get interface) script generates an HTML document and writes the
HTML document to the Web server.
Step 6: The Web server sends the HTML page back to the remote user.
Sockets
 A socket is one endpoint of a two-way communication link between two programs
running on the network.
 A socket is a connection to another machine. A server will listen for connections on a
particular port.

 From the server side, the input stream is read to get commands from the client and the
output stream is used to write results back to the client.

 From the client side, the output stream is used to write commands to the server and the
input stream is used to read the results from the server.
Cont…
 A socket consists of
 Local socket address: Local IP address and service port number
 Remote socket address: Only for established TCP sockets
 Protocol: A transport protocol, e.g., TCP or UDP.

 A socket address is the combination of an IP address and service port number.


 API is an application programming interface (API), usually provided by the operating
system.
 API:- defines interface between application and transport layer
 A socket API (Internet API) :-two processes communicate by sending data into socket,
reading data out of socket.
Service ports
 Computers often communicate more than one type of service or to talk to multiple
hosts/computers at a time
 Ports are used to distinguish these services
 Each service offered by a computer is identified by a port number
 Some ports have been reserved to support common services
 FTP: 21
 HTTP: 80
 Telnet :23
Socket programming
 A server runs on a specific computer and has a socket that is bound to a specific port
number.
 The server just waits, listening to the socket for a client to make a connection request.
 On the client-side: The client knows the hostname of the machine on which the server is
running and the port number on which the server is listening.
 The client also needs to identify itself to the server so it binds to a local port number that it
will use during this connection, that is assigned by the system.
Cont..
 Socket enable communication between two program running the same JVM or different
JVMs.
 Server socket is associated with a number called port number.
 In order to access a server socket, client socket has to provide the name of the machine
on which server socket runs and the port number at which server socket listens.

 Port number is an integer to uniquely identify each server socket on the system.
 Name of the system and port number uniquely identify server socket in the network.
 Once you established a connection with socket.
 You can take Inputstream to read data from socket and Outputstream to write data to
socket.
Cont…
Client Socket :
 Socket is a listener through which computer can receive requests and send respond.
 The listener of a client system is called socket.
 Socket class represent a client socket. A client socket connects to a server socket, which
is created using serversocket calss.
 Address of server is specified either by using IP address or the name of the computer.
Server socket:
 The listener of server system is called server socket
 Create a server socket with the given port number.
 A server socket waits for a request to come from clients and process the request.
Functions in socket programming
socket() :create the socket descriptor
bind() :associate the local address
 • Returns 0 on success, and -1 if an error occurs
listen() :wait for incoming connections from clients
 Returns 0 on success, and -1 on error
accept() :accept incoming connection
 Returns descriptor for a new socket for this connection
read(),write() :communicate with client
close() :close the socket descriptor
Cont…
Multithreading
 Multitasking:- Executing multiple task at a time is called multitasking.
E.g While typing a program we can download a file, we can listen music.
Types of Multitasking
1. Process based multitasking
2. Thread based multitasking
 Process based multitasking:- Executing multiple tasks simultaneous is called process
based multitasking, here each task is a separate independent process.
E.g While typing java program we can listen song and the same time we can download a file
from net, all this task executing simultaneously and there is no relationship between these
tasks.
 All task have their own independent address space.
Cont…
 Thread based multitasking:- Executing multiple tasks concurrently is called thread
based multitasking, here each task is a separate independent part of a single process.
 This type of multitasking is developed at programmatic level
 Sequential execution:- means single thread execution
 Take more time to complete all method of execution
 Concurrent execution:- means multithreading execution
 Take less time to complete all method execution
 Executing multiple task in “start----suspend-----resume-----end” fashion is called
concurrent execution.
 In concurrent execution both tasks are started at different point of time and one task is
paused while other task is executing.
Cont…
 Thread:
 A thread is a code that can act independently of any other code within an application.
 The piece of code is usually started by another code, but once it is started, it runs
independently of the original caller, and controls its own destiny.
 A thread is an independent sequential flow of execution
 It executes methods in sequence one after one.
 Multithreading:
 It is the process of creating multiple threading to executing multiple tasks concurrently to
finish their execution in short time by using process ideal time effectively.
 In multithreading based programming CPU ideal time is utilized effectively.
 Multithreading is light weight because switching between context is fast because each
thread is stored in same address.

You might also like