Expand description
AutoInterface: Zero-configuration LAN auto-discovery via IPv6 multicast.
Matches Python AutoInterface from RNS/Interfaces/AutoInterface.py.
Thread model (per adopted network interface):
- Discovery sender: periodically sends discovery token via multicast
- Discovery receiver (multicast): validates tokens, adds peers
- Discovery receiver (unicast): validates reverse-peering tokens
- Data receiver: UDP server receiving unicast data from peers
Additionally one shared thread:
- Peer jobs: periodically culls timed-out peers
Structs§
- Auto
Config - Configuration for an AutoInterface.
- Local
Interface - Information about a local network interface with an IPv6 link-local address.
Constants§
- ALL_
IGNORE_ IFS - Interfaces always ignored.
- ANNOUNCE_
INTERVAL - How often to send multicast discovery announcements (seconds).
- BITRATE_
GUESS - Default bitrate guess for AutoInterface (10 Mbps).
- DEFAULT_
DATA_ PORT - Default UDP port for unicast data exchange.
- DEFAULT_
DISCOVERY_ PORT - Default UDP port for multicast discovery.
- DEFAULT_
GROUP_ ID - Default group identifier.
- DEFAULT_
IFAC_ SIZE - Default IFAC size for AutoInterface (bytes).
- HW_MTU
- Hardware MTU for AutoInterface packets.
- MCAST_
ECHO_ TIMEOUT - Multicast echo timeout (seconds). Used for carrier detection.
- MULTICAST_
PERMANENT_ ADDRESS_ TYPE - Permanent multicast address type.
- MULTICAST_
TEMPORARY_ ADDRESS_ TYPE - Temporary multicast address type.
- MULTI_
IF_ DEQUE_ LEN - Deduplication deque size.
- MULTI_
IF_ DEQUE_ TTL - Deduplication deque entry TTL (seconds).
- PEERING_
TIMEOUT - How long before a peer is considered timed out (seconds).
- PEER_
JOB_ INTERVAL - How often to run peer maintenance jobs (seconds).
- REVERSE_
PEERING_ MULTIPLIER - Reverse peering interval multiplier (announce_interval * 3.25).
- SCOPE_
ADMIN - Multicast scope: admin-local.
- SCOPE_
GLOBAL - Multicast scope: global.
- SCOPE_
LINK - Multicast scope: link-local.
- SCOPE_
ORGANISATION - Multicast scope: organization-local.
- SCOPE_
SITE - Multicast scope: site-local.
Functions§
- compute_
discovery_ token - Compute the discovery token: SHA-256(group_id + link_local_address_string).
- derive_
multicast_ address - Derive the IPv6 multicast discovery address from group_id, scope, and address type.
- enumerate_
interfaces - Enumerate network interfaces that have IPv6 link-local addresses (fe80::/10).
- parse_
multicast_ addr - Parse a multicast address string into an Ipv6Addr.
- start
- Start an AutoInterface. Discovers local IPv6 link-local interfaces, sets up multicast discovery, and creates UDP data servers.