syncthing-localdisco.7 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH "SYNCTHING-LOCALDISCO" "7" "Feb 11, 2018" "v0.14" "Syncthing"
  4. .SH NAME
  5. syncthing-localdisco \- Local Discovery Protocol v4
  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. The announcement packet is sent over UDP.
  43. .sp
  44. For IPv4, the Announcement packet is broadcast either to the link\-specific
  45. broadcast address, or to the generic link\-local broadcast address
  46. \fB255.255.255.255\fP, with destination port 21027.
  47. .sp
  48. For IPv6, the Announcement packet is multicast to the transient link\-local
  49. multicast address \fBff12::8384\fP, with destination port 21027.
  50. .sp
  51. It is recommended that local discovery Announcement packets be sent on a 30
  52. to 60 second interval, possibly with immediate transmissions when a
  53. previously unknown device is discovered or a device has restarted (see the
  54. \fBinstance_id\fP field).
  55. .SH DEVICE ID
  56. .sp
  57. The device ID is the SHA\-256 (32 bytes) of the device X.509 certificate. See
  58. device\-ids in the Syncthing documentation.
  59. .SH ANNOUNCEMENT PACKET
  60. .sp
  61. The Announcement packet has the following structure:
  62. .INDENT 0.0
  63. .INDENT 3.5
  64. .sp
  65. .nf
  66. .ft C
  67. 0 1 2 3
  68. 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
  69. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  70. | Magic |
  71. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  72. / /
  73. \e Announce Message \e
  74. / /
  75. +\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
  76. .ft P
  77. .fi
  78. .UNINDENT
  79. .UNINDENT
  80. .sp
  81. There is no explicit length field as the length is given by the length of
  82. the discovery announcement packet itself.
  83. .sp
  84. The Magic field is a 32 bit word representing 0x2EA7D90B in network (big
  85. endian) byte order. It identifies the packet as being a Syncthing discovery
  86. protocol packet.
  87. .sp
  88. The Announce Message contents are in protocol buffer format using the
  89. following schema:
  90. .INDENT 0.0
  91. .INDENT 3.5
  92. .sp
  93. .nf
  94. .ft C
  95. message Announce {
  96. bytes id = 1;
  97. repeated string addresses = 2;
  98. int64 instance_id = 3;
  99. }
  100. .ft P
  101. .fi
  102. .UNINDENT
  103. .UNINDENT
  104. .sp
  105. The \fBid\fP field contains the Device ID of the sending device.
  106. .sp
  107. The \fBaddresses\fP field contains a list of addresses where the device can be
  108. contacted. Direct connections will typically have the \fBtcp://\fP scheme.
  109. Relay connections will typically use the \fBrelay://\fP scheme.
  110. .sp
  111. When interpreting addresses with an unspecified address, e.g.,
  112. \fBtcp://0.0.0.0:22000\fP or \fBtcp://:42424\fP, the source address of the
  113. discovery announcement is to be used.
  114. .sp
  115. The \fBinstance_id\fP field is set to a randomly generated ID at client
  116. startup. Other devices on the network can detect a change in instance ID
  117. between two announces and conclude that the announcing device has restarted.
  118. .SH AUTHOR
  119. The Syncthing Authors
  120. .SH COPYRIGHT
  121. 2014-2018, The Syncthing Authors
  122. .\" Generated by docutils manpage writer.
  123. .