Transcript ppt

Higher level protocols
Domain Naming System, DNS
HTTP
1
Overview
• What do names do?
–
–
–
–
–
identify objects
help locate objects
define membership in a group
specify a role
convey knowledge of a secret
• Name space
– defines set of possible names
– consists of a set of name to value bindings
2
Properties
•
•
•
•
•
•
•
Names versus addresses
Location transparent versus location-dependent
Flat versus hierarchical
Global versus local
Absolute versus relative
By architecture versus by convention
Unique versus ambiguous
3
Examples
• Hosts
cheltenham.cs.princeton.edu
192.12.69.17
192.12.69.17
80:23:A8:33:5B:9F
• Files
/usr/llp/tmp/foo
(server, fileid)
• Users
Larry Peterson
[email protected]
4
Examples (cont)
• Mailboxes
2
cs.princeton.edu
Name
server
User
1
user @ cs.princeton.edu
Mail
program
192.12.69.5
192.12.69.5
3
4
TCP
192.12.69.5
5
IP
5
Domain Naming System
• Hierarchy
edu
princeton … mit
cs
com
gov
cisco … yahoo nasa … nsf
mil
org
arpa … navy
acm … ieee
net
uk
fr
ee physics
ux01 ux04
• Name
chinstrap.cs.princeton.edu
6
Name Servers
• Partition hierarchy into zones
edu
princeton … mit
cs
ee
com
gov
cisco … yahoo nasa … nsf
mil
org
arpa … navy
acm … ieee
net
uk
fr
physics
ux01 ux04
• Each zone implemented by
two or more name servers
Root
name server
Princeton
name server
CS
name server
…
…
Cisco
name server
EE
name server
7
Resource Records
• Each name server maintains a collection of resource records
(Name, Value, Type, Class, TTL)
• Name/Value: not necessarily host names to IP addresses
• Type
– NS: Value gives domain name for host running name server that
knows how to resolve names within specified domain.
– CNAME: Value gives canonical name for particle host; used to
define aliases.
– MX: Value gives domain name for host running mail server that
accepts messages for specified domain.
• Class: allow other entities to define types
• TTL: how long the resource record is valid
8
Root Server
(princeton.edu, cit.princeton.edu, NS, IN)
(cit.princeton.edu, 128.196.128.233, A, IN)
(cisco.com, thumper.cisco.com, NS, IN)
(thumper.ciscoe.com, 128.96.32.20, A, IN)
…
9
Princeton Server
(cs.princeton.edu, optima.cs.princeton.edu, NS, IN)
(optima.cs.princeton.edu, 192.12.69.5, A, IN)
(ee.princeton.edu, helios.ee.princeton.edu, NS, IN)
(helios.ee.princeton.edu, 128.196.28.166, A, IN)
(jupiter.physics.princeton.edu, 128.196.4.1, A, IN)
(saturn.physics.princeton.edu, 128.196.4.2, A, IN)
(mars.physics.princeton.edu, 128.196.4.3, A, IN)
(venus.physics.princeton.edu, 128.196.4.4, A, IN)
10
CS Server
(cs.princeton.edu, optima.cs.princeton.edu, MX, IN)
(cheltenham.cs.princeton.edu, 192.12.69.60, A, IN)
(che.cs.princeton.edu, cheltenham.cs.princeton.edu,
CNAME, IN)
(optima.cs.princeton.edu, 192.12.69.5, A, IN)
(opt.cs.princeton.edu, optima.cs.princeton.edu,
CNAME, IN)
(baskerville.cs.princeton.edu, 192.12.69.35, A, IN)
(bas.cs.princeton.edu, baskerville.cs.princeton.edu,
CNAME, IN)
11
Name Resolution
• Strategies
Root
name
server
2
– forward
– iterative
– recursive
3
1
cicada.cs.princeton.edu
Client
192.12.69.60
8
4
Local
name
server
cicada.cs.princeton.edu Princeton
name
server
cs.princeton.edu, 192.12.69.5
5
• Local server
– need to know root at only one
place (not each host)
– site-wide cache
6
7
CS
name
server
12
1.
2.
3.
4.
5.
6.
The user clicks on a link to indicate which document is to be
retrieved.
The browser must determine the address that contains the
document. It does this by sending a query to its local name
server.
Once the address is known the browser establishes a connection to the
specified machine, usually a TCP connection. In order for the
connection to be successful, the specified machine must be ready to
accept TCP connections.
The browser runs a client version of HTTP, which issues a request
specifying both the name of the document and the possible document
formats it can handle.
The machine that contains the requested document runs a server
version of HTTP. It reacts to the HTTP request by sending an
HTTP response which contains the desired document in the
appropriate format.
The TCP connection is then closed and the user may view
the document.
Web Transfers Revisited
13
Request
HTTP
client
HTTP
server
Response
14
HTTP Client-Server Interaction
HTTP
server
HTTP
client
Ephemeral
Port 80
Port #
GET
80, #
TCP
TCP
#, 80
STATUS
15
HTTP Request Operations
• OPTIONS: Request information about available
options
• GET: Retrieve document in URL
• HEAD: Retrieve metainformation about document
in URL
• POST: give information to server
• PUT: store document under specified URL
• DELETE: delete specified URL
• TRACE: loopback request message
16
HTTP Result codes
• Code
• 1xx
• 2xx
• 3xx
• 4xx
• 5xx
Type
Example Reasons
Informational request received
Success
action successfully
received, accepted
Redirection Page moved, further action
necessary
Client error bad syntax
Server error server failed for valid req.
17
Application A
Application B
Application
Layer
Application
Layer
Presentation
Layer
Presentation
Layer
Session
Layer
Session
Layer
Transport
Layer
Communication Network
Transport
Layer
Network
Layer
Network
Layer
Network
Layer
Network
Layer
Data Link
Layer
Data Link
Layer
Data Link
Layer
Data Link
Layer
Physical
Layer
Physical
Layer
Physical
Layer
Physical
Layer
Electrical and/or Optical Signals
Layered Architecture Revisited
18
User
Interface
Control
Server PI
Server
DTP
Server FTP
Connection
Data
User PI
User DTP
Connection
User FTP
PI = Protocol interpreter
DTP = Data transfer process
FTP Protocol
19
PING
C:\WINDOWS>ping nal.toronto.edu
Pinging nal.toronto.edu [128.100.244.3] with 32 bytes of data:
Reply
Reply
Reply
Reply
from
from
from
from
128.100.244.3:
128.100.244.3:
128.100.244.3:
128.100.244.3:
bytes=32
bytes=32
bytes=32
bytes=32
time=118ms
time=118ms
time=118ms
time=118ms
TTL=243
TTL=243
TTL=243
TTL=243
C:\WINDOWS>
20