Upload
delphia-norton
View
222
Download
0
Embed Size (px)
Citation preview
6. Naming (name services)
• General issues
• Naming in distributed systems
• Locating mobile entities
P183
• WWW can be viewed as a huge distributed system consisting of millions of clients and servers for accessing linked documents.
• DNS is a distributed naming system.
P648
6.1 Naming entities
1. Three kinds of names• human-friendly name: f1, cs.nju.edu.cn• address: a special kind of name – name of an access
point. 202.119.32.6
• identifier: a name has properties:– an identifier refers to at most one entity– each entity is referred to by at most one identifier
RFC:2648
Names are used to identify and refer to entities.
• Address is not well suited for referring an entity– an entity may be moved changes address– an entity can offer more than one access points.
• Identifier is location independent (PID)
Name space is a collection of all valid names which
can be represented as a labeled, directed graph.(recognized by a particular service)
C++: namespace A { … }XML:
<student xmlns = “student.dtd” xmlns:teacher =“teacher.dtd”><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
2. Name spaces
For human use For implementation
1 “usr”2 “dev”
0
7 8
2
9
11 12
usr dev
1
li liu
f1 f2
nic
0
13
f1
usr
li liu
dev
nic
f1 f2 f1
Purpose?
Example of Unix file system
The general organization of the UNIX file system implementation on a logical disk of contiguous disk blocks.
inode inode inode0 1 n
data data data data
… …
… …
blocks
P188
• Leaf node
represent named entity
store information (address or state) on the entity• directory node
represent a collection of entities
store a directory table of (edge label, node identifier).
• path name
N:<label-1, label-2, …, label-n> ..
no:<home,steen,mbox> /home/steen/mbox
com, edu, gov, mil, net, org, arpa, int, country
root
cn jp edu com
edu MIT cmcom
ustcpku nju
…...
...
….. ...
…...
…...
…...
...
us ...
edu com
Name space distribution
An example partitioning of the DNS name space, including Internet-accessible files, into three layers.
P196
3. Name resolution
A path name ---> information stored in the node.
or entity
• Name resolution:
the process of traversing the naming graph by looking up the components of a path name, one at a time.
N:<label-1, label-2, …, label-n>
P198
find
4. Name service in large distributed system
• Name service Chapter 6.1 DNS
name entity (or address)• Design issue: structure of name space
A large-scale name space (naming graph) is implemented
by distributing its nodes across multiple name servers and organized hierarchically.
• Distribution of a name space across multiple name servers affects the implementation of name resolution
P194
6.2 Directory service
1. Directory service
If we wish to find a particular person or resource, but we don’t know its name, only some of its other attributes.
For example,– Query the name of each Web server running Unix– the person with CS department whose family name is
Li, man
If we have directory service with information:
P206
Entity Attributes User Name: …
Tel.no.: …
Email address:
Dept: ……
Sex:
Host Name:
Type:
OS:
IP address:
……
Printer Name:
Type:
……
… ……
Predefined entities and their attributes
Entry Attributes user name:xxx; tel.no.:xxxxx; email addr.:…
name:yyy; tel.no.:yyyyy; email addr.:…
……
host name:xxx; type:www server; OS:Unix; …
name:yyy; type:FTP server; OS:Linux; …
……
printer ……
… ......
DIB
Directory service
• store collections of binding between names and attributes
• look for an entity based on a description of attributes
some attributes ----> information of entities type=Web server&OS=Unix ----> entities (or names)
Examples:
X.500, LDAP(P209), Active directory services
• an X.500 directory service consists of a number of directory entries
• a directory entry is made up of a collection of (attribute, value) pairs
……
Name: cs.nju.edu.cn
Type: www server
OS: Linux
IP address: 202.119.36.1
……
P2062. X.500 general model for global
130.37.21.11--WWW_Server
130.37.21.11--FTP_Server
130.37.24.6, 192.31.231.42,192.31.231.66--Mail_Servers
Main serverCNCommonName
Math. & Comp. Sc.OUOrganizationalUnit
Vrije UniversiteitOOrganization
AmsterdamLLocality
NLCCountry
ValueAbbr.Attribute
A simple example of a X.500 directory entry using X.500 naming convention.
P207
• Naming convention applies to the first five attribut
es: C, L, O, OU, CN • CommonName is used as a name to identify an ent
ry within a limited part of a directory
• The collection of all directory entries in X.500 directory service is called DIB (Directory Information Base)
P207
• Each entry in DIB is uniquely named by listing
naming attributes in sequence• Each naming attribute is called RDN
C : nlL : AmsterdamO : Vrije UniversiteitOU : Math. & Comp. Sc.CN : Main serverMail_server : …FTP_server : …WWW_server: …
P207
• C, O, OU could be used to form the global unique name, analog to DNS name
/C=NL/O=Vrije Univ/OU=Math.& Sc
~ nl.vu.cs
• DIT (Directory Information Tree)
use of globally unique names leads to a hierarchy of the collection of directory entries
Attribute Value Attribute Value
Country NL Country NL
Locality Amsterdam Locality Amsterdam
Organization Vrije Universiteit Organization Vrije Universiteit
OrganizationalUnit Math. & Comp. Sc. OrganizationalUnitMath. & Comp. Sc.
CommonName Main server CommonName Main server
Host_Name star Host_Name zephyr
Host_Address 192.31.231.42 Host_Address 192.31.231.66
Two directory entries having Host_Name as RDN
(Relative Distinguished Name).
P208
2) Look up operations
• readpath name an entity
• search base name list of names
record=read(“&(C=NL)(O=Vrije Univ.)(OU=Math. & Comp. Sc.)(CN=Main server)”) P207
list=search(“&(C=NL)(O=Vrije Univ.)(OU= Math. & Comp. Sc.) (CN=Main server)”) star, zephyr
filter expression for all of entries below the base node
list
3) Implementation
DIT is partitioned and distributed across many Directory Service Agent (DSA)
P209
DSA
DSA DSA
DSADSA
DSADUA
DUA
Client (DUA—Directory User Agent) interacts with a DSA, which accesses other DSAs as necessary
2. LDAP
1) LDAP is Internet-based directory services.
ASN.1 encoding string
2) Active directory services P539
Microsoft’s LDAP implementation
P209
X.500 protocol
ISOprotocol stack
LDAP
TCP IP
Lightweight Directory Access Protocol
Active directory services
• a distributed system is partitioned into domains
• each domain consists of a number of users and resources• each domain has one or more directory servers, each of wh
ich has a DNS name (ldap.cs.nju.edu.cn)
nju
soft CS phy… …
Domain tree
directory servers
Domain:
• Users: teacher, student, …
• Resources: host, printer,
Entry Attributes user1
user2
resource1
resource2
DIB
Entity Attributes Teacher Name: …
Tel.no.: …
Email address:
……
Student Name: …
Email address:
Status:
……
Host Name:
Type:
OS:
IP address:
……
Printer Name:
Type:
……
Implementation with DNS
DNS Directory service
edu
ustcpku nju
...
nju
soft CS phy… …
directory server
Domain tree
domain has DNS name: ldap.cs.nju.edu.cn
name server
Name Type Value
www.nju.edu.cn A 202.119.32.6
cs.nju.edu.cn A 202.119.36.1
ldap.cs.nju.edu.cn SRV 202.119.36.2
ldap.cs.nju.edu.cn TXT “LDAP server”
DNS database
Entry Attributes user1
user2
resource1
resource2
DIB for domain cs.nju.edu.cn
P202
Use directory service
client
DNSserver
query(LDAP server) request address
directoryserver
LDAP query
LDAP reply
6.3 Locating mobile entities
1. Feature of mobile entitiesA mobile entity has multiple addresses when mobile host moves.
2. Locating mobile entities• use forwarding pointer• use location-independent identifier to locate mobile
entities
P210
1) Forwarding pointer
location A location B location C
entity
When an entity move from A to B, it leaves behind a reference to its new location at B
entity entityentity
P214
3) Hierarchical approaches
It is used in Globe location service.• A network is divided into a collection of domains.• There is a single top-domain that spans the entire
network• each domain can be subdivided into multiple small
er subdomains• leaf domain is lowest-level one
P217
D1D2
D3
D21D24
D11
D12
D13
Top domain D
D231D232
E1
E12
E13
E31
E32
E33
E23, E232
E22
How organize location service?
• Directory node:
each domain D has a directory node dir(D) that stores location records for all entities in D
• Location record:
For leaf domain, the location record for entity E contains E’s current address in the domain;
For higher-level domain D’, the location record for entity E contains a pointer to directory node of next lower-level domain that has E
• root directory node knows about all entities
dir(D)
E1 ->dir(D1)E12 ->dir(D1)E13 ->dir(D1) ->dir(D2)E22 ->dir(D2)E23 ->dir(D2)E232 ->dir(D2)E31 ->dir(D3)E32 ->dir(D3)E33 ->dir(D3)
dir(D1)
E1 <E1>E12 ->dir(D12)E13 ->dir(D13)
dir(D2)
E22 ->dir(D22) E23 ->dir(D23)E232 ->dir(D23)E13 ->dir(D21)
dir(D22)
E22 <E22>
dir(D23)
E23 <E23>
E232 ->dir(D232)
dir(D232)
E232 <E232>
Hierarchical organization of a location service into domains, each having an associated directory node.
P218
Look up operation
• Client issues the request for E to the directory node of the leaf domain D in which the client resides
• search the tree of directory nodes• E’ address is returned to the client
method 1: from the root if E is not in the leaf domain method 2: from its parents if … and there are copies
Insert operation
• An insert request is forwarded to the first node that knows about entity E.
• A chain of forwarding pointers to the leaf node is created.
For example, An entity E has created a replica in the leaf domain
D.
Summary
1. Naming entity and name service• three kinds of name• name space• name resolution • name service in large distributed system(DNS)2. Directory service• difference between directory service and name
service• X.500 and LDAP (Active directory services)