Persistent with pipelining
Download
Report
Transcript Persistent with pipelining
HyperText Transfer Protocol
(HTTP)
RICHI GUPTA
CISC 856: TCP/IP and Upper Layer Protocols
Fall 2007
Thanks to Dr. Amer, UDEL for some of the slides used in this presentation
Thanks to Madhusri Nayak for some of the slides used in this presentation
Motivation ?
Single informational network
Light protocol
Speed
Tim-Berners Lee
HTTP Versions
Format : HTTP/<major>.<minor>
HTTP/0.9 – No RFC
HTTP/1.0 – RFC 1945
HTTP/1.1 – RFC 2616
2
Director of the W3C
Position of HTTP in the TCP/IP Protocol suite
Application-layer
Transport layer
HTTP
TCP
IGMP ICMP
Network layer
IP
ARP
RARP
Data link layer
Physical layer
3
Underlying LAN or
WAN
Request –Response Protocol
User-Agent
(browser/client)
Origin Server
DNS query
DNS Server
URL
DNS response
HTTP request
TCP connection
HTTP response
optional TCP connections
4
A-PDU format (cont’d)
Request Line
Request Type
Header format
6
space
Request
Type
space
HTTP
version
URL
GET , HEAD, POST, PUT , TRACE , CONNECT ,
OPTION
space
Header
Name
:
Header
Value
General Header
Date , Pragma, Cache control ,Connection,
MIME-version, Upgrade, Transfer encoding
Request Header
From, Referer, User-agent, Authorization,
If-Modified-Since, Accept *
Entity Header
Content-length, Content-type, Contentencoding, Last-modified, Expires, Upgrade
Response Header
Location, Age, Retry-after, Server
A-PDU format Cont’d…
Status Line
space
HTTP
Version
space
Status Code
Status
Phrase
1xx: Informational
Continue (100) , Switching Protocols(101)
2xx: Success - action was successfully received, understood, and accepted
Created (201), Accepted (202), No Content (204), OK (200)
3xx: Redirection - further action needed to complete request
Moved Permanently (301) , Moved Temporarily (302), Not Modified (304)
4xx: Client Error - request contains bad syntax or cannot be fulfilled
Bad Request (400), Unauthorized (401), Forbidden (403), Not Found (404)
5xx: Server Error - server failed to fulfill an apparently valid request
Internal Server Error (500), Not Implemented (501), Bad Gateway (502),
Service Unavailable (503)
7
Example Of Request/Response
8
Note: Headers are in ascii format.
4 variations of HTTP
Nonpersistent with one connection
Nonpersistent with parallel connections
Persistent without pipelining
Persistent with pipelining
Nonpersistent (HTTP /1.0 default)
Client
Server
SYN
3-way
handshake
SYN-ACK
ACK
GET web page HTTP/1.0
Get web page
OK
Web page
Web page
transferred
Client parses
HTML web
page
FIN
Ack
Data
Connection
close
1.Found referenced object
“Image 1”
2. Found referenced object
11 “Image 2”
FIN
ACK
Nonpersistent (cont’d)
Client
Server
SYN
SYN-ACK
3-Way
Handshake
ACK
GET image1 HTTP/1.0
Get image1
Image1
OK
Image 1
Transferred
FIN
Connection
close
ACK
FIN
ACK
Client
Server
SYN
3-Way
Handshake
SYN-ACK
ACK
GET image2 HTTP/1.0
OK
Image 2
Transferred
FIN
Connection
close
ACK
FIN
ACK
12
Get image2
Image2
Ack
Data
Key points
Connection does not persist for other objects
Connections are sequential
13
Rough calculation for number of RTTS
Client
Server
Web Page
Can we reduce the number of RTTS?
Image 1
Image 2
Delay due to connection request/handshake
Time delay in RTTs = 6
14
Delay Due to HTML Page Request
Delay Due to Object Request
Nonpersistent with parallel connections
( browser dependent)
15
Client
Server
SYN
SYN-ACK
3-Way
Handshake
ACK
GET web page HTTP/1.0
Get web page
Web page
OK
Web page
Client parses
Transferred
HTML web page
FIN
1. Referenced object
“Image 1”
2. Referenced object Connection close
“Image 2”
ACK
FIN
ACK
Parallel connections
Client
Client
SYN
SYN
3-Way
Handshake
Server
Server
3-Way
Handshake
SYN-ACK
SYN-ACK
ACK
GET image2 HTTP/1.0
GET image1 HTTP/1.0
OK
Image 1
Transferred
Get image2
Get image1
Image1
OK
Image 2
Image2
Transferred
FIN
FIN
Connection
close
16
ACK
FIN
ACK
Connection
close
ACK
FIN
Ack
ACK
Data
Rough calculation
Client
Server
Web page
Image1 &
Image2
Time delay in RTTs = 4
Delay due to connection request/handshake
Delay due to HTML page request
Delay due to object request
17
Disadvantages:
overhead of multiple TCP connections
A busy server could end up with lots of connections in the ‘TIME-
WAIT’ state
Seldom does each connection get past the ‘slow-start’ region
failure to use the full end-to-end available bandwidth
extra time opening connections increases user-perceived latency
Can HTTP be further improved?
18
Persistent without pipelining
Client
3-Way
Handshake
Web page
Transferred
Server
SYN
SYN-ACK
GET web page HTTP/1.1
Get web page
OK
Get image2
Image2
OK
Image 2
Web
Transferred
page
Timer started
Timer started
OK
GET image1 HTTP/1.1
Image 1
Transferred
GET image2 HTTP/1.1
Timer starte
Time Out
Get image1
Image1
FIN
Timer started
Connection
close
ACK
FIN
ACK
Ack
20
Note: 1) Requests are sequential
2) Timer is at application layer
Data
Rough calculation
Client
Server
Web page
Image1
Image2
Time delay in RTTs = 4
Delay due to connection request/handshake
Delay due to HTML page request
Delay due to object request
21
Persistent with pipelining
22
Client
3-Way
Handshake
Web page
Transferred
Server
SYN
SYN-ACK
GET webpage HTTP/1.1
OK
GET image1 HTTP/1.1
Get web
page
GET image2 HTTP/1.1
ACK
ACK
Web
page
Get
image1
Get
image2
Back to back requests
OK
Client parses
Image 1
web page;
Gets Image 1
Gets Image 2
Image 1
Image 2
OK
Image 2
Timer started
Time Out
Timer started
FIN
ACK
FIN
Connection
close
23
ACK
Ack
Data
Rough calculation
Client
Server
Web page
24
Image1 &
Image2
Time delay in RTTs = 3
Delay due to connection request/handshake
Delay due to HTML page request
Delay due to object request
24
Advantages:
fewer connections
• Reduced network traffic
• CPU time is saved in routers and hosts
Reduced perceived latency on subsequent requests
Either client or server can close the connection
Disadvantages:
Connections stay open longer at the server
25
Network Latency (seconds)
Experimental Results
(NP HTTP/1.0) without parallel connections
(Persistent without pipelining)
(Persistent with pipelining)
Number of in lined images
27
Figure 6-1: Latencies for a remote server, image size = 2544 bytes
Network Latency (seconds)
Experimental Results (cont’d)
(NP HTTP/1.0) without parallel connections
(Persistent without pipelining)
(Persistent with pipelining)
Number of in lined images
Figure 6-2: Latencies for a remote server, image size = 45566 bytes
28
Summary: 4 variations of HTTP
Nonpersistent with 1 connection
One TCP connection at a time
Server initiates connection close
Nonpersistent with parallel connections
More than one TCP connection at a time
Server initiates connection close
Persistent without pipelining
One TCP connection at a time
Sequential requests of embedded web page objects
Server or client initiates connection close
Persistent with pipelining
One TCP connection at a time
Back to back requests for embedded web page objects
Server or client initiates connection close
Questions?
Do you know?
IE will only
Firefox
Pipelining
willisopen
implemented
4
2 parallel entirely
HTTP connections
at the browser
to aend.
named server by default
35
Thanks