Foundations of the www
Download
Report
Transcript Foundations of the www
Web application architecture
And protocols of the www
SE-2840
Dr. Mark L. Hornick
1
Q: What does a Browser do?
Web Browsers
SE-2840
Dr. Mark L. Hornick
2
The www message model
consists of Requests and
Responses
Client Request: “I need a resource (html page, picture, pdf doc, mp3 file…)”
Q: How does a
user initiate a
request?
Web Browser
(the client)
Resource
access
Server Response: “Here you go!”
SE-2840
Dr. Mark L. Hornick
Web Server
3
How a browser initiates a
request: anatomy of a url
The most commonly used form:
www.msoe.edu
Represents the DNS name of the server which listens
for HTTP requests on port 80
The complete url is really:
http://www.msoe.edu:80/index.html, where the http://
prefix explicitly instructs the browser to communicate
using the http protocol, and the :80 suffix instructs the
browser which port to use, and /index.html is the path
of the resource to be retrieved.
When the protocol and port are omitted, the browser assumes
http and 80
index.html is one of several default files the server looks for
when none is specified by the browser (another is
welcome.html)
4
Other protocols and ports can
also be specified
https://sapphire.msoe.edu:8443/OnTrack/login.jsp
https:// specifies that a secure version of HTTP
(using SSL) should be used (recall from CS2910)
:8443 is a commonly-selected port that servers
use for https.
/OnTrack/login.jsp is the path to a web page being
requested by the browser
CS-4220 Dr. Mark L. Hornick
5
Browsers can use protocols
other than http
ftp://myfiles.msoe.edu/public/pictures/dog.jpg
ftp:// specifies that the browser should use the ftp
protocol to retrieve the specified resource
The default port for ftp is used unless specified
explicitly
file:///D:/MyDocs/SampleHTML/BasicHTML.htm
file:// specifies that the browser should retrieve the
specified resource directly from the filesystem
The filepath syntax is specific to the operating system
running the browser (Windows in this case)
CS-4220 Dr. Mark L. Hornick
6
A three-tier model (Client, Server,
Database) is a common web
application architecture
Client
Web Server
Q: What’s in
the lightning
bolts ??
SE-2840
Dr. Mark L. Hornick
Database Server
Databases are often
on a separate server,
but not always.
7
How are messages sent back
and forth?
Request: Internet message from Client to Server
router
router
router
router
router
Generic Client
Generic Server
Response: Internet message from Server to Client
SE-2840
Dr. Mark L. Hornick
8
Packaging a message for
delivery
Internet message from Client to Server
Applicationspecific data of
the message
router
router
router
router
router
Generic Client
Ethernet
Frame Header
Generic Server
IP Header
(address of
Server)
TCP Header
(Part 1 of N)
Applicationspecific data of
the message
Ethernet
Frame Footer
Internet message packet
SE-2840
Dr. Mark L. Hornick
9
Peeling the onion of an
internet message
Ethernet
Frame Header
IP Header
(address of
Server)
TCP Header
(Part 1 of N)
CS-4220 Dr. Mark L. Hornick
Applicationspecific data of
the message
Ethernet
Frame Footer
10
The sequence for retrieving a static
web page (no db needed)
Note: This diagram can
be found in your textbook
Browser formats the
request and sends it
to the server
…or types a
url into the
address bar
HTML (and other)
files
Server formats the
response and sends it
to the client (browser)
11
SE-2840
Dr. Mark L. Hornick
HTTP: The message protocol of
the www
HTTP request
Simple
page
fetch…
Web Browser
HTTP response
SE-2840
Dr. Mark L. Hornick
Web Server
Q: Does a
response always
carry a payload?
12
The HTTP GET Request is the
most commonly issued message
GET requests the retrieval of a resource specified
via a URL
Example: http://faculty-web.msoe.edu//hornick/index.html
URLs you type into the address bar of a web
browser are always formatted into GET Requests:
GET /hornick/index.html HTTP/1.1
Host: faculty-web.msoe.edu
Accept: */*
\r\n
SE-2840
Dr. Mark L. Hornick
13
Request / Response illustrated
SE-2840
Dr. Mark L. Hornick
Note: This diagram can
be found in your textbook
14
Of all other HTTP requests, POST
is the only one commonly used
POST
PUT
Returns the HTTP methods that the server supports. This can be used to check the
functionality of a web server.
CONNECT
Echoes back the received request, so that a client can see what intermediate servers
are adding or changing in the request.
OPTIONS
Deletes the specified resource.
TRACE
Uploads a representation of the specified resource.
DELETE
Submits data to be processed (commonly from a HTML form) to the identified
resource. The data is included in the body of the request. The data thus provided
typically changes the state of the web application. More on this later.
For use with a proxy that can change to being an SSL tunnel.
HEAD
Asks for the response identical to the one that would correspond to a GET request, but
without the response body. This is useful for retrieving meta-information written in
response headers, without having to transport the entire content. .
SE-2840
Dr. Mark L. Hornick
15
Wfetch is free HTTP protocol
viewer
Live link on course webpage under Tools.
http://download.microsoft.com/download/iis50
/Utility/5.0/W9XNT4/EN-US/wfetch.exe
SE-2840
Dr. Mark L. Hornick
16
Use Wfetch for
http://www.msoe.edu/welcome.html
CS-4220 Dr. Mark L. Hornick
17