EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4...

22
1 EECS F05 EECS 122: Introduction to Computer Networks DNS and WWW Computer Science Division Department of Electrical Engineering and Computer Sciences University of California, Berkeley Berkeley, CA 94720-1776 2 EECS F05 Internet Names & Addresses Names: e.g., ariachne.berkeley.edu - human-usable labels for machines - conforms to “organizational” structure Addresses: e.g., 169.229.131.109 - router-usable labels for machines - conforms to “network” structure How do you map from one to another? - Domain Name System (DNS)

Transcript of EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4...

Page 1: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

1

EECS F05

EECS 122:Introduction to Computer Networks

DNS and WWW

Computer Science DivisionDepartment of Electrical Engineering and Computer Sciences

University of California, BerkeleyBerkeley, CA 94720-1776

2EECS F05

Internet Names & Addresses

� Names: e.g., ariachne.berkeley.edu- human-usable labels for machines- conforms to “organizational” structure

� Addresses: e.g., 169.229.131.109- router-usable labels for machines- conforms to “network” structure

� How do you map from one to another?- Domain Name System (DNS)

Page 2: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

2

3EECS F05

DNS: History

� Initially all host-addess mappings were in a file called hosts.txt (in /etc/hosts)- Changes were submitted to SRI by email- New versions of hosts.txt ftp’d periodically from SRI- An administrator could pick names at their discretion

� As the Internet grew this system broke down because:- SRI couldn’t handled the load- Names were not unique- Many hosts had inaccurate copies of hosts.txt

� Internet growth was threatened!- Domain Name System (DNS) was born

4EECS F05

Basic DNS Features

� Hierarchical namespace- As opposed to original flat namespace

� Distributed storage architecture- As opposed to centralized storage (plus replication)

� Client--server interaction on UDP Port 53- But can use TCP if desired

Page 3: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

3

5EECS F05

Naming Hierarchy

� “Top Level Domains” are at the top

� Depth of tree is arbitrary (limit 128)

� Domains are subtrees- E.g: .edu, berkeley.edu, eecs.berkeley.edu

� Name collisions avoided- E.g. berkeley.edu and berkeley.com can

coexist, but uniqueness is job of domain

root

edu com gov mil org net uk fr

berkeley mit

eecs sims

argus

etc.

6EECS F05

Host names are administered hierarchically

root

edu com gov mil org net uk fr

berkeley mit

eecs sims

argus

root

edu com gov mil org net uk fr

berkeley

eecs sims A zone corresponds to an administrative authority that is responsible for that portion of the hierarchy

eecs controls names: x.eecs.berkeley.edu

berkeley controls names: x.berkeley.edu and y.sims.berkeley.edu

Page 4: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

4

7EECS F05

Server Hierarchy

� Each server has authority over a portion of the hierarchy

- A server maintains only a subset of all names

� Each server contains all the records for the hosts in its zone

- Might be replicated for robustness

� Each server needs to know other servers that are responsible for the other portions of the hierarchy

- Every server knows the root- Root server knows about all top-level domains

8EECS F05

DNS Name Servers

� Local name servers:- Each ISP (company) has local default name server- Host DNS query first goes to local name server

� Authoritative name servers:- For a host: stores that host’s (name, IP address)- Can perform name/address translation for that host’s name

� Can also do IP to name translation, but won’t discuss

Page 5: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

5

9EECS F05

DNS: Root Name Servers

� Contacted by local name server that can not resolve name

� Root name server:- Contacts authoritative name

server if name mapping not known

- Gets mapping- Returns mapping to local

name server� ~ Dozen root name servers

worldwide

10EECS F05

Simple DNS Example

Host whistler.cs.cmu.edu wants IP address of www.berkeley.edu

1. Contacts its local DNS server, mango.srv.cs.cmu.edu

2. mango.srv.cs.cmu.edu contacts root name server, if necessary

3. Root name server contacts authoritative name server,ns1.berkeley.edu, if necessary

requesting hostwhistler.cs.cmu.edu

www.berkeley.edu

root name server

authorititive name serverns1.berkeley.edu

local name servermango.srv.cs.cmu.edu

1

23

45

6

Page 6: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

6

11EECS F05

Example of Recursive DNS Query

Root name server:� May not know authoritative

name server� May know intermediate name

server: who to contact to find authoritative name server?

Recursive query:� Puts burden of name

resolution on contacted name server

� Heavy load?

requesting hostwhistler.cs.cmu.edu

www.berkeley.edu

root name server

local name servermango.srv.cs.cmu.edu

1

23

4 5

6

authoritative name serverns1.berkeley.edu

intermediate name server(edu server)

7

8

12EECS F05

Example of Iterated DNS Query

Iterated query:� Contacted server replies

with name of server to contact

� “I don’t know this name, but ask this server”

requesting hostwhistler.cs.cmu.edu

www.berkeley.edu

root name server

local name servermango.srv.cs.cmu.edu

1

2

34

67

authoritative name serverns1.berkeley.edu

intermediate name server(edu server)

5

8

iterated query

Page 7: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

7

13EECS F05

DNS Records

� Four fields:(name, value, type, TTL)

� Type = A: - name = hostname- value = IP address

� Type = NS: - name = domain- value = name of dns server for domain

14EECS F05

DNS Records (cont’d)

� Type = CNAME:- name = hostname

- value = canonical name

� Type = MX:- name = domain in email address- value = canonical name of mail server

Page 8: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

8

15EECS F05

DNS as Indirection Service

� Can refer to machines by name, not address- Not only easier for humans

- Also allows machines to change IP addresses without having to change way you refer to machine

� Can refer to machines by alias- www.berkeley.edu can be generic web server

- but DNS can point this to particular machine that can change over time

� But, this flexibility applies only within domain!

16EECS F05

Special Topics

� DNS caching- Improve performance by saving results of previous

lookups

� DNS “hacks”- Return records based on requesting IP address

� Dynamic DNS- Allows remote updating of IP address for mobile hosts

� DNS politics (ICANN) and branding battles

Page 9: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

9

17EECS F05

Important Properties of DNS

Administrative delegation and distributed server architecture results in:

� Easy unique naming

� Fate sharing for network failures

� Reasonable trust model

18EECS F05

The Web – History (I)

� 1945: Vannevar Bush, Memex:

� "a device in which an individual stores all his books, records, and communications, and which is mechanized so that it may be consulted with exceeding speed and flexibility"

Vannevar Bush (1890-1974)

Memex

(See http://www.iath.virginia.edu/elab/hfl0051.html)

Page 10: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

10

19EECS F05

The Web – History (II)

� 1967, Ted Nelson, Xanadu:- A world-wide publishing network that

would allow information to be stored not as separate files but as connected literature

- Owners of documents would be automatically paid via electronic means for the virtual copying of their documents

� Coined the term “Hypertext”

Ted Nelson

20EECS F05

The Web – History (III)

� World Wide Web (WWW): a distributed database of “pages” linked through Hypertext Transport Protocol (HTTP)

- First HTTP implementation - 1990 • Tim Berners-Lee at CERN

- HTTP/0.9 – 1991

• Simple GET command for the Web- HTTP/1.0 –1992

• Client/Server information, simple caching- HTTP/1.1 - 1996

Tim Berners-Lee

Page 11: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

11

21EECS F05

The Web

� Core components:- Servers: store files and execute remote commands

- Browsers: retrieve and display “pages”- Uniform Resource Locators (URLs): way to refer to pages

� A protocol to transfer information between clients and servers

- HTTP

22EECS F05

Uniform Record Locator (URL)

protocol://host-name:port/directory-path/resource

� Extend the idea of hierarchical namespaces to include anything in a file system- ftp://www.cs.berkeley.edu/~istoica/cs194/05/lecture.ppt

� Extend to program executions as well…- http://us.f413.mail.yahoo.com/ym/ShowLetter?box=%40B%40Bulk&M

sgId=2604_1744106_29699_1123_1261_0_28917_3552_1289957100&Search=&Nhead=f&YY=31454&order=down&sort=date&pos=0&view=a&head=b

- Server side processing can be incorporated in the name

Page 12: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

12

23EECS F05

Web and DNS

� URLs use hostnames

� Thus, content names are tied to specific hosts

� This is bad!

� Uniform Resource Names (URNs) are one proposal to achieve persistence

- Not discussed in this lecture

24EECS F05

Hyper Text Transfer Protocol (HTTP)

� Client-server architecture

� Synchronous request/reply protocol - Runs over TCP, Port 80

� Stateless

Page 13: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

13

25EECS F05

Big Picture

Client ServerTCP Syn

TCP syn + ack

TCP ack + HTTP GET

...

Establishconnection

Requestresponse

Client request

Closeconnection

26EECS F05

Hyper Text Transfer Protocol Commands

� GET – transfer resource from given URL� HEAD – GET resource metadata (headers) only� PUT – store/modify resource under given URL� DELETE – remove resource� POST – provide input for a process identified by

the given URL (usually used to post CGI parameters)

Page 14: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

14

27EECS F05

Response Codes

� 1x informational� 2x success� 3x redirection� 4x client error in request� 5x server error; can’t satisfy the request

28EECS F05

Client Request

� Steps to get the resource:

http://www.eecs.berkeley.edu/index.html

1. Use DNS to obtain the IP address of www.eecs.berkeley.edu

2. Send to an HTTP request:

GET /index.html HTTP/1.0

Page 15: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

15

29EECS F05

Server Response

HTTP/1.0 200 OKContent-Type: text/htmlContent-Length: 1234Last-Modified: Mon, 19 Nov 2001 15:31:20 GMT<HTML><HEAD><TITLE>EECS Home Page</TITLE></HEAD>…</BODY></HTML>

30EECS F05

HTTP/1.0 Example

Client Server

Request image 1

Transfer image 1

Request image 2

Transfer image 2

Request text

Transfer text

Finish displaypage

Page 16: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

16

31EECS F05

HHTP/1.0 Performance

� Create a new TCP connection for each resource- Large number of embedded objects in a web page

- Many short lived connections� TCP transfer

- Too slow for small object- May never exit slow-start phase

� Connections may be set up in parallel (5 is default in most browsers)

32EECS F05

HTTP/1.0 Caching Support

� Exploit locality of reference� A modifier to the GET request:

- If-modified-since – return a “not modified” response if resource was not modified since specified time

� A response header:- Expires – specify to the client for how long it is safe to cache

the resource� A request directive:

- No-cache – ignore all caches and get resource directly from server

� These features can be best taken advantage of with HTTP proxies

- Locality of reference increases if many clients share a proxy

Page 17: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

17

33EECS F05

HTTP/1.1 (1996)

� Performance: - Persistent connections

- Pipelined requests/responses- …

� Efficient caching support- Network Cache assumed more explicitly in the design- Gives more control to the server on how it wants data

cached� Support for virtual hosting

- Allows to run multiple web servers on the same machine

34EECS F05

Persistent Connections

� Allow multiple transfers over one connection

� Avoid multiple TCP connection setups

� Avoid multiple TCP slow starts

Page 18: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

18

35EECS F05

Pipelined Requests/Responses

� Buffer requests and responses to reduce the number of packets

� Multiple requests can be contained in one TCP segment

� Note: order of responses has to be maintained

Client Server

Request 1Request 2Request 3

Transfer 1

Transfer 2

Transfer 3

36EECS F05

Caching and Replication

� Problem: You are a web content provider - How do you handle millions of web clients?

- How do you ensure that all clients experience good performance?

- How do you maintain availability in the presence of server and network failures?

� Solutions:- Add more servers at different locations

�If you are CNN this

might work!- Caching- Content Distribution Networks (Replication)

Page 19: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

19

37EECS F05

“Base-line”

� Many clients transfer same information- Generate unnecessary server and network load

- Clients experience unnecessary latency

Server

Clients

Backbone ISP

ISP-1 ISP-2

38EECS F05

Reverse Caches� Cache documents close to server

�decrease server load

� Typically done by content providers

Clients

Backbone ISP

ISP-1 ISP-2

Server

Reverse caches

Page 20: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

20

39EECS F05

Forward Proxies� Cache documents close to clients

�reduce network traffic

and decrease latency� Typically done by ISPs or corporate LANs

Clients

Backbone ISP

ISP-1 ISP-2

Server

Reverse caches

Forward caches

40EECS F05

Content Distribution Networks (CDNs)

� Integrate forward and reverse caching functionalities into one overlay network (usually) administrated by one entity

- Example: Akamai� Documents are cached both

- As a result of clients’ requests (pull)- Pushed in the expectation of a high access rate

� Beside caching do processing, e.g.,- Handle dynamic web pages

- Transcoding

Page 21: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

21

41EECS F05

CDNs (cont’d)

Clients

ISP-1

Server

Forward caches

Backbone ISP

ISP-2

CDN

42EECS F05

Example: Akamai

� Akamai creates new domain names for each client content provider.

- e.g., a128.g.akamai.net� The CDN’s DNS servers are authoritative for the

new domains� The client content provider modifies its content so

that embedded URLs reference the 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.

Page 22: EECS 122: Introduction to Computer Networks DNS and - Domain Name System (DNS) was born EECS F05 4 Basic DNS Features Hierarchical namespace - As opposed to original flat namespace

22

43EECS F05

Example: Akamai

gethttp://www.nhc.noaa.gov

a

DNS server fornhc.noaa.gov

b

c

localDNS server

www.nhc.noaa.gov“Akamaizes” its content.

“Akamaized” response object has inline URLs for secondary content at a128.g.akamai.netand other Akamai-managed DNS names.

akamai.netDNS servers

lookupa128.g.akamai.net

Akamai servers store/cache secondary

content for “Akamaized”services.

44EECS F05

What You Need to Know

� DNS: record types, and how they are used

� HTTP basics (and essential differences between 1.0 and 1.1)