Skip to content

Architecture

Hamed Soleimani edited this page Jan 23, 2016 · 2 revisions

Architecture

###Class Diagram client of udp-synchronizer consists of 2 classes and a main program. here is class diagram: client class diagram

###Activity Diagram Main program send the orders to server in this way: client activity diagram

###Data Model Packets are devided into 2 types (Message, Chunk). So what is difference between them? As mentioned before this program will receive synchronization events from client to sync 2 folders on client and server. Events are create/remove file and create/remove folder. 3 of them only need name of file/folder to create or remove, but to create file we need file contents too. So events are categorized into 2 category (Message and Chunk). Message for create/remove folder and remove file, Chunk for create file. Also we cant send big files in a packet to server so we should split files into several chunks and send the chunks to server. Here is format of chunk and message: Chunk/Message format

Fields are separate by ;. As you can see first 20 bytes in each of them is checksum. It used for evaluating correctness of the package. After the checksum there is a 2 byte field called type that determine the type of message.

In message type packages there is operation type (one of CREATE_DIR, REMOVE_FILE, REMOVE_DIR) and filename fields after the type field.

In Chunk type packages after the checksum there is file name, start location of the chunk on the file and contents field.

###References

Clone this wiki locally