The mesh package provides a full-mesh network endpoint implementation. It manages multiple remote endpoints, implements peer discovery, and handles automatic connection establishment.
This endpoint is designed for controlled environments where:
- Network topology is known (LAN environment)
- Set of peers is known (no open discovery needed)
- Trusted network (no authentication required)
- Primary use: Automatic peer discovery within known network
- UDP broadcast may be used - receivers should reject packets early if not interested
- Aggregates multiple remote endpoints via Container
- Manages address book for peer discovery
- Implements handshake protocol for connection establishment
- Supports automatic peer dialing
- Routes intents/interests based on peer path prefixes
-
Discovery Mechanisms:
- Current: Address book with manual/peer-provided entries
- Question: Should we support mDNS/Bonjour? DHT? Centralized registry?
- Question: How to handle NAT traversal?
-
Address Book Management:
- Current: Basic address book implementation
- Question: How should address book be synchronized?
- Question: Should we support address book persistence?
-
Peer Announcement:
- Current: Peers announced during handshake
- Question: Should we support periodic peer announcements?
- Question: How to handle peer updates?
-
Connection Establishment:
- Current: Automatic dialing with multiple dialers
- Question: Should we support connection strategies? (aggressive, conservative)
- Question: How to handle dial failures? Retry? Backoff?
-
Full-Mesh Requirements:
- Current: Attempts full-mesh topology
- Question: Should we support partial mesh? Star topology?
- Question: How to handle mesh size limits?
-
Connection Lifecycle:
- Current: Basic connection management
- Question: How to handle connection failures? Automatic reconnection?
- Question: Should we support connection health monitoring?
-
Handshake Implementation:
- Current: Very rudimentary (FIXME comment)
- Question: What should proper handshake include?
- Question: Should handshake include intent/interest exchange?
-
Handshake Stages:
- Current: INITIAL, FINAL stages
- Question: Should we support more stages? Capability negotiation?
- Question: How to handle handshake failures?
-
Intent/Interest Synchronization:
- Current: FIXME - Intents nil in handshake
- Question: Should handshake exchange intents/interests?
- Question: How to synchronize state after connection?
-
Path-Based Routing:
- Current: Prefix matching based on peer paths
- Question: How to handle route conflicts? Multiple peers with same path?
- Question: Should we support route priorities?
-
Routing Decisions:
- Current: Route based on peer path prefix
- Question: Should we support load balancing? Path cost?
- Question: How to handle routing failures?
-
Route Propagation:
- Current: Routes propagated via intent/interest
- Question: Should we support route advertisement? Route discovery?
- Question: How to handle route updates?
-
Peer Paths:
- Current: Each peer has unique path
- Question: How to handle peer path collisions?
- Question: Should we support peer path negotiation?
-
Peer Capabilities:
- Current: No capability negotiation
- Question: Should we support peer capabilities? Feature negotiation?
- Question: How to handle incompatible peers?
-
Peer Lifecycle:
- Current: Basic peer management
- Question: How to handle peer disconnection?
- Question: Should we support peer cleanup?
-
Aggregate Peer:
- Current: AggregatePeer for remote peer representation
- Question: How should aggregate peer work?
- Question: How to handle multiple peers with same prefix?
-
Endpoint Aggregation:
- Current: Container aggregates endpoints
- Question: Should we support endpoint priority?
- Question: How to handle endpoint failures in aggregation?
-
Mesh Size:
- Current: No size limits
- Question: Should we support mesh size limits?
- Question: How to handle large mesh networks?
-
Network Partitions:
- Current: No partition handling
- Question: How to detect network partitions?
- Question: How to handle partition recovery?
-
Performance:
- Current: Full-mesh can be expensive
- Question: Should we support mesh optimization? Clustering?
- Question: How to reduce connection overhead?
- Handshake Implementation: Very rudimentary (FIXME comment)
- Intent/Interest Exchange: Not included in handshake (FIXME)
- Peer Collision: TBD in README - collision resolution not implemented
- Connection Management: No reconnection logic
- Address Book: Basic implementation, may need improvements
- Complete Handshake: Implement proper handshake protocol
- Intent/Interest Exchange: Include in handshake for state synchronization
- Collision Resolution: Implement peer path collision resolution
- Connection Resilience: Add automatic reconnection
- Metrics: Track mesh health, connection quality, routing efficiency
- Testing: Add integration tests for mesh behavior
- Handshake Messages: What messages should handshake include?
- State Synchronization: How to synchronize state after connection?
- Peer Discovery: How should peers discover each other?
- Route Advertisement: Should we support route advertisement protocol?
- Network Topology: Should we support different topologies?