[go: up one dir, main page]

0% found this document useful (0 votes)
20 views18 pages

Lec 03

The document discusses client-side processing and the client-server model. It explains that in the client-server model, clients request services from servers which provide resources and processing. It also discusses web clients and servers communicating through HTTP and URLs to transfer web pages. The client's role is to display content through HTML while additional processing can occur through scripts on the client-side.

Uploaded by

Logeen Zayan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views18 pages

Lec 03

The document discusses client-side processing and the client-server model. It explains that in the client-server model, clients request services from servers which provide resources and processing. It also discusses web clients and servers communicating through HTTP and URLs to transfer web pages. The client's role is to display content through HTML while additional processing can occur through scripts on the client-side.

Uploaded by

Logeen Zayan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

10/30/2023

Client-side processing

70

70

Objective Of The Lecture


• Introduction the client/server model
• Learn about client side processing
• Learn about HTTP

71

71

1
10/30/2023

Client /server Model

72

72

Client/Server Application

• Server provide many different services.


• File servers store files for distributed system.
• Print servers allow multiple users to share a set of printers.
• Databases servers store and process data for large application.

73

73

2
10/30/2023

Client / Server computing

• Client machines are connected to servers through some type of


communication software – Such as TCP/IP.
• Application are divided into tasks , each task executes where it can be
handled most efficiently.
• For example, the client will provide the user interface to the system.
• The server may do all or part of the processing.

74

74

Fat client / thin client

• In the “fat-client” model, much of the processing is done locally on the client.

• In the “thin-client” model , most of the processing is done on the server


• Maintenance is centralized, therefore simpler.
• Client machines can be much simpler.

75

75

3
10/30/2023

76

76

A public thin-client computer terminal inside a public library

77

77

4
10/30/2023

Web client -server

• Web client (browser): An application program that run on a client


computer and requests and displays web pages.
• Can also support other features such as email and newsgroup.

• Web server: A server-side application program that runs on a host


computer and responds to requests for web pages.

78

78

Web client/server communication

• Like any other client server application, web browsers and servers need a
way to:
1. Locate each other so they can send requests and responses back and
forth
• Uniform resource locator (URL)
2. Communication with one another
• Hypertext transport protocol (HTTP).

79

79

5
10/30/2023

Uniform resource locator (URL)

• The global address of the documents and other resources on the web.
• URLs provide a unique name for every page on the web.

80

80

Section of a URL

• // represents that a system address follows (rather than a file address).


• Domain name of the host computer where the file is stored
• Port (default 80)
• Path name
• File name
• Query string parameter (variables passed to server side scripts)

81

81

6
10/30/2023

What is a port?

• In computer and telecommunication devices , a port is generally a specific


place for being physical connected to some other device.

• In programming , a port (noun) is a “logical connection place” and specify,


using the internet’s protocol, TCP/IP , the way a client program specifics a
particular server program on a computer in a network.

82

82

Web based client processing

• Html
• Plug-ins
• Scripts

83

83

7
10/30/2023

Html

• Hypertext Mark-up Language


• HTML is presentation language – not a programming language
• Controls the appearance of the information on the client’s screen but does
not support processing or manipulating information.

84

84

Sample html page

<HTMl>
<head>
<title> My Web page</title>
</head>
<body>This is the body of the page </body>
</html>

85

85

8
10/30/2023

A browsing scenario (1)

• User of client machine types in a URL

Http://www.smallco.com/index.html

86

86

A browsing scenario (2)

• Sever name is translated to an IP address via a domain name server (DNS)

Http://www.smallco.com/index.html

192.22.107.5

87

87

9
10/30/2023

A browsing scenario (3)

• Client connects to server using IP address and port number

192.22.107.5
port 80

Http://www.smallco.com/index.html

192.22.107.5

88

88

A browsing scenario (4)

• Client sends HTTP request to server

GET index.html HTTP/1.1

Http://www.smallco.com/index.html

89

89

10
10/30/2023

A browsing scenario (5)

Server determines which file to send

Http://www.smallco.com/index.htm “index.html” is really


l /etc/httpd/htdocs/index.html

90

90

A browsing scenario (6)

Server sends response code and the document

HTTP/1.1 200 OK
Content-type: text/html
[contents of index.html]

Http://www.smallco.com/index.html

91

91

11
10/30/2023

A browsing scenario (7)

• Connection is broken

92

92

HTTP

• Hypertext transfer protocol. (HTTP)


• Protocol that browsers and servers use to communicate with one another
for transferring web page.
• HTTP session begin when a client’s browser requested a web page.
• Once the server responds by sending the page requested, the http session
end.

93

93

12
10/30/2023

HTTP (Cont)

• HTTP is stateless because every request that a browser opens a new


connection that is immediately closed after the document is returned.
• Even a web page with many objects (graphics, sound, video, etc) requires
separate HTTP requests for each object
• Each operation is unaware of any other connection
• The server cannot maintain state information about successive requests
easily.

94

94

HTTP request/response

• The browser sends a header to server each time you ask for information

• Server responds with a header and possibly content.

95

95

13
10/30/2023

How does a http request/ response look like?

• Browser request = header only.

• Server response = header + object file


(generally)
• Header:
• Plain text
• Info about the object
• Methods allowed
• Etc.

96

96

HTTP request

• HTTP request message

• Get /panko/home.html http/1.1


• Host: Voyager.cba.Hawaii.edu

97

97

14
10/30/2023

HTTP response

• Start line
• Consists of HTTP version, status code , and description
HTTP / 1.1 200 OK
HTTP /1.1 404 Not Found
• Headers
Content – type: text/html
• Content

98

98

HTTP response codes

• Response coded by first digit


• 1xx: information , request received
• 2xx: success, request accepted
• 3xx: redirection , action needs to be taken in order to complete the
request
• 4xx: client error, The request contains bad syntax or cannot be fulfilled
• 5xx: server error, The server failed to fulfill an apparently valid request

99

99

15
10/30/2023

HTTP Response Example

HTTP/1.1 200 OK
Date: Mon, 15 Sep 2003 21:06:50 GMT
Server: Apache/2.0.40 (Red Hat Linux)
Last-Modified: Tue, 15 Apr 2003 17:28:57 GMT
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Content-length: 107

<html> <head> <title> A Sample HTML file </title> </head> <body> The rest of the document goes here
</body> </html>

100

100

Plug-ins

• A plug-in is a software routine that extends the capability f a larger


application
• Allow a browser to process non-standard, often proprietary animation,
video, and files embedded in HTML document
• Examples:
• Macromedia shockwave and flash
• RealAudio player
• Adobe acrobat reader

101

101

16
10/30/2023

Script

• What is a Script?
• A program embedded in an HTML document
• Script can be found multiple places in a document
• There are multiple scripting languages
• JavaScript – far more common and universally interpreted in all
browsers

102

102

Example of script: Javascript

• JavaScript programs are included directly in web-page


• JavaScript is a language understood directly by the web-browser;
• Typically uses of JavaScript are:
• Changing images when the mouse is moved
• Reacting to the user pressing a button
• Validating the content of a form

103

103

17
10/30/2023

A simple example

• This piece of JavaScript automatically writes the last modification date of


the web-page;
<Script Language=“JavaScript”>
Document.write(“Last update on: “ + document.lastModified);
</script>

104

104

18

You might also like