Skip to content
Tutorials Center
My learning

Topics

Lesson 18 of 38 ยท Active Directory Structure

Sites, Subnets and Replication

Learn how Active Directory sites and subnets model your network, how the KCC builds replication topology, how multi-master replication and USNs work, and how to check health.

An Active Directory domain with several domain controllers must keep them identical. A change to a password in the head office must appear on the controllers in a branch office on another continent. Two ideas make this efficient: sites, which describe your physical network, and replication, the process that copies changes between controllers.

This lesson explains sites, subnets and site links, how the Knowledge Consistency Checker (KCC) builds a topology, how intrasite and intersite replication differ, how conflicts are resolved and which tools check health. A Python stand-in calculates cheapest replication paths over site links.

Why sites?

A site is a set of well-connected IP subnets, typically one physical location with fast LAN links. Sites tell AD where close is. AD uses that knowledge to:

  1. Route client logons to a nearby domain controller instead of a distant one.
  2. Control replication: frequent and cheap inside a site, scheduled and compressed between sites.
  3. Locate services such as DFS and Exchange in the nearest place.

Objects involved:

Object Purpose
Site A group of well-connected subnets (Default-First-Site-Name is the first one)
Subnet An IP range such as 10.20.0.0/16 assigned to a site
Site link A connection between sites with a cost, schedule and interval
Site link bridge Makes site links transitive (on by default)
Server object A DC placed in its site

Subnets are how a client finds its site: it looks up its own IP address in the subnet list. A client on an unassigned subnet falls back to any DC, which causes slow logons. Keeping the subnet list complete is one of the most important hygiene tasks.

Sites model the network

Site A well-connected location.
Subnet Maps IPs to a site.
Site link Has cost and schedule.

Clients find the nearest DC via their subnet

1 / 2

Replication basics

AD uses multi-master replication: any writable DC accepts changes and passes them on. The data is split into the naming contexts from Domains, Trees and Forests; each context replicates only to DCs that hold it.

Update sequence numbers and the high-watermark

Every DC keeps a counter, the update sequence number (USN), that grows with every change it commits. Each object records the USN of its last change (uSNChanged) and the originating DC and USN. A partner DC remembers the highest USN it has received from each source (the high-watermark vector) and asks only for changes above it. This is why AD replicates only the changed attributes, not whole objects, and why it is efficient.

Conflict resolution

Two admins can change the same attribute on different DCs at once. The rule, per attribute, is: the highest version number wins; ties are broken by the later timestamp, then the originating DC's GUID. Two objects with the same name created in the same container on different DCs result in a conflict object whose name gets CNF: appended. Clean these up by renaming or deleting.

Intrasite replication

Inside a site, DCs are connected in a ring (with shortcuts so that no more than three hops separate any two DCs). A DC waits about 15 seconds after a change, then notifies its first partner, with 3 seconds between further partners. Urgent replication (immediate) covers account lockouts, changing the RID master and the password of an account in some cases.

Intersite replication

Between sites, replication follows site links, runs on a schedule (a default interval of 180 minutes, minimum 15) and is compressed. Each site has one or more bridgehead servers that exchange the changes for the whole site. Change notification between sites can be enabled for fast replication where links are good.

The KCC

The Knowledge Consistency Checker runs on every DC every 15 minutes. It builds connection objects (inbound replication links) automatically, so that the topology is always connected and efficient, and the Inter-Site Topology Generator (ISTG), one DC per site, selects bridgeheads. You normally let the KCC work, but you can add manual connection objects or change site link costs to steer it.

SYSVOL and DFS-R

The SYSVOL folder holds Group Policy templates and logon scripts. It replicates separately from the directory using DFS Replication (DFS-R), which replaced the older FRS. Replication problems affect either the directory (AD replication) or SYSVOL (DFS-R); diagnose them separately.

Tools

POWERSHELL
repadmin /replsummary                 # overall health, failures per DC
repadmin /showrepl                    # inbound partners and last success
repadmin /syncall /AdeP               # force a sync everywhere
dcdiag /v                             # comprehensive DC health test
Get-ADReplicationFailure -Target dc1  # PowerShell view of failures
Get-ADReplicationSite -Filter *       # list sites
Get-ADReplicationSubnet -Filter *     # list subnets
Get-ADReplicationSiteLink -Filter *   # list site links and costs

Typical symptoms and their usual causes:

Symptom Likely cause
Replication fails with "RPC server unavailable" Firewall, network or DNS issue
"Access denied" in repadmin Secure channel or time skew problem
A DC not replicating for more than the tombstone lifetime (180 days by default) The DC is lingering: do not bring it back, rebuild it
New user appears in one site but not another Waiting for the intersite schedule
Clients log on to a faraway DC Missing subnet in Sites and Services

A domain controller that has been offline longer than the tombstone lifetime can reintroduce deleted objects ("lingering objects") when reconnected. Remove it from the domain and rebuild it instead of letting it replicate.

Site link cost drives which route changes take between distant sites (lower is better). This stand-in uses Dijkstra's algorithm to find the cheapest path between sites, as the ISTG would reason about it. It is a simplified teaching model.

Python Least-cost replication path (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Note how HQ -> NewYork uses the cheaper two-hop route through London rather than the direct 500 link.

USNs and the high-watermark (Python stand-in)

This model has one source DC with a USN counter and a partner that remembers the highest USN it has seen. Only the new changes travel.

Python Replication by USN

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. How does a client determine which site it belongs to?

    Subnets map IP ranges to sites; clients on unassigned subnets get poor DC selection.
  2. 2. What does the KCC do?

    The Knowledge Consistency Checker generates connection objects so that replication stays connected and efficient.
  3. 3. What happens if a DC is offline longer than the tombstone lifetime?

    Lingering objects appear when a stale DC replicates. Remove and rebuild it.
  4. 4. Which command summarizes replication health across DCs?

    repadmin /replsummary gives per-DC success and failure counts.

Summary

  • Sites and subnets model the network so clients find nearby DCs and replication is efficient.
  • Replication is multi-master, per attribute, driven by USNs and a high-watermark vector.
  • Intrasite replication is fast and notified; intersite replication uses site links with cost and a schedule.
  • The KCC and ISTG build the topology; SYSVOL replicates separately via DFS-R.
  • Check health with repadmin and dcdiag, and keep subnets complete and DCs below the tombstone lifetime.

Next: Global Catalog and FSMO Roles