Uploaded by Geleta Dube

4.naming

advertisement
Module 4 – Distributed Naming
Names, Addresses, etc.
n
Names
l
Identification of objects
Resource sharing: Internet domain names
à Communication: domain name part of email address
à
l
How much information about an object is in a name?
Pure names: uninterpreted bit patterns
à Non-pure names: contain information about the object, e. g., its location
à
n
Name Services
l
l
Entries of the form <name, attributes>, where attributes are typically network
addresses
Type of lookup queries
name → attribute values
à also called name resolution
à
n
Directory Services
l
l
<name, attributes> entries
Types of lookup queries
name → attribute values
à attribute values → names
à
CS454/654
4-2
Composed Naming Domains
URL
http://www.cdk3.net:8888/WebExamples/earth.html
DNS lookup
Resource ID (IP number, port number, pathname)
55.55.55.55 8888 WebExamples/earth.html
Web server
Network address
file
2:60:8c:2:b0:5a
Socket
CS454/654
From Coulouris, Dollimore and Kindberg, Distributed Systems: Concepts and Design, 3rd ed.
© Addison-Wesley Publishers 2000
4-3
Requirements on Name Services
n
Usage of unique naming conventions
l
l
n
Scalability
l
n
l
l
Speed and availability of lookup operations
Name services are at the heart of many distributed applications
Adaptability to change
l
n
Short and mid-term inconsistencies tolerable
In the long term, system should converge towards a consistent state
Performance and availability
l
n
Naming directories tend to grow very fast, in particular in Internet
Consistency
l
n
Enables sharing
It is often not easily predictable which services will eventually share resources
Organizations frequently change structure during lifetime
Fault isolation
l
System should tolerate failure of some of its servers
CS454/654
4-4
Name Spaces
n
n
n
Set of all valid names to be used in a certain context, e. g., all valid URLs
in WWW
Can be described using a generative grammar (e. g., BNF for URLs)
Internal structure
l
l
l
n
Potentially infinite
l
l
n
Holds only for hierarchic name spaces
Flat name spaces finite size induced by max. name length
Aliases
l
n
Flat set of numeric or symbolic identifiers
Hierarchy representing position (e. g., UNIX file system)
Hierarchy representing organizational structure (e. g., Internet domains)
In general, allows a convenient name to be substituted for a more complicated
one
Naming domain
l
Name space for which there exist a single administrative authority for
assigning names within it
CS454/654
4-5
Naming Graph with Single Root
CS454/654
From Tanenbaum and van Steen, Distributed Systems: Principles and Paradigms
© Prentice-Hall, Inc. 2002
4-6
Name Space Distribution (1)
An example partitioning of the DNS name space, including
Internet-accessible files, into three layers.
CS454/654
From Tanenbaum and van Steen, Distributed Systems: Principles and Paradigms
© Prentice-Hall, Inc. 2002
4-7
Name Space Distribution (2)
Item
Global
Administrational
Managerial
Geographical scale of network
Worldwide
Organization
Department
Total number of nodes
Few
Many
Vast numbers
Responsiveness to lookups
Seconds
Milliseconds
Immediate
Update propagation
Lazy
Immediate
Immediate
Number of replicas
Many
None or few
None
Is client-side caching applied?
Yes
Yes
Sometimes
A comparison between name servers for implementing nodes from a large-scale name
space partitioned into a global layer, as an administrational layer, and a managerial layer.
CS454/654
From Tanenbaum and van Steen, Distributed Systems: Principles and Paradigms
© Prentice-Hall, Inc. 2002
4-8
Issues in Name & Directory
Services
n
Partitioning
l
l
n
Replication
l
l
n
No one name server can hold all name and attribute entries for entire
network, in particular in Internet
Name server data partitioned according to domain
A domain has usually more than one name server
Availability and performance are enhanced
Caching
l
Servers may cache name resolutions performed on other servers
à
l
Avoids repeatedly contacting the same name server to look up identical
names
Client lookup software may equally cache results of previous requests
CS454/654
4-9
Name Resolution
n
n
Translation of a name into the related primitive attribute
Often, an iterative process
l
l
n
Name service returns attributes if the resolution can be performed in
it’s naming context
Name service refers query to another context if name can’t be resolved
in own context
Deal with cyclic alias references, if present
l
Abort resolution after a predefined number of attempts, if no result
obtained
CS454/654
4-10
Navigation
Accessing naming data from more than one name server in order
to resolve a name
n
Iterative Navigation
l
l
l
l
Used in DNS
Client contacts one NS
Name Server either resolves
name, or suggests other name
server to contact
Resolution continues until name
resolved or name found to be
unbound
CS454/654
NS2
2
Client
1
NS1
Name
servers
3
From Coulouris, Dollimore and Kindberg, Distributed Systems: Concepts and Design, 3rd ed.
© Addison-Wesley Publishers 2000
NS3
4-11
Iterative Navigation Example
CS454/654
From Tanenbaum and van Steen, Distributed Systems: Principles and Paradigms
© Prentice-Hall, Inc. 2002
4-12
Navigation (2)
n
l
2
Server contacts peers if it cannot
resolve name itself
à
n
NS2
Non-recursive, server-controlled
by multicast or iteratively by
direct contact
1
NS1
client
3
4
Recursive, server-controlled
l
NS3
If name cannot be resolved,
server contacts superior server
responsible for a larger prefix of
the name space
recursively applied until name
resolved
à can be used when clients and
low-level servers are not entitled
to directly contact high-level
servers
NS2
à
CS454/654
2
1
client
4
3
NS1
5
From Coulouris, Dollimore and Kindberg, Distributed Systems: Concepts and Design, 3rd ed.
© Addison-Wesley Publishers 2000
NS3
4-13
Recursive Navigation Example
CS454/654
From Tanenbaum and van Steen, Distributed Systems: Principles and Paradigms
© Prentice-Hall, Inc. 2002
4-14
Recursive Name Resolution
Server for
node
Should resolve
Looks up
Passes to child
Receives and
caches
Returns to
requester
cs
<ftp>
#<ftp>
--
--
#<ftp>
vu
<cs,ftp>
#<cs>
<ftp>
#<ftp>
#<cs>
#<cs, ftp>
ni
<vu,cs,ftp>
#<vu>
<cs,ftp>
#<cs>
#<cs,ftp>
#<vu>
#<vu,cs>
#<vu,cs,ftp>
root
<ni,vu,cs,ftp>
#<nl>
<vu,cs,ftp>
#<vu>
#<vu,cs>
#<vu,cs,ftp>
#<nl>
#<nl,vu>
#<nl,vu,cs>
#<nl,vu,cs,ftp>
n
Recursive name resolution of <nl, vu, cs, ftp>. Name servers cache
intermediate results for subsequent lookups.
CS454/654
From Tanenbaum and van Steen, Distributed Systems: Principles and Paradigms
© Prentice-Hall, Inc. 2002
4-15
Communication Cost Comparison of
Iterative vs Recursive
CS454/654
From Tanenbaum and van Steen, Distributed Systems: Principles and Paradigms
© Prentice-Hall, Inc. 2002
4-16
Name & Directory Services
n
Domain Name System (DNS)
l
n
Global Name Service (GNS)
l
n
ITU - standardized directory service
Jini
l
l
n
Developed at DEC
X. 500
l
n
Name service used across the Internet
Discovery service used in spontaneous networking
Contains directory service component
LDAP
l
l
l
Directory service
Lightweight implementation of X.500
Often used in intranets
CS454/654
4-17
Domain Name System (DNS)
n
n
Performs name-to-IP mapping
Distributed database
l
n
Application-layer protocol
l
n
implemented in hierarchy of many name servers
host, routers, name servers to communicate to resolve names (address/name
translation)
Why not centralize DNS?
single point of failure
l traffic volume
l distant centralized database
l maintenance
ý doesn’t scale!
l
CS454/654
4-18
DNS Types
n
n
No server has all name-to-IP address mappings
Local name servers
l
l
n
Authoritative name server
l
l
n
Each ISP, company has local (default) name server
Host DNS query first goes to local name server
For a host: stores that host’s IP address, name
Can perform name-to-address translation for that host’s name
Root name server
l
Establishes a rooted tree of DNSs
CS454/654
4-19
DNS: Root Name Servers
n
n
Contacted by local name server
that can not resolve name
Root name server:
l
l
l
n
contacts authoritative name
server if name mapping not
known
gets mapping
returns mapping to local name
server
Approximately dozen root name
servers worldwide
CS454/654
4-20
Simple DNS Example
root name server
Host db.utoronto.ca wants IP
address of
malliag.math.uwaterloo.ca
2
4
5
1. Contacts its local DNS server,
dns.utoronto.ca
2. dns.utoronto.ca contacts root
name server, if necessary
local name server
3. root name server contacts authoritative dns.utoronto.ca
name server,
1
dns.uwaterloo.ca, if necessary
6
3
authorititive name server
dns.uwaterloo.ca
requesting host malliag.math.uwaterloo.ca
db.utoronto.ca
CS454/654
4-21
DNS Example
root name server
Root name server:
n
n
may not know authoritative name
2
server
7
may know intermediate name
server: who to contact to find
local name server
authoritative name server
6
3
intermediate name server
dns.uwaterloo.ca
dns.utoronto.ca
1
4
8
5
authoritative name server
dns.math.uwaterloo.ca
requesting host
db.utoronto.ca
malliag.math.uwaterloo.ca
CS454/654
4-22
DNS: iterated queries
root name server
Recursive query:
n
n
Puts burden of name
resolution on contacted
name server
Heavy load?
3
4
7
Iterated query:
n
n
Contacted server replies
with name of server to
contact
“I don’t know this name,
but ask this server”
iterated query
2
local name server
dns.utoronto.ca
1
8
intermediate name server
dns.uwaterloo.ca
5
6
authoritative name server
dns.math.uwaterloo.ca
requesting host
db.utoronto.ca
malliag.math.uwaterloo.ca
CS454/654
4-23
DNS Records
n
DNS holds resource records (RR)
l
n
RR format: (name, value, type,ttl)
Example records:
l
Type=A
is hostname
à value is IP address
à name
l
Type=NS
is domain (e.g. foo.com)
à value is IP address of authoritative name server for this domain
à name
l
Type=CNAME
is an alias name for some “canonical” (the real) name
à value is canonical name
à name
l
Type=MX
CS454/654
à value
is hostname of mail server associated with name
4-24
DNS Record Types
Record type Meaning
Main contents
A
NS
CNAME
SOA
WKS
PTR
IP number
Domain name for server
Domain name for alias
Parameters governing the zone
List of service names and protocols
Domain name
HINFO
A computer address
An authoritative name server
The canonical name for an alias
Marks the start of data for a zone
A well-known service description
Domain name pointer (reverse
lookups)
Host information
MX
TXT
Mail exchange
Text string
CS454/654
Machine architecture and operating
system
List of <preference, host> pairs
Arbitrary text
From Coulouris, Dollimore and Kindberg, Distributed Systems: Concepts and Design, 3rd ed.
© Addison-Wesley Publishers 2000
4-25
DNS Protocol & Messages
16 bit # for query,
reply to query
uses same #
query or reply
recursion desired
recursion available
reply is authoritative
Name, type fields
for a query
RRs in response
to query
records for
authoritative servers
additional “helpful”
info that may be used
CS454/654
4-26
Discovery Services
n
Directory services that allow clients to query available services
in a spontaneous networking environment
l
l
l
n
e. g., which are the available color printers
services enter their data using registration interfaces
structure usually rather flat, since scope limited to (wireless) LAN
JINI (http://www.sun.com/jini/)
l
JAVA-based discovery service
à
clients and servers run JVMs
– communication via Java RMI
– dynamic loading of code
CS454/654
4-27
JINI Discovery Related Services
n
Lookup service
l
n
Query of lookup service by Jini client
l
l
n
Holds information regarding available services
Match request
Download object providing service from lookup service
Registration of a Jini client or Jini service with lookup service
l
l
l
Send message to well-known IP multicast address, identical to all Jini
instances
Limit multicast to LAN using time-to-live attribute
Use of leases that need to be renewed periodically for registering Jini
services
CS454/654
4-28
JINI Discovery Scenario
n new client wishes to print on a printer belonging to the finance group
admin
Client
Printing
service
1. ‘finance’
lookup service?
admin
Client
Lookup
service
Network
2. Here I am: .....
4. Use printing
service
Corporate
infoservice
admin, finance
Printing
service
3. Request
printing
Lookup
service
finance
CS454/654
From Coulouris, Dollimore and Kindberg, Distributed Systems: Concepts and Design, 3rd ed.
© Addison-Wesley Publishers 2000
4-29
X.500 Directory Service
n
Geared towards satisfying descriptive queries
l
n
Provide attributes of other users and system resources
Architecture
l
l
Directory user agents (DUA)
Directory service agents (DSA)
DUA
DUA
DSA
DSA
DSA
DSA
DUA
DSA
DSA
CS454/654
From Coulouris, Dollimore and Kindberg, Distributed Systems: Concepts and Design, 3rd ed.
© Addison-Wesley Publishers 2000
4-30
X.500 Name Tree
n
Directory Information Tree (DIT)
l
n
Every node of the tree stores extensive information
Directory Information Base (DIB)
l
DIT plus node information
...
X.500 Service (root)
France (country) Great Britain (country) Greece (country)...
...
BT Plc (organization) University of Gormenghast (organization)
...
... Computing Service (organizationalUnit)
Department of Computer Science (organizationalUnit)
Engineering Department (organizationalUnit)
...
... Departmental Staff (organizationalUnit)
ely (applicationProcess)
Research Students (organizationalUnit)
...
... Alice Flintstone (person) ... Pat King (person) James Healey (person) Janet Papworth (person) ...
CS454/654
From Coulouris, Dollimore and Kindberg, Distributed Systems: Concepts and Design, 3rd ed.
© Addison-Wesley Publishers 2000
4-31
Example X.500 DIB Entry
info
Alice Flintstone, Departmental Staff, Department of Computer Science,
University of Gormenghast, GB
commonName
Alice.L.Flintstone
Alice.Flintstone
Alice Flintstone
A. Flintstone
surname
Flintstone
telephoneNumber
+44 986 33 4604
uid
alf
mail
alf@dcs.gormenghast.ac.uk
Alice.Flintstone@dcs.gormenghast.ac.uk
roomNumber
Z42
userClass
Research Fellow
CS454/654
From Coulouris, Dollimore and Kindberg, Distributed Systems: Concepts and Design, 3rd ed.
© Addison-Wesley Publishers 2000
4-32
X.500 Directory Accesses
n
Read
l
l
n
Absolute or relative name provided
DSA navigates tree and returns requested attributes
Search
l
Input
base name: starting point for search in tree
à filter expression: boolean condition on directory attributes
à
l
Returned
à
n
Lightweight Directory Access Protocol (LDAP)
l
n
list of DIT node names for which filter evaluates to true
Lightweight version of X. 500; access of DSA through TCP/ IP; simpler API;
textual encoding in place of ASN. 1 encoding
Practical Usage of X. 500/LDAP
l
l
LDAP currently widely used for intranets
adoption in Internet
CS454/654
4-33
CORBA Object References (1)
n
The organization of an IOR with specific information for IIOP.
CS454/654
From Tanenbaum and van Steen, Distributed Systems: Principles and Paradigms
© Prentice-Hall, Inc. 2002
4-34
CORBA Object References (2)
n
Indirect binding in CORBA.
CS454/654
From Tanenbaum and van Steen, Distributed Systems: Principles and Paradigms
© Prentice-Hall, Inc. 2002
4-35
Naming graph in CORBA Naming
Service
initial naming context
initial naming context
B
ShapeList
initial naming context
XX
P
V
C
D
CS454/654
E
R
Q
From Coulouris, Dollimore and Kindberg, Distributed Systems: Concepts and Design, 3rd ed.
© Addison-Wesley Publishers 2000
S
T
U
4-36
CORBA NamingContext Interface
(Partial)
struct NameComponent { string id; string kind; };
typedef sequence <NameComponent> Name;
interface NamingContext {
void bind (in Name n, in Object obj);
binds the given name and remote object reference in my context.
void unbind (in Name n);
removes an existing binding with the given name.
void bind_new_context(in Name n);
creates a new naming context and binds it to a given name in my context.
Object resolve (in Name n);
looks up the name in my context and returns its remote object reference.
void list (in unsigned long how_many, out BindingList bl, out BindingIterator bi);
returns the names in the bindings in my context.
};
CS454/654
From Coulouris, Dollimore and Kindberg, Distributed Systems: Concepts and Design, 3rd ed.
© Addison-Wesley Publishers 2000
4-37
Download