@node Sync
+@cindex sync protocol
+@cindex online protocol
+@cindex synchronization
@unnumbered Synchronization protocol
So-called synchronization protocol (SP) is used in current TCP daemon's
implementation. It is used for synchronizing @ref{Spool, spool}
directory contents between two nodes.
+@cindex XMODEM
It is aimed to be very simple and effective. It uses reliable transport
like TCP connections. It must be effective both on single-duplex and
full-duplex links: for example satellites have very high throughput but
@url{https://en.wikipedia.org/wiki/XMODEM, XMODEM} does, causes
unacceptable performance degradation.
+@vindex NNCPDEADLINE
+Internally it uses various timeouts and deadlines. One of them used
+extensively is 10 seconds default deadline timeout. You can override it
+with @env{$NNCPDEADLINE} environment variable, that could be useful with
+very high delay links.
+
+@cindex Noise-IK
SP works on top of
@url{http://noiseprotocol.org/noise.html#interactive-patterns,
@code{Noise_IK_25519_ChaChaPoly_BLAKE2b}} protocol. Each Noise packet
@table @emph
+@cindex HALT payload
@item HALT
Stop file transmission, empty sending queue on the remote side.
Actually @emph{HALT} packet does not have any body, only the header
+------+
@end verbatim
+@cindex PING payload
@item PING
Dummy packet only used for determining workability of the connection.
+------+
@end verbatim
+@cindex INFO payload
@item INFO
Information about the file we have for transmission.
Unique file identifier, its checksum
@end multitable
+@cindex FREQ payload
@item FREQ
File transmission request. Ask remote side to queue the file for
transmission.
Offset from which remote side must transmit the file
@end multitable
+@cindex FILE payload
@item FILE
Chunk of file.
Chunk of file itself
@end multitable
+@cindex DONE payload
@item DONE
Signal remote side that we have successfully downloaded the file.