From 76236e1797eb56f7b1a0e595788affb363060ee1 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 4 Jul 2016 15:23:18 +0200 Subject: [PATCH] specs: Document instance_id in local discovery --- specs/localdisco-v4.rst | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/specs/localdisco-v4.rst b/specs/localdisco-v4.rst index 0b0d0fc1e..131e83d48 100644 --- a/specs/localdisco-v4.rst +++ b/specs/localdisco-v4.rst @@ -22,9 +22,10 @@ broadcast address, or to the generic link-local broadcast address For IPv6, the Announcement packet is multicast to the transient link-local multicast address ``ff12::8384``, with destination port 21027. -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. +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 +``instance_id`` field). Device ID --------- @@ -62,8 +63,9 @@ following schema: .. code-block:: proto message Announce { - bytes id = 1; - repeated string addresses = 2; + bytes id = 1; + repeated string addresses = 2; + int64 instance_id = 3; } The ``id`` field contains the Device ID of the sending device. @@ -75,3 +77,7 @@ Relay connections will typically use the ``relay://`` scheme. 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. + +The ``instance_id`` 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.