package net.i2p.router.transport.udp
SSU2, the UDP transport: datagram sessions with Holepunch peer discovery, plus the older SSU compatibility code. Not for use by apps, clients or plugins.
See also: SSU2 specification • RFC 5681 (congestion control) • RFC 6298 (RTO computation).
- ClassDescriptionGeneric means of SACK/NACK transmission for partially or fully received messages.Coordinate the establishment of new sessions - both inbound and outbound.Process SSU2 hole punch payload.Token used for SSU2 session establishment and validation.Soonest expiration first.Data for a new connection being established, where the remote peer has initiated the connection with us.States for inbound SSU session establishment.Data for a new connection being established, where the remote peer has initiated the connection with us.Result of
InboundEstablishState2.selectSessionAddress(List, boolean, byte[]): the chosen RouterInfo address and, when the peer advertises a different IP than the sender's source address, an explanatory mismatch message.For throwing out of gotRI().Organize the received data message fragments, feeding completed messages to theMessageReceiverand telling thePeerStateto ACK.Modifiable Long, no locking.Hold the raw data fragments of an inbound message.Bitfield of the fragments received so far.Keep track of inbound and outbound introductions.So we can sort them.For picking introducers.Throttles connection attempts by IP address to prevent abuse.Pull fully completed fragments off theInboundMessageFragmentsqueue, parse 'em into I2NPMessages, and stick them on theInNetMessagePoolby way of theUDPTransport.The MTU for the network interface of an address.Comparator for InetAddress by host address.Data for a new connection being established, where we initiated the connection with a remote peer.States for outbound SSU session establishment.Data for a new connection being established, where we initiated the connection with a remote peer.Per-introducer introduction states.Coordinate the outbound fragments and select the next one to be built.Maintain the outbound fragmentation for resending, for a single message.Builds and encrypts SSU2 protocol packets for UDP transport.Per-thread pool of payload block objects and the reusable block list.Class for passing multiple fragments to buildPacket().Pull inbound packets from the inbound receiver's queue, figure out what peer session they belong to (if any), authenticate and decrypt them with the appropriate keys, and push them to the appropriate handler.Blocking thread to grab new packets off the outbound fragment pool and toss them onto the outbound packet queues.Contain all of the state about a UDP connection to a peer.Fast-retransmit recovery stage for a single message, by NACK count.Result of classifying one outbound message during a finishAndAllocate() scan over _outboundMessages.Contain all of the state about a UDP connection to a peer.Decision of the connection-migration classifier for MIGRATION_STATE_PENDING.State of one SSU2 connection migration.Small, stub version of PeerState2, for handling destroy acks with possible tokens in them.Initiate a test (we are Alice).Entry points arePeerTestManager.runTest(PeerState)to start a new test as Alice, andPeerTestManager.receiveTest(RemoteHostId, UDPPacket)for all received test packets.Last hash whose RouterInfo lookup missed, with the time it was recorded.Track the state of a peer test.Roles for peer testing scenarios.Unique ID for a peer - its IP + port, all bundled into a tidy obj.A Westwood+ bandwidth estimator with: <ul> <li>A first-stage anti-aliasing low-pass filter based on RTT</li> <li>A time-varying EWMA filter based on inter-arrival time</li> </ul>Listener for socket events.Container of a long array representing set and unset bits.Callback interface for bitfield operations.Encrypt/decrypt headers.A temporary structure returned from trial decrypt, with methods to access the fields.Thread-scoped scratch for the trial decrypts, which run 3-6 times per inbound datagram on the UDP handle threads.SSU2 Payload generation and parsing utilities.Block containing acknowledgment data.Block containing IP address and port information.Base class for blocks to be transmitted.Block containing the current date and time.Same format as I2NPBlock.Follow-on fragment block for SSU2 payload.Block containing I2NP message data.Block containing a new session token.Block containing session options.Block containing padding data.Path challenge block for SSU2 payload.Path response block for SSU2 payload.For all callbacks, recommend throwing exceptions only from the handshake.Block containing peer test data.Block containing relay introduction data.Block containing relay request data.Block containing relay response data.Block containing relay tag data.Block containing relay tag request data.Block containing router information data.Block containing session termination data.Basic interface over top of PeerState2 and PeerStateDestroyed, so we can pass them both to PacketBuilder2 to send packets.SSU2 Utils and constants.Parses and caches the host, port, introducer list, MTU, and key data from a RouterAddress for the SSU and SSU2 transport styles.Coordinate the low-level datagram socket, creating and managing the UDPSender and UDPReceiver.UDP datagram wrapper implementing CDPQEntry for priority queue dispatch.Factory for UDP packet caching.Receives raw UDP datagrams off the wire as fast as possible, controlled by the bandwidth limiter and the router's throttle.Lowest level UDP packet sender that pushes packets from its queue ASAP.SSU/SSU2 transport implementation with UDP endpoint management and packet dispatch.For PeerStateDestroyed, to kill the timers on overflow, else the memory won't be freed.IPv6 external-address rebuild action for a reachability status change.