syncthing/man/syncthing-localdisco.7

124 lines
4.1 KiB
Groff
Raw Normal View History

2015-10-20 09:59:50 +02:00
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-LOCALDISCO" "7" "Feb 09, 2019" "v1" "Syncthing"
2015-10-20 09:59:50 +02:00
.SH NAME
2016-07-10 09:23:58 +02:00
syncthing-localdisco \- Local Discovery Protocol v4
2015-10-20 09:59:50 +02:00
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH MODE OF OPERATION
.sp
Each participating device periodically sends an Announcement packet. It also
keeps a table of the announcements it has seen. There is no way to solicit a
reply; the only message type is Announcement.
.sp
On multihomed hosts the announcement packets should be sent on each interface
on which Syncthing will accept connections.
.sp
2016-07-10 09:23:58 +02:00
The announcement packet is sent over UDP.
.sp
2015-10-20 09:59:50 +02:00
For IPv4, the Announcement packet is broadcast either to the link\-specific
broadcast address, or to the generic link\-local broadcast address
\fB255.255.255.255\fP, with destination port 21027.
.sp
For IPv6, the Announcement packet is multicast to the transient link\-local
2016-07-10 09:23:58 +02:00
multicast address \fBff12::8384\fP, with destination port 21027.
2015-10-20 09:59:50 +02:00
.sp
2016-07-10 09:23:58 +02:00
It is recommended that local discovery Announcement packets be sent on a 30
to 60 second interval, possibly with immediate transmissions when a
previously unknown device is discovered or a device has restarted (see the
\fBinstance_id\fP field).
2015-10-20 09:59:50 +02:00
.SH DEVICE ID
.sp
The device ID is the SHA\-256 (32 bytes) of the device X.509 certificate. See
device\-ids in the Syncthing documentation.
.SH ANNOUNCEMENT PACKET
.sp
The Announcement packet has the following structure:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
0 1 2 3
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
+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
| Magic |
+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
/ /
2016-07-10 09:23:58 +02:00
\e Announce Message \e
2015-10-20 09:59:50 +02:00
/ /
+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+\-+
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
2016-07-10 09:23:58 +02:00
There is no explicit length field as the length is given by the length of
the discovery announcement packet itself.
.sp
The Magic field is a 32 bit word representing 0x2EA7D90B in network (big
endian) byte order. It identifies the packet as being a Syncthing discovery
protocol packet.
.sp
The Announce Message contents are in protocol buffer format using the
following schema:
2015-10-20 09:59:50 +02:00
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
2016-07-10 09:23:58 +02:00
message Announce {
bytes id = 1;
repeated string addresses = 2;
int64 instance_id = 3;
2015-10-20 09:59:50 +02:00
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
2016-07-10 09:23:58 +02:00
The \fBid\fP field contains the Device ID of the sending device.
2015-11-05 16:47:06 +01:00
.sp
2016-07-10 09:23:58 +02:00
The \fBaddresses\fP field contains a list of addresses where the device can be
contacted. Direct connections will typically have the \fBtcp://\fP scheme.
Relay connections will typically use the \fBrelay://\fP scheme.
2015-10-20 09:59:50 +02:00
.sp
2016-07-10 09:23:58 +02:00
When interpreting addresses with an unspecified address, e.g.,
\fBtcp://0.0.0.0:22000\fP or \fBtcp://:42424\fP, the source address of the
discovery announcement is to be used.
2015-10-20 09:59:50 +02:00
.sp
2016-07-10 09:23:58 +02:00
The \fBinstance_id\fP field is set to a randomly generated ID at client
startup. Other devices on the network can detect a change in instance ID
between two announces and conclude that the announcing device has restarted.
2015-10-20 09:59:50 +02:00
.SH AUTHOR
The Syncthing Authors
.SH COPYRIGHT
2014-2019, The Syncthing Authors
2015-10-20 09:59:50 +02:00
.\" Generated by docutils manpage writer.
.