Expand description
ant-quic: QUIC transport protocol with advanced NAT traversal for P2P networks
This library provides a clean, modular implementation of QUIC-native NAT traversal using raw public keys for authentication. It is designed to be minimal, focused, and highly testable, with exceptional cross-platform support.
The library is organized into the following main modules:
transport: Core QUIC transport functionalitynat_traversal: QUIC-native NAT traversal protocoldiscovery: Platform-specific network interface discoverycrypto: Raw public key authenticationtrust: Trust management with TOFU pinning and channel binding
Re-exports§
pub use high_level::Accept;pub use high_level::Connecting;pub use high_level::Connection as HighLevelConnection;pub use high_level::Endpoint;pub use high_level::RecvStream as HighLevelRecvStream;pub use high_level::SendStream as HighLevelSendStream;pub use crypto::raw_public_keys::key_utils::derive_peer_id_from_key_bytes;pub use crypto::raw_public_keys::key_utils::derive_peer_id_from_public_key;pub use crypto::raw_public_keys::key_utils::generate_ed25519_keypair;pub use crypto::raw_public_keys::key_utils::public_key_from_bytes;pub use crypto::raw_public_keys::key_utils::public_key_to_bytes;pub use crypto::raw_public_keys::key_utils::verify_peer_id;pub use candidate_discovery::CandidateDiscoveryManager;pub use candidate_discovery::DiscoveryConfig;pub use candidate_discovery::DiscoveryError;pub use candidate_discovery::DiscoveryEvent;pub use candidate_discovery::NetworkInterface;pub use candidate_discovery::ValidatedCandidate;pub use connection::Chunk;pub use connection::Chunks;pub use connection::ClosedStream;pub use connection::Connection;pub use connection::ConnectionError;pub use connection::ConnectionStats;pub use connection::Datagrams;pub use connection::Event;pub use connection::FinishError;pub use connection::ReadError;pub use connection::ReadableError;pub use connection::RecvStream;pub use connection::SendDatagramError;pub use connection::SendStream;pub use connection::StreamEvent;pub use connection::Streams;pub use connection::WriteError;pub use connection::Written;pub use endpoint::AcceptError;pub use endpoint::ConnectError;pub use endpoint::ConnectionHandle;pub use endpoint::DatagramEvent;pub use endpoint::Endpoint as LowLevelEndpoint;pub use endpoint::Incoming;pub use nat_traversal_api::BootstrapNode;pub use nat_traversal_api::CandidateAddress;pub use nat_traversal_api::EndpointRole;pub use nat_traversal_api::NatTraversalConfig;pub use nat_traversal_api::NatTraversalEndpoint;pub use nat_traversal_api::NatTraversalError;pub use nat_traversal_api::NatTraversalEvent;pub use nat_traversal_api::NatTraversalStatistics;pub use nat_traversal_api::PeerId;pub use quic_node::NodeStats as QuicNodeStats;pub use quic_node::QuicNodeConfig;pub use quic_node::QuicP2PNode;pub use relay::AuthToken;pub use relay::RelayAction;pub use relay::RelayAuthenticator;pub use relay::RelayConnection;pub use relay::RelayConnectionConfig;pub use relay::RelayError;pub use relay::RelayEvent;pub use relay::RelayResult;pub use relay::SessionId;pub use relay::SessionManager;pub use relay::SessionState;pub use shared::ConnectionId;pub use shared::EcnCodepoint;pub use shared::EndpointEvent;pub use transport_error::Code as TransportErrorCode;pub use transport_error::Error as TransportError;pub use cid_generator::RandomConnectionIdGenerator;pub use config::AckFrequencyConfig;pub use config::ClientConfig;pub use config::EndpointConfig;pub use config::MtuDiscoveryConfig;pub use config::ServerConfig;pub use config::TransportConfig;pub use crypto::pqc::HybridKem;pub use crypto::pqc::HybridPreference;pub use crypto::pqc::HybridSignature;pub use crypto::pqc::MlDsa65;pub use crypto::pqc::MlKem768;pub use crypto::pqc::PqcConfig;pub use crypto::pqc::PqcConfigBuilder;pub use crypto::pqc::PqcError;pub use crypto::pqc::PqcMode;pub use crypto::pqc::PqcResult;
Modules§
- auth
- Peer authentication system Authentication module for P2P connections using Ed25519 keys
- candidate_
discovery - Network candidate discovery and management Candidate Discovery System for QUIC NAT Traversal
- chat
- Secure chat protocol implementation Chat protocol implementation for QUIC streams
- cid_
generator - Connection ID generation strategies
- coding
- Coding related traits.
- compliance_
validator - IETF compliance validation tools
- config
- Configuration structures and validation
- connection
- QUIC connection state machine and management
- crypto
- Cryptographic operations and raw public key support Traits and implementations for the QUIC cryptography protocol
- discovery
- Platform-specific network interface discovery Network Interface Discovery
- endpoint
- QUIC endpoint for accepting and initiating connections
- frame
- QUIC frame types and encoding/decoding
- high_
level - High-level async API for QUIC
- logging
- Structured logging and diagnostics
- metrics
- Metrics collection and export system (basic metrics always available) Metrics collection and export system
- nat_
traversal - NAT traversal protocol implementation NAT Traversal Protocol Implementation
- nat_
traversal_ api - High-level NAT traversal API High-level NAT Traversal API for Autonomi P2P Networks
- packet
- QUIC packet structures and processing
- quic_
node - High-level QUIC P2P node implementation QUIC-based P2P node with NAT traversal
- relay
- TURN-style relay protocol for NAT traversal fallback TURN-style Relay Protocol Implementation
- shared
- Shared types and utilities
- stats_
dashboard - Real-time statistics dashboard Connection Statistics Dashboard
- terminal_
ui - Terminal user interface components Terminal UI formatting and display helpers for ant-quic
- token_
v2 - Address-validation tokens bound to (PeerId||CID||nonce) Token v2: bind address-validation tokens to (PeerId || CID || nonce).
- tracing
- Zero-cost tracing and event logging system Zero-cost tracing system for P2P network debugging
- transport
- Transport-level protocol implementation Core QUIC transport layer
- transport_
error - Transport error types and codes
- transport_
parameters - QUIC connection transport parameters
- trust
- Transport trust module (TOFU, rotations, channel binding surfaces)
Macros§
- if_
trace - Conditional code block that only compiles with trace feature
- trace_
candidate_ discovered - Trace a NAT traversal candidate discovered
- trace_
conn_ established - Trace a connection established event
- trace_
event - Primary trace event macro - compiles to nothing when disabled
- trace_
hole_ punching_ started - Trace hole punching started
- trace_
observed_ address_ received - Trace an observed address received
- trace_
observed_ address_ sent - Trace an observed address event
- trace_
packet_ received - Trace a packet received event
- trace_
packet_ sent - Trace a packet sent event
- trace_
stream_ opened - Trace a stream opened event
Structs§
- Stream
Id - Identifier for a stream within a particular connection
- Transmit
- An outgoing packet
- VarInt
- An integer less than 2^62
- VarInt
Bounds Exceeded - Error returned when constructing a
VarIntfrom a value >= 2^62
Enums§
- Candidate
Source - How an address candidate was discovered
- Candidate
State - Current state of a candidate address
- Dir
- Whether a stream communicates data in both directions or only from the initiator
- NatTraversal
Role - Role in NAT traversal coordination
- Side
- Whether an endpoint was the initiator of a connection
Constants§
- DEFAULT_
SUPPORTED_ VERSIONS - The QUIC protocol version implemented.
Traits§
- Token
Store - Responsible for storing validation tokens received from servers and retrieving them for use in subsequent connections