[MS-FRS1]:

File Replication Service Protocol

Intellectual Property Rights Notice for Open Specifications Documentation

Technical Documentation. Microsoft publishes Open Specifications documentation (“this documentation”) for protocols, file formats, data portability, computer languages, and standards support. Additionally, overview documents cover inter-protocol relationships and interactions.

Copyrights. This documentation is covered by Microsoft copyrights. Regardless of any other terms that are contained in the terms of use for the Microsoft website that hosts this documentation, you can make copies of it in order to develop implementations of the technologies that are described in this documentation and can distribute portions of it in your implementations that use these technologies or in your documentation as necessary to properly document the implementation. You can also distribute in your implementation, with or without modification, any schemas, IDLs, or code samples that are included in the documentation. This permission also applies to any documents that are referenced in the Open Specifications documentation.

No Trade Secrets. Microsoft does not claim any trade secret rights in this documentation.

Patents. Microsoft has patents that might cover your implementations of the technologies described in the Open Specifications documentation. Neither this notice nor Microsoft's delivery of this documentation grants any licenses under those patents or any other Microsoft patents. However, a given Open Specifications document might be covered by the Microsoft Open Specifications Promise or the Microsoft Community Promise. If you would prefer a written license, or if the technologies described in this documentation are not covered by the Open Specifications Promise or Community Promise, as applicable, patent licenses are available by contacting .

License Programs. To see all of the protocols in scope under a specific license program and the associated patents, visit the Patent Map.

Trademarks. The names of companies and products contained in this documentation might be covered by trademarks or similar intellectual property rights. This notice does not grant any licenses under those rights. For a list of Microsoft trademarks, visit

Fictitious Names. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events that are depicted in this documentation are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred.

Reservation of Rights. All other rights are reserved, and this notice does not grant any rights other than as specifically described above, whether by implication, estoppel, or otherwise.

Tools. The Open Specifications documentation does not require the use of Microsoft programming tools or programming environments in order for you to develop an implementation. If you have access to Microsoft programming tools and environments, you are free to take advantage of them. Certain Open Specifications documents are intended for use in conjunction with publicly available standards specifications and network programming art and, as such, assume that the reader either is familiar with the aforementioned material or has immediate access to it.

Support. For questions and support, please contact .

Revision Summary

Date / Revision History / Revision Class / Comments
3/2/2007 / 1.0 / Major / Updated and revised the technical content.
4/3/2007 / 1.1 / Minor / Clarified the meaning of the technical content.
5/11/2007 / 2.0 / Major / Updated technical content
6/1/2007 / 2.1 / Minor / Clarified the meaning of the technical content.
7/3/2007 / 2.1.1 / Editorial / Changed language and formatting in the technical content.
8/10/2007 / 2.1.2 / Editorial / Changed language and formatting in the technical content.
9/28/2007 / 2.1.3 / Editorial / Changed language and formatting in the technical content.
10/23/2007 / 2.1.4 / Editorial / Changed language and formatting in the technical content.
1/25/2008 / 2.1.5 / Editorial / Changed language and formatting in the technical content.
3/14/2008 / 2.1.6 / Editorial / Changed language and formatting in the technical content.
6/20/2008 / 3.0 / Major / Updated and revised the technical content.
7/25/2008 / 3.0.1 / Editorial / Changed language and formatting in the technical content.
8/29/2008 / 4.0 / Major / Updated and revised the technical content.
10/24/2008 / 4.0.1 / Editorial / Changed language and formatting in the technical content.
12/5/2008 / 5.0 / Major / Updated and revised the technical content.
1/16/2009 / 6.0 / Major / Updated and revised the technical content.
2/27/2009 / 7.0 / Major / Updated and revised the technical content.
4/10/2009 / 8.0 / Major / Updated and revised the technical content.
5/22/2009 / 9.0 / Major / Updated and revised the technical content.
7/2/2009 / 9.0.1 / Editorial / Changed language and formatting in the technical content.
8/14/2009 / 9.0.2 / Editorial / Changed language and formatting in the technical content.
9/25/2009 / 10.0 / Major / Updated and revised the technical content.
11/6/2009 / 11.0 / Major / Updated and revised the technical content.
12/18/2009 / 11.1 / Minor / Clarified the meaning of the technical content.
1/29/2010 / 12.0 / Major / Updated and revised the technical content.
3/12/2010 / 12.0.1 / Editorial / Changed language and formatting in the technical content.
4/23/2010 / 13.0 / Major / Updated and revised the technical content.
6/4/2010 / 14.0 / Major / Updated and revised the technical content.
7/16/2010 / 15.0 / Major / Updated and revised the technical content.
8/27/2010 / 15.0 / None / No changes to the meaning, language, or formatting of the technical content.
10/8/2010 / 15.0 / None / No changes to the meaning, language, or formatting of the technical content.
11/19/2010 / 15.0 / None / No changes to the meaning, language, or formatting of the technical content.
1/7/2011 / 15.0 / None / No changes to the meaning, language, or formatting of the technical content.
2/11/2011 / 15.0 / None / No changes to the meaning, language, or formatting of the technical content.
3/25/2011 / 15.0 / None / No changes to the meaning, language, or formatting of the technical content.
5/6/2011 / 16.0 / Major / Updated and revised the technical content.
6/17/2011 / 17.0 / Major / Updated and revised the technical content.
9/23/2011 / 18.0 / Major / Updated and revised the technical content.
12/16/2011 / 19.0 / Major / Updated and revised the technical content.
3/30/2012 / 20.0 / Major / Updated and revised the technical content.
7/12/2012 / 21.0 / Major / Updated and revised the technical content.
10/25/2012 / 21.0 / None / No changes to the meaning, language, or formatting of the technical content.
1/31/2013 / 22.0 / Major / Updated and revised the technical content.
8/8/2013 / 23.0 / Major / Updated and revised the technical content.
11/14/2013 / 24.0 / Major / Updated and revised the technical content.
2/13/2014 / 24.0 / None / No changes to the meaning, language, or formatting of the technical content.
5/15/2014 / 24.0 / None / No changes to the meaning, language, or formatting of the technical content.
6/30/2015 / 25.0 / Major / Significantly changed the technical content.
10/16/2015 / 25.0 / None / No changes to the meaning, language, or formatting of the technical content.
7/14/2016 / 25.0 / None / No changes to the meaning, language, or formatting of the technical content.
6/1/2017 / 25.0 / None / No changes to the meaning, language, or formatting of the technical content.
9/15/2017 / 26.0 / Major / Significantly changed the technical content.

Table of Contents

1Introduction

1.1Glossary

1.2References

1.2.1Normative References

1.2.2Informative References

1.3Overview

1.4Relationship to Other Protocols

1.5Prerequisites/Preconditions

1.6Applicability Statement

1.7Versioning and Capability Negotiation

1.7.1NtFrsApi

1.7.2FRSRPC

1.8Vendor-Extensible Fields

1.9Standards Assignments

2Messages

2.1Transport

2.2Common Data Types

2.2.1WCHAR and PWCHAR

2.2.2NtFrsApi Common Data Types

2.2.2.1NTFRSAPI_INFO

2.2.3FRSRPC Common Data Types

2.2.3.1GVSN

2.2.3.2CHANGE_ORDER_COMMAND

2.2.3.3CO_RECORD_EXTENSION_WIN2K

2.2.3.4CHANGE_ORDER_RECORD_EXTENSION

2.2.3.5COMM_PACKET and PCOMM_PACKET

2.2.3.6COMM_PACKET Elements

2.2.3.6.1COMM_BOP

2.2.3.6.2COMM_COMMAND

2.2.3.6.3COMM_TO

2.2.3.6.4COMM_FROM

2.2.3.6.5COMM_REPLICA

2.2.3.6.6COMM_CXTION

2.2.3.6.7COMM_JOIN_GUID

2.2.3.6.8COMM_LAST_JOIN_TIME

2.2.3.6.9COMM_VVECTOR

2.2.3.6.10COMM_JOIN_TIME

2.2.3.6.11COMM_REPLICA_VERSION_GUID

2.2.3.6.12COMM_COMPRESSION_GUID

2.2.3.6.13COMM_BLOCK

2.2.3.6.14COMM_BLOCK_SIZE

2.2.3.6.15COMM_FILE_SIZE

2.2.3.6.16COMM_FILE_OFFSET

2.2.3.6.17COMM_GVSN

2.2.3.6.18COMM_CO_GUID

2.2.3.6.19COMM_CO_SEQUENCE_NUMBER

2.2.3.6.20COMM_REMOTE_CO

2.2.3.6.21COMM_CO_EXT_WIN2K

2.2.3.6.22COMM_CO_EXTENSION_2

2.2.3.6.23COMM_EOP

2.2.3.7DATA_EXTENSION_CHECKSUM

2.2.3.8DATA_EXTENSION_PREFIX

2.2.3.9DATA_EXTENSION_RETRY_TIMEOUT

2.2.3.10STAGE_HEADER

2.3Directory Service Schema Elements

2.3.1DFS Active Directory Configuration

2.3.1.1NTFRS Settings Object

2.3.1.2NTFRS Replica Set Object

2.3.1.3NTFRS Member Object

2.3.1.4NTDS Active Directory Service Agent (nTDSDSA) Object

2.3.1.5NTDS Active Directory Service Agent Read Only (nTDSDSARO) Object

2.3.1.6NTDS Connection Object

2.3.1.7Computer Object

2.3.1.8NTFRS Subscriptions Container

2.3.1.9NTFRS Subscriber Object

2.3.1.10Object Types

2.3.1.11Top class

2.3.2SYSVOL Active Directory Configuration

2.3.2.1NTFRS Settings Object

2.3.2.2NTFRS Replica Set Object

2.3.2.3NTFRS Member Object

2.3.2.4NTDS Connection Object

2.3.2.5Computer Object

2.3.2.6NTFRS Subscriptions Container

2.3.2.7NTFRS Subscriber Object

2.4FRS Performance Counters

2.4.1FileReplicaConn Object

2.4.2FileReplicaSet

3Protocol Details

3.1Common Details

3.1.1Abstract Data Model

3.1.1.1File System

3.1.1.2Replica Set Object

3.1.1.3Member Object (Replica Member Object)

3.1.1.4Replica Tree

3.1.1.5IDTable

3.1.1.6Inbound Log Object (InLog)

3.1.1.7Outbound Log Object (OutLog)

3.1.1.8Connection Object

3.1.1.9Staging File Object

3.1.1.10Change Order Object

3.1.1.10.1Local Change Order

3.1.1.10.2Retry Change Order

3.1.1.10.3Directed Change Order

3.1.1.10.4Out-of-Order Change Order

3.1.1.10.5Skip-VV-Update Change Order

3.1.1.11Version Vector Object

3.1.1.12Communication Packet Object

3.1.2Timers

3.1.3Initialization

3.1.4Message Processing Events and Sequencing Rules

3.1.5Timer Events

3.1.5.1Both Short and Long DS Polling Interval Timers

3.1.6Other Local Events

3.2FRSAPI Interface

3.2.1Abstract Data Model

3.2.2Timers

3.2.3Initialization

3.2.4Message Processing Events and Sequencing Rules

3.2.4.1NtFrsApi_Rpc_Set_DsPollingIntervalW (Opnum 4)

3.2.4.2NtFrsApi_Rpc_Get_DsPollingIntervalW (Opnum 5)

3.2.4.3NtFrsApi_Rpc_InfoW (Opnum 7)

3.2.4.4NtFrsApi_Rpc_IsPathReplicated (Opnum 8)

3.2.4.5NtFrsApi_Rpc_WriterCommand (Opnum 9)

3.2.4.6NtFrsApi_Rpc_ForceReplication (Opnum 10)

3.2.5Timer Events

3.2.6Other Local Events

3.3FRSRPC Interface

3.3.1Abstract Data Model

3.3.2Timers

3.3.2.1Connection Schedule Timer

3.3.2.1.1SYSVOL Connection ScheduleTimer

3.3.2.1.2DFS Connection Schedule

3.3.3Initialization

3.3.4Message Processing Events and Sequencing Rules

3.3.4.1Change Orders

3.3.4.1.1File Is Added/Updated on the Upstream Partner

3.3.4.1.2File Is Removed on the Upstream Partner

3.3.4.1.3File Is Renamed on the Upstream Partner

3.3.4.1.4Folder Is Created/Updated on the Upstream Partner

3.3.4.1.5Folder Is Removed on the Upstream Partner

3.3.4.1.6Folder Is Renamed on the Upstream Partner

3.3.4.2FrsRpcStartPromotionParent Message (Opnum 2)

3.3.4.3FrsNOP Message (Opnum 3)

3.3.4.4FrsRpcSendCommPkt (Opnum 0)

3.3.4.4.1Common Details

3.3.4.4.2COMM_COMMAND Is CMD_NEED_JOIN

3.3.4.4.3COMM_COMMAND Is CMD_START_JOIN

3.3.4.4.4COMM_COMMAND Is CMD_JOINING

3.3.4.4.4.1Connection VVJoin

3.3.4.4.4.1.1Common Details for Initial Syncing a File and a Folder

3.3.4.4.4.1.2Initial Syncing a File

3.3.4.4.4.1.3Initial Syncing a Folder

3.3.4.4.4.1.4CMD_VVJOIN_DONE Once Initial Sync Is Done

3.3.4.4.5COMM_COMMAND Is CMD_JOINED

3.3.4.4.6COMM_COMMAND Is CMD_REMOTE_CO

3.3.4.4.6.1Requesting a Staging File

3.3.4.4.6.2Acknowledging the Change Is Done

3.3.4.4.7COMM_COMMAND Is CMD_SEND_STAGE

3.3.4.4.8COMM_COMMAND Is CMD_RECEIVING_STAGE

3.3.4.4.9COMM_COMMAND Is CMD_REMOTE_CO_DONE

3.3.4.4.10COMM_COMMAND Is CMD_ABORT_FETCH

3.3.4.4.11COMM_COMMAND Is CMD_RETRY_FETCH

3.3.4.4.12COMM_COMMAND Is CMD_VVJOIN_DONE

3.3.4.4.13COMM_COMMAND Is CMD_UNJOIN_REMOTE

3.3.4.5FrsRpcVerifyPromotionParent (Opnum 1)

3.3.4.6Establishing a Connection Session

3.3.5Timer Events

3.3.6Other Local Events

3.4PERFFRS Interface

4Protocol Examples

4.1Connection Establishment Sequence

4.2Change Order Handling Sequence

4.3COMM_PACKET

4.4SYSVOL Initial Sync

4.4.1Replica DC Sends Out CMD_NEED_JOIN to PDC

4.4.2PDC Sends Out CMD_START_JOIN to Replica DC

4.4.3Replica DC Sends Out CMD_JOINING

4.4.4PDC Sends Out CMD_JOINED

4.4.5PDC Sends Out CMD_REMOTE_CO

4.4.6Replica DC Sends Out CMD_SEND_STAGE

4.4.7PDC Sends Out CMD_RECEIVING_STAGE

4.4.8Replica DC Sends Out CMD_REMOTE_CO_DONE

4.4.9Once All Change Orders are Sent Out, PDC Sends Out CMD_VVJOIN_DONE

4.4.10Replica DC Sends Out CMD_UNJOIN_REMOTE

4.5Normal Sync

4.5.1Copy a File

4.5.1.1Upstream Partner Sends Out CMD_REMOTE_CO

4.5.1.2Downstream Partner Sends Out CMD_SEND_STAGE 1

4.5.1.3Upstream Partner Sends Out CMD_RECEIVING_STAGE 1

4.5.1.4Downstream Partner Sends Out CMD_SEND_STAGE 2

4.5.1.5Upstream Partner Sends Out CMD_RECEIVING_STAGE 2

4.5.1.6Downstream Partner Sends Out CMD_REMOTE_CO_DONE

4.5.2Rename a File

4.5.2.1Upstream Partner Sends Out CMD_REMOTE_CO

4.5.2.2Downstream Partner Sends Out CMD_SEND_STAGE

4.5.2.3Upstream Partner Sends Out CMD_RECEIVING_STAGE

4.5.2.4Downstream Partner Sends Out CMD_REMOTE_CO_DONE

4.5.3Remove a File

4.5.3.1Upstream Partner Sends Out CMD_REMOTE_CO

4.5.3.2Downstream Partner Sends Out CMD_REMOTE_CO_DONE

4.5.4Copy an Empty Folder

4.5.4.1Upstream Partner Sends Out CMD_REMOTE_CO

4.5.4.2Downstream Partner Sends Out CMD_SEND_STAGE

4.5.4.3Upstream Partner Sends Out CMD_RECEIVING_STAGE

4.5.4.4Downstream Partner Sends Out CMD_REMOTE_CO_DONE

4.5.5Remove a Folder

4.5.5.1Upstream Partner Sends Out CMD_REMOTE_CO

4.5.5.2Downstream Partner Sends Out CMD_REMOTE_CO_DONE

4.5.6Rename an Empty Folder

4.5.6.1Upstream Partner Sends Out CMD_REMOTE_CO

4.5.6.2Downstream Partner Sends Out CMD_SEND_STAGE

4.5.6.3Upstream Partner Sends Out CMD_RECEIVING_STAGE

4.5.6.4Downstream Partner Sends Out CMD_REMOTE_CO_DONE

5Security

5.1Security Considerations for Implementers

5.2Index of Security Parameters

6Appendix A: Full IDL

6.1Appendix A.1: frsapi.idl

6.2Appendix A.2: frsrpc.idl

7Appendix B: Product Behavior

8Change Tracking

9Index

1Introduction

This is a protocol document specifying the File Replication Service (FRS) Protocol. The FRS Protocol is used to replicate files and folders among servers on the network. This protocol enables duplicate files and folders to be maintained on multiple servers. Microsoft operating systems use FRS to maintain duplicate copies of data files in system volume (SYSVOL) system folders on multiple domain controllers in a domain. Microsoft operating systems also use FRS to replicate data files among Distributed File System (DFS) shares.

This document provides detailed technical reference material for the Remote Procedure Call (RPC) interfaces, packet formats, and data structures required for interoperation using FRS.

Sections 1.5, 1.8, 1.9, 2, and 3 of this specification are normative. All other sections and examples in this specification are informative.

1.1Glossary

This document uses the following terms:

Active Directory: A general-purpose network directory service. Active Directory also refers to the Windows implementation of a directory service. Active Directory stores information about a variety of objects in the network. User accounts, computer accounts, groups, and all related credential information used by the Windows implementation of Kerberos are stored in Active Directory. Active Directory is either deployed as Active Directory Domain Services (AD DS) or Active Directory Lightweight Directory Services (AD LDS). [MS-ADTS] describes both forms. For more information, see [MS-AUTHSOD] section 1.1.1.5.2, Lightweight Directory Access Protocol (LDAP) versions 2 and 3, Kerberos, and DNS.

Active Directory object: A set of directory objects that are used within Active Directory as defined in [MS-ADTS] section 3.1.1. An Active Directory object can be identified by a dsname. See also directory object.

Active Directory replication: The process by which the changes that are made to Active Directory objects on one domain controller (DC) are automatically synchronized with other DCs.

Change Order: A message that contains information about a file or folder that has changed on a replica. The change order is sent to the member's downstream partners. If the downstream partners accept the change, the partners request the associated staging file. After installing the changed file in their individual replica trees, the partners propagate the change order to their downstream partners.

Connection Join (Join): The process by which a connection session is established.

Connection Session: After FRS discovers a connection from Active Directory, FRS establishes a connection session with the remote connection partner based on the information provided by the connection object. The connection is called "joined" when a connection session is successfully established. This connection session is disconnected once the connection schedule is off (forbidding file replication on the connection).

Dampening: On receiving a remote change order, FRS must determine if the change order is already known to the local machine by using the version vector of the local machine. If the remote change order is known, FRS drops the change order and informs the upstream partner. This process is called "dampening" a change order.

DFS-R: A service that keeps DFS and SYSVOL folders in sync automatically. DFS-R is a state-based, multimaster replication system that supports replication scheduling and bandwidth throttling. This is a rewrite and new version of FRS. For more information, see [MS-FRS2].

Directed Change Order: A change order directed to a single downstream partner and produced when the partner is a Version Vector Join (VVJoin), such as during initial sync.

Distributed File System (DFS): A file system that logically groups physical shared folders located on different servers by transparently connecting them to one or more hierarchical namespaces. DFS also provides fault-tolerance and load-sharing capabilities.

Distributed File System Replication (DFS-R): A service that keeps DFS folders in sync automatically. DFS-R is a state-based, multi-master replication system that supports replication scheduling and bandwidth throttling. This is a rewrite and new version of the File Replication Service (FRS). For more information, see [MS-FRS2].

domain: A set of users and computers sharing a common namespace and management infrastructure. At least one computer member of the set must act as a domain controller (DC) and host a member list that identifies all members of the domain, as well as optionally hosting the Active Directory service. The domain controller provides authentication of members, creating a unit of trust for its members. Each domain has an identifier that is shared among its members. For more information, see [MS-AUTHSOD] section 1.1.1.5 and [MS-ADTS].

domain controller (DC): The service, running on a server, that implements Active Directory, or the server hosting this service. The service hosts the data store for objects and interoperates with other DCs to ensure that a local change to an object replicates correctly across all DCs. When Active Directory is operating as Active Directory Domain Services (AD DS), the DC contains full NC replicas of the configuration naming context (config NC), schema naming context (schema NC), and one of the domain NCs in its forest. If the AD DS DC is a global catalog server (GC server), it contains partial NC replicas of the remaining domain NCs in its forest. For more information, see [MS-AUTHSOD] section 1.1.1.5.2 and [MS-ADTS]. When Active Directory is operating as Active Directory Lightweight Directory Services (AD LDS), several AD LDS DCs can run on one server. When Active Directory is operating as AD DS, only one AD DS DC can run on one server. However, several AD LDS DCs can coexist with one AD DS DC on one server. The AD LDS DC contains full NC replicas of the config NC and the schema NC in its forest. The domain controller is the server side of Authentication Protocol Domain Support [MS-APDS].

domain functional level: A specification of functionality available in a domain. Must be less than or equal to the DC functional level of every domain controller (DC) that hosts a replica of the domain's naming context (NC). For information on defined levels, corresponding features, information on how the domain functional level is determined, and supported domain controllers, see [MS-ADTS] sections 6.1.4.2 and 6.1.4.3. When Active Directory is operating as Active Directory Lightweight Directory Services (AD LDS), domain functional level does not exist.

Downstream Partner: The partner that receives change orders, files, and folders.

endpoint: A network-specific address of a remote procedure call (RPC) server process for remote procedure calls. The actual name and type of the endpoint depends on the RPC protocol sequence that is being used. For example, for RPC over TCP (RPC Protocol Sequence ncacn_ip_tcp), an endpoint might be TCP port 1025. For RPC over Server Message Block (RPC Protocol Sequence ncacn_np), an endpoint might be the name of a named pipe. For more information, see [C706].

endpoint mapper: A service on a remote procedure call (RPC) server that maintains a database of dynamic endpoints and allows clients to map an interface/object UUID pair to a local dynamic endpoint. For more information, see [C706].

Event Time: See File Event Time.

file: An entity of data in the file system that a user can access and manage. A file must have a unique name in its directory. It consists of one or more streams of bytes that hold a set of related data, plus a set of attributes (also called properties) that describe the file or the data within the file. The creation time of a file is an example of a file attribute.

file attribute: A 32-bit bitmask containing information on a file's properties. For instance, 0x00000001 is used for the read-only attribute.

File GUID: An identifying property of a file or folder in a replica tree. FRS creates and manages fileGUIDs, which, along with the file version number and file event time, are stored in the IDTable. Each file and folder stores its file GUID as part of its attributes; therefore, corresponding files and folders across all replica set members have the same file GUID.

File Replication Service (FRS): One of the services offered by a domain controller (DC), which is advertised through the Domain Controller Location protocol. The service being offered to clients is a replicated data storage volume that is associated with the default naming context (NC). The running or paused state of the FRS on a DC is available through protocols documented in [MS-ADTS] section 6.3.