4 Protocol Examples

FRS uses FrsRpcSendCommPkt (see section 3.3.4.4) to send COMM_PACKET (see section 2.2.3.5) between replica members to replicate files and folders inside a replica set.

If machine A calls the FrsRpcSendCommPkt method on machine B, in the following sections, this is called: Machine A sends COMM_PACKET packet to machine B.

There are 12 types of COMM_PACKETS (see section 2.2.3.6.2):

  • CMD_START_JOIN

  • CMD_JOINING

  • CMD_JOINED

  • CMD_REMOTE_CO

  • CMD_SEND_STAGE

  • CMD_RECEIVING_STAGE

  • CMD_REMOTE_CO_DONE

  • CMD_ABORT_FETCH

  • CMD_RETRY_FETCH

  • CMD_UNJOIN_REMOTE

  • CMD_VVJOIN_DONE

If machine A sends a COMM_PACKET to machine B, and if COMM_PACKET.COMM_COMMAND is CMD_NEED_JOIN (0x00000121), this is called: Machine A sends CMD_NEED_JOIN to machine B.

Section 4.1 gives the connection establishment sequence.

Section 4.2 gives the change order handling sequence after connections are established.

Section 4.3 gives an example to show the byte layout of COMM_PACKET.

Section 4.4 gives a complete initial sync example with details for every packet that is transmitted on the wire.

Section 4.5 gives a set of examples for normal sync with details for every packet that is transmitted on the wire, including:

  • Copying a file.

  • Renaming a file.

  • Removing a file.

  • Copying a folder.

  • Removing a folder.

  • Renaming a folder.

Sections 4.4 and 4.5 are intended to provide complete examples with every byte. These examples are used on the wire for both initial sync and normal sync.