Home

Awesome

MOVED

This repo has been moved to https://github.com/nislab/gensync . Please update your references.




CPISync

This is the source code for set reconciliation from the CPISync project by BU NISLAB.

Current Version - 2.0.3


References:

The code, explanation, references, API, and a demo can be found on this web page. If you use this work, please cite any relevant papers below.

The main theoretical bases for the approaches in this work are:

Relevant applications and extensions can be found at:

Additional algorithms:

Contributors:

Elements of the CPISync project code have been worked on, at various points, by:

@ Ari Trachtenberg

@ Sachin Agarwal

@ Paul Varghese

@ Jiaxi Jin

@ Jie Meng

@ Alexander Smirnov

@ Eliezer Pearl

@ Sean Brandenburg

@ Zifan Wang

@ Novak Boškov

Compilation:

Installation:

MacOS & Linux

  1. Install dependencies, download the project and navigate to the project folder in terminal

  2. Run the following commands in the project directory (The directory containing CMakeLists.txt)

    • cmake .
    • sudo make install
  3. Run ./UnitTest to ensure that the install has run successfully

    OR

1. Run the .deb or .rpm files included on a compatible linux system

Windows - Not currently supported

Use Instructions:

  1. Initialize a GenSync object with the constructor or builder helper class on the client and server machine

        GenSync::Builder builder = GenSync::Builder().
           setProtocol(GenSync::SyncProtocol::CPISync).  //CPISync,InterCPISync, ProbCPISync, IBLTSync, FullSync, etc.
           setComm(GenSync::SyncComm::socket). //CommSocket or CommString
           setPort(8001).
           setHost(localhost).
        
           //Set the parameters for your specific sync type (Not the same for every protocol. See GenSync build parameters section)
           setBits(64). // Bits per element
           setMbar(256). // Max differences to sync
           setErr(7); // -log_2(prob of error) to allow for errors that might otherwise underflow
           
        GenSync mySyncClientOrServer = builder.build();
    
  2. Add elements to your GenSyncs (If you need to add large elements use the ZZ class from NTL)

    • You may manually create a shared_ptr<DataObject> (Data/DataObject.h) or pass a data type compatible with DataObject and one will be automatically created for you, returning a pointer to the newly created DataObject
        mySyncClientOrServer.addElem(myZZ);
        mySyncClientOrServer.addElem(myLong);
        mySyncClientOrServer.addElem(myInt);
        mySyncClientOrServer.addElem(myMultiSet); // Multisets are serialized for use in IBLTSetOfSets. This does NOT add each element in the multiset to your sync.
    
  3. Run serverSyncBegin and clientSyncBegin on the server and client respectively

        mySyncServer.serverSyncBegin(0); //Add the index of the sync you would like to perform
        mySyncClient.clientSyncBegin(0);  //Multiple syncs or communicants may be added to one GenSync
    
  4. Collect relevant statistics

       //The sync index is decided by the order you added your sync in
       //If your GenSync has only 1 sync the index is 0
        mySyncClient.printStats(syncIndex); //Returns a string of formatted stats about your sync
        mySyncClient.mySyncVec[syncIndex]->getName(); //Retruns the name and parameters for your sync
        mySyncClient.getXmitBytes(syncIndex); //Returns the number of bytes transmitted by this sync
        mySyncClient.getRecvBytes(syncIndex); //Returns the number of bytes received by this sync
        mySyncClient.getCommTime(syncIndex); //Returns the amount of time in seconds that the sync spent sending and receiving info through a socket
        mySyncClient.getIdleTime(syncIndex); //The amount of time spent waiting for a connection or for a peer to finish computation
        mySyncClient.getCompTime(syncIndex); //The amount of time spent doing computations
    
        
    

Sync Types:

GenSync Builder Parameters:

Documentation

More documentation may be found in the documents folder:

General usage

Data structures

Acknowledgments: NSF

Ari Trachtenberg, trachten@bu.edu, Boston University