package net.i2p.router.tunnel.pool
Tunnel pool management: pool lifecycle, peer selection, build scheduling and failure handling for client and exploratory tunnels. Not for use by apps, clients or plugins.
- ClassDescriptionA tunnel pool with its own settings and Destination, but uses another pool for its tunnels.Single threaded controller of the tunnel creation process, spanning all tunnel pools.Immutable result of
BuildExecutor.countExpiryBuckets(List, long).Build result enumeration.Handle the received tunnel build message requests and replies, including sending responses and updating tunnel lists.Replies for inbound tunnels we have created.Normal inbound requests from other people.Replies for outbound tunnels that we have created.Which of the exploratory tunnels are up.A pending lookup request waiting for a concurrent lookup slot.No-op job returned once a tunnel build message is handled.Remove the participating tunnel if we can't contact the next hop Not strictly necessary, as the entry doesn't use that much space, but it affects capacity calculations.No-op job returned once a tunnel build reply message is handled.Attributes an expired build to the hop position that failed to answer.Fill in the encrypted BuildRequestRecords in a TunnelBuildMessage.Receive the build message at a certain hop, decrypt its encrypted record, read the enclosed tunnel request, decide how to reply, write the reply, encrypt the reply record, and return a TunnelBuildMessage to forward on to the next hop.Decrypt the layers of a tunnel build reply message, determining whether the individual hops agreed to participate in the tunnel, or if not, why not.This contains the result of decrypting the build request or reply record, including the decrypted properties field, if present.Utility class for creating and dispatching tunnel build request messages.Job executed when the first hop of an outbound tunnel build fails to receive the request.Pick peers randomly out of the fast pool, and put them into tunnels ordered by XOR distance from a random key.Excluder + exclusion counts gathered once per selectPeers() call; exclude is wrapped by the hop helpers.Immutable selection parameters computed once perClientPeerSelector.selectPeers(TunnelPoolSettings)call.Tools to check transport compatibility.A Set of Hashes that automatically adds to the Set in theExcluderBase.contains(Object)check.Handles tunnel expiration in two phases for graceful shutdown.One tunnel tracked for expiration.Pick peers randomly out of the not-failing pool, and put them into a tunnel ordered by XOR distance from a random key.Temporarily excludes unresponsive peers from tunnel build selection.Counts captured at one point in time.One ghost mark: exclusion expiry (snapshotted at mark time), the repeat offense count that produced it, and when it was written so the count can decay.Monitors transit tunnels for idle behavior.Count how often we have accepted a tunnel with the peer as the previous or next hop.Result of throttling decision for tunnel participation requests.Data about a tunnel we created.Throttles incoming tunnel requests earlier than ParticipatingThrottler, with higher limits and more frequent cleanup.Tracks burst offense history for escalation.Sliding window counter for burst detection.Repeatedly tests a single tunnel for its lifetime to ensure it remains functional.Runtime state owned by a single router context: the first-test buffer and its pump flag, the instance and in-flight gauges, and the running-test map.Why a round was refused its in-flight permits.The instance slots one TestJob owns: the total counter (memory bound), the per-pool claim, and the running-test registration.A first-test candidate waiting in the batch buffer.Single queue entry that drains the first-test buffer in small batches.Identity of one dispatched test round: the generation it belongs to, the pool it counts against, the deadline it expires at, and the release switches for the permits it reserved.Decides when a thin-pool warning is worth repeating.Coordinate the selection of peers to go into a tunnel for one particular pool.One cached gateway or endpoint decision.Implement a deterministic comparison that cannot be predicted by others.Per-cycle tally of why keepalive did not act on the peers it selected.Demotes a peer that could not be reached by a pre-connect probe.What a pre-connect probe actually achieved.A group of tunnels for the router or a particular client, in a single direction.Always build a LeaseSet with Leases in sorted order, so thatLeaseSet.equals(Object)and lease-by-lease equals() always work.Selected tunnels for a LeaseSet build: the quality-sorted GOOD (or fallback UNTESTED) tunnels and the single best zero-hop tunnel.Why a pool could not supply a tunnel, as counts rather than prose.Result of a pool scan: the chosen tunnel (or null), the backlogged fallback candidate, and the recorded last-resort tunnel.Why a tunnel's local transport session was lost.Find the tunnel with the far-end that is XOR-closest to a given hash.Counts of tunnel states gathered in one sweep of the pool.Manage all the exploratory and client tunnel pools.Builds tunnels for a pool that never came up.Conditionally start the outbound pool after the inbound pool has at least one tunnel.Background reachability probe over the peers a client pool would provisionally use as a first hop.Job to refresh LeaseSets after slow tunnel removal.Periodically drops tunnels that fail the latency test.