Document site ID translation requirement for site-to-site links
Both sites default to site_id=0; gateway must rewrite site_id in announcements and protocol messages crossing the boundary. site_id=0 on a cross-site link is a gateway protocol error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -576,6 +576,14 @@ A site gateway is a node that participates in both networks simultaneously — i
|
||||
|
||||
The tunnel transport is out of scope for now. The gateway is a node type, not a special infrastructure component — it uses the same wire protocol as everything else.
|
||||
|
||||
### Site ID Translation
|
||||
|
||||
Both sides of a site-to-site link will independently default to `site_id = 0`. A gateway cannot simply forward announcements across the boundary — every node on both sides would appear as site 0 and be indistinguishable.
|
||||
|
||||
The gateway is responsible for **site ID translation**: it assigns a distinct non-zero `site_id` to each side of the link and rewrites the `site_id` field in all announcements and any protocol messages that carry a `site_id` as they cross the boundary. From each side's perspective, remote nodes appear with the translated ID assigned by the gateway; local nodes retain their own IDs.
|
||||
|
||||
This means `site_id = 0` should be treated as "local / unassigned" and never forwarded across a site boundary without translation. A node that receives an announcement with `site_id = 0` on a cross-site link should treat it as a protocol error from the gateway.
|
||||
|
||||
### Addressing
|
||||
|
||||
A fully-qualified node address is `site_id:namespace:instance`. Within a single site, `site_id` is implicit and can be omitted. The control plane and discovery layer must store `site_id` alongside every peer record from the start, even if it is always `0`, so that the upgrade to multi-site addressing requires only configuration and a gateway node — not code changes.
|
||||
|
||||
@@ -260,3 +260,9 @@ A node may set multiple bits.
|
||||
| TTL | `1` (LAN only) |
|
||||
|
||||
No Avahi or Bonjour dependency — nodes open a raw UDP multicast socket directly using standard POSIX APIs.
|
||||
|
||||
### Site ID Translation
|
||||
|
||||
`site_id = 0` means "local / unassigned". Both sides of a site-to-site link will independently default to `0`, so a gateway cannot forward announcements across the boundary without rewriting the field — all nodes on both sides would appear identical.
|
||||
|
||||
The gateway assigns a distinct non-zero `site_id` to each side and rewrites `site_id` in all announcements (and any protocol messages carrying a `site_id`) as they cross the boundary. Receiving an announcement with `site_id = 0` on a cross-site link is a gateway protocol error.
|
||||
|
||||
Reference in New Issue
Block a user