syncthing-localdisco.7 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH "SYNCTHING-LOCALDISCO" "7" "January 01, 2016" "v0.12" "Syncthing"
  4. .SH NAME
  5. syncthing-localdisco \- Local Discovery Protocol v3
  6. .
  7. .nr rst2man-indent-level 0
  8. .
  9. .de1 rstReportMargin
  10. \\$1 \\n[an-margin]
  11. level \\n[rst2man-indent-level]
  12. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  13. -
  14. \\n[rst2man-indent0]
  15. \\n[rst2man-indent1]
  16. \\n[rst2man-indent2]
  17. ..
  18. .de1 INDENT
  19. .\" .rstReportMargin pre:
  20. . RS \\$1
  21. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  22. . nr rst2man-indent-level +1
  23. .\" .rstReportMargin post:
  24. ..
  25. .de UNINDENT
  26. . RE
  27. .\" indent \\n[an-margin]
  28. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  29. .nr rst2man-indent-level -1
  30. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  31. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  32. ..
  33. .SH MODE OF OPERATION
  34. .sp
  35. Each participating device periodically sends an Announcement packet. It also
  36. keeps a table of the announcements it has seen. There is no way to solicit a
  37. reply; the only message type is Announcement.
  38. .sp
  39. On multihomed hosts the announcement packets should be sent on each interface
  40. on which Syncthing will accept connections.
  41. .sp
  42. For IPv4, the Announcement packet is broadcast either to the link\-specific
  43. broadcast address, or to the generic link\-local broadcast address
  44. \fB255.255.255.255\fP, with destination port 21027.
  45. .sp
  46. For IPv6, the Announcement packet is multicast to the transient link\-local
  47. multicast address \fB[ff12::8384]\fP, with destination port 21027.
  48. .sp
  49. It is recommended that local discovery Announcement packets be sent on a 30 to
  50. 60 second interval, possibly with immediate transmissions when a previously
  51. unknown device is discovered.
  52. .SH DEVICE ID
  53. .sp
  54. The device ID is the SHA\-256 (32 bytes) of the device X.509 certificate. See
  55. device\-ids in the Syncthing documentation.
  56. .SH ANNOUNCEMENT PACKET
  57. .sp
  58. The Announcement packet has the following structure:
  59. .INDENT 0.0
  60. .INDENT 3.5
  61. .sp
  62. .nf
  63. .ft C
  64. Announce Structure:
  65. 0 1 2 3
  66. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  67. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  68. | Magic |
  69. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  70. / /
  71. \e Device Structure \e
  72. / /
  73. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  74. | Number of Extra Devices |
  75. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  76. / /
  77. \e Zero or more Device Structures \e
  78. / /
  79. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  80. Device Structure:
  81. 0 1 2 3
  82. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  83. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  84. | Length of ID |
  85. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  86. / /
  87. \e ID (variable length) \e
  88. / /
  89. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  90. | Number of Addresses |
  91. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  92. / /
  93. \e Zero or more Address Structures \e
  94. / /
  95. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  96. | Number of Relays |
  97. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  98. / /
  99. \e Zero or more Relay Structures \e
  100. / /
  101. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  102. Address Structure:
  103. 0 1 2 3
  104. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  105. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  106. | Length of URL |
  107. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  108. / /
  109. \e URL (variable length) \e
  110. / /
  111. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  112. Relay Structure:
  113. 0 1 2 3
  114. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  115. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  116. | Length of URL |
  117. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  118. / /
  119. \e URL (variable length) \e
  120. / /
  121. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  122. | Latency |
  123. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  124. .ft P
  125. .fi
  126. .UNINDENT
  127. .UNINDENT
  128. .sp
  129. The corresponding XDR representation is as follows (see
  130. \fI\%RFC4506\fP <\fBhttp://tools.ietf.org/html/rfc4506\fP> for the XDR format):
  131. .INDENT 0.0
  132. .INDENT 3.5
  133. .sp
  134. .nf
  135. .ft C
  136. struct Announcement {
  137. unsigned int Magic;
  138. Device This;
  139. Device Extra<>;
  140. }
  141. struct Device {
  142. opaque ID<32>;
  143. Address Addresses<16>;
  144. Relay Relays<16>;
  145. }
  146. struct Address {
  147. string URL<2083>;
  148. }
  149. struct Relay {
  150. string URL<2083>;
  151. int Latency;
  152. }
  153. .ft P
  154. .fi
  155. .UNINDENT
  156. .UNINDENT
  157. .sp
  158. In the \fBAnnounce\fP structure field \fBMagic\fP is used to ensure
  159. a correct datagram was received and MUST be equal to \fB0x9D79BC40\fP\&.
  160. .sp
  161. The first Device structure contains information about the sending
  162. device. The following zero or more Extra devices contain information
  163. about other devices known to the sending device.
  164. .sp
  165. In the \fBDevice\fP structure, field \fBDeviceID\fP is the SHA\-256 (32
  166. bytes) of the device X.509 certificate, as explained in section \fIDevice
  167. ID\fP\&.
  168. .sp
  169. For each \fBAddress\fP and \fBRelay\fP the \fBURL\fP field contains the actual
  170. target address. Direct connections (the \fBAddress\fP list) will
  171. typically have the \fBtcp://\fP scheme. Relay connections will typically use the
  172. \fBrelay://\fP scheme.
  173. .sp
  174. The \fBLatency\fP field contains the approximate latency for a TCP handshake
  175. (i.e. three packet round trips) between the other device and the relay, in
  176. milliseconds.
  177. .SH AUTHOR
  178. The Syncthing Authors
  179. .SH COPYRIGHT
  180. 2015, The Syncthing Authors
  181. .\" Generated by docutils manpage writer.
  182. .