Naming and Directory Services - Nuts and Bolts


Naming Services Concepts

What is a naming service?
You must be familiar with the way in which your browser retrieves web pages for you. You type in a well known address like www.yahoo.com on your address bar; your browser then looks up the DNS for the IP address and then contacts the Yahoo web server using the IP address. That then is a naming service at work.
In other words, a naming service is a means by which well known names can be associated with objects and by which objects can be found given their names. The name in the case of the DNS is the server name (eg. www.yahoo.com, java.sun.com) and the object is the IP address.
A naming service makes it easy to look up objects using a common name that can be easily remembered. Wouldn't it be a bit hard on you if browsers expected you to remember the IP address of every website you browsed? Another example is the file system. The file system has a naming service used to look up file object in memory using the file name.

Atomic Names
An atomic name is an indivisible component of a name. If the name of a server is www.xyz.com then, 'www', 'xyz' and 'com' would be the atomic components of the name.

Naming convention
The naming convention for a naming service defines the syntactic rules that a name must follow. The file system for example defines that names should be written in starting with the most significant name first and each atomic name should be separated by a '/'. The Domain Name Service specifies that names should be written starting with the least significant component and each component should be separated by a dot.

Binding
A binding is the association of a name with an object. The objects can be of any type.

Compound Name
A compound name is a sequence of zero of more atomic names composed according to the naming convention. '/etc/hosts' is an example of a compound name, i.e. the complete path name of a file is a compound name.

Context and sub-contexts
A context is a set of bindings with distinguished atomic names. Every context has a naming convention associated with it. If you take the file system, a directory can be viewed as a context. Each file within the directory has to a have a distinguished name which follow the file naming conventions defined by the file system.
A context can have bindings within it that are bound to another context object. This is what happens when you create a sub-directory. The sub-directory is itself a directory that has a unique name within the parent directory.

What is a naming system?
A naming system is a connected set of contexts that have the same naming convention. The naming system provides a common set of operations for all the entries contained in it.
A typical entry in a naming system will consist of a set of names and a unique object to which the names are mapped. A great example is the hosts file on your machine - 'etc/hosts' in UNIX and its variants and 'winnt\system32\drivers\etc\hosts' for NT. The hosts file look typically like this...

172.16.69.8 eibweb.planetasia.com project.planetasia.com
172.16.69.156 seed.planetasia.com
				
'eibweb.planetasia.com' and 'project.planetasia.com' are names bound to the IP address 172.16.69.8.

Namespace
A namespace is the set of all names in a naming system. For example, in the file system, the set of all directories and files form the namespace for the naming system.


Directory Service Concepts

What is a directory?
A directory a type of database that is optimized for read and search operations. Directories do not have transactional capabilities like relational databases. The directory operations are optimized using indexing, caching and attribute value matching mechanisms. A directory is organized in a hierarchical fashion staring with a root node.

What is a directory service?
You saw that naming systems map names to objects and objects could be of any type. In a directory service, objects are of a particular type and can have attributes associated with them. Attributes are name-value pairs. Attribute names are also known as identifiers. Each identifier can have one or more values.

Directory and Naming services
How are directory services related to naming services? Well, here is how … a naming service may or may not have a directory service, while all directory services require naming services (rather, they are built upon naming services) to locate objects within the directory.
In the file system, the binding of a file name to the file handle is the naming service. The organization of the bindings itself is a directory service.
In the DNS, the host name - IP address mapping is a naming service. The organization of the mappings is a directory service.

Directory Information Tree
Directory objects are organized in a tree structure called the directory information tree (DIT). In the DIT, directory objects play the role of naming contexts and also act as containers for attributes.

For comments and suggestions, contact me at vikramr@planetasia.com