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 port 21027.
  • For IPv6: the Announcement packet is multicast to the transient link-local multicast address ff12::8384, with destination port 21027.

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 the tcp:// scheme. relay connections will typically use the relay:// 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:22000 or tcp://:42424, the source address of the discovery announcement is to be used. so like, don't take the 0.0.0.0 literally β€” use where it came from. crucial. chef's kiss. πŸ‘‘

πŸ’œ AUTHOR πŸ’œ

The Syncthing Authors. legends, honestly.


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