April 5th Lecture Presentation
April 5th Lecture Presentation
April 5th Lecture Presentation
Computer Networks
1
Happy Bayrams to all....
2
Happy 31st Birthday Turkish Internet
3
Protocol Suites
• HTTP/0.9 Tim
Berners-Lee - 1991
Engelbart - https://youtu.be/74c8LntW7fo
As we may think, The Atlantic Monthly, July 1945
http://www.theatlantic.com/doc/194507/bush
6
December 9, 1968 demo by Doug Engelbart
at SRI (Stanford Research Institute)
7
Web and HTTP
web page consists of objects, each of which can be
stored on different Web servers
object can be HTML file, JPEG image, Java applet, audio
file,…
web page consists of base HTML-file which includes
several referenced objects, each addressable by a URL,
e.g.,
www.someschool.edu/someDept/pic.gif
• Why stateless?
— Hint: it was a design decision due to the nature of transactions
HTTP overview
HTTP: hypertext transfer protocol
Web’s application layer protocol
Textual protocol (Headers are PC running
textual – like SMTP) Firefox browser
client/server model:
• client: browser that requests,
receives, (using HTTP protocol) and server running
Apache Web
“displays” Web objects server
• server: Web server sends (using HTTP
protocol) objects in response to iPhone running
Safari browser
requests
HTTP overview (continued)
HTTP uses TCP: HTTP is “stateless”
client initiates TCP connection server maintains no
(creates socket) to server, port 80 information about past client
server accepts TCP connection from requests
client aside
protocols that maintain “state”
HTTP messages (application-layer are complex!
protocol messages) exchanged past history (state) must be
between browser (HTTP client) and maintained
Web server (HTTP server) if server/client crashes, their
TCP connection closed views of “state” may be
inconsistent, must be reconciled
HTTP message structure: general format
Response / request
method sp URL sp version cr lf
line
header field name value cr lf
header
~
~ ~
~ lines
~
~ entity body ~
~ body
HTTP request message
two types of HTTP messages: request, response
HTTP request message:
• ASCII (human-readable format) carriage return character
line-feed character
request line (GET, POST, GET /index.html HTTP/1.1\r\n
HEAD commands) Host: www.mit.edu\r\n
User-Agent: Firefox/3.6.10\r\n
Accept: text/html,application/xhtml+xml\r\n
header Accept-Language: en-us,en;q=0.5\r\n
lines Accept-Encoding: gzip,deflate\r\n
Accept-Charset: ISO-8859-1,utf-8;q=0.7\r\n
Keep-Alive: 115\r\n
Connection: keep-alive\r\n
carriage return, line \r\n
feed at start of line
indicates end of
header lines
General Header Fields
• Contain information that is not directly related to data to be
transferred
— some are for connection management
— for example
• Keep-alive: to keep the TCP connection open for a while; needed for
persistent connections (shall see persistent connections later)
— can be used for both request and response
Other HTTP request messages
GET method (for sending data to
server): HEAD method:
requests headers (only) that
include user data in URL field of HTTP would be returned if specified
GET request message URL were requested with an
HTTP GET method.
POST method: PUT method:
web page often includes form
uploads new file (object) to
input
server
user input sent from client to
completely replaces file that
server in entity body of HTTP
exists at specified URL with
POST request message
content in entity body of POST
HTTP request message
HTTP response message
status line (protocol HTTP/1.1 200 OK\r\n
status code status phrase) Date: Sun, 26 Sep 2010 20:09:20 GMT\r\n
Server: Apache/2.0.52 (CentOS)\r\n
Last-Modified: Tue, 30 Oct 2007 17:00:02 GMT\r\n
ETag: "17dc6-a5c-bf716880"\r\n
header Accept-Ranges: bytes\r\n
lines Content-Length: 2652\r\n
Keep-Alive: timeout=10, max=100\r\n
Connection: Keep-Alive\r\n
Content-Type: text/html; charset=ISO-8859-1\r\n
\r\n
time time
Non-pers HTTP response time = 2RTT+ file trans. time
Non-persistent HTTP: example
User enters URL: www.mit.edu/someDepartment/home.index
(containing text, references to 10 jpeg images)
RTT time to
Transmit
index file
time to 1 index, 10 image files
RTT transmit
image file
RTT time to T=RTT+RTT+10xRTT+all trans. times
transmit
image file
RTT time to
transmit
image file
time time 25
initiate TCP RTT
Persistent, with pipeline
connection
RTT time to
Transmit
index file
time to 1 index, 10 image files
RTT transmit
image file
time to T=RTT+RTT+RTT+all trans. times
transmit
image file
time time 26
Maintaining user/server state:
cookies
Recall: HTTP GET/response interaction is stateless
Web sites and client browser use cookies to maintain some
state between transactions
four components:
1) cookie header line of HTTP response message
2) cookie header line in next HTTP request message
3) cookie file kept on user’s host, managed by user’s
browser
4) back-end database at Web site
Maintaining user/server state:
cookies
client
server
usual HTTP request msg Amazon server
cookie file creates ID backend
usual HTTP response 1678 for user create database
amazon 1678 set-cookie: 1678 entry
usual HTTP request msg
cookie: 1678 cookie- access
specific
action
usual HTTP response msg
one week later: access
amazon 1678 usual HTTP request msg
cookie: 1678 cookie-
specific
usual HTTP response msg action
time
time
HTTP cookies: comments
aside
What cookies can be used for: cookies and privacy:
authorization cookies permit sites to
shopping carts learn a lot about you on
their site.
recommendations
third party persistent
user session state (Web e-mail) cookies (tracking
cookies) allow common
identity (cookie value)
Challenge: How to keep state: to be tracked across
protocol endpoints: maintain state at
multiple web sites
sender/receiver over multiple transactions
cookies: HTTP messages carry state
Web caches (proxy servers)
Goal: satisfy client request without involving origin server
32
Caching example
Scenario:
access link rate: 1.54 Mbps origin
RTT from institutional router to server: 2 sec servers
Web object size: 100K bits public
Internet
Average request rate from browsers to origin
servers: 15reqs/sec
average data rate to browsers: 1.50 Mbps
1.54 Mbps
Performance: problem: large
access link
GET O4 GET O
3 GET O2
GET O1
object data requested
client
O1
O2
O1
O2 O3
O3
O4
O4
GET O4 GET O
3 GET O2
object data requested
GET O1
client
O2
O4
O3 O1
O2
O3
O1 O4
• It uses UDP
• HTTP/3's use of UDP is specifically built on top of the QUIC
(Quick UDP Internet Connections) protocol
• HTTP/3 aims to enhance the performance and security of web
communication, especially in scenarios with high latency or
unreliable network conditions
40