web application architecture and protocols of the www cs-4220 dr. mark l. hornick1
TRANSCRIPT
CS-4220 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?
A three-tier model (Client, Server, Database) is a common web application architecture
CS-4220Dr. Mark L. Hornick
4
Databases are often on a separate server,but not always.
ClientWeb Server Database
Q: What’s in the lightning bolts ??
CS-4220 Dr. Mark L. Hornick 5
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
CS-4220 Dr. Mark L. Hornick 7
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 8
Ethernet Frame Header
IP Header(address of
Server)
TCP Header
(Part 1 of N)
Application-specific data of the message
Ethernet Frame Footer
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 browser9
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 10
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 11
The sequence for retrieving a static web page (no db needed)
CS-4220 Dr. Mark L. Hornick12
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)
CS-4220 Dr. Mark L. Hornick 13
HTTP: The message protocol of the www
Web Browser
Web Server
HTTP request
HTTP response
Simplepagefetch…
Q: Does a response always carry a payload?
CS-4220 Dr. Mark L. Hornick 14
The HTTP GET Request is the most commonly issued message
GET requests the retrieval of a resource specified via a URL
Example: http://people.msoe.edu/hornick/Courses/cs4220/mypage.htm
URLs you type into the address bar of a web browser are always formatted into GET Requests:
GET /hornick/Courses/cs4220/mypage.htm HTTP/1.1Host: people.msoe.eduAccept: */*<CRLF>
Request / Response illustrated
CS-4220 Dr. Mark L. Hornick 15
Note: This diagram canbe found in your textbook
CS-4220 Dr. Mark L. Hornick 16
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
CS-4220 Dr. Mark L. Hornick 17