Active Directory Replication

Active Directory Domain Services (ADDS) is a distributed directory service which stores objects, here referred to real world entities such as users, groups, computers etc. Objects in the directory are distributed among all domain controllers in a forest. ADDS replication is the process by which any changes applied to one domain controller are automatically transferred to other domain controllers and global catalogs.
Replication has two types based on where it replicates:

Intra-site replication happens within a site. Here, the replication attempts to complete as fast as possible since the dc’s within that site should allow the users to logon. When a change is performed in its database, the dc waits for a specified set of time (5 minutes) for accepting more changes (if any) and then sends a notification to the replication partner allows in reducing the traffic. If no changes are done within a configurable period (6 hours), the dc initiates a replication sequence, just to ensure that it didn’t miss anything.
Inter-sitereplication happens between multiple sites. Here, the replication is done slowly (compared to intra-site) for minimizing the traffic. This type of replication happens at an admin scheduled time and this normally happens outside the business hours so that the users are not affected. There is no notification scenario in this type the replicating dc has to check all existing naming contexts for any changes.
Domain controllers make use of USNs (Update Sequence Numbers) to record each transaction happened on a DC. Before replication a topology is created by KCC (Knowledge Consistency Checker). KCC builds this topology on the basis of cost inputs given by the administrator. A DC database can consist of both originating write and replicated write. For each write operation on the AD database, USN is incremented by one.
Since there is a possibility to replicate a change again from one DC to another, each DC keeps track of what all changes have been replicated. For this each DC maintains a value called High WaterMark Vector (HWMV). A DC’s USN is referred to HWMV of another DC and this is checked to see if other DC partners are up to date.
To simplify, let us consider 2 Dc’s DC1 and DC2 as shown in the picture below:

Now a change is done on DC1 which therefore results in the USN change of DC1.

DC1 now notifies DC2, about the change available and DC2 initiates replication with DC1.
Now the DC1 sends the update across DC2 and the HWMV of DC2 is now incremented.
But what if the replication is between multiple dc’s? Read here.
*Thanks to Microsoft official technet site for the images

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s