Material from Computer Networking: A Top Down Approach, 6th edition. J.F. Kurose and K.W. Ross
Application Protocols and HTTP
14-740: Fundamentals of Computer Networks Bill Nace
Application Protocols and HTTP 14-740: Fundamentals of Computer - - PowerPoint PPT Presentation
Application Protocols and HTTP 14-740: Fundamentals of Computer Networks Bill Nace Material from Computer Networking: A Top Down Approach, 6 th edition. J.F. Kurose and K.W. Ross Administrivia Lab #0 due in a week Next time: Paper
Material from Computer Networking: A Top Down Approach, 6th edition. J.F. Kurose and K.W. Ross
14-740: Fundamentals of Computer Networks Bill Nace
Peering, Web & HTTP , DNS, P2P , Queuing Theory
2
3
4
5 TCP UDP
HTTP SMTP DNS
(queries)
VOIP
6
connection to server
messages exchanged between browser and web server
Client Server initiate transport connection accept connection request file send file file received; close connection closed
7
8
receives, renders web objects
response to requests
systems communicate using HTTP
9
PC running IE Mac running Safari Linux running Apache (web server) HTTP Request HTTP Request HTTP Response HTTP Response
http://lists.w3.org/Archives/Public/www-talk/1992JanFeb/0000.html
10
HTTP 1.1 even before it became standard!
2068
11
12
13
14
HTTP-message = Request | Response
15
generic-message = start-line *( message-header CRLF ) CRLF [ message-body ] start-line = Request-line | status-line Zero or more times
Request = Request-Line *(( general-header |request-header |entity-header ) CRLF) CRLF [ message-body ]
Zero or more of general, request or entity headers followed by CRLF, followed by an optional message body
17
Request-Line = Method SP Request-URI SP HTTP-Version CRLF Method = “OPTIONS” | “GET” | “HEAD” | “POST” | “PUT” | “DELETE”
18
19
GET /images/logos.html HTTP/1.1 Host: www.cmu.edu User-agent: mozilla/5.0... Connection: close Accept-language: en-US ¶ ¶ (extra carriage return, line feed) Request-line (GET, POST, ... commands) message-header (x4) CRLF: Carriage return, line feed 2nd CRLF indicates no message-body, thus end of message
20
21
22
HTTP/1.1 200 OK Connection close Date: Wed, 01 Sep 2018 12:16:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 2016 ... Content-Length: 6821 Content-Type: text/html data data data data data ... start-line = Request-line | status-line Recall: status-line = HTTP-version SP Status-Code SP Reason-Phrase CRLF Defined as: Status code Header lines data, e.g. requested HTML file
process
request
be fulfilled
24
this message
later in this message (Location:)
25
layout, links, scripts, etc
image file (logo.gif)
27
GET /index.html HTTP/1.1 <CR> Host: www.google.com <CR> <CR>
28
29
30
connection to cmu.edu on port 80
request message (containing URL /index.html) into connection socket
waiting for connection on port 80 “accepts” connection, responds to sender
message, fetches object, formats response message, sends message into connection
response message. Parses HTML file, discovering 10 referenced image files
Client Server initiate transport connection accept connection request file send file file received; close connection closed
small packet from client to server and back
byte of response
RTT Transmit Time RTT
34
data transfers. Pays extra startup time to avoid congestion (slow-start, windowing, etc)
initial phase
increased significantly
35
download embedded images separately but simultaneously
36
bored), so we click “Back” button
been paid, and thus is wasted
37
38
upon receipt of previous response
Client Server accept connection request
send object
received; request next object send object initiate transport connection
soon as it encounters a referenced object
referenced objects
Client Server accept connection request object send object receive object request object request object send object send object receive object receive object initiate transport connection
41
42
43
Client Origin Server Proxy Server Origin Server HTTP Request HTTP Response Client Request Response
cache this object?
does this object become stale?
server
44
45
Control header
46
validate with server
has up-to-date cached version
in HTTP request
date:
47
Cache HTTP request msg If-modified-since: <date>
not modified
HTTP response HTTP/1.0 200 OK <data>
modified
Server HTTP response HTTP/1.0 304 Not Modified HTTP request msg If-modified-since: <date>
48
mechanism and data types of the Application Layer
format, interaction model and connection management
nonpersistent, parallel or persistent connections, including the pipelined variant
responses, including how they ensure consistency
49