Web Programming 01
Web Programming 01
Web Programming 01
CS333-CS644
Dr Safa’a Saleh
1
Lecture 1
Application Layer
Outline
Application Architectures
Host-Based, Client-Based, and Client-Server Architectures,
Choosing Architectures
World Wide Web
How the Web Works, Inside an HTTP Request & HTTP
Response
4
Application Layer - Introduction
6
6
Host-Based Architectures
or a PC running a
terminal emulation
program
7
7
Problems with Host-based Arch.
8
8
Client-Based Architectures
10
10
Client-Server Architectures
Used by most networks today
Client Server
(PC) (PC, mini, mainframe)
Advantages
More efficient because of distributed processing
Allow hardware and software from different
vendors to be used together
Disadvantages
Difficulty
in getting software from different
vendors to work together smoothly
May require Middleware, a third category of
software
12
12
Middleware
client application programs
a standard
– Manages
way of
translating message
Middleware transfers
between
software – Isolates network
from changes from the
different clients ((e.g.,
vendors server application adding a new
programs server)
Examples:
Distributed Computing Environment (DCE)
Common Object Request Broker Architecture (CORBA)
Open Database Connectivity (ODBC)
13
13
Multi-tier Architectures
Involve more than two computers in distributing
application program logic
2-tier architecture (architectures discussed so far)
3-tier architecture
3 sets of computers involved
N-tier architecture
more than three sets of computers used
14
14
3-tier Architecture
15
15
N-tier Architecture
16
16
Multi-tier Architectures
Advantages
Better load balancing:
More evenly distributed processing. (e.g., application logic
distributed between several servers.)
More scalable:
Only servers experiencing high demand need be upgraded
Disadvantages
Heavily loaded network:
More distributed processing more exchanges
17
17
Fat vs. Thin Clients
Depends on how much of the application logic resides
on the client
Fat client: (a.k.a., thick client)
All or most of the application logic
Thin client:
Little or no application logic
18
18
Thin-Client Example: Web Architecture
Web Server
Client (PC, mini,
(PC) mainframe)
19
19
Criteria for Choosing Architecture
Infrastructure Cost
Cost of servers, clients, and circuits
Mainframes: very expensive; terminals, PCs: very inexpensive
Development Cost
Mainly cost of software development
Software: expensive to develop; off-the-shelf software:
inexpensive
Scalability
Ability to increase (or decrease) in computing capacity as
network demand changes
Mainframes: not scalable; PCs: highly scalable
20
20
Choosing an Architecture
Cost of
Infrastructure High Medium Low
Cost of
Development Low Medium High
21
21
Applications
22
22
World Wide Web
Two central ideas:
Hypertext
A document containing links to other documents
25
25
What is Web Browser ?
A Web browser is a software that enables a
user to display and interact with the Web’s rich
multimedia content such as text, images, and
other information.
The Web could be the World Wide Web, a local
area network, or a web page on your own
machine.
Microsoft Internet Explorer or Netscape
Navigator
The appearance of a Web page may differ
between browsers.
26
26
URL & Hyperlinks
Hyperlinks
Graphical or textual elements
Click
to link to another Web page
Loads new page into browser window
27
27
URL & Hyperlinks
URL (Uniform/Universal Resource
Locator)
Web page address – typing in Address
field
HTTP (HyperText Transfer Protocol)
Protocol for transferring data over the
Internet
HTTPS (Secure HyperText Transfer
Protocol)
Protocol for transferring encrypted data
over the Internet.
28
URL & Hyperlinks
http://www.ipoh.com/news
29
29
URL & Hyperlinks
You can access a Web page by entering its unique
address, called the Uniform Resource Locator (URL), in
a browser’s address bar.
31
31
Web Standard.
Different between IP Address and Domain Names
IP ADDRESS DOMAIN NAMES
• An identifier for a computer or • A name that identifies one or
device on a TCP/IP network. more IP addresses.
Networks route messages • For example, the domain name
based on the IP address of the notifycorp.com represents
destination. The format of an several IP addresses.
IP address is four numbers • Domain names are used in
separated by periods. Each URLs to identify particular Web
number can be zero to 255. pages.
• For example, 1.140.10.230 • For example, in the URL
could be an IP address. http://www.notifycorp.com/index
.htm, the domain name is
notifycorp.com.
32
32
Types of Web Sites – Cont.
34
34
Types of Web Sites – Cont.
In URL, the domain name and top-level domain
designation are preceded by a protocol.
For Web pages, that protocol is the Hypertext
Transfer Protocol (HTTP), which is the
communications standard for transmitting Web
pages over the Internet.
Most Web browsers will insert the HTTP protocol
automatically as the requested Web page is
downloaded into the browser.
35
35
How the Web Works
Main Web communications protocol:
HTTP - Hypertext Transfer Protocol
A request-response cycle:
include multiple steps since web
Clicking on a hyperlink or pages often contain embedded
typing a URL into a browser files, such as graphics, each
starts a request-response cycle requiring a separate response.
36
How the Web Works
Main Web communications protocol:
HTTP - Hypertext Transfer Protocol
37
Web Standard.
Different between IP Address and Domain Names
38
38
Web Standard.
39
39
HTTP Request Message
Request line
(command, URL, HTTP version number) required
(If the user
types in the Request header
optional
URL by (information on the browser,
themselves, date, and the referring page )
then the
referring page
is blank.)
Request body
(information sent to the server, optional
e.g., from a form)
40
Example of an HTTP Request
Command URL HTTP version
Request
GET http://www.kelley.indiana.edu/ardennis/home.htm HTTP/1.1
Line
Date: Mon 06 Aug 2001 17:35:46 GMT
Request
User-Agent: Mozilla/6.0 Header
Referer: http://www.indiana.edu/~aisdept/faculty.htm
41
HTTP Response Message
Response status
(http version number, status code, reason) optional
Response header
optional
(information on the server, date,
URL of the page retrieved, format used )
Response body
(requested web page) required
42
Example of an HTTP Response
HTTP/1.1 200 OK Response
Status
Date: Mon 06 Aug 2001 17:35:46 GMT
Server: NCSA/1.3 Response
Location: http:// www.kelley.indiana.edu/adennis/home.htm Header
Content-type: text/html
<html>
<head>
<title>Allen R. Dennis</title>
</head>
<body>
<H2> Allen R. Dennis </H2> Response
<P>Welcome to the home page of Allen R. Dennis</P> Body
</body>
</html>
44
44
Multitier Application Architecture
45
HTML - Hypertext Markup Language
A protocol used to format Web pages
TAGs embedded in HTML documents
include information on how to format the file
Extensions to HTML needed to format
multimedia files
XML - Extensible Markup Language
A new markup language becoming popular
46
46
Scripting Languages
http://www.w3.org/
The World Wide Web Consortium (W3C).
http://www.w3schools.com/
Full Web Building Tutorials - All Free
http://wps.prenhall.com/esm_deitel_iw3htp
_3
The official web page for the text book.
48
Reference
49
ANY QUESTION?