Title: Hypertext Transfer Protocol (HTTP)
1Hypertext Transfer Protocol (HTTP)
Madhusri Nayak CISC 856 TCP/IP and Upper Layer
Protocols Fall 2004
Thanks to Dr. Amer, UDEL for some of the slides
used in this presentation Thanks to Forouzan for
some slides used in this presentation
2Motivation ?
Tim-Berners Lee
- Created by Tim Berners-Lee at CERN (Centre
European pour Rechearche Nucleaire) - physicists, not computer scientists
- to share data from physics experiments
- because ftp was too heavy
- Standardized and much expanded by IETF
Aerial View of CERN
3Basic HTTP Protocol
HTTP
HTTP
TCP
TCP
IP
IP
Link
Link
Physical
- Goal transfer data
- Stateless, Application-layer protocol
- Request-Response Protocol, uses TCP port 80
4HTTP Version
HTTP/ltmajorgt.ltminorgt
HTTP/0.9 HTTP/1.0 HTTP/1.1
5Overview of a browser
TCP connection
6(No Transcript)
7Request Message
A-PDU
- 3 request methods
- GET, HEAD, POST
GET /pub/index.html HTTP/1.0 Date Wed, 20 Mar
2002 100002 GMT From amer_at_udel.edu User-Agent
Mozilla/4.03
8Response Message
HTTP/1.1 200 OK Date Tue, 08 Oct 2002 003135
GMT Server Apache/1.3.27 tomcat/1.0 Last-Modified
7Oct2002 234001 GMT Accept-Ranges
bytes Content-Length 27723 Keep-Alive
timeout5, max300 Connection Keep-Alive Content-
Type text/html
9Status Codes
- 200 OK
- 201 Created
- 202 Accepted
- 204 No Content
- 301 Moved Permanently
- 302 Moved Temporarily
- 304 Not Modified
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 500 Internal Server Error
- 501 Not Implemented
- 502 Bad Gateway
- 503 Service Unavailable
Classes 1xx Informational - not used, reserved
for future 2xx Success - action was
successfully received, understood, and
accepted 3xx Redirection - further action
needed to complete request 4xx Client Error -
request contains bad syntax or cannot be
fulfilled 5xx Server Error - server failed to
fulfill an apparently valid request
10Headers
11Example Of Request/Response
12Performance Issues
13FTP vs. HTTP
14FTP vs. HTTP (contd)
15HTTP/1.0 Nonpersistent Connections
Server
Client
SYN
SYN-ACK
3-way handshake
ACK
GET URI HTTP/1.0
URL
ACK
ACK
web page
web page transferred
client parses HTML web page
connection close
16HTTP/1.0 Nonpersistent (contd)
Client
Server
SYN
SYN-ACK
3-Way Handshake
ACK
URL
GET URI HTTP/1.0
ACK
ACK
Web Page with Image1
Web page transfer
Client parses HTML web page
connect close
HTML file gets parsed GET Image 1 will be
issued
17Nonpersistent with parallel Connections (a.k.a.
Parallel Connections Hack)
Client initiates new TCP connections for each
embedded object after parsing the HTML file
18HTTP Delay Estimation
assume web page with 2 images
Non Persistent with Parallel Connections
Non Persistent
Client
Server
Client
Server
Time Delay in RTTs 4
Delay Due to Connection Request/Handshake
Delay Due to HTML Page Request
Time Delay in RTTs 6
Delay Due to Object Request
19Potential HTTP 1.0 Inefficiencies
- v1.0 fetches single URL per TCP connection
- Mean size of responses only a few thousand bytes
? inefficient use of available network bandwidth
- User perceived latency is high
- TCP congestion control not used due to short
transfers
20HTTP/1.1 Default Persistent Connections
GET image 3
Client parses HTML GET image 1
Conn. timeout
GET image 2
- Either client or server can close the connection
21Why Persistent Connections?
- CPU time is saved in routers and hosts
- Reduced Network Congestion fewer packets
- Reduced perceived latency on subsequent requests
22Persistent with pipelining
GET Image 2
Client parses HTML
23HTTP Delay Estimation (contd)
Persistent w/o pipelining
Persistent with pipelining
Server
Client
Server
Client
Time Delay in RTTs 3
Time Delay in RTTs 4
Delay Due to Connection Request/Handshake
Delay Due to HTML Page Request
Delay Due to Object Request
24Quantifying TCP connection overhead
Throughput (bits/second)
Connection Length (bytes)
Figure 3-2 Throughput vs. connection length, RTT
70 msec
25Experimental Results
(NP HTTP/1.0)
Network Latency (seconds)
Number of in lined images
Figure 6-1 Latencies for a remote server, image
size 2544 bytes
26Experimental Results (contd..)
(NP HTTP/1.0)
Network Latency (seconds)
Number of in lined images
Figure 6-2 Latencies for a remote server, image
size 45566 bytes
27TCP-PDUs and round-trip times for HTTP/1.0
Client
Server
SYN
Client opens TCP connection
SYN-ACK
ACK
DAT
Client sends HTTP GET request for /index.html
ACK
DAT
FIN
ACK
ACK
Client parses /index.html
FIN
SYN
Client Opens TCP Connection
ACK
SYN-ACK
ACK
Client Sends HTTP Request for image
DAT
ACK
DAT
Image Begins to Arrive
28TCP-PDUs for HTTP/1.1 (persistent connections)
Client
Server
SYN
Client opens TCP connection
SYN-ACK
ACK
DAT
Client Sends HTTP GET request for /index.html
ACK
DAT
ACK
Client Parses HTML
DAT
Client Sends HTTP Request for image 1-n
ACK
DAT
Image Begins to Arrive
29TCP-PDUs for HTTP/1.1 (persistent connections
with pipelining)
Client
Server
SYN
Client opens TCP connection
SYN-ACK
ACK
DAT
Client Sends HTTP GET request for /index.html
ACK
DAT
ACK
Client Parses HTML
GET Image-1
Client Sends HTTP Request for image 1-n
GET Image-2
GET Image-3
ACK
DAT
Image Begins to Arrive
30Questions?