0% found this document useful (0 votes)
10 views88 pages

Naming

The document discusses the importance of naming in distributed systems, highlighting how names are used to identify resources like computers, services, and files. It outlines the features of a good naming system, including location transparency and scalability, and differentiates between human-oriented and system-oriented names. Additionally, it covers the structure of name spaces, name servers, and various object-locating mechanisms, emphasizing the need for efficient naming and resolution in distributed environments.

Uploaded by

hiral2004gabhane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views88 pages

Naming

The document discusses the importance of naming in distributed systems, highlighting how names are used to identify resources like computers, services, and files. It outlines the features of a good naming system, including location transparency and scalability, and differentiates between human-oriented and system-oriented names. Additionally, it covers the structure of name spaces, name servers, and various object-locating mechanisms, emphasizing the need for efficient naming and resolution in distributed environments.

Uploaded by

hiral2004gabhane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 88

Naming

Naming

 In a distributed system, names are used to


refer to a wide variety of resources such as:
 computers,
 services,
 remote objects &
 files, as well as users.
Cont…

 Naming is fundamental issue in DS design as it


facilitates communication and resource sharing.
 A name in the form of URL is needed to access a specific
web page.

 Process cannot share particular resources unless they can


name these consistently.

 Users cannot communicate with one another via a DS


unless they can name one another.
Naming System
 Naming system provides the users with an
abstraction of an object that hides the details of
how and where an object is actually located in the
network.
 Naming system helps in achieving:
 location transparency,
 facilitating replication of objects,
 facilitating object sharing.
Desirable features of a good naming system

 Location Transparency
 An object’s name should be independent of:
 physical connectivity
or
 topology of the system,
or
 current location of the object.
Cont…
 Location Independency
 The name of an object need not be changed when
the object’s location changes.
 An object at any node can be accessed without the
knowledge of its physical location
 User mobility - An object at any node can issue an
access request without the knowledge of its own
physical location
 It supports dynamic mapping scheme.
Cont…
 Scalability
 Uniform naming convention
 Multiple user-defined names for the same object
 Group naming
 Meaningful names
 Performance
 Fault tolerance
 Replication transparency
 Locating the nearest replica
 Locating all replicas
Name

 A string composed of a set of symbols chosen from a


finite alphabet.
 An identifier
 Identifies an object uniquely
 Describes an object
 Enables us to locate that object directly.
Human-oriented & System-oriented names

 Human-oriented names
 A character string that is meaningful to users.
 For example: /user/dsk/project/file1
 Defined by their users
 Also known as high-level names
 Not unique for an object
 Variable in length
 System-oriented names

 Bit patterns of fixed size that can be easily manipulated


and stored by machines.
 Used to uniquely identify an object in entire system.
 Automatically generated by the system.
 Also known as U-Id and low-level names.
Physical addresses
of the named object

Replica

Human-oriented System-oriented Replica


name name

Second-level Replica
First-level
mapping mapping

A simple naming model based on the use of human-oriented and


system-oriented in a distributed system.
Name Space
 When there is a need to assign unambiguous meaningful
names to a large set of objects, a naming convention that
partitions the name space to disjoint classes is used.
 Each partition or domain of a partition name space may be
viewed as a flat name space.
Name Space
 The purpose of each namespace is to wrap a particular global
system resource in an abstraction that makes it appear to the
processes within the namespace that they have their own
isolated instance of the global resource.

 One of the overall goals of namespaces is to support the


implementation of containers, a tool for lightweight
virtualization (as well as other purposes) that provides a
group of processes with the illusion that they are the only
processes on the system.
Names

 Simple name - a name defined in a domain.


 Compound name – composed of one or more simple names
that are separated by special delimiter characters such as /, $,
@.
 Eg. /a/b/c => compound name with 3 name spaces a, b & c
 Eg. Hierarchical name spaces.

 Hierarchical Name Space


 Name space is partitioned into multiple levels and
structured as an inverted tree.
Name Server

 It is a process that:
 Maintains information about named objects

 Provides facility that enable users to access that


information.
 It acts to bind an object's name to some of its properties,
including the object's location.
Authoritative Name Server

 An ANS (Authoritative Name Server) provides actual


answer to DNS queries such as:
 mail server IP address or
 web site IP address (A resource record).

 The name server that stores the information about


an object is said to be authoritative name server of
that object.
 Authority attributes may contains sub-authorities.
Sub-Authorities
 protocol://servername:port/path/filename?arg1=val
&arg2=val
 where:
 protocol is either HTTP or HTTPS
 servername:port is the name and port number of the
system running the application.
 For example, the servername might be cracker and the
port is typically 7001 for HTTP connections and 7002 for
HTTPS connections.
 path is the directory on the server, such as /ales/docs21.
 filename is the page being served, such as index.html.
 The args are query_string arguments, such
as ?SectionID=26 & SubSectionID=398
Types of Authoritative Name Servers
Master Server (Primary Name Server)
 A master server stores the original master copies of all
zone records.
 Each slave server gets updates via special automatic
updating mechanism of the DNS protocol.
 DNS Protocol is a process that allows internet users to
navigate internet using hostnames instead of IP addr.
 DNS resource records are stored on authoritative DNS
servers also known as authoritative name servers.
 They contain information related to the domain,
including how long a server will keep DNS records
cached, a period known as time-to-live (TTL).
 All slave servers maintain copy of the master records.
Contd..

Slave Server (Secondary Name Server)


 A slave server is exact replica of master server.
 It is used to share DNS server load and to improve DNS
zone availability in case master server fails.
 It is recommend to have at least have 2 slave servers and
one master server for each domain name.

 DNS has always been designed to use both UDP and TCP
port 53
 UDP being the default, and fall back to using TCP when it
is unable to communicate on UDP, typically when the
packet size is too large to push through in a single UDP
packet.
Domain
(D1)

Domain Domain Domain


(D2) (D3) (D4)

Domain Domain
(D5) (D6)

Domains of a hierarchical name space


Name Agent (Resolvers)
 It is used to achieve the transparency between name servers
and their clients.
 It maintains knowledge of existing name servers.
 When a client requests for a name service, the name agent
uses proper communication protocol to transfer the user's
request to a proper name server.
Types of name agent

 Private name agent


 works for a single client,
 Structured as a set of subroutines that are linked to the client
program.

 Shared name agent


 works for several clients,
 Structured as a part of an operating system kernel, with system
calls to invoke name service operations, or
 as a separate process that is accessed via IPC primitives.
Context
 It is an environment in which a name is valid.
 Qualified name: a context / name pair used for uniquely
identifying an object.
 Context represents a division of the name space along natural
geographical, organizational, or functional boundaries.
 A name may occur in more that one context of a name space.
 Contexts may also be nested, as in the case of hierarchical
name spaces.
Context
(C1)

Context
(C2)

Context
(C3)

Nested contexts
Name resolution
 It is a process of mapping an object's name:
 to the object's properties, such as its location,

 to the authoritative name servers of that object.

 In a partitioned name space, the name resolution mechanism


traverses a resolution chain from one context to another until
the authoritative name servers of the named object are
encountered.
Abbreviation / Alias
 Generally simple names that need to be unique only
in a private context.
 Abbreviations are short-form substitutes for
qualified name allowed to user to specify an object
every time he or she wants to use it.
 A mapping of abbreviations to qualified names is
maintained on a per private context basis.
 A binding associates a single simple name with a
qualified name.
Absolute and Relative names

 An absolute name
 Begins at the root context of name space tree &

 Follows a path down to the specified object, giving the


context names on the path.
 A relative name:
 starts from the user's current context.
 defines a path from the current context to the
specified context.
Generic and Multicast Names
 Both supports one-to-many bindings.
 Generic naming facility
 A name is mapped to any one of the set of objects to
which it is bound.

 Useful when a user wants a request to be serviced by


any of the servers capable of servicing that request
and the user is not concerned which server services
the request.
 Group or multicast naming facility

 in which a name is mapped to all the members of the


set of objects to which it is bound.
 useful for the broadcasting or multicasting of a
message.
Descriptive / Attribute-based Name
 A naming system that supports descriptive / attribute-based
names & allows an object to be identified by a set of
attributes or properties that describe the object and uniquely
identify it among the group of objects in the name space.
 Eg. User = dsk, filetype = source, name = btree;
System-Oriented Names
 Features:
 Large integers or bit strings.

 Unique identifiers – in most naming systems, they are


guaranteed to be unique in both space and time.

 Uniform size and shorter than human-oriented names.

 Hard to guess and sometimes used for security-related


purposes.

 Automatically generated by the system.


System-Oriented Names

 Unstructured system-oriented names


 A single field of large integers or bit strings that
uniquely identifies an object
 It does not provide any other information about the
object.

 Structured system-oriented names


 Contains more than one component, some of which
provide information about the properties of the object
identified by its name.
A single field of large integers or bit strings

(a) Unstructured system-oriented names

Node identifier Local unique identifier

(b) Structured system-oriented names


System-Oriented Names

 Centralized approach
 It is mainly used by a naming system that uses
unstructured names.

 In this method, a standard, uniform global identifier is


generated for each object in the system by a centralized
global unique identifier generator, &

 some method is used to partition this global name space


among the local domains of each node.
System-Oriented Names

 Advantages
 simple and easy to implement.

 the only method for generating unstructured global unique


identifiers.
 Drawbacks
 Poor efficiency and poor reliability.
 The continuous generation of global unique identifiers is
totally dependent on the reliability of the centralized
global unique identifier generator.
System-Oriented Names
 Distributed approach
 It forces the naming system to use structured object
identifiers.
 Hierarchical concatenation strategy is used to
create global unique identifiers.
 A global unique identifier for an object is created by
concatenating the unique identifier of a domain with an
identifier used within this domain.
 Here global unique identifier consists of two components
 – server-ID, server-specific-unique-ID
 Advantages
1. Better efficiency and reliability as compared to the centralized
approach.

 Drawbacks
1. In a heterogeneous environment, the form and length of
identifiers may be different for different computers, resulting in
non-uniform global unique identifiers.

2. Node boundaries or servers are explicitly visible.


Object-Locating Mechanisms

 Broadcasting
 An object is located by broadcasting a request for the
object from a client node.

 The request is processed by all nodes and nodes


currently having the object reply back.
Contd...

 Advantages- simple and high degree of reliability.

 Drawbacks- poor efficiency and scalability

 This method is suitable only when:


 the number of nodes are less,
 communication speed is high, and
 object-locating requests are not so frequent.
Object 1
location Client
node
1 Broadcast request
1 message
2
2 Reply from the node
on which the object is
1 located

Broadcasting object-locating mechanism


Object-Locating Mechanisms

 Expanding ring broadcast


 Distant LANs are systematically searched until the object is
found or until every LAN has been searched.
 The distance metric used is hop.
 This method does supply the nearest replica locations of an
object.
 The efficiency of an object-locating operation is directly
proportional to the distance of the object from the client
node at the time of locating it.
i 1 Searching nodes at 0
hop distance

2 2 Searching
1
2 nodes at 1 hop
i distance if the
Client
1 node 1 search of 0 hop
i fails
1 2 Searching nodes at i
2 3 hops distance if the
searches up to i-1
hops fail
i

Object-locating mechanism: expanding-ring


broadcast
Object-Locating Mechanisms

 Encoding location of object within its UID


 This scheme uses structured object identifiers.

 Given a UID, the system simply extracts the


corresponding object's location from its UID by
examining the appropriate field of the structured UID.

 The extracted location is the node on which the object


resides.
Object-Locating Mechanisms

 Limitations

 An object is fixed to one node throughout its


lifetime.
 The use of this object-locating scheme is limited
to those distributed systems that do not support
object migration and object replication.
Object Client
location node
Extracting object's
1 1 location from its UID. No
message exchange with
any other node is
required for locating the
object.

Object-locating mechanism: Encoding the location


of an object within its UID
Object-Locating Mechanisms

 Search creator node first & then broadcasting


 This scheme supports object migration facility.
 Given a UID, the creator node information is extracted
from the UID and a request is sent to that node.
 If the object no longer resides on its creator node, a
failure reply is returned back to the client node.
 In case of failure, the object is located by broadcasting
the request from the client node.
Object-Locating Mechanisms
 Advantages
1. Helps in reducing the network traffic to a great extent as
compared to the broadcasting scheme.
2. More flexible than the method of encoding the location
of an object within its UID.

 Limitations
1. The use of broadcast protocol to locate those objects
that are not found on their creator nodes limits the
scalability of this mechanism.
Creator
node

Object 1 Client
node 1 Searching the
location 2 creator node
3
2 Negative reply
4
3 Broadcast request
message
3
4 Reply from the node
on which the object is
located

Object-locating mechanism: searching the creator


node first and then broadcasting
Object-Locating Mechanisms
 Using forward location pointers
 It uses forward location pointer, a reference at a
node to indicate the new location of an object.
 Advantages
1. Avoiding the use of broadcast protocol.
2. Allows the support of object migration facility.
 Disadvantages:
1. The object-locating cost is directly proportional to the
length of the chain of pointers to be traversed.
2. Poor reliability
3. Additional system overhead for upkeep.
Creator
node

Object 1
location Client
2 node
1 2 3 Path of
4 message forwarding

3 4 Reply from the node on


which the object is
located

Object-locating mechanism: Using forward location


pointers
Object-Locating Mechanisms

 Using hint cache and broadcasting


 In this method, a cache is maintained on each node
that contains the (UID, last known location) pairs of
a number of recently referenced remote objects.
 If not found or invalid, request is broadcast.
Object-Locating Mechanisms
 Advantages:
 It can be very efficient if a high degree of locality is
exhibited.
 It is flexible since it supports object migration facility.
 Supports object migration.

 Drawback
• Broadcast requests will clutter up the network, disturbing
all the nodes even though only a single node is directly
involved.
Client
Object 2 node Searching of local
location 1
cache
2 1
2 Broadcast request
3 message
3 Reply from the node
2 on which the object is
located

Object-locating mechanism: using hint cache and


broadcasting
Human-oriented names

 Characterstics:
 They are character strings that are meaningful to their
users.
 They are defined and used by the users.
 The facility of aliasing is provided to the users.
 These names are variable in length both in names for
different and same objects.
 They are not unique in either space or time.
Human-oriented hierarchical naming
schemes
 Combining an object's local name with its host name
 This naming scheme uses a name space that is comprised
of several isolated name spaces.

 Each isolated name space corresponds to a node of the


distributed system, and a name in this name space
uniquely identifies an object of the node.
Human-oriented hierarchical naming
schemes
 Advantage – simple and easy to implement.
 Drawback-
1. Neither location transparent nor location
independent.
2. Inflexible - an object's name changes every time
an object moves from one node to another.
Human-oriented hierarchical naming
schemes
 Interlinking isolated name spaces into a single name
space
 Global name space is comprised of several isolated name
spaces.
 The isolated name spaces are joined together to form a
single naming structure.
 The position of these component name spaces in the
naming hierarchy is arbitrary.
 Used by UNIX United
Human-oriented hierarchical naming
schemes
 Sharing remote name spaces on explicit request
 Scheme is based on the idea of attaching the isolated name
spaces of various nodes to create a new name space.
 The users are given the flexibility to attach a context of a
remote name space to one of the contexts of their local
name spaces.
 The goal is to allow some degree of sharing among the name
spaces of various nodes in a transparent manner on explicit
request by the users.
Human-oriented hierarchical naming
schemes
 A single global name space
 A single global name structure spans all the objects of
all the nodes in the system.
 The same name space is visible to all users and an
object's absolute name is always the same irrespective
of the location of the object or the user accessing it.
 It supports both type of location independency (location
of the accessing object and the location of the accessed
object).
Partitioning a name space into contexts

 The notion of context is used for partitioning a name


space into smaller components.
 A name space is partitioned into contexts by using
clustering conditions.
 A clustering condition is an expression that, when
applied to a name, returns either a true or false value,
depending on whether given name exists in the context
designated by the clustering condition.
Partitioning a name space into contexts

 Methods of clustering:
 Algorithmic clustering
 Syntactic clustering
 Attribute clustering
Algorithmic Clustering
 Names are clustered according to the value that results
from applying a function to these.
 Therefore, the clustering condition is a predicate of the form
function(name)=value.

 Advantage:
 It supports structure-free name distribution.
 It allows a healthy name resolution tree to be built even
for flat name spaces.
 Drawbacks-
 Difficult to devise proper clustering functions because
the characteristics of the names to be defined by the
various users is normally unpredictable.
London Paris Arizona
Poznan Oregon Berlin
Vienna Tokyo Kyoto
Nara Mexico Nebraska
Nagasaki

func-1(name)=0 func-1(name)=1

London Poznan
Berlin Vienna Paris Arizona
Oregon Mexico Nara Tokyo Kyoto
Nagasaki Nebraska

Func-2(name)=0 func-2(name)=1

London Poznan func-1(name): if (total characters(name)=even)


Berlin Nara Vienna Oregon Return(0)
Nagasaki Mexico Nebraska Else return (1);
func-2(name): if (total vowels(name)=even)
Return (0)
Else return (1);

An example of Algorithmic clustering


Syntactic Clustering
 It is performed using pattern-matching techniques.
 Patterns are templates against which a name is
compared.
 A syntactic clustering condition that is meant for a
particular pattern, when applied to a name; returns
TRUE if the name matches the pattern.
 It allows names to be resolved in a manner similar to
their structure, as is done by virtually all name
management systems.
/country/India/Delhi country/India/Bombay
/country/Japan/Tokyo /country/Japan/Kyoto
/user/sinha/file1 /user/sinha/file2 /user/sinha/file3
/user/pradeep/file1 /user/pradeep/file2

Matches the pattern Matches the pattern


“/country/*” “/user/*”

Sinha/file1
India/Delhi Sinha/file2
India/Bombay Sinha/file3
Japan/Tokyo Pradeep/file1
Japan/Kyoto Pradeep/file2

Matches the pattern Matches the pattern


“India/*” “Japan/*” Matches the Matches the
pattern pattern
“Sinha/*” “Pradeep/*”
Delhi Tokyo
Bombay Kyoto
File1 File1
File2 file2
file3

An example of syntactic clustering


(a) partitioning of structured names
Poppy Poster Powder
Power Sheep Shark
Silky Silver

Matches the pattern Matches the pattern


“P*” “S*”

Poppy Poster Sheep Shark


Powder Power Silky Silver

Matches”pow*”
Matches “pos*”
Matches “pop*” Matches “Si*” Matches “sh*”

powder poster
poppy Shark
Silver
Silky sheep

An example of syntactic clustering


(b) partitioning of flat names
Attribute Clustering

 Names are grouped based on the attributes


possessed by the names.
 Attribute clustering conditions are not restricted to
matching a single additional attribute in each step
and several attributes may be matched in a single
step.
Type=Source, Lang=Basic, Name=p1
Type=Source, Lang=C, Name=p2
Type=Object, Name=P1
Type=Object, Name=P2

Matches the attribute Matches the attribute


Type=Source Type=Object

Lang=Basic, Name=P1 Name=P1

Lang=C, Name=P2 Name=P2

An example of attribute clustering


Context binding

 Contexts of a name space are distributed among various


name servers.
 If authority attrib of a named object is not found in the
local context, additional configuration data i.e. Context
binding must exist locally for the name to be resolved.
 A context binding associates the context within which it
is stored to another context, that is more knowledgeable
about the named object & the name servers that store
that context.
 Strategies for context binding are-
1. Table-based strategy
2. Procedure-based strategy
Table-based strategy
 Most commonly used approach for implementing
context bindings in hierarchical tree-structured name
spaces.
 Each context is a table having two fields:
 the first field stores a component name of the named
object &
 the second field either stores context binding
information or authority attribute information.
 The contexts of a table-based strategy are also
known as directories.
Procedure-based strategy

 A context binding takes the form of a procedure,


which, when executes, supplies information about
the next context to be consulted for the named
object.

 Less flexible than table-based strategy because, if


required, the context bindings cannot be changed
dynamically and independently for each object.
Distribution of contexts and name
resolution mechanisms

Some name resolution mechanisms are as follows:


1. Centralized approach
2. Fully replicated approach
3. Distribution based on physical structure of name space
4. Structure-free distribution of contexts
Centralized approach

 A single name server in the entire distributed system is located


at a centralized node.

 This name server is responsible for storing all contexts and


maintaining the name-mapping information in them up to date.

 The location of the centralized name server is known to all


other nodes.
Centralized approach
 Advantage-
1. Simple and easy to implement.
2. Efficient because any name resolution request involves
only two messages (a request and a reply) to be passed
across the network.

 Some drawbacks-
1. It does not scale well because the performance of the
centralized name server may become a serious bottleneck
for large systems.
2. The reliability of this mechanism is very poor.
Fully replicated approach

 There is a name server located on each node of the


distributed system and all contexts are replicated at
every node.
 The name space is fully replicated & each name server
has the name-mapping information for all object names.
 The method is simple and efficient because all name
resolution requests can be serviced locally without the
need to communicate with any other node.
 It involves large overhead in maintaining consistency of
naming information in all servers and hence is not
suitable for large name spaces.
Distribution based on physical structure of
name space

 This method is mostly used in hierarchical tree-structured


name spaces.

 Name space tree is divided into several subtrees that are


known by different names in different systems - ZONES.
Structure-free distribution of contexts

 Allows easy reconfiguration.

 It places no restriction on the administrative control over


parts of a name space.

 Any context of the name space can be freely


stored/moved to any name server independent of any
other context.
 Locate the context identified by name
 Always start resolution from root context
Interacting with name servers during name
resolution

 Methods:
• Recursive
• Iterative
• Transitive
Recursive
 In this method, the name agent forwards the name resolution
request to the name server that stores the first context
needed to start the resolution of the given name.
Client

8 1

Name
Agent
7
2
3 4
Name Name Name
Server server 5 server
6
Iterative
 In this method, the name server don’t call each other directly.
Rather, the name agent retains control over the resolution process
and one by one calls each of the servers involved in the resolution
process.
Client

1 8

Name
Agent
7
3
4 5 6
2
Name Name Name
Server server server
Transitive
 This method requires fewest number of messages. A sender does
not receive any acknowledgement message once it passes on the
resolution operation to another server. This approach should be
used in systems with reliable communication.
Client

6 1

Name
Agent
5
2

3 4
Name Name Name
Server server server
Name caches
 The performance can be improved using name
caches due to:
1. High degree of locality of name lookup.
2. Slow update of name information database.
3. On-use consistency of cached information is possible.
Types of name caches
 Directory cache
 each entry consists of a directory page

 Mostly used in iterative method of name resolution.

 Prefix cache
 Each entry consists of a name prefix and the corresponding
zone identifier.
 Used in those naming systems that use the zone-based
context distribution mechanism.
Types of name caches

 Full-name cache
 Each entry consists of an object’s full path name and the
identifier and location of its authoritative name server.

 Used with any naming mechanism, although it is mainly used


by the naming systems that use the structure-free context
distribution approach.
Approaches for name cache implementation
 A cache per process
 A separate name cache is maintained for each process.
 Each cache is maintained in the corresponding process’s
address space and is usually small in size.
 Accessing of cached information is fast and no memory
area of the OS is occupied by the name caches.
 A process-oriented name cache vanishes with the
process. Therefore every new process must create its
name cache from scratch.
Approaches for name cache implementation

 A single cache for all processes of a node


 These caches are large in size and are located in the
memory area of the operating system and accessing of
cached information is slower, as compared to process-
oriented name caches.

 Cached information in a single-name cache is long lived


and is removed only when the cache replacement policy
finds it suitable for being removed.
Multicache consistency

 Immediate invalidate
 In this method, all related name cache entries are
immediately invalidated when a naming data update occurs.

 On-use update
 No attempt is made to invalidate all related cache entries
when a naming data update occurs.
 When a client uses a stale cached data, it is informed by the
naming system that the data being used is either incorrectly
specified or stale.

You might also like