Exchange Geek's Weblog

I'm a Geek!

Active Directory Namespaces

Posted by Milind Naphade on 11/04/2008

The previous post was all about LDAP namespace structure which is defined by IETF in RFCs. So in stead of writing down anything which is not useful lets jump over to a session to understand the Active Directory Namespace structure today.

Typeful Names
The combination of an object’s name and its LDAP designator is called a typeful name. Examples include cn=Administrator and cn=Administrator, cn=Users, dc=Company, dc=com.

Some applications can parse for delimiters such as periods or semicolons between the elements of a distinguished name. For example, an application may permit you to enter Administrator.Users.Company.com rather than the full typeful name. This is called typeless naming. When entering typeless names, it is important to place the delimiters properly.

The console-based tools provided by Microsoft use a GUI to navigate the LDAP namespace, so you don’t need to worry about interpreting typeful or typeless names right away. But if you want to use many of the support tools that come on the Windows Server 2003 CD or in the Resource Kit, or you want to use scripts to manage Active Directory, you’ll need to use typeful naming. After you get the hang of it, rattling off a long typeful name becomes second nature.

Directory Information Tree
In LDAP, as in X.500, the servers that host copies of the information base are called Directory Service Agents, or DSAs. A DSA can host all or part of the information base. The portions of the information base form a hierarchy called a Directory Information Tree, or DIT. Figure shows an example.

The top of the DIT is occupied by a single object. The class of this object is not defined by the LDAP specification. In Active Directory, the object must come from the object class DomainDNS. Because Active Directory uses DNS to structure its namespace, the DomainDNS object is given a DC designator. For example, the object at the top of the tree in Figure would have the distinguished name dc=Company, dc=com.

Typeless Names and Delimiters
If you write scripts and you need to allow for periods in object names, precede the period with a backslash. This tells the parser that the period is a special character, nt a delimiter. For example, if your user names look like tom.collins, a typeless name in a script would look like this: tom\.collins.Users.Company.com. The same is true for user names that have embedded commas and periods, such as Winston H. Borntothepurple, Jr. An ADSI query for this name would look like this: winston h\. borntothepurple\, jr\.

Active Directory and DNS Roots
Active Directory cannot be rooted at the very top of a DNS namespace. The assumption is that many different Active Directory namespaces could share the same root. For this reason, the DomainDNS object at the top of the tree must always have at least two domain component designators.

An LDAP tree contains branches formed by containers underneath the root container. These containers hold objects that have some relation to each other as defined by the namespace. For instance, in Active Directory, the default container for User objects is cn=Users. For Computer objects, it is cn=Computers. Information about group policies, DNS, Remote Access Services, and so forth go in cn=System. As we’ll see when we discuss Active Directory design in Chapter 8,”Designing Windows Server 2003 Domains,” administrators have the ability to create Organizational Units (OUs) to contain objects that have similar management or configuration requirements.
An LDAP tree contains branches formed by containers underneath the root container. These containers hold objects that have some relation to each other as defined by the namespace. For instance, in Active Directory, the default container for User objects is cn=Users. For Computer objects, it is cn=Computers. Information about group policies, DNS, Remote Access Services, and so forth go in cn=System. As we’ll see when we discuss Active Directory design in Chapter 8,”Designing Windows Server 2003 Domains,” administrators have the ability to create Organizational Units (OUs) to contain objects that have similar management or configuration requirements.

Naming Contexts
As the number of objects in a DIT grows, the database may get too large to store efficiently on one DSA. Also, an organization might want to use bandwidth more effectively by using a DSA in New York to store information about users in North America and another DSA in Amsterdam to store information about users in Europe.
Naming Contexts and Partitions
X. 501, “Information Technology—Open Systems Interconnection—The Directory: Models,” defines the term naming context as, “A subtree of entries held in a single master DSA. ” It goes on to describe the process of dividing a tree into multiple naming contexts as partitioning.

Novell chose to adopt the term partition to define separate pieces of the directory database. In their seminal book, Understanding and Deploying LDAP Directory Services, Tim Howe, Mark Smith, and Gordon Good use the term partition in favor of naming context, although they describe both as meaning the same thing. Microsoft uses the two terms interchangeably.

The tools that come with the Windows Server 2003 CD and in the Resource Kit favor the term naming context. That is the term I use throughout this book.

Here is where the distributed nature of an LDAP database comes into play. The Directory Information Base can be separated into parts called naming contexts, or NCs. In Active Directory, each domain represents a separate naming context. Domain controllers in the same domain each have a read/write replica of that Domain naming context. Configuration and Schema objects are stored in their own naming contexts, as are DNS Record objects when using Active Directory Integrated DNS zones.

When a client submits a query for information about a particular object, the system must determine which DSA hosts the naming context that contains that particular object. It does this using the object’s distinguished name and knowledge about the directory topology.

If a DSA cannot respond to a query using information in the naming contexts it hosts, it sends the client a referral to a DSA hosting the next higher or lower naming context in the tree (depending on the distinguished name of the object in the search). The client then submits the request to a DSA hosting the naming context in the referral. This DSA either responds with the information being requested or a referral to another DSA. This is called walking the tree.

DSAs that host copies of the same naming context must replicate changes to each other. It’s important to keep this in mind as you work with Active Directory servers. If you have separate domains, then clients in one domain must walk the tree to get access to Active Directory objects in another domain. If the domain controllers for the domains are in different locations in the WAN, this can slow performance. Many of the architectural decisions you’ll make as you design your system focus on the location, accessibility, and reliability of naming contexts.

LDAP Searches
From a client’s perspective, LDAP operates like a well-run department store. In a department store, you can sidle up to the fragrance counter and ask,”How much is the Chanel No. 5?” and be sure of getting an immediate reply, especially if you already have your credit card in hand. The same is true of LDAP. When a search request is submitted to a DSA that hosts a copy of the naming context containing the objects involved in the search, the DSA can answer the request immediately.

But in a department store, what if you ask the fragrance associate,”

Where can I find a size 16 chambray shirt that looks like a Tommy Hilfiger design but doesn’t cost so darn much?” The associate probably doesn’t know, but gives you directions to the Menswear department. You make your way there and ask your question to an associate standing near the slacks. The associate may not know the answer, but gives you directions to the Bargain Menswear department in the basement behind last year’s Christmas decorations. You proceed to that area and ask an associate your question again. This time you’re either handed a shirt or given an excuse why one isn’t available.

LDAP uses a similar system of referrals to point clients at the DSA that hosts the naming context containing the requested information. These referrals virtually guarantee the success of any lookup so long as the object exists inside the scope of the information base.

The key point to remember is that LDAP referrals put the burden of searching on the clients. This contrasts to X.500, where all the messy search work is handed over to the DSAs. LDAP is Wal-Mart to the Nordstroms of X.500.

RootDSE
When LDAP clients need information from a DSA, they must first bind to the directory service. This authenticates the client and establishes a session for the connection. The client then submits queries for objects and attributes within the directory. This means the client needs to know the security requirements of the DSA along with the structure of the directory service it hosts.

DSAs “advertise” this information by constructing a special object called RootDSE. The RootDSE object acts like a signpost at a rural intersection. It points the way to various important features in the directory service and gives useful information about the service. LDAP clients use this information to select an authentication mechanism and configure their searches.

Each DSA constructs its own copy of RootDSE. The information is not replicated between DSAs. RootDSE is like the eye above the pyramid on the back of a dollar bill. It sits apart from the structure but knows all about it. You’ll be seeing more about RootDSE later in this book in topics that cover scripting. Querying RootDSE for information about Active Directory rather than hard-coding that information into your scripts is a convenient way to make your scripts portable.

LDAP Namespace Structure Summary
Here are the highlights of what you need to remember about the LDAP namespace structure to help you design and administer Active Directory:
• An object’s full path in the LDAP namespace is called its distinguished name. All DNs must be unique.
• The Directory Information Tree, or DIT, is a distributed LDAP database that can be hosted by more than one server.
• The DIT is divided into separate units called naming contexts. A domain controller can host more than one naming context.
• Active Directory uses separate naming contexts to store information about domains in the same DIT.
• When LDAP clients search for an object, LDAP servers refer the clients to servers that host the naming context containing that object. They do this using shared knowledge about the system topology.
• Each DSA creates a RootDSE object that describes the content, controls, and security requirements of the directory service. Clients use this information to select an authentication method and to help formulate their search requests.

Sorry, the comment form is closed at this time.