Download presentation
Presentation is loading. Please wait.
Published byMargaret Gabriella Hoover Modified over 8 years ago
1
HyperText Transfer Protocol (HTTP) Deepti Kulkarni CISC 856: TCP/IP and Upper Layer Protocols Fall 2008 Acknowledgements Professor Amer Richi Gupta
2
Motivation ? Single informational network Light protocol Speed Tim-Berners Lee Director of the W3C 2 HTTP Versions Format : HTTP/. HTTP/0.9 – No RFC HTTP/1.0 – RFC 1945 HTTP/1.1 – RFC 2616
3
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 WAN
4
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)
5
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
6
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.
7
GET, HEAD, POST, PUT, TRACE, CONNECT, OPTION URL HTTP version space Request Line 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 HeaderContent-length, Content-type, Content- encoding, Last-modified, Expires, Upgrade Response Header Location, Age, Retry-after, Server A-PDU format (cont’d)
8
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 Version Status Line space A-PDU format (cont’d) …
9
Variations of HTTP Nonpersistent connections with serial connections with parallel connections Persistent connections without pipelining with pipelining
10
Nonpersistent (HTTP /1.0 default)
11
SYN SYN-ACK ACK ClientServer 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 FIN
12
Nonpersistent (cont’d) Ack Data SYN SYN-ACK ACK Client Server GET image1 HTTP/1.0 OK FIN Image 1 Transferred Connection close 3-Way Handshake Get image1 FIN ACK Image1 SYN SYN-ACK ACK Client Server GET image2 HTTP/1.0 OK FIN Image 2 Transferred Connection close 3-Way Handshake Get image2 FIN ACK Image2
13
Key points Connection does not persist for other objects Connections are sequential
14
Rough calculation for number of RTTS ClientServer 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
15
Nonpersistent with parallel connections ( browser dependent)
16
Ack Data Parallel connections SYN SYN-ACK ACK Client Server GET web page HTTP/1.0 OK FIN Web page Transferred Connection close 3-Way Handshake Get web page FIN ACK Web page SYN SYN-ACK ClientServer GET image1 HTTP/1.0 OK FIN Image 1 Transferred Connection close 3-Way Handshake Get image1 FIN ACK Image1 SYN SYN-ACK ACK Client Server GET image2 HTTP/1.0 OK FIN Image 2 Transferred Connection close 3-Way Handshake Get image2 FIN ACK Image2 Client parses HTML web page 1. Referenced object “Image 1” 2. Referenced object “Image 2”
17
Rough calculation ClientServer 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
18
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
19
Persistent without pipelining
20
20 FIN Connection close ACK FIN ACK Time Out Ack Data SYN SYN-ACK ClientServer GET web page HTTP/1.1 OK Web 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
21
Rough calculation ClientServer 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
22
Persistent with pipelining
23
Client parses web page; Gets Image 1 Gets Image 2 FIN Connection close FIN ACK Back to back requests Ack Data SYN SYN-ACK ClientServer GET webpage HTTP/1.1 OK Web page Transferred 3-Way Handshake Get web page Web page Image 2 OK Image 2 Get image1 Get image2 GET image1 HTTP/1.1 GET image2 HTTP/1.1 ACK Image 1 OK Time Out Timer started Note: Requests are serviced in order
24
Rough calculation ClientServer 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
25
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
26
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 Network Latency (seconds) (Persistent without pipelining) (Persistent with pipelining)
27
Figure 6-2: Latencies for a remote server, image size = 45566 bytes Experimental Results (cont’d) Number of in lined images Network Latency (seconds) (Persistent without pipelining) (Persistent with pipelining) (NP HTTP/1.0) without parallel connections
28
Questions? Thanks
29
Example Of Request/Response Lets have a live demo! telnet cis.poly.edu 80 GET /~ross/ HTTP/1.1 Host: cis.poly.edu
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.