Skip to main content

Module auto

Module auto 

Source
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§

AutoConfig
Configuration for an AutoInterface.
LocalInterface
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.