Simplified Operation

General Operation

Using Caches


//Request
GET /wireshark-labs/HTTP-wireshark-file1.html HTTP/1.0
Host: gaia.cs.umass.edu
//Response
HTTP/1.0 200 OK
Date: Tue, 05 Nov 2013 09:37:56 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Tue, 05 Nov 2013 09:37:01 GMT
Content-Length: 128
Content-Type: text/html
Congratulations. You've downloaded the file
http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file1.html!
//Request
HEAD /wireshark-labs/HTTP-wireshark-file1.html HTTP/1.0
Host: gaia.cs.umass.edu
//Response
HTTP/1.0 200 OK
Date: Tue, 05 Nov 2013 09:37:56 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Tue, 05 Nov 2013 09:37:01 GMT
Content-Length: 128
Content-Type: text/html
What has changed?
Create TCP-Connection ONCE and use it for several request/response pairs. (Reduces Load on Network and gets Results faster)
Usage of Header 'Connection: keep-alive' in request indicates the intention to use a persistent connection
Servers have the last word, only if Header 'Connection: keep-alive' is included in request ==> connection is persistent now
GET /wireshark-labs/HTTP-wireshark-file1.html HTTP/1.1
Host: gaia.cs.umass.edu
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
If-None-Match: "8734d-80-c649c940"
If-Modified-Since: Tue, 05 Nov 2013 09:37:01 GMT
HTTP/1.1 200 OK
Date: Tue, 05 Nov 2013 09:59:49 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Tue, 05 Nov 2013 09:59:01 GMT
ETag: "8734d-80-14f76340"
Accept-Ranges: bytes
Content-Length: 128
Keep-Alive: timeout=10, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
Congratulations. You've downloaded the file http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file1.html!
//Request
GET / HTTP/1.1
Host: www.orf.at
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
//Response
HTTP/1.1 200 OK
Date: Tue, 05 Nov 2013 10:08:50 GMT
Server: Jetty(6.1.22)
X-Cache: HIT from localhost
ETag: "XOyamG4ZEJIhX3vZRY0UvA=="
Content-Length: 15805
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Accept-Ranges: none
Connection: close
Client can issue several requests in a row without having to wait for each response (Speedup)

GET / HTTP/1.1
User-Agent: Wget/1.13.3 (linux-gnu)
Accept: */*
Host: homegateway.lan
Connection: Keep-Alive
Message Body is transferred in separate CHUNKS and reassembled to a response in the client.HTTP/1.1 200 OK Connection: close Date: Thu, 15 Sep 2011 08:48:47 GMT Transfer-Encoding: chunked Content-Type: text/html//Body //CHUNK1 //CHUNK2 //CHUNK3 //CHUNK4
Request only part of a Object (saves Bandwidth)
//Request
GET /examples/dog.jpg HTTP/1.1
Host: www.someschool.edu
Range: bytes=0-999
HTTP/1.0 206 Partial Content
Date: Mon, 05 May 2008 00:36:57 GMT
Server: Apache/2.0.52 (Red Hat)
Accept-Ranges: bytes
Content-Length: 1000
Content-Range: bytes 0-999/3980
Content-Type: image/jpeg
binary data.....binary data...
//cache-request-directives
"no-cache"
"no-store"
"max-age" "=" delta-seconds
"max-stale" [ "=" delta-seconds ]
"min-fresh" "=" delta-seconds
"no-transform"
"only-if-cached"
//cache-response-directives
"public"
"private" [ "=" <"> 1#field-name <"> ]
"no-cache" [ "=" <"> 1#field-name <"> ]
"no-store"
"no-transform"
"must-revalidate"
"proxy-revalidate"
HTTP/1.0 had only the field 'LastModified' to check if a cached website is still fresh
HTTP/1.1 introduces ETag as new Validator and a bunch of new Header-Fields for conditional GET
cond. GET - HeaderFields
Source: http://tools.ietf.org/html/draft-ietf-httpbis-http2-04
Today, important features of HTTP/1.1 like persistent connections and pipelining are used only sparsely because often, not all hosts on the request/response chain support it.(e.g proxys)
HTTP/2.0 is a way to demand that all participants support those features
It will include a broad use of security-mechanisms like encryption
It reduces the number of TCP-Connections needed by using individual ones more efficiently (connection multiplexing)
This is achieved by letting independent Streams (>100) share one HTTP/2.0 connection
The streams allow a concurrent execution of different requests/responses
FlowControl is present for the DATA-frames of each stream and for the connection as well
No more Text, instead binary encoded frames
Smallest unit of transfer is a 'Frame'

Different types of frames

Encapsulates one request-response pair
Each stream has a state (idle, reserved, open, halfclosed, closed)
Today - HTTP-Headers can be relatively large and redundant, the goal is to transmit them more efficiently
After receiving a certain request, a server can decide that it is the best to send neccessary files without being asked for it
That way, a server can speed up the transfer of Objects by sending them without request if it is inevitable to send them
This way, mediafiles can be present at the client before he starts to realize that he has to request them, saving precious bandwith
telnet mailsrv.uni.at 25
Trying 123.204.666.43...
Connected to mailsrv.uni.at.
Escape character is '^]'.
220 mailsrv.at ESMTP Postfix
HELO foobar.example.net
250 mailsrv.uni.at
MAIL FROM:
250 2.1.0 Ok
RCPT TO:
250 2.1.5 Ok
DATA
354 End data with .
From: user@edu.uni.at
To: user@gmail.com
Subject: Vorzeigeeffekt
Hi,
don't panic
sincerely you
Lg
.
250 2.0.0 Ok: queued as CE22E160A77
3 phases of interaction
C: telnet mailServer 110
S: +OK POP3 server ready
C: user bob
C: pass swordfish
S: +OK user successfully logged on
C: list
S: 1 498
S: 2 912
S: .
C: retr 1
S: (blah blah ...
S: ..............
S: ........blah)
S: .
C: dele 2
C: quit
S: +OK POP3 server signing off
+
-
Root DNS Server: Map the top level domain - part of the hostname to Ip-Adresses of TLD-servers
Top-level domain servers (TLD): Map the domainName - part of the hostname to the IP-Address of the responsible Authoritative Servers
Authoritative DNS server: Knows the translation of Hostname -> IP-Adress of host in his domain
Local DNS server: Acts like a proxy for DNS-Requests, first asked, caches responses

(Name, Value, Type, TTL)