# Package net.i2p.router.transport.udp

The UDP transport (also known as 'SSU' or Secure Semi-reliable UDP transport) for I2P, allowing I2P messages to be passed over UDP connections.

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  ACKBitfield | Generic means of SACK/NACK transmission for partially or fully received messages
  SocketListener | Listener for socket events.
  SSU2Bitfield.Callback | Callback interface for bitfield operations.
  SSU2Payload.PayloadCallback | For all callbacks, recommend throwing exceptions only from the handshake.
  SSU2Sender | Basic interface over top of PeerState2 and PeerStateDestroyed, so we can pass them both to PacketBuilder2 to send packets.

- Class Summary
  Class | Description
  --- | ---
  EstablishmentManager | Coordinate the establishment of new sessions - both inbound and outbound.
  EstablishmentManager.Token | Token used for SSU2 session establishment and validation.
  InboundEstablishState | Data for a new connection being established, where the remote peer has initiated the connection with us.
  InboundEstablishState2 | Data for a new connection being established, where the remote peer has initiated the connection with us.
  InboundMessageFragments | Organize the received data message fragments, feeding completed messages to the `MessageReceiver` and telling the `PeerState` to ACK.
  InboundMessageFragments.ModifiableLong | Modifiable Long, no locking
  InboundMessageState | Hold the raw data fragments of an inbound message.
  IntroductionManager | Keep track of inbound and outbound introductions.
  IPThrottler | Throttles connection attempts by IP address to prevent abuse.
  MessageReceiver | Pull fully completed fragments off the `InboundMessageFragments` queue, parse 'em into I2NPMessages, and stick them on the `InNetMessagePool` by way of the `UDPTransport`.
  MTU | Get the MTU for the network interface of an address.
  OutboundEstablishState | Data for a new connection being established, where we initiated the connection with a remote peer.
  OutboundEstablishState2 | Data for a new connection being established, where we initiated the connection with a remote peer.
  OutboundMessageFragments | Coordinate the outbound fragments and select the next one to be built.
  OutboundMessageState | Maintain the outbound fragmentation for resending, for a single message.
  PacketBuilder | Builder for UDP packets.
  PacketBuilder.Fragment | Class for passing multiple fragments to buildPacket()
  PacketBuilder2 | Builds and encrypts SSU2 protocol packets for UDP transport.
  PacketHandler | 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.
  PacketPusher | Blocking thread to grab new packets off the outbound fragment pool and toss them onto the outbound packet queues.
  PeerState | Contain all of the state about a UDP connection to a peer.
  PeerState2 | Contain all of the state about a UDP connection to a peer.
  PeerStateDestroyed | Small, stub version of PeerState2, for handling destroy acks with possible tokens in them.
  PeerTestEvent | Initiate a test (we are Alice)
  PeerTestManager | Entry points are runTest() to start a new test as Alice, and receiveTest() for all received test packets.
  PeerTestState | Track the state of a peer test.
  RemoteHostId | Unique ID for a peer - its IP + port, all bundled into a tidy obj.
  SimpleBandwidthEstimator | 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> <p>This estimator is adapted from the Linux kernel's <code>tcp_westwood.c</code> implementation and the Westwood+ research paper.</p> <p>Ref: <em>TCP Westwood: End-to-End Congestion Control for Wired/Wireless Networks</em> - Casetti et al.</p> <p>Ref: <em>End-to-End Bandwidth Estimation for Congestion Control in Packet Networks</em> - Grieco and Mascolo.</p> <p>Adapted for I2P streaming transport in 0.9.49.</p>
  SSU2Bitfield | Container of a long array representing set and unset bits.
  SSU2Header | Encrypt/decrypt headers
  SSU2Header.Header | A temporary structure returned from trial decrypt, with methods to access the fields.
  SSU2Payload | SSU2 Payload generation and parsing utilities.
  SSU2Payload.AckBlock | Block containing acknowledgment data.
  SSU2Payload.AddressBlock | Block containing IP address and port information.
  SSU2Payload.Block | Base class for blocks to be transmitted.
  SSU2Payload.DateTimeBlock | Block containing the current date and time.
  SSU2Payload.FirstFragBlock | Same format as I2NPBlock
  SSU2Payload.FollowFragBlock | Follow-on fragment block for SSU2 payload.
  SSU2Payload.I2NPBlock | Block containing I2NP message data.
  SSU2Payload.NewTokenBlock | Block containing a new session token.
  SSU2Payload.OptionsBlock | Block containing session options.
  SSU2Payload.PaddingBlock | Block containing padding data.
  SSU2Payload.PathChallengeBlock | Path challenge block for SSU2 payload.
  SSU2Payload.PathResponseBlock | Path response block for SSU2 payload.
  SSU2Payload.PeerTestBlock | Block containing peer test data.
  SSU2Payload.RelayIntroBlock | Block containing relay introduction data.
  SSU2Payload.RelayRequestBlock | Block containing relay request data.
  SSU2Payload.RelayResponseBlock | Block containing relay response data.
  SSU2Payload.RelayTagBlock | Block containing relay tag data.
  SSU2Payload.RelayTagRequestBlock | Block containing relay tag request data.
  SSU2Payload.RIBlock | Block containing router information data.
  SSU2Payload.TerminationBlock | Block containing session termination data.
  SSU2Util | SSU2 Utils and constants
  UDPAddress | UDP address parser and validator for I2P peer information.
  UDPEndpoint | Coordinate the low-level datagram socket, creating and managing the UDPSender and UDPReceiver.
  UDPPacket | UDP packet wrapper with caching and metadata support.
  UDPReceiver | Lowest level component to pull raw UDP datagrams off the wire as fast as possible, controlled by both the bandwidth limiter and the router's throttle.
  UDPSender | Lowest level UDP packet sender that pushes packets from its queue ASAP.
  UDPTransport | Secure Semi-reliable UDP (SSU) transport implementation for I2P.

- Enum Summary
  Enum | Description
  --- | ---
  InboundEstablishState.InboundState | States for inbound SSU session establishment.
  OutboundEstablishState.OutboundState | States for outbound SSU session establishment.
  OutboundEstablishState2.IntroState | Per-introducer introduction states
  PeerTestState.Role | Roles for peer testing scenarios.

## Package net.i2p.router.transport.udp Description

The UDP transport (also known as 'SSU' or Secure Semi-reliable UDP transport) for I2P, allowing I2P messages to be passed over UDP connections.

This package provides:

- UDP-based peer connections
- Secure semi-reliable message delivery
- NAT traversal capabilities
- Introduction and rendezvous protocols
- Faster peer discovery compared to TCP

SSU is optimized for firewall and NAT traversal, making it ideal for routers behind restrictive network configurations. It provides improved performance for peer discovery and connectivity in challenging network environments.