web application architecture
DESCRIPTION
Web application architecture. And protocols of the www. Q: What does a Browser do?. Web Browsers. 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?. - PowerPoint PPT PresentationTRANSCRIPT
SE-2840 Dr. Mark L. Hornick
3
The www message model consists of Requests and Responses
Web Browser(the client) Web Server
Client Request: “I need a resource (html page, picture, pdf doc, mp3 file…)”
Server Response: “Here you go!”
Resource access
Q: How does a user initiate a request?
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
SE-2840 Dr. Mark L. Hornick
7
Databases are often on a separate server,but not always.
ClientWeb Server Database Server
Q: What’s in the lightning bolts ??
SE-2840 Dr. Mark L. Hornick
8
How are messages sent back and forth?
Generic Client
Generic Server
Request: Internet message from Client to Server
Response: Internet message from Server to Client
router
router
router
router router
SE-2840 Dr. Mark L. Hornick
9
Packaging a message for delivery
Generic ClientGeneric Server
Internet message from Client to Server
router
router
router
router router
Ethernet Frame Header
IP Header(address of
Server)
TCP Header(Part 1 of N)
Application-specific data
of the message
Ethernet Frame Footer
Application-specific data of the message
Internet message packet
Peeling the onion of an internet message
CS-4220 Dr. Mark L. Hornick 10
Ethernet Frame Header
IP Header(address of
Server)
TCP Header(Part 1 of N)
Application-specific data
of the message
Ethernet Frame Footer
The sequence for retrieving a static web page (no db needed)
SE-2840 Dr. Mark L. Hornick
11
Note: This diagram canbe found in your textbook
Browser formats therequest and sends itto the server
HTML (and other)files
…or types aurl into theaddress bar
Server formats theresponse and sends itto the client (browser)
SE-2840 Dr. Mark L. Hornick
12
HTTP: The message protocol of the www
Web BrowserWeb Server
HTTP request
HTTP response
Simplepagefetch…
Q: Does a response always carry a payload?
SE-2840 Dr. Mark L. Hornick
13
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.1Host: faculty-web.msoe.eduAccept: */*\r\n
Request / Response illustrated
SE-2840 Dr. Mark L. Hornick
14
Note: This diagram canbe found in your textbook
SE-2840 Dr. Mark L. Hornick
15
Of all other HTTP requests, POST is the only one commonly used POST
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.
PUT Uploads a representation of the specified resource.
DELETE Deletes the specified resource.
TRACE Echoes back the received request, so that a client can see what intermediate servers
are adding or changing in the request. OPTIONS
Returns the HTTP methods that the server supports. This can be used to check the functionality of a web server.
CONNECT 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. .
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