49
Katz, Stoica F04 EE122: DNS and the Web (after a little more multicast) October 27, 2003

Katz, Stoica F04 EE122: DNS and the Web

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Katz, Stoica F04 EE122: DNS and the Web

Katz, Stoica F04

EE122: DNS and the Web

(after a little more multicast)

October 27, 2003

Page 2: Katz, Stoica F04 EE122: DNS and the Web

Katz, Stoica F04

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

Page 3: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

3Katz, Stoica F04

Barriers to Multicast

Hard to change IP- multicast means change to IP

- details of multicast were very hard to get right

Not always consistent with ISP economic model- charging done at edge, but single packet from edge can

explode into millions of packets within network

Troublesome security model- Anyone can send to a group

- Denial-of-service attacks on known groups

Page 4: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

4Katz, Stoica F04

Application Layer Multicast (ALM)

Let the hosts do all the “special” work- only require unicast from infrastructure

Basic idea:- hosts do the copying of packets

- set up tree between hosts

Example: Narada [Yang-hua et al, 2000]- Small group sizes <= hundreds of nodes

- Typical application: chat

Page 5: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

5Katz, Stoica F04

Narada: End System Multicast

Stanford

CMU

Stan1

Stan2

Berk2

“Overlay” TreeGatech

Berk1

Berkeley

GatechStan1

Stan2

CMU

Berk1

Berk2

Page 6: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

6Katz, Stoica F04

Algorithmic Challenge

Choosing replication/forwarding points among hosts

- how do the hosts know about each other

- and know which hosts should forward to other hosts

Page 7: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

7Katz, Stoica F04

Advantages of ALM

No need for changes to IP or routers

No need for ISP cooperation

End hosts can prevent other hosts from sending

Easy to implement reliability- use hop-by-hop retransmissions

Page 8: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

8Katz, Stoica F04

Performance Concerns

Stretch- ratio of latency in the overlay to latency in the

underlying network

Stress- number of duplicate packets sent over the same

physical link

Page 9: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

9Katz, Stoica F04

Performance Concerns

Duplicate Packets:

Bandwidth Wastage

CMU

Stan1

Stan2

Berk2

Gatech

Berk1

Delay from CMU to

Berk1 increases

Stanford

Berkeley

GatechStan1

Stan2

CMU

Berk1

Berk2

Page 10: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

10Katz, Stoica F04

Single Sender Multicast

Many problems with IP multicast disappear if each group is associated with a single source

Hosts joining multicast group can send join messages to source

- this sets up delivery tree

- no worry about “root” being in wrong place

This solves several problems:- better security and charging model

- simple algorithm

Page 11: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

11Katz, Stoica F04

Example

Group members: M1, M2, M3

source

M1

M2 M3

control (join) messagesdata

Page 12: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

12Katz, Stoica F04

What’s Wrong with SSM?

Multiple sources?- can set up group per source, or...

- source can serve as relay for other senders

Algorithm?- trivial

So, why isn’t SSM the answer?- multicast no longer serves as “rendezvous”

- ok for “broadcast” apps, not good for “meeting” apps

Page 13: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

13Katz, Stoica F04

What Do You Need to Know?

DVRMP CBT SSM How they compare

Page 14: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

14Katz, Stoica F04

Today’s Lecture: 17

Network (IP)

Application

Transport

Link

Physical

2

7, 8, 9

10,11

17, 18, 19

14, 15, 16

21, 22, 23

25

6

Page 15: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

15Katz, Stoica F04

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 16: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

16Katz, Stoica F04

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

Page 17: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

17Katz, Stoica F04

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 18: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

18Katz, Stoica F04

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.

Page 19: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

19Katz, Stoica F04

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 20: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

20Katz, Stoica F04

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

Page 21: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

21Katz, Stoica F04

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 22: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

22Katz, Stoica F04

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

Page 23: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

23Katz, Stoica F04

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

4

5

6

Page 24: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

24Katz, Stoica F04

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

Page 25: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

25Katz, Stoica F04

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 26: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

26Katz, Stoica F04

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

Page 27: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

27Katz, Stoica F04

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 28: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

28Katz, Stoica F04

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!

Page 29: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

29Katz, Stoica F04

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 30: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

30Katz, Stoica F04

Important Properties of DNS

Administrative delegation and distributed server architecture results in:

Easy unique naming

Fate sharing for network failures

Reasonable trust model

Page 31: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

31Katz, Stoica F04

The Web

A distributed database of “pages”

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

- Browsers: retrieve and display “pages” - URLs: way to refer to pages

Need a protocol to transfer information between clients and servers

- HTTP

Page 32: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

32Katz, Stoica F04

Uniform Record Locator

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

Extend the idea of hierarchical namespaces to include anything in a file system- ftp://www.eecs.berkeley.edu/122/Lecture6/presentation.ppt

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

k&MsgId=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 33: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

33Katz, Stoica F04

Web and DNS

URLs use hostnames

Thus, content names are tied to specific hosts

This is bad!

URNs are one proposal to achieve persistence

Page 34: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

34Katz, Stoica F04

Hyper Text Transfer Protocol

Client-server architecture Synchronous request/reply protocol

- Runs over TCP, Port 80

Stateless Uses unicast

Page 35: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

35Katz, Stoica F04

Big Picture

Client ServerTCP Syn

TCP syn + ack

TCP ack + HTTP GET

...

Establishconnection

Requestresponse

Client request

Closeconnection

Page 36: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

36Katz, Stoica F04

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 37: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

37Katz, Stoica F04

Response Codes

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

Page 38: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

38Katz, Stoica F04

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 39: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

39Katz, Stoica F04

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>

Page 40: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

40Katz, Stoica F04

Example (from Kurose and Ross)

http://www.mylife.org/mypictures.htm After finding out the IP address of the host…1. http client initiates a TCP connection on :802. Client sends the get request via socket established in 13. Server sends the html file, which is encapsulated in its

response4. http server tells tcp to terminate connection5. http client receives the file and the browser parses it…

contains ten jpeg images6. Client repeats steps 1-4

Page 41: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

41Katz, Stoica F04

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 42: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

42Katz, Stoica F04

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)

Page 43: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

43Katz, Stoica F04

HTTP/1.0 Caching

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 44: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

44Katz, Stoica F04

Web Proxies

Intermediaries between client and server

Client 1

Proxy Proxy Server

Client 2

Client N

...

Page 45: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

45Katz, Stoica F04

HTTP/1.1 (1996)

Performance: - Persistent connections

- Pipelined requests/responses

- …

Support for virtual hosting Efficient caching support

- Network Cache assumed more explicitly in the design

- Gives more control to the server on how it wants data cached

Page 46: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

46Katz, Stoica F04

Persistent Connections

Allow multiple transfers over one connection Avoid multiple TCP connection setups Avoid multiple TCP slow starts

Page 47: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

47Katz, Stoica F04

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

Page 48: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

48Katz, Stoica F04

What You Need to Know

DNS: record types, and how they are used

HTTP basics (and essential differences between 1.0 and 1.1)

Page 49: Katz, Stoica F04 EE122: DNS and the Web

04/10/23 16:38

49Katz, Stoica F04

What’s the Moral of this Story?

QoS and IP Multicast:- interesting algorithmic and architectural issues

- thousands of academic papers

- ubiquitous in routers, but not deployed by ISPs

- little or no impact on end users

DNS and the Web:- no research papers on topic before deployment

- really boring designs

- they changed the world....