@node Sync
-@unnumbered Sync protocol
+@unnumbered Synchronization protocol
-So-called sync protocol (SP) is used in current TCP daemon's
+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.
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 and
+full-duplex links: for example satellites have very high throughput but
high-delay links, so acknowledging of each received packet, like
@url{https://en.wikipedia.org/wiki/XMODEM, XMODEM} does, causes
unacceptable performance degradation.
hiding actual number of @code{INFO} packets (number of files available
for transmission).
-Each SP payload is a concatenation of various SP packets. Each packet
-has XDR-encoded header and then corresponding XDR-encoded body. Header
-is just an unsigned integer telling what body structure follows.
+Each SP payload is a concatenation of SP packets. Each packet has
+XDR-encoded header and then corresponding XDR-encoded body. Header is
+just an unsigned integer telling what body structure follows.
@table @code
Actually @code{HALT} packet does not have any body, only the header
with the type. It is also used in the first payload for padding to
the maximum size.
+@verbatim
++------+
+| HALT |
++------+
+@end verbatim
@item INFO
Information about the file we have for transmission.
@verbatim
-+--------------------+
-| NICE | SIZE | HASH |
-+--------------------+
++------+--------------------+
+| INFO | NICE | SIZE | HASH |
++------+--------------------+
@end verbatim
@multitable @columnfractions 0.2 0.3 0.5
@headitem @tab XDR type @tab Value
@item Niceness @tab
unsigned integer @tab
- 1-255, file niceness level, its priority
+ 1-255, file niceness level
@item Size @tab
unsigned hyper integer @tab
File size
File transmission request. Ask remote side to queue the file for
transmission.
@verbatim
-+---------------+
-| HASH | OFFSET |
-+---------------+
++------+---------------+
+| FREQ | HASH | OFFSET |
++------+---------------+
@end verbatim
@multitable @columnfractions 0.2 0.3 0.5
@headitem @tab XDR type @tab Value
@item FILE
Chunk of file.
@verbatim
-+-------------------------+
-| HASH | OFFSET | PAYLOAD |
-+-------------------------+
++------+-------------------------+
+| FILE | HASH | OFFSET | PAYLOAD |
++------+-------------------------+
@end verbatim
@multitable @columnfractions 0.2 0.3 0.5
@headitem @tab XDR type @tab Value
@item DONE
Signal remote side that we have successfully downloaded the file.
@verbatim
-+------+
-| HASH |
-+------+
++------+------+
+| DONE | HASH |
++------+------+
@end verbatim
@multitable @columnfractions 0.2 0.3 0.5
@headitem @tab XDR type @tab Value