hypertext transfer protocol (http) deepti kulkarni cisc 856: tcp/ip and upper layer protocols fall...
DESCRIPTION
Position of HTTP in the TCP/IP Protocol suite HTTP TCP Application-layer Transport layer Network layer Data link layer Physical layer IGMPICMP ARPRARP IP Underlying LAN or WANTRANSCRIPT
![Page 1: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/1.jpg)
HyperText Transfer Protocol (HTTP)
Deepti KulkarniCISC 856: TCP/IP and Upper Layer Protocols
Fall 2008
AcknowledgementsProfessor Amer Richi Gupta
![Page 2: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/2.jpg)
Motivation ?
Single informational network
Light protocol
SpeedTim-Berners LeeDirector of the W3CHTTP Versions
Format : HTTP/<major>.<minor> HTTP/0.9 – No RFC
HTTP/1.0 – RFC 1945
HTTP/1.1 – RFC 2616
![Page 3: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/3.jpg)
Position of HTTP in the TCP/IP Protocol suite
HTTP
TCP
Application-layer
Transport layer
Network layer
Data link layer
Physical layer
IGMP ICMP
ARP RARPIP
Underlying LAN or WAN
![Page 4: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/4.jpg)
Quick overview of HTTP
• Generic protocol for communication
• Stateless protocol
• In-band protocol• control information is sent in-band (unlike FTP)
• Pull protocol • pulls information from the server (unlike SMTP which is push
protocol)
![Page 5: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/5.jpg)
Client-Server protocol
HTTP Request
HTTP Response
PC running Explorer/MAC running Navigator
Server running Apache Web server
HTTP Request/Response are over TCP connections
![Page 6: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/6.jpg)
A-PDU format
Request Line
A Blank Line
Body
Entity Headers
Request Headers
General Headers
Request Message
Status Line
A Blank Line
Body
Entity Headers
Response Headers
General Headers
Response Message
Note: Each line ends with ‘cr lf ‘ control characters.
![Page 7: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/7.jpg)
GET , HEAD, POST, PUT , TRACE , CONNECT , OPTION
URL HTTP version
space space
Request Line Request Type
Request Type
Header Name Header format : Header
Value
General Header Date , Pragma, Cache control ,Connection, MIME-version, Upgrade, Transfer encoding
space
Request Header From, Referer, User-agent, Authorization, If-Modified-Since, Accept
Entity Header Content-length, Content-type, Content- encoding, Last-modified, Expires, Upgrade
Response Header Location, Age, Retry-after, Server
A-PDU format (cont’d)
![Page 8: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/8.jpg)
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)
Status Code
Status Phrase
HTTP VersionStatus Line
space spaceA-PDU format (cont’d)…
![Page 9: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/9.jpg)
Variations of HTTP
• Nonpersistent connections• with serial connections• with parallel connections
• Persistent connections• without pipelining• with pipelining
![Page 10: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/10.jpg)
Nonpersistent (HTTP /1.0 default)
![Page 11: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/11.jpg)
SYN
SYN-ACK
ACK
Client Server
GET web page HTTP/1.0
OK
Web page transferred
3-way handshake
Connection close
Get web page
Web page
Client parses HTML web page
FIN
1.Found referenced object “Image 1”2. Found referenced object “Image 2”
Ack
Data
ACK
ACK
FIN
![Page 12: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/12.jpg)
Nonpersistent (cont’d)
Ack
Data
SYNSYN-ACK
ACK
Client Server
GET image1 HTTP/1.0
OK
FIN
Image 1 Transferred
Connection close
3-Way Handshake Get image1
FINACK
ACK
Image1
SYNSYN-ACK
ACK
Client Server
GET image2 HTTP/1.0
OK
FIN
Image 2
Transferred
Connection close
3-Way Handshake Get image2
FINACK
ACK
Image2
![Page 13: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/13.jpg)
Key points Connection does not persist for other objects
Connections are sequential
![Page 14: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/14.jpg)
Rough calculation for number of RTTSClient Server
Delay due to connection request/handshake
Delay Due to HTML Page Request
Delay Due to Object Request
Time delay in RTTs = 6
Can we reduce the number of RTTS?
Web Page
Image 1
Image 2
![Page 15: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/15.jpg)
Nonpersistent with parallel connections( browser dependent)
![Page 16: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/16.jpg)
Ack
Data
Parallel connections
SYN
SYN-ACKACK
Client Server
GET web page HTTP/1.0
OK
FIN
Web page Transferred
Connection close
3-Way Handshake
Get web page
FINACK
ACK
Web page
SYN
SYN-ACK
Client Server
GET image1 HTTP/1.0
OK
FIN
Image 1 Transferred
Connection close
3-Way Handshake
Get image1
FINACK
ACK
Image1
SYN
SYN-ACKACK
Client Server
GET image2 HTTP/1.0
OK
FIN
Image 2
Transferred
Connection close
3-Way Handshake
Get image2
FINACK
ACK
Image2
Client parses HTML web page
1. Referenced object “Image 1”2. Referenced object “Image 2”
![Page 17: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/17.jpg)
Rough calculation
Client Server
Time delay in RTTs = 4 Delay due to connection request/handshake
Delay due to HTML page request
Delay due to object request
Web page
Image1 & Image2
![Page 18: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/18.jpg)
Disadvantages:
• Overhead of multiple TCP connections.
• A busy server could end up with lots of connections in the ‘TIME-WAIT’ state
• Rarely 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
![Page 19: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/19.jpg)
Persistent without pipelining
![Page 20: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/20.jpg)
FIN
Connection close
ACKFIN
ACK
Time Out
Ack
Data
SYNSYN-ACK
Client Server
GET web page HTTP/1.1
OKWeb page Transferred
3-Way Handshake Get web page
Web page
GET image2 HTTP/1.1
OK Image 2 Transferred
Get image2
Image2
GET image1 HTTP/1.1
OK Image 1 Transferred
Get image1
Image1
Note: 1) Requests are sequential 2) Timer is at application layer
Timer started
Timer started
Timer startedTimer started
![Page 21: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/21.jpg)
Rough calculation
Client Server
Time delay in RTTs = 4Delay due to connection request/handshake
Delay due to HTML page request
Delay due to object request
Web page
Image1
Image2
![Page 22: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/22.jpg)
Persistent with pipelining
![Page 23: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/23.jpg)
Client parses
web page;
Gets Image 1
Gets Image 2
FIN
Connection close FIN
ACK
ACK
Back to back requests
Ack
Data
SYNSYN-ACK
Client Server
GET webpage HTTP/1.1
OKWeb page Transferred
3-Way Handshake Get web
page
Web page
Image 2
OK Image 2
Get image1Get image2
GET image1 HTTP/1.1
GET image2 HTTP/1.1ACKACK
Image 1
Image 1OK
Time Out
Timer started
Timer startedNote: Requests are serviced in order
![Page 24: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/24.jpg)
Rough calculation
Client Server
24
Time delay in RTTs = 3
Delay due to connection request/handshake
Delay due to HTML page request
Delay due to object request
Web page
Image1 & Image2
![Page 25: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/25.jpg)
Advantages:
• Fewer connections • Reduced network traffic • CPU time is saved in routers and hosts• Less overhead for the servers
• Reduced perceived latency for clients on subsequent requests
• Either client or server can close the connection
Disadvantages:
• Connections stay open longer at the server
![Page 26: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/26.jpg)
Figure 6-1: Latencies for a remote server, image size = 2544 bytes
Experimental Results
(NP HTTP/1.0) without parallel connections
Number of in lined images
Net
wor
k La
tenc
y (s
econ
ds)
(Persistent without pipelining)
(Persistent with pipelining)
![Page 27: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/27.jpg)
Figure 6-2: Latencies for a remote server, image size = 45566 bytes
Experimental Results (cont’d)
Number of in lined images
Net
wor
k La
tenc
y (s
econ
ds)
(Persistent without pipelining)
(Persistent with pipelining)
(NP HTTP/1.0) without parallel connections
![Page 28: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/28.jpg)
Questions?
Thanks
![Page 29: HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta](https://reader033.vdocuments.us/reader033/viewer/2022052711/5a4d1b937f8b9ab0599c275c/html5/thumbnails/29.jpg)
Example Of Request/Response
Lets have a live demo!• telnet cis.poly.edu 80• GET /~ross/ HTTP/1.1 Host: cis.poly.edu