You are on page 1of 34

Naming

Part I

CS403/534
Distributed Systems
Erkay Savas
Sabanci University

1
Overview
• Names, identifiers, and addresses
• Name resolution
• Name space implementation
• Locating mobile entities
• Removing unreferenced entities

2
Naming
• Names (character or bit strings) are used to
denote entities in a distributed system.
• Entity: resources, processes, users, mailboxes,
newsgroups, queues, web pages, etc.
• To operate on an entity, we need an access point.
• An access points is a special kind of entity whose
name is called address
– The address of an access point of an entity is also
called an address of that entity
– An entity may offer more than one access point
– Access point of an entity may change
• Address is a special kind of name
– It refers to an access point of an entity
3
Addresses as Names
• An entity may change its access point (so its
address)
• An access point may be reassigned for another
entity
• If an entity has multiple addresses, it is not
always obvious which one to choose from
performance point of view
• We need to uniquely identify an entity
• A location-independent name for an entity E, is
independent from the addresses of the access
points offered by E.

4
Identifiers
• A true identifier is a name with the following
properties:
• P1: An identifier refers to at most one entity
• P2: Each entity is referred to by at most one
identifier
• P3: An identifier always refers to the same
entity

• Addresses and identifiers are two important


types of names that are each used for different
purposes
• Human-friendly names - UNIX file names
5
Name Spaces (1)
• Names in DS are organized into a name space.
• A name space can be represented as a labeled and
directed graph with nodes representing entities
• Each node is also an entity with an associated identifier
• Leaf node:
– represents a named entity, no outgoing edges
– It stores information on the entity it is representing (e.g. the
address of the entity)
– It can also store state of the entity, for example the file
• Directory node:
– has a number of outgoing edges, each labeled with a name
– A directory node stores a directory table in which each outgoing
edge is represented as a pair
(edge label, node identifier)
6
Name Spaces (2)
A general naming graph with a single root node n0.
n2: “elke” n0
n3: “max” keys
home
n4: “steen” “/keys”
n5 “/home/steen/keys”
n1
steen
elke max

n2 n3 n4 “/keys”

.twmrc mbox

“/home/steen/mbox”

Different path
No cycle!
names for the same
entity 7
Name Spaces (3)
• We can easily store all kinds of attributes in a node,
describing aspects of the entity the node represents:
– Address of the entity’s location,
– An identifier for that entity
– Type of the entity
– Nicknames, etc.
Example: UNIX file system
– Directory node represents a directory, leaf node a file

super
block file data blocks

boot index nodes


block 8
UNIX File System
• The general organization of the UNIX file
system implementation is based on a logical disk
of contiguous disk blocks.
• An index node (inode) corresponds to a node
identifier in the naming graph for the
associated file and directories
– when given the index number of an inode, it is
possible to access its associated file.
• An inode also contains information on the
owner, time of creation and last modification,
protection of a file
9
Name Resolution
• Given a path name, it is easy to lookup information stored
in the node for the entity in name space
• The process of looking up a name is called name
resolution.
• Example:
– N:<label-1, label-2, …, label-n>
– Resolution starts at N, looking up the directory table returns the
identifier for the node that label-1 refers to, N1
– Second, looking up the label-2 in directory table of the node
N1, and so on
– Resolution stops at node referred to by label-n by returning
the content of that node

10
Closure Mechanism
• So far in our examples, we have been given the
starting node and access to its directory table.
• The root node cannot be looked up since it has no
incoming edge.
• Knowing how and where to start name resolution
is generally known as closure mechanism.
– Selecting the initial node where the name resolution is
to start
– In UNIX, the inode of the root directory is the first
inode

11
Aliases
• Alias is another name for the same entity (e.g.
environment variable)
– Multiple absolute paths or symbolic links
• Hard link: What we have described so far as a
pathname. A name that is resolved by following a
specific path in the naming graph from one node
to another
• Soft (Symbolic) link: A leaf node O contains the
absolute pathname of another node (instead of
storing the address or state of the entity)
– First resolve O’s name (leading to O)
– Read the content of O, yielding, say, name
– Name resolution continues with name
12
Soft Link: Example

n2: “elke” n0
n3: “max” keys
home
n4: “steen” “/keys”
n5
n1
steen
elke max

n2 n3 n4
date stored in n6
keys “/keys”
.twmrc
mbox

n6 “/home/steen/keys”

The concept of a symbolic link explained in a naming graph.


13
Merging Name Spaces
• Problem:
– We have different name spaces
– we wish to merge them so that we can access nodes of
a “foreign” names space from our local name space
• Solution 1: Mounting
– Introduce a (directory) node (mount point) that
contain the name of a node in a foreign name space
(mounting point), along with the information to access
it.
– The name of an access protocol
– The name of the server
– The name of the mounting point in the foreign name
space
14
Mounting: Example

nfs://flits.cs.vu.nl//home/steen
15
Global Name Service (1)
m0 home
n0 vu vu home

n0 m0
home mbox
keys

n1
steen n5
elke max “m0:/mbox”

n2 n3 n4

keys
.twmrc
mbox

n6 “n0:/home/steen/keys”

Organization of the DEC Global Name Service 16


Global Name Service (2)
• Solution 2:
– Add a new root and make the existing root nodes of
two name spaces the children of the new root node
(Global Name Service, GNS of DEC)
• Drawback:
– Existing names has to be changed
– To allow other name spaces to be added in the future,
names in GNS always (implicitly) include the identifier
of the node from where resolution should normally
start
– Example: /home/steen/keys in NS1 is always
(implicitly) expanded to include the current root name,
i.e. n0:/home/steen/keys.
– It is assumed that a node identifier is universally
unique 17
Name Space Implementation
• Basic issue:
– Distribute the naming service across multiple machines (name
servers)
• Consider a hierarchical naming graph in three levels:
– Global level: consists of the highest-level directory nodes. Root
node and its children. Directory tables rarely change.
– Administrational level: is formed by directory nodes that are
managed within a single organization or administrational unit.
Directory tables are relatively stable
– Managerial level: consists of nodes that regularly change. Nodes
representing hosts in a local network.
• Nodes representing shared files such as those for libraries
and binaries and user defined directories belong in the
managerial layer.
• Managed by system administrators as well as end users

18
Name Space Distribution (1)

An example partitioning of the DNS name space, including


Internet-accessible files, into three layers. 19
Name Space Distribution (2)
• The name space is divided into nonoverlapping
parts, called zones in DNS.
• A zone is a part of the name space that is
implemented by a separate name server
• Name server requirements:
– Name servers must be highly available in global and
administrational layers (replication & fault tolerance)
– Performance is also another issue (replication &
caching may be remedy)
– Performance requirements are more strict in the
managerial level while availability is not crucial.
20
Name Space Distribution (3)

Item Global Administrational Managerial


Geographical scale of network Worldwide Organization Department
Vast
Total number of nodes Few Many
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.
21
Iterative Name Resolution
1. <nl,vu,cs,ftp>
root
2. #<nl>,<vu,cs,ftp>
name server
nl
3. <vu,cs,ftp>
name server
Client’s
4. #<vu>,<cs,ftp> nl node
name vu
5. <cs,ftp>
resolver name server
6. #<cs>,<ftp> vu node
cs
7. <ftp>
name server
8. #<ftp> cs node
ftp
#<nl,vu,cs,ftp>
<nl,vu,cs,ftp>
Resolving :< nl, vu, cs, ftp, pub, globe, index.html>
ftp://ftp.cs.cu.nl/pub/globe/index.html 22
Recursive Name Resolution (1)
1. <nl,vu,cs,ftp>
root
8. #<nl,vu,cs,ftp>
name server 2. <vu,cs,ftp>

7. #<vu,cs,ftp> name server


Client’s nl node
3. <cs,ftp>
name
resolver name server
6. #<cs,ftp>
vu node
4. <ftp>

name server
5. #<ftp> cs node

#<nl,vu,cs,ftp>
<nl,vu,cs,ftp>

What is the main disadvantage of recursive name resolution?


23
Recursive Name Resolution (2)

Server for Should Looks Passes to Receives and Returns to


node resolve up child caches requester

cs <ftp> #<ftp> -- -- #<ftp>

vu <cs,ftp> #<cs> <ftp> #<ftp> #<cs>


#<cs, ftp>

nl <vu,cs,ftp> #<vu> <cs,ftp> #<cs> #<vu>


#<cs,ftp> #<vu,cs>
#<vu,cs,ftp>
root <nl,vu,cs,ftp> #<nl> <vu,cs,ftp> #<vu> #<nl>
#<vu,cs> #<nl,vu>
#<vu,cs,ftp> #<nl,vu,cs>
#<nl,vu,cs,ftp>

Recursive name resolution of <nl, vu, cs, ftp>.


Name servers cache intermediate results for
subsequent lookups. 24
Comparison of Resolution Schemes
• Caching is effectively implemented in many levels
in recursive name resolution
• Caching is restricted to client side in iterative
name resolution
– An intermediate name server in an organization can
cache name resolution information that can be shared
by multiple users
• Recursive name resolution results in performance
demand on name servers
• Communication is often less costly in recursive
name resolution
25
Recursive vs. Iterative: Example
R1
recursive
name server
name resolution
nl node
L1
R2
L2 name server
client
vu node
L3 R3
name server
iterative cs node
name resolution

long-distance communication

The comparison between recursive and iterative name


resolution with respect to communication costs.
26
Example: The Domain Name System (DNS)

• The largest distributed naming service is in use


today
• DNS is primarily used for looking up host
addresses and mail servers
• Hierarchically organized as a rooted tree
• Except the root, each node has only one incoming
edge; thus, label of edge also denotes the node
• A subtree is called a domain
• A path name to the root node of a domain is
called domain name
• The contents of a node is formed by a collection
of resource records.
27
DNS: Resource Records
The most important types of resource records
Type of Associated
Description
record entity

SOA Zone Holds information on the represented zone

A Host Contains an IP address of the host this node represents


Refers to a mail server to handle mails addressed to this
MX Domain
node
SRV Domain Refers to a server handling a specific service
Refers to a name server that implements the represented
NS Zone
zone
CNAME Node Symbolic link with the primary name of the represented node

PTR Host Contains the canonical name of a host

HINFO Host Holds information on the host this node represents

TXT Any kind Contains any entity-specific information considered useful


28
DNS: Resource Records
• SOA(start of authority):
– the name of the host where data on the zone can be
fetched
– contains information such as an e-mail address of the
system administrator responsible for the represented
zone,
• A (address) :
– Represent a particular host in the internet (its IP
address is included to allow communication)
• MX (mail exchange)
– Mail servers for the domain
• NS (name server)
– Name servers for the zone
29
DNS: Example
. (root)

nl

vu

cs

star zephyr www ftp soling laser vucs-das

tornado

Zone: cs.vu.nl

30
DNS Implementation
An excerpt
from the
DNS
database for
the zone
cs.vu.nl.

The file
shows the
contents of
eight nodes
that are part
of
cs.vu.nl.
31
Glue to Another Zone
. (root)

nl

vu

cs

star zephyr www ftp soling laser vucs-das

tornado
zone: cs.vu.nl
solo

32
Glue Record

Name Record type Record value

cs.vu.nl NS solo.cs.vu.nl

solo.cs.vu.nl A 130.37.21.1

So called glue record for a subdomain


implemented in a different zone.

33
Reading Assignment

X.500 Naming Service – pages 206-210 from the


textbook

34

You might also like