Lecture - 06 - Chapter 2 - 05 Sep 2024
Lecture - 06 - Chapter 2 - 05 Sep 2024
Lecture 6
Chapter 2
~
~ entity body ~
~ body
* Check out the online interactive exercises for more examples: http://gaia.cs.umass.edu/kurose_ross/interactive/
Application Layer: 2-8
Server-to-Client
Communication
❖ HTTP Response Message
▪ Status line: protocol version, status code, status phrase
▪ Response headers: provide information
▪ Body: optional data
Cookies
Maintaining user/server state: cookies
a stateful protocol: client makes
Recall: HTTP GET/response two changes to X, or none at all
interaction is stateless
X
▪ no notion of multi-step exchanges
of HTTP messages to complete a X
Web “transaction”
• no need for client/server to track X
“state” of multi-step exchange ’
t’
• all HTTP requests are independent of X
each other ’’
3 4
6 5
HTTP GET
Referrer: NY Times Sports
4
7493: NY Times sports, 2/15/22
5
“third party” cookie – HTTP reply
from website you did NY Times: 1634 Set cookie: 7493
not choose to visit AdX: 7493
AdX.com
Cookies: tracking a user’s browsing behavior
nytimes.com AdX:
▪ tracks my web browsing
socks.com over sites with AdX ads
2
HTTP 1 ▪ can return targeted ads
GET based on browsing history
HTTP GET
Referrer: socks.com, cookie:
7493
4
7493: NY Times sports, 2/15/22
5 7493: socks.com, 2/16/22
HTTP reply
NY Times: 1634 Set cookie: 7493
AdX: 7493
AdX.com
Cookies: tracking a user’s browsing behavior (one day later)
nytimes.com (arts)
socks.com HTTP HTTP
GET reply
cookie: 1634 Set cookie: 1634
HTTP GET
Referrer: nytimes.com, cookie: 7493
4
7493: NY Times sports, 2/15/22
5 7493: socks.com, 2/16/22
HTTP reply 7493: NY Times arts, 2/15/22
NY Times: 1634 Set cookie: 7493
AdX: 7493 Returned ad for socks!
AdX.com
Cookies: tracking a user’s browsing behavior
Cookies can be used to:
▪ track user behavior on a given website (first party cookies)
▪ track user behavior across multiple websites (third party cookies)
without user ever choosing to visit tracker site (!)
▪ tracking may be invisible to user:
• rather than displayed ad triggering HTTP GET to tracker, could be an
invisible link
queueing delays
at high
utilization!
Option 1: buy a faster access link
Scenario: 154 Mbps
▪ 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: 15/sec
▪ avg data rate to browsers: 1.50 Mbps 154 Mbps
1.54 Mbps
access link
Performance:
▪ access link utilization = .97 .0097 (= 0.97%) institutional
network
1 Gbps LAN
▪ LAN utilization: .0015
▪ end-end delay = Internet delay +
access link delay + LAN delay
= 2 sec + minutes + usecs
Cost: faster access link (expensive!) msecs
Application Layer: 2-26
Option 2: install a web cache
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: 15/sec
▪ avg data rate to browsers: 1.50 Mbps
1.54 Mbps
access link
Cost: web cache (cheap!)
institutional
network
Performance: 1 Gbps LAN
▪ LAN utilization: .? How to compute link
▪ access link utilization = ? utilization, delay?
▪ average end-end delay = ? local web cache
lower average end-end delay than with 154 Mbps link (and cheaper too!)
Problem with Web Cache (Proxy Server)
O1
O2
O1 O3
O2
O3
O4
O4
objects delivered in order requested: O2, O3, O4 wait behind O1 Application Layer: 2-33
HTTP/2: mitigating HOL blocking
HTTP/2: objects divided into frames, frame transmission interleaved
server
O2
O3
O1
O4
2-36