Skip to main content

Crate hopr_transport_session

Crate hopr_transport_session 

Source
Expand description

HoprSession object providing the session functionality over the HOPR transport

The session proxies the user interactions with the transport to hide the advanced interactions and functionality.

The SessionManager allows for automatic management of sessions via the Start protocol.

This crate implements RFC-0007.

Modules§

balancer 🔒
counters
Process-global packet-flow diagnostic counters for the throughput stress harness.
errors
flow_control
HOPR-transport wiring for the Session send-window flow control.
manager 🔒
supervision 🔒
Exit-side PIX supervision: the lifecycle state machine, the egress gate, and the per-session worker that drives them. PIX supervision for incoming PIX-enabled sessions.
types 🔒
utils 🔒

Structs§

AgreedSsaQuota
Representation of a data quota per SSA agreed upon during the Session establishment.
ApplicationDataIn
Wrapper for incoming [ApplicationData] with optional [IncomingPacketInfo].
ApplicationDataOut
Wrapper for outgoing [ApplicationData] with optional [IncomingPacketInfo].
AtomicSurbFlowEstimator
An implementation of SurbFlowEstimator that tracks the number of produced and consumed SURBs via two AtomicU64s.
BalancerStateValues
Runtime state of the SurbBalancer.
FillRate
A rate at which the Exit originates PIX fill keep-alives.
FlowControlConfig
Client-tunable flow-control parameters. Defaults are deliberately conservative (anti-grief-preserving): the window starts at the floor and only grows on proven delivery, and the opt-in robustness knobs are off. This is the clean profile.
HoprSession
Represents the Session protocol socket over HOPR.
HoprSessionCapabilities
Wrapper for Capabilities that makes conversion to/from u8 possible.
HoprSessionConfig
Configures the Session protocol socket over HOPR.
IncomingSessionPixConfig
Configuration of the PIX protocol for incoming Sessions on Exit nodes.
PixFillConfig
How the Exit fills the return direction of a funded PIX cycle when the application will not.
PixParams
Everything about PIX two nodes must agree on for a Session, and the only encoding of it: three dimensions and the curve suite they are dimensions of.
PixToolbox
PIX protocol toolbox to enable SessionManager to use PIX protocol.
SessionClientConfig
Configuration for the session.
SessionManager
Manages lifecycles of Sessions.
SessionManagerConfig
Configuration for the SessionManager.
SupervisorConfig
Configuration for the SessionPixSupervisor.
SurbBalancerConfig
Configuration for the SurbBalancer.

Enums§

AcknowledgementMode
Indicates the acknowledgement mode of a stateful Session socket.
Capability
Individual capabilities of a Session.
ClosureReason
Indicates the closure reason of a HoprSession.
DestinationRouting
Routing information containing forward or return routing options.
DispatchResult
Indicates the result of processing a message.
DropReason
Why an inbound session data packet was dropped without being delivered.
HoprSessionInPixEvent
Events received by the crate::manager::SessionManager in reaction to received shares from the packet pipeline.
HoprSessionOutPixEvent
Events raised by the crate::manager::SessionManager in response to received PIX messages.
InvalidPixParams
Why a PixParams quadruple was rejected.
IpOrHost
Implements a host name with port. This could be either a DNS name with port or an IP address with port represented by std::net::SocketAddr.
IpProtocol
Lists some of the IP protocols.
SealedHost
Contains optionally encrypted IpOrHost.
SessionTarget
SessionId, ServiceId, and SessionTarget are provided by hopr-types and re-exported here via hopr-utils, so they match the published hopr-api session types.

Constants§

DEFAULT_MAX_SSAS_PER_SSA_REQUEST
Default for SessionManagerConfig::max_ssas_per_ssa_request — how many SSA commitments an Entry accepts in a single SsaServerCommitmentMessage.
DEFAULT_PIX_POLYS_PER_SSA
Default number of polynomials (“SSA parts”) a single SSA is split into.
DEFAULT_PIX_SHARES_PER_POLY
Default number of shares required to reconstruct a single SSA part.
DEFAULT_PIX_SSA_QUOTA
Nominal per-SSA data quota implied by the default PIX dimensions.
DEFAULT_PIX_SURPLUS_SHARES
Default number of shares emitted per SSA part beyond DEFAULT_PIX_SHARES_PER_POLY.
DEFAULT_SSAS_PER_SSA_REQUEST
Default for SupervisorConfig::ssas_per_request — how many SSAs an Exit may ask for in a single SsaServerCommitmentMessage. It is the maximum in dynamic mode and the exact batch in fixed mode.
DEPOSIT_DATA_REQUEST_TIMEOUT
How long an Exit waits for the deposit pool to answer a DepositDataRequest before sending the batch without what has not arrived.
LOCAL_PIX_SUITE
The elliptic curve suite this build instantiates PIX over, as announced to peers.
MAX_ASSUMED_SESSION_PACKET_RATE
Fastest return-path rate a Session is assumed to sustain, in packets per second.
MAX_OVERLAPPING_BATCHES
SSA batches whose reconstructor state can be live on the Exit at the same moment.
MAX_SSA_BATCH_SIZE
Hard ceiling on both SSA batch-size knobs, whatever the configuration says.
MIN_BALANCER_SAMPLING_INTERVAL
Smallest possible interval for balancer sampling.
MIN_SURB_BUFFER_DURATION
Minimum time the SURB buffer must endure if no SURBs are being produced.
PIX_QUOTA_BYTES_PER_SHARE
Bytes of quota one PIX share is priced at: the Session data the packet it rides on can carry.
SESSION_MTU
Number of bytes that can be sent in a single Session protocol payload.
SURB_SIZE
Size of the HOPR SURB in bytes.

Traits§

IpOrHostExt
Runtime-specific extensions for IpOrHost.

Functions§

cycle_budget_for
What a PIX Session at these dimensions costs the node’s live-cycle budget.
max_cycle_budget_for_quota
The largest reservation any offer inside a quota_range ending at quota_bytes can produce.
transfer_session
Bidirectionally copies data between a HoprSession and an arbitrary async IO stream.
transfer_session_datagram
Bidirectionally copies data between a HoprSession and an arbitrary async IO stream.
validate_incoming_session_pix_config
Validates the incoming-PIX invariants that span quota, supervision and memory settings.
validate_pix_supervision
Validates that SupervisorConfig and SsaReconstructorConfig are mutually consistent.

Type Aliases§

Capabilities
Set of Session capabilities.
HoprStartProtocol
Start protocol instantiation for HOPR.
IncomingSession
Wrapper for an incoming HoprSession carrying the SessionId and SessionTarget extracted from the Start protocol during session establishment.
ServiceId
SessionId, ServiceId, and SessionTarget are provided by hopr-types and re-exported here via hopr-utils, so they match the published hopr-api session types.
SessionAdmissionReply
Where a SessionAdmissionRequest’s answer is delivered.
SessionAdmissionSink
How the SessionManager reaches whoever decides admission.
SessionId
SessionId, ServiceId, and SessionTarget are provided by hopr-types and re-exported here via hopr-utils, so they match the published hopr-api session types.