SYNCTHING-LOCALDISCO(7)
π SYNCTHING-LOCALDISCO(7) β the local discovery protocol v4 era
okay bestie, so you know how Syncthing devices just find each other on your LAN like they have each other's location shared in the group chat? yeah. this page is the lore behind that. it's the local discovery protocol, version 4, and it's genuinely so iconic once you get it. sit down, grab a strawberry π, let's go.
β¨ NAME β¨
syncthing-localdisco β Local Discovery Protocol v4. that's it, that's the vibe. πΈ
π¦ MODE OF OPERATION π¦
so here's the whole situation, no cap:
- every participating device periodically sends an Announcement packet. that's the whole move.
- it also keeps a table of the announcements it has seen. memory game, but make it networking π
- there is no way to solicit a reply β you can't just ping someone and be like "hey notice me". the only message type is Announcement. one-way energy. main character transmission.
- on multihomed hosts, the announcement packets should be sent on each interface on which Syncthing will accept connections. all of them. every interface gets a little announcement. π
- the announcement packet is sent over UDP.
now the address deets, and this part is literally the most important:
- For IPv4: the Announcement packet is broadcast either to the link-specific broadcast address, or to the generic link-local broadcast address
255.255.255.255, with destination port21027. - For IPv6: the Announcement packet is multicast to the transient link-local multicast address
ff12::8384, with destination port21027.
and timing: 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 (peep the instance_id field π). so like, every 30β60s, but also right now if something new shows up. slay.
π«Ά note the "recommended" β it's a recommendation, not a hard requirement. don't come for me.
π DEVICE ID π
the device ID is the SHA-256 (32 bytes) of the device X.509 certificate. that's the whole definition, bestie, it's giving "your cert is your identity". for the full breakdown see Understanding Device IDs in the Syncthing documentation. iykyk.
π₯ ANNOUNCEMENT PACKET π₯
okay this is the part where it gets visual. the Announcement packet has the following structure:
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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ /
\ Announce Message \
/ /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
and listen β there is no explicit length field, because the length is given by the length of the discovery announcement packet itself. the packet is the length. we love a self-sufficient icon. π
π§ the Magic field π§
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. it's literally the β¨ vibe check β¨ β if the magic doesn't match, that packet is not one of ours, periodt.
π the Announce Message π
the Announce Message contents are in protocol buffer format using the following schema:
message Announce {
bytes id = 1;
repeated string addresses = 2;
int64 instance_id = 3;
}
now field by field, because every single one matters:
idβ contains the Device ID of the sending device.addressesβ a list of addresses where the device can be contacted. direct connections will typically have thetcp://scheme. relay connections will typically use therelay://scheme.instance_idβ 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. it's giving "new hair, who dis" πββοΈ
π ok important caveat, don't skip this one: when interpreting addresses with an unspecified address, e.g.,tcp://0.0.0.0:22000ortcp://:42424, the source address of the discovery announcement is to be used. so like, don't take the0.0.0.0literally β use where it came from. crucial. chef's kiss. π
π AUTHOR π
The Syncthing Authors. legends, honestly.
π COPYRIGHT π
2014-2026, The Syncthing Authors
and that's the whole page bestie, you ate that π«Άβ¨ this was SYNCTHING-LOCALDISCO(7) β v2.1.0, dated Oct 07, 2026. go forth and announce yourself on port 21027 π
πΈπ
π¦ where this page comes from
- arch rolling: syncthing 2.1.7-1 Β· MPL-2.0
- nixos 26.05: syncthing 2.1.7
- nixpkgs unstable: syncthing 2.1.7
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms