The World Wide Web application
• The first killer application that really caught the general public’s eye
Copyright By PowCoder代写 加微信 powcoder
• Invented in 1989 by Lee and his associates
• Wide-area hypermedia information retrieval initiative aiming to give universal access to a large universe of documents.
• Client-Server application
The world’s first web page:
Key components:
1. HTML 2. HTTP
Web server Web browser
http://info.cern.ch/hypertext/WWW/TheProject.html Application Layer 2-2 Timer Berner’s Lee interview: https://www.w3.org/People/Berners-Lee/Kids.html
The World Wide Web application
referenced by its URL
PC running Firefox browser
running Apache Web server
base html file
html – Hypertext Markup Language
html file containing a form
1. HTML 2. HTTP
3. Web server
4. Web browser
iphone running Safari browser
www.massey.ac.nz/~nhreyes
Key components:
Application Layer 2-3
Web and HTTP
Hypertext Markup Language (html)
• Mark up to describe structure of document
– Basically the markup is a suggestion to the browser how to present the content.
Hello World!
• HTML tags + attributes define how content is displayed
A simple example of an html 5 file The world’s first web page: http://info.cern.ch/hypertext/WWW/TheProject.html
Web and HTTP
First, a review…
web page consists of base HTML-file which includes
several referenced objects
web page consists of objects
object can be HTML file, JPEG image, Java applet, audio file,…
each object is addressable by a URL(Uniform Resource Locator)
example URL: http://www.someschool.edu:80/someDept/sun.gif
host name of object’s path name server and filename
Application 2-5
HTTP overview
RFC 1945 and 2616 and 7540
Client/Server Model
HTTP: hypertext transfer protocol
Web’s application layer protocol
PC running
defines the communication protocol between a client and a server
Mozilla Firefox
client/server model
Server running
client: browser that requests, receives, “displays” Web objects
Apache Web server
server: Web server sends objects in response to requests
Mac running
v.1.0 v.1.1
Application 2-6
HTTP overview (continued)
HTTP is a “stateless” protocol
client initiates TCP connection (creates socket) to server, port 80
server maintains no information about past client requests
server accepts TCP connection from client
HTTP messages (application- layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server)
protocols that maintain “state” are complex!
TCP connection closed
if server/client crashes, their views of “state” may be inconsistent, and must be reconciled
TCP segment
TCP header
past history (state) must be maintained
Application 2-7
HTTP development
Next, we are going to examine several enhancements made to HTTP over the years.
Our focus is on the design issues concerning the creation/destruction of TCP connections for data transfer.
2: Application Layer 8
HTTP connections
non-persistent HTTP
persistent HTTP
at most one object is sent over a TCP connection.
multiple objects can be sent over single TCP connection between client, server.
Application 2-9
Non-persistent HTTP
(contains base HTML file and references to 10 jpeg images)
suppose user enters URL: www.someSchool.edu/someDepartment/home.index
1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 80
1b. HTTP server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client
2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object someDepartment/home.index
3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket
Application 2-10
6. Steps 1-5 repeated for each of 10 jpeg objects
Nonpersistent HTTP (cont.)
5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects
4. HTTP server closes TCP connection.
In a non-persistent connection, each TCP connection transports exactly one request message and one response message.
Application 2-11
Non-Persistent HTTP: Response time Client
definition of RTT: time for a small packet to travel from client to server and back.
response time:
initiate TCP connection
one RTT to initiate TCP connection
one RTT for HTTP request and first few bytes of HTTP response to return
request file
time to transmit file
File (object) transmission time
file received
For each object,
total = 2RTT+transmission time
Application 2-12
Persistent HTTP
non-persistent HTTP issues:
persistent HTTP
Server closes the TCP connection after sending a response message
server leaves the TCP connection open after sending a response message
requires 2 RTTs per object, plus the object’s transmission time
subsequent HTTP messages between same client/server are sent over the open TCP connection
OS overhead (TCP buffers and variables) for each TCP connection establishment
client sends a request as soon as it encounters a referenced object
browsers often open parallel TCP connections to fetch referenced objects
as little as one persistent TCP connection for all the referenced objects
Wireshark filter: http.connection
Application 2-13
HTTP non-persistent connection: example
http://media.pearsoncmg.com/aw/aw_kurose_network_2/applets/http/http.html
2: Application Layer 15
HTTP: non-persistent with parallel connections: example
2: Application Layer 16
Close TCP Close TCP
HTTP persistent connection: example
2: Application Layer 17
HTTP Pipelining: a feature introduced in HTTP/1.1 but did not really take off.
allows a client to send multiple HTTP requests on a single TCP connection without waiting for the corresponding responses
HTTP/1.1 specification requires servers to respond to pipelined requests correctly, sending back non-pipelined but valid responses, even if server does not support HTTP pipelining
many legacy HTTP/1.1 servers do not support pipelining correctly, forcing most web browsers not to use HTTP pipelining in practice
superseded by multiplexing via HTTP/2.
HTTP persistent with pipelining: example
HTTP pipelining: example (4 objects)
Note: The option to enable pipelining has been removed from Chrome, as there are known crashing bugs and known front- of-queue blocking issues. There are also a large number of servers and middleboxes that behave badly and inconsistently when pipelining is enabled
One of the biggest problems with pipelining is that one request can take a long time and stall other requests behind it in the pipeline. We need techniques to avoid and recover from that situation.
HTTP Pipelining with HTTP proxy servers
web proxy server may suffer from a HOL blocking problem, significantly slowing down its response (responses must be in the same order of the received HTTP requests)
a web proxy server may be transparent from the web browser (because they are used anyway without requiring user client configuration). Along an HTTP chain of web proxy servers, if one of them fails, HTTP pipelining will not work
Browser Settings
Google Chrome
Mozilla Firefox about:config
about:flags
chrome://view-http-cache/ about:about
About:cache
https://addons.mozilla.org/en-
It is considered poor etiquette to make too many connections to a single server and may lead to you being banned from that server.
network.http.max-connections 256 network.http.max-connections-per-server 6 network.http.max-persistent-connections-per-proxy 8 4 network.http.max-persistent-connections-per-server 6 8 network.http.pipelining false network.http.pipelining.maxrequests 32 network.http.proxy.pipelining false
Note that Google Chrome does not even allow you to fiddle with this parameter at all.
Note: As technology advances, these properties/values change
https://bugs.chromium.org/p/chromium/issues/detail?id=119332
https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/Mozilla_networking_preferences
2: Application Layer 22
gb/firefox/addon/cacheviewer/
Browser Settings
Internet Explorer You need to modify the
How to change the default keep-alive time-out value in Internet Explorer
registry to change the
https://support.microsoft.com/en-nz/help/813827/how-to- change-the-default-keep-alive-time-out-value-in-internet- explor
PERSISTENT HTTP
connections settings.
Note: As technology advances, these properties/values change
2: Application Layer 23
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com