Sie sind auf Seite 1von 50

Computer Networks

CDN and DNS

1
Question on differences between
connection and circuit
• Connection
A transport layer concept
Resources are reserved at end hosts (sender & receiver)
Need the underlying network layer to send data

• Circuit
A network layer concept
Resources are reserved at each hop
Circuit switching is one way to support a connection;
packet switching is the other way

2
Agenda
• CDN: Content Distribution Network
• DNS: Domain Name System

3
Recap:
Improving HTTP performance
• Optimizing connections using three “P”s
Persistent connections
Parallel/concurrent connections
Pipelined transfers over the same connection

4
Caching
• Why does caching work?
Exploit locality of reference

• How well does caching work?


Very well, up to a limit
Large overlap in content
But many unique requests
• Empirical result: effectiveness of caching (cache hit ratio) grows
logarithmically with user size

5
Caching: How
• Modifier to GET requests:
If-modified-since – returns “not modified” if
resource not modified since specified time

GET /somedir/page.html HTTP/1.1


Host: www.someschool.edu
User-agent: Mozilla/4.0
If-modified-since: Wed, 18 Jan 2017 10:25:50 GMT
(blank line)

6
Caching: How
• Modifier to GET requests:
If-modified-since – returns “not modified” if
resource not modified since specified time
• Client specifies “if-modified-since” time in
request
• Server compares this against “last
modified” time of resource
• Server returns “Not Modified” if resource
has not changed
• …. or a “OK” with the latest version
otherwise

7
Caching: How
• Modifier to GET requests:
If-modified-since – returns “not modified” if
resource not modified since specified time
• Response header:
Expires – how long it’s safe to cache the resource
No-cache – ignore all caches; always get resource
directly from server

8
Caching: Where?
• Options
Client (browser)
Forward proxies
Reverse proxies
Content Distribution Network

The Cache-control header in http defines control info

9
Caching: Where?
• Many clients transfer same information
Generate unnecessary server and network load
Clients experience unnecessary latency

Server

Tier-1 ISP

ISP-1 ISP-2

Clients
10
Caching with Reverse Proxies
• Cache documents close to server
Decrease server load
By content provider

Reverse proxies

Tier-1 ISP

ISP-1 ISP-2

Clients
11
Caching with Forward Proxies
• Cache documents close to clients
Reduce network traffic and decrease latency
By ISPs or enterprises

Reverse proxies

Tier-1 ISP
Forward proxies

ISP-1 ISP-2

Clients
12
Replication
• Replicate popular Websites across many machines
Spread load across servers
Place content closer to clients
Help when content isn’t cacheable

13
Content Distribution Networks
(CDN)
• Caching and replication as a service
• Large-scale distributed storage infrastructure
(usually) administered by one entity
e.g., Akamai has servers in 20,000+ locations
• Combination of caching and replication
Pull: Direct result of clients’requests (caching)
Push: Expectation of high access rate (replication)
• Can do some processing to handle dynamic
webpage content

14
CDN example – Akamai
• Akamai creates new domain names for each client
e.g., a128.g.akamai.net for cnn.com
• The client content provider modifies content so
that embedded URLs reference new domains
“Akamaize” content
e.g., http://www.cnn.com/image-of-the-day.gif becomes
http://a128.g.akamai.net/image-of-the-day.gif
• Requests now sent to CDN’s infrastructure

15
How to direct clients to particular
replicas?
• In order to
Balancing load across server replicas
Pairing clients with nearby servers to decrease latency
and overall bandwidth usage

16
DNS

TCP Layer Vulenrabilities 17


Internet names & addresses
• Machine addresses: e.g., 141.212.113.143
Router-usable labels for machines
Conforms to network structure (the “where”)
• Machine names: e.g., cs.jhu.edu
Human-usable labels for machines
Conforms to organizational structure (the “who”)
• The Domain Name System (DNS) is how we map
from one to the other
A directory service

18
Why?
• Convenience
Easier to remember www.google.com than
216.58.216.100

• Provides a level of indirection!


Decoupled names from addresses
Many uses beyond just naming a specific host

19
Goals
• Uniqueness: no naming conflicts
• Scalable
Many names and frequent updates
• Distributed, autonomous administration
Ability to update my own (machines’) names
Don’t have to track everybody’s updates
• Highly available
• Lookups are fast
• Perfect consistency is a non-goal
20
How?
• Partition the namespace
• Distribute administration of each partition
Autonomy to update my own (machines’) names
Don’t have to track everybody’s updates
• Distribute name resolution for each partition
• How should we partition things?

21
Key idea: Hierarchy
• Three intertwined hierarchies
Hierarchical namespace
• As opposed to original flat namespace
Hierarchically administered
• As opposed to centralized
(Distributed) hierarchy of servers
• As opposed to centralized storage

22
Key idea: Hierarchy
$ sftp subidh

subidh

10.5.20.4

23
DNS Hierarchy

root

org net ac.in com uk ca

wisc ucb iitbhila cmu mit

www Placement ftp

www

TCP Layer Vulenrabilities 24


DNS Hierarchy
DNS Hierarchy

facebook
DNS Type

• Primary DNS Server (Authoratative)


Stores a file about zone of its authority

• Secondary DNS Server


Loads information from Primary DNS server
DNS Type
Name Servers and Zones
A client prog Of dns that that
fetches ip of a url Keep all URL vs
8.8.8.8
serves data for both IP mapping of an
Client typed url in iitbhilai.ac.in and organization
browser iisc.ac.in zones

14.139.54.198
8.8.8.8
iitbhilai.ac.in

Client Resolver Name Server


DNS client
Recursive nameserver: It fetches multiple domains for clients

Delegation: A name server may not have a zone but may iisc.ac.in
have the link of another nameserver who has the zone 29
Zones
The Resolution Process
• Let’s look at the resolution process step-by-step:

Debobroto’s machine
ping www.facebook.com.
TCP Layer Vulenrabilities 30
The Resolution Process

Resolver

What’s the IP address


of
www.facebook.com?

Debobroto’s machine
ping www.facebook.com.
TCP Layer Vulenrabilities 31
The Resolution Process

m.root-servers.net
Resolver

What’s the IP address


of
www.facebook.com?

Debobroto’s machine
ping www.facebook.com.
TCP Layer Vulenrabilities 32
The Resolution Process
• The root server m refers DNS to the com name servers
• This type of response is called a “referral”

m.root-servers.net
Resolver
Here’s a list of the
com name servers.
Ask one of them.

Debobroto’s machine
ping www.facebook.com.
TCP Layer Vulenrabilities 33
The Resolution Process

What’s the IP address


of
www.facebook.com?

m.root-servers.net
Resolver

f.gtld-servers.net

Debobroto’s machine
ping www.facebook.com.
TCP Layer Vulenrabilities 34
The Resolution Process

Here’s a list of the


facebook.com
name servers.
Ask one of them.
m.root-servers.net
Resolver

f.gtld-servers.net

Debobroto’s machine
ping www.facebook.com.
TCP Layer Vulenrabilities 35
The Resolution Process

What’s the IP address


of
www.facebook.com?

m.root-servers.net
Resolver

ns1.sanjose.facebook.net

f.gtld-servers.net

Debobroto’s machine
ping www.facebook.com.
TCP Layer Vulenrabilities 36
The Resolution Process

m.root-servers.net
Resolver

Here’s the IP ns1.sanjose.facebook.net


address for
www.facebook.com
f.gtld-servers.net

Debobroto’s machine
ping www.facebook.com.
TCP Layer Vulenrabilities 37
The Resolution Process
• The name server DNS responds to Debobroto
with www.facebook.com’s address
Here’s the IP
address for
www.facebook.com

m.root-servers.net
Resolver

ns1.sanjose.facebook.net

f.gtld-servers.net

Debobroto’s machine
ping www.facebook.com.
TCP Layer Vulenrabilities 38
Resolution Process
(Caching)
• After the previous query, the name server DNS now knows:
The names and IP addresses of the com name servers
The names and IP addresses of the facebook.com name
servers
The IP address of www.facebook.com
• Let’s look at the resolution process again

Debobroto’s machine
ping ftp.facebook.com.
TCP Layer Vulenrabilities 39
Resolution Process
(Caching)

m.root-servers.net
Resolver

What’s the IP address ns1.sanjose.facebook.net


of ftp.facebook.com?

f.gtld-servers.net

Debobroto’s machine
ping www.facebook.com.
TCP Layer Vulenrabilities 40
Resolution Process
(Caching)
• DNS has cached a NS record indicating ns1.sanjose is an
facebook.com name server, so it asks it for
ftp.facebook.com’s address
What’s the IP address
of ftp.facebook.com?

m.root-servers.net
Resolver

ns1.sanjose.facebook.net

f.gtld-servers.net

Debobroto’s machine
ping ftp.facebook.com.
TCP Layer Vulenrabilities 41
Resolution Process
(Caching)
• The facebook.com name server ns1.sanjose
responds with ftp.facebook.com’s address
DNS responses are cached

NS records are also cached

-ive queries are also cached m.root-servers.net


Resolver
Cache data timed out periodically

Here’s the IP
address for ns1.sanjose.facebook.net
ftp.facebook.com
f.gtld-servers.net

Debobroto’s machine
ping ftp.facebook.com.
TCP Layer Vulenrabilities 42
DNS Packet
• Query ID:
16 bit random value
Links response to query

TCP Layer Vulenrabilities 43


DNS Packet

TCP Layer Vulenrabilities 44


Response to resolver
Response contains IP addr
of next NS server
(called “glue”)

Response ignored if
unrecognized QueryID

TCP Layer Vulenrabilities 45


DNS root servers
• 13 root servers letter.root-servers.net (letter is a
label A-M)
A Verisign, Dulles, VA
C Cogent, Herndon, VA
D U Maryland College Park, MD
G US DoD Vienna, VA K RIPE London
H ARL Aberdeen, MD
J Verisign I Autonomica, Stockholm
E NASA Mt View, CA
F Internet Software
Consortium M WIDE Tokyo
Palo Alto, CA

B USC-ISI Marina del Rey, CA


L ICANN Los Angeles, CA

46
Inserting Resource Records into
DNS
• Register foobar.com at registrar (GoDaddy)
Provide registrar with names and IP addresses of your
authoritative name server(s)
Registrar inserts RR pairs into the .com TLD server:
• (foobar.com, dns1.foobar.com, NS)
• (dns1.foobar.com, 212.44.9.129, A)
• Store resource records in your server
dns1.foobar.com
e.g., type A record for www.foobar.com
e.g., type MX record for foobar.com

47
Two ways to resolve a name
• Recursive name resolution
Ask server to do it for you
• Iterative name resolution
Ask server who to ask next
• The iterative example we saw is a mix of both!

48
Reliability
• Replicated DNS servers (primary/secondary)
Name service available if at least one replica is up
Queries can be load-balanced between replicas
• Usually, UDP used for queries
Reliability, if needed, must be implemented on UDP
• Try alternate servers on timeout
Exponential backoff when retrying same server
• Same identifier for all queries
Don’t care which server responds

49
Thanks!
Q&A

50

Das könnte Ihnen auch gefallen