Lecture03 Part1
Lecture03 Part1
Lecture 3 (Part 1)
Web Caching and CDNs, and DNS
Kaushik P. Seshadreesan, Fall 2023
Partially adapted from Kurose & Ross slides: http://gaia.cs.umass.edu/kurose_ross/ppt.htm
Partially adapted from JHU Computer Networks course: https://github.com/xinjin/course-net
L7
Applications Application
built on
L4
Reliable or unreliable transport Transport
built on
L3
Best-effort global packet delivery Network
built on
L2
Best-effort local packet delivery Data link
built on
L1
Physical transfer of bits Physical
L7 Application Application L7
L4 Transport Transport L4
L3 Network Network L3
L2 Data link Data link L2
L1 Physical Physical L1
Application Application
Transport Transport
Network Network Network
Datalink Datalink Datalink
Physical Physical Physical
Application Application
Transport Transport
Network Network Network
Datalink Datalink Datalink
Physical Physical Physical
transport transport
network network controlled
link by OS
link Internet
physical physical
time time
HTTP response time = 2RTT+ file transmission time
09/16/2023 TELCOM 2310 Fall 2024: Lecture 3
Application Layer: 2-12
Recap: Issuing Multiple Requests
• Naïve approach: just repeat the process for each object
– Open TCP connection (incurs 1 RTT)
– Request and retrieve object (incurs 1 RTT + object transfer)
– incurs (at least) 2n RTT to retrieve all objects
• How to improve?
– Parallel connections
– Persistent connections (introduced in HTTP 1.1)
– Pipelining
– Note: can mix and match these techniques
09/16/2023 TELCOM 2310 Fall 2024: Lecture 3 13
Recap: Non-Persistent HTTP (HTTP/1.0) in Parallel
• To reduce response
time, run separate
TCP connection per
initiate initiate initiate
object, but in connection connection connection
for obj 1 for obj 2 for obj 3
parallel
receive
But, 1) has OS overhead of obj 1
multiple TCP sessions; 2) receive
receive obj 3
can violate TCP congestion time
obj 2
time time time time time
control expectations
09/16/2023 TELCOM 2310 Fall 2024: Lecture 3 14
Recap: Persistent HTTP (HTTP/1.1)
• Maintain TCP connection across Pipelined communication
pattern
multiple requests Client Server
– Avoid overhead of setting up and tearing
down many connections
– Better match TCP expectations: allow TCP to
learn RTT and bandwidth characteristics,
support fair bandwidth sharing
• Pipelining to further reduce response
time
Lecture 3 (Part 1)
Web Caching and CDNs, and DNS
Kaushik P. Seshadreesan, Fall 2023
Partially adapted from Kurose & Ross slides: http://gaia.cs.umass.edu/kurose_ross/ppt.htm
Partially adapted from JHU Computer Networks course: https://github.com/xinjin/course-net
Object
transmission
time =
𝑑𝑎𝑡𝑎_𝑠𝑖𝑧𝑒
𝑏𝑎𝑛𝑑𝑤𝑖𝑑𝑡ℎ
O1
O2
O3
O4
Outcomes:
▪ no object transmission delay – reduce data size
▪ lower link utilization – increase free bandwidth HTTP request msg
for other requests If-modified-since: <date> object
▪ can also use cached copy without contacting modified
server – very fast (eliminates RTT), but risks HTTP response after
stale data HTTP/1.1 200 OK <date>
<data>
09/16/2023 TELCOM 2310 Fall 2024: Lecture 3
22
Caching beyond the browser: Proxy Servers
• ISPs (or institutions) can deploy proxy servers (web caches) in their networks
– Increases potential for cache hits compared with browser-only cache (many users access
the same content)
– Reduces network traffic for ISP
– Improves performance for users
Origin Server
Tier-1 ISP
Forward proxies
ISP-1 ISP-2
Clients
09/16/2023 TELCOM 2310 Fall 2024: Lecture 3 23
Forward Proxy: Motivation
Scenario:
▪ access link rate: 15 Mbps origin
▪ LAN rate: 1 Gbps servers
▪ RTT from institutional router to server: 2 sec public
Internet
▪ Web object size: 1 Mbits
▪ Average request rate from browsers to origin
servers: 15/sec
15 Mbps
▪ average data rate to browsers: 15 Mbps access link
Performance: institutional
▪ LAN utilization: .015 network
1 Gbps LAN
▪ access link utilization = 1.0
▪ end-end delay = Internet delay +
access link delay + LAN delay
= 2 sec + unbounded delay (~minutes if not more!) + ~10s of ms
09/16/2023 TELCOM 2310 Fall 2024: Lecture 3
24
Option 1: Upgrade Access Link
Scenario: 150 Mbps
▪ access link rate: 15 Mbps, LAN rate: 1 Gbps origin
▪ RTT from institutional router to server: 2 sec servers
▪ Web object size: 1 Mbits public
Internet
▪ Average request rate from browsers to origin
servers: 15/sec
▪ avg data rate to browsers: 15 Mbps 150 Mbps
15 Mbps
Performance: access link
▪ end-end delay = ??
Cost: web cache (cheap!) local web cache
Tier-1 ISP
Forward proxies
ISP-1 ISP-2
Clients
09/16/2023 TELCOM 2310 Fall 2024: Lecture 3 28
Content Distribution Networks (CDNs)
• Caching and replication by content providers
– May be private CDN built by content provider (e.g. Google, Netflix)
– May be third-party CDN that serves many content providers (e.g. Akamai, Limelight)
• Aim to get content closer to users – servers distributed across the globe and
placed in or close to access ISPs
– Reduce propagation delay
– Reduce number of links traversed (reduce chance of encountering congested
“bottleneck link”)
– Reduce backbone traffic (and lower content provider cost)
– Improve fault tolerance
• Can combine reactive caching and proactive replication
– Pull: Cache content requested by clients
– Push: Proactively replicate content expected to have high access rates
server IP address
where’s One Piece?
DNS
• Scalable
• Easy to maintain
• Highly available
• No single point of failure
• Fast lookups
are iterated
09/16/2023 TELCOM 2310 Fall 2024: Lecture 3
46
DNS name resolution: recursive query
root DNS server
Example: host at sci.pitt.edu wants IP
address for gaia.cs.umass.edu 2 3
7 6
Recursive query: 1 TLD DNS server
▪ puts burden of name
resolution on contacted 8
name server requesting host at local DNS server
5 4
▪ All the queries can be sci.pitt.edu sci.pitt.edu
gaia.cs.umass.edu
recursive (not common)
▪ Usually the query from the
host to the local server is authoritative DNS server
recursive and all the rest dns.cs.umass.edu
iterative (like previous
example)
09/16/2023 TELCOM 2310 Fall 2024: Lecture 3
47
DNS Caching
▪ How DNS caching works
• DNS servers (at every level) cache responses to queries
• Responses include a “time to live” (TTL) field
• Server deletes cached entry after TTL expires
▪ Caching can greatly reduce overhead
• The top-level servers very rarely change
• Popular sites visited often
• Local DNS server often has the information cached
▪ But, cached entries may be out-of-date (best-effort name-to-address
translation)
• if host changes its IP address, may not be known Internet-wide until all TTLs
expire
• recursion desired
answers (variable # of RRs)
• recursion available
• reply is authoritative authority (variable # of RRs)
identification flags