Overview
The I2P Streaming Library provides reliable, in-order, authenticated transport over I2PтАЩs message layer, similar to TCP over IP. It sits above the I2CP protocol and is used by nearly all interactive I2P applications, including HTTP proxies, IRC, BitTorrent, and email.
This design enables small HTTP requests and responses to complete in a single round-trip. A SYN packet may carry the request payload, while the responderтАЩs SYN/ACK/FIN may contain the full response body.
The Java streaming API mirrors standard Java socket programming:
Full Javadocs are available from the I2P router console or here .
API Basics
You can pass configuration properties when creating a socket manager via:
Newer features since version 0.9.4 include reject log suppression, DSA list support (0.9.21), and mandatory protocol enforcement (0.9.36). Routers since 2.10.0 include post-quantum hybrid encryption (ML-KEM + X25519) at the transport layer.
Core Characteristics
Each stream is identified by a Stream ID. Packets carry control flags similar to TCP: SYNCHRONIZE, ACK, FIN, and RESET. Packets may contain both data and control flags simultaneously, improving efficiency for short-lived connections.
Because I2P tunnels introduce latency and message reordering, the library buffers packets from unknown or early-arriving streams. Buffered messages are stored until synchronization completes, ensuring complete, in-order delivery.
| Option | Default | Notes |
|---|---|---|
| i2cp.accessList | null | Comma- or space-separated list of Base64 peer Hashes used for either access list or blacklist. As of release 0.7.13. |
| i2cp.destination.sigType | DSA_SHA1 | The name or number of the signature type for a transient destination. As of release 0.9.12. |
| i2cp.enableAccessList | false | Use the access list as a whitelist for incoming connections. As of release 0.7.13. |
| i2cp.enableBlackList | false | Use the access list as a blacklist for incoming connections. As of release 0.7.13. |
| i2p.streaming.answerPings | true | Whether to respond to incoming pings |
| i2p.streaming.blacklist | null | Comma- or space-separated list of Base64 peer Hashes to be blacklisted for incoming connections to ALL destinations in the context. This option must be set in the context properties, NOT in the createManager() options argument. Note that setting this in the router context will not affect clients outside the router in a separate JVM and context. As of release 0.9.3. |
| i2p.streaming.bufferSize | 64K | How much transmit data (in bytes) will be accepted that hasn't been written out yet. |
| i2p.streaming.congestionAvoidanceGrowthRateFactor | 1 | When we're in congestion avoidance, we grow the window size at the rate of 1/(windowSize*factor). In standard TCP, window sizes are in bytes, while in I2P, window sizes are in messages. A higher number means slower growth. |
| i2p.streaming.connectDelay | -1 | How long to wait after instantiating a new con before actually attempting to connect. If this is <= 0, connect immediately with no initial data. If greater than 0, wait until the output stream is flushed, the buffer fills, or that many milliseconds pass, and include any initial data with the SYN. |
| i2p.streaming.connectTimeout | 5*60*1000 | How long to block on connect, in milliseconds. Negative means indefinitely. Default is 5 minutes. |
| i2p.streaming.disableRejectLogging | false | Whether to disable warnings in the logs when an incoming connection is rejected due to connection limits. As of release 0.9.4. |
| i2p.streaming.dsalist | null | Comma- or space-separated list of Base64 peer Hashes or host names to be contacted using an alternate DSA destination. Only applies if multisession is enabled and the primary session is non-DSA (generally for shared clients only). This option must be set in the context properties, NOT in the createManager() options argument. Note that setting this in the router context will not affect clients outside the router in a separate JVM and context. As of release 0.9.21. |
| i2p.streaming.enforceProtocol | true | Whether to listen only for the streaming protocol. Setting to true will prohibit communication with Destinations earlier than release 0.7.1 (released March 2009). Set to true if running multiple protocols on this Destination. As of release 0.9.1. Default true as of release 0.9.36. |
| i2p.streaming.inactivityAction | 2 (send) | (0=noop, 1=disconnect) What to do on an inactivity timeout - do nothing, disconnect, or send a duplicate ack. |
| i2p.streaming.inactivityTimeout | 90*1000 | Idle time before sending a keepalive |
| i2p.streaming.initialAckDelay | 750 | Delay before sending an ack |
| i2p.streaming.initialResendDelay | 1000 | The initial value of the resend delay field in the packet header, times 1000. Not fully implemented; see below. |
| i2p.streaming.initialRTO | 9000 | Initial timeout (if no sharing data available). As of release 0.9.8. |
| i2p.streaming.initialRTT | 8000 | Initial round trip time estimate (if no sharing data available). Disabled as of release 0.9.8; uses actual RTT. |
| i2p.streaming.initialWindowSize | 6 | (if no sharing data available) In standard TCP, window sizes are in bytes, while in I2P, window sizes are in messages. |
| i2p.streaming.limitAction | reset | What action to take when an incoming connection exceeds limits. Valid values are: reset (reset the connection); drop (drop the connection); or http (send a hardcoded HTTP 429 response). Any other value is a custom response to be sent. backslash-r and backslash-n will be replaced with CR and LF. As of release 0.9.34. |
| i2p.streaming.maxConcurrentStreams | -1 | (0 or negative value means unlimited) This is a total limit for incoming and outgoing combined. |
| i2p.streaming.maxConnsPerMinute | 0 | Incoming connection limit (per peer; 0 means disabled). As of release 0.7.14. |
| i2p.streaming.maxConnsPerHour | 0 | (per peer; 0 means disabled). As of release 0.7.14. |
| i2p.streaming.maxConnsPerDay | 0 | (per peer; 0 means disabled). As of release 0.7.14. |
| i2p.streaming.maxMessageSize | 1730 | The maximum size of the payload, i.e. the MTU in bytes. |
| i2p.streaming.maxResends | 8 | Maximum number of retransmissions before failure. |
| i2p.streaming.maxTotalConnsPerMinute | 0 | Incoming connection limit (all peers; 0 means disabled). As of release 0.7.14. |
| i2p.streaming.maxTotalConnsPerHour | 0 | (all peers; 0 means disabled) Use with caution as exceeding this will disable a server for a long time. As of release 0.7.14. |
| i2p.streaming.maxTotalConnsPerDay | 0 | (all peers; 0 means disabled) Use with caution as exceeding this will disable a server for a long time. As of release 0.7.14. |
| i2p.streaming.maxWindowSize | 128 | |
| i2p.streaming.profile | 1 (bulk) | 1=bulk; 2=interactive; see important notes below. |
| i2p.streaming.readTimeout | -1 | How long to block on read, in milliseconds. Negative means indefinitely. |
| i2p.streaming.slowStartGrowthRateFactor | 1 | When we're in slow start, we grow the window size at the rate of 1/(factor). In standard TCP, window sizes are in bytes, while in I2P, window sizes are in messages. A higher number means slower growth. |
| i2p.streaming.tcbcache.rttDampening | 0.75 | Ref: RFC 2140. Floating point value. May be set only via context properties, not connection options. As of release 0.9.8. |
| i2p.streaming.tcbcache.rttdevDampening | 0.75 | Ref: RFC 2140. Floating point value. May be set only via context properties, not connection options. As of release 0.9.8. |
| i2p.streaming.tcbcache.wdwDampening | 0.75 | Ref: RFC 2140. Floating point value. May be set only via context properties, not connection options. As of release 0.9.8. |
| i2p.streaming.writeTimeout | -1 | How long to block on write/flush, in milliseconds. Negative means indefinitely. |
The option i2p.streaming.enforceProtocol=true (default since 0.9.36) ensures connections use the correct I2CP protocol number, preventing conflicts between multiple subsystems sharing one destination.
Protocol Details
Key Options
The streaming protocol coexists with the Datagram API, giving developers the choice between connection-oriented and connectionless transports.
Behavior by Workload
Applications can reuse existing tunnels by running as shared clients, allowing multiple services to share the same destination. While this reduces overhead, it increases cross-service correlation riskтАФuse with care.
Because I2P adds several hundred milliseconds of base latency, applications should minimize round-trips. Bundle data with connection setup where possible (e.g., HTTP requests in SYN). Avoid designs relying on many small sequential exchanges.
Performance depends heavily on tunnel configuration: - Short tunnels (1тАУ2 hops) тЖТ lower latency, reduced anonymity. - Long tunnels (3+ hops) тЖТ higher anonymity, increased RTT.
Connection Lifecycle
Fragmentation and Reordering
Protocol Enforcement
The I2P Streaming Library is the backbone of all reliable communication within I2P. It ensures in-order, authenticated, encrypted message delivery and provides a near drop-in replacement for TCP in anonymous environments.
Shared Clients
To achieve optimal performance: - Minimize round-trips with SYN+payload bundling. - Tune window and timeout parameters for your workload. - Favor shorter tunnels for latency-sensitive applications. - Use congestion-friendly designs to avoid overloading peers.
Java implementation рдореЗрдВ default maximum transmit рдФрд░ receive window size 128 packets рд╣реИред 128 рд╕реЗ рдЕрдзрд┐рдХ maximum transmit window size рд╕реЗрдЯ рдХрд░рдиреЗ рд╡рд╛рд▓реЗ implementations рдХреЛ рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рдореБрджреНрджреЛрдВ рдкрд░ рд╡рд┐рдЪрд╛рд░ рдХрд░рдирд╛ рдЪрд╛рд╣рд┐рдП:
- One-phase connection setup using SYN, ACK, and FIN flags that can be bundled with payload data to reduce round-trips.
- Sliding-window congestion control, with slow start and congestion avoidance tuned for I2PтАЩs high-latency environment.
- Packet compression (default 4KB compressed segments) balancing retransmission cost and fragmentation latency.
- Fully authenticated, encrypted, and reliable channel abstraction between I2P destinations.
receiver implementations рдХреЗ рд▓рд┐рдП рдЕрдиреБрд╢рдВрд╕рд┐рдд рдиреНрдпреВрдирддрдо buffer size 128 packets рдпрд╛ 232 KB (рд▓рдЧрднрдЧ 128 * 1812) рд╣реИред I2P network latency, packet drops, рдФрд░ рдкрд░рд┐рдгрд╛рдореА congestion control рдХреЗ рдХрд╛рд░рдг, рдЗрд╕ рдЖрдХрд╛рд░ рдХрд╛ buffer рд╢рд╛рдпрдж рд╣реА рдХрднреА рднрд░рддрд╛ рд╣реИред рд╣рд╛рд▓рд╛рдВрдХрд┐, overflow рд╣реЛрдиреЗ рдХреА рд╕рдВрднрд╛рд╡рдирд╛ high-bandwidth “local loopback” (same-router) connections рдпрд╛ local testing рдореЗрдВ рдмрд╣реБрдд рдЕрдзрд┐рдХ рд╣реЛрддреА рд╣реИред
overflow рд╕реНрдерд┐рддрд┐рдпреЛрдВ рдХреЛ рддреБрд░рдВрдд рд╕рдВрдХреЗрддрд┐рдд рдХрд░рдиреЗ рдФрд░ рд╕реБрдЪрд╛рд░реВ рд░реВрдк рд╕реЗ рд░рд┐рдХрд╡рд░ рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП, streaming protocol рдореЗрдВ pushback рдХреЗ рд▓рд┐рдП рдПрдХ рд╕рд░рд▓ рддрдВрддреНрд░ рд╣реИред рдпрджрд┐ рдХреЛрдИ packet 60001 рдпрд╛ рдЙрд╕рд╕реЗ рдЕрдзрд┐рдХ value рдХреЗ optional delay field рдХреЗ рд╕рд╛рде рдкреНрд░рд╛рдкреНрдд рд╣реЛрддрд╛ рд╣реИ, рддреЛ рдпрд╣ “choking” рдпрд╛ рд╢реВрдиреНрдп receive window рдХреЛ рджрд░реНрд╢рд╛рддрд╛ рд╣реИред 60000 рдпрд╛ рдЙрд╕рд╕реЗ рдХрдо value рдХреЗ optional delay field рд╡рд╛рд▓рд╛ packet “unchoking” рдХреЛ рджрд░реНрд╢рд╛рддрд╛ рд╣реИред рдмрд┐рдирд╛ optional delay field рд╡рд╛рд▓реЗ packets choke/unchoke state рдХреЛ рдкреНрд░рднрд╛рд╡рд┐рдд рдирд╣реАрдВ рдХрд░рддреЗред
choked рд╣реЛрдиреЗ рдХреЗ рдмрд╛рдж, transmitter рдХреЗ unchoked рд╣реЛрдиреЗ рддрдХ рдбреЗрдЯрд╛ рдХреЗ рд╕рд╛рде рдХреЛрдИ рдФрд░ packets рдирд╣реАрдВ рднреЗрдЬреЗ рдЬрд╛рдиреЗ рдЪрд╛рд╣рд┐рдП, рд╕рд┐рд╡рд╛рдп рдХрднреА-рдХрднрд╛рд░ “probe” рдбреЗрдЯрд╛ packets рдХреЗ рдЬреЛ рд╕рдВрднрд╛рд╡рд┐рдд рдЦреЛрдП рдЧрдП unchoke packets рдХреА рднрд░рдкрд╛рдИ рдХреЗ рд▓рд┐рдП рднреЗрдЬреЗ рдЬрд╛рддреЗ рд╣реИрдВред choked endpoint рдХреЛ probing рдХреЛ рдирд┐рдпрдВрддреНрд░рд┐рдд рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП TCP рдХреА рддрд░рд╣ рдПрдХ “persist timer” рд╢реБрд░реВ рдХрд░рдирд╛ рдЪрд╛рд╣рд┐рдПред unchoking endpoint рдХреЛ рдЗрд╕ field рдХреЗ рд╕реЗрдЯ рдХреЗ рд╕рд╛рде рдХрдИ packets рднреЗрдЬрдиреЗ рдЪрд╛рд╣рд┐рдП, рдпрд╛ рдЬрдм рддрдХ рдбреЗрдЯрд╛ packets рджреЛрдмрд╛рд░рд╛ рдкреНрд░рд╛рдкреНрдд рдирд╣реАрдВ рд╣реЛрддреЗ рддрдм рддрдХ рдЙрдиреНрд╣реЗрдВ рдирд┐рдпрдорд┐рдд рд░реВрдк рд╕реЗ рднреЗрдЬрддреЗ рд░рд╣рдирд╛ рдЪрд╛рд╣рд┐рдПред unchoking рдХреЗ рд▓рд┐рдП рдЕрдзрд┐рдХрддрдо рдкреНрд░рддреАрдХреНрд╖рд╛ рд╕рдордп implementation-dependent рд╣реИред unchoked рд╣реЛрдиреЗ рдХреЗ рдмрд╛рдж transmitter window size рдФрд░ congestion control strategy implementation-dependent рд╣реИред
Congestion Control
рд╕реНрдЯреНрд░реАрдорд┐рдВрдЧ lib рдорд╛рдирдХ slow-start (exponential window growth) рдФрд░ congestion avoidance (linear window growth) phases рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рддреА рд╣реИ, exponential backoff рдХреЗ рд╕рд╛рдеред Windowing рдФрд░ acknowledgments packet count рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рддреЗ рд╣реИрдВ, byte count рдХрд╛ рдирд╣реАрдВред
Latency Considerations
рдХреЛрдИ рднреА packet, рдЬрд┐рд╕рдореЗрдВ SYNCHRONIZE flag рд╕реЗрдЯ рд╡рд╛рд▓рд╛ рднреА рд╢рд╛рдорд┐рд▓ рд╣реИ, рдЙрд╕рдореЗрдВ CLOSE flag рднреА рднреЗрдЬрд╛ рдЬрд╛ рд╕рдХрддрд╛ рд╣реИред connection рддрдм рддрдХ рдмрдВрдж рдирд╣реАрдВ рд╣реЛрддрд╛ рдЬрдм рддрдХ peer CLOSE flag рдХреЗ рд╕рд╛рде рдЬрд╡рд╛рдм рдирд╣реАрдВ рджреЗрддрд╛ред CLOSE packets рдореЗрдВ data рднреА рд╣реЛ рд╕рдХрддрд╛ рд╣реИред
Ping / Pong
I2CP layer (ICMP echo рдХреЗ рд╕рдордХрдХреНрд╖) рдпрд╛ datagrams рдореЗрдВ рдХреЛрдИ ping function рдирд╣реАрдВ рд╣реИред рдпрд╣ function streaming рдореЗрдВ рдкреНрд░рджрд╛рди рдХреА рдЬрд╛рддреА рд╣реИред Pings рдФрд░ pongs рдХреЛ standard streaming packet рдХреЗ рд╕рд╛рде рдЬреЛрдбрд╝рд╛ рдирд╣реАрдВ рдЬрд╛ рд╕рдХрддрд╛; рдпрджрд┐ ECHO option рд╕реЗрдЯ рд╣реИ, рддреЛ рдЕрдзрд┐рдХрд╛рдВрд╢ рдЕрдиреНрдп flags, options, ackThrough, sequenceNum, NACKs, рдЖрджрд┐ рдХреЛ ignore рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред
рдПрдХ ping packet рдореЗрдВ ECHO, SIGNATURE_INCLUDED, рдФрд░ FROM_INCLUDED flags рд╕реЗрдЯ рд╣реЛрдиреЗ рдЪрд╛рд╣рд┐рдПред sendStreamId рд╢реВрдиреНрдп рд╕реЗ рдЕрдзрд┐рдХ рд╣реЛрдирд╛ рдЪрд╛рд╣рд┐рдП, рдФрд░ receiveStreamId рдХреЛ рдЕрдирджреЗрдЦрд╛ рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред sendStreamId рдХрд┐рд╕реА рдореМрдЬреВрджрд╛ connection рд╕реЗ рдореЗрд▓ рдЦрд╛рддрд╛ рд╣реЛ рдпрд╛ рди рд╣реЛред
рдПрдХ pong packet рдореЗрдВ ECHO flag рд╕реЗрдЯ рд╣реЛрдирд╛ рдЪрд╛рд╣рд┐рдПред sendStreamId рд╢реВрдиреНрдп рд╣реЛрдирд╛ рдЪрд╛рд╣рд┐рдП, рдФрд░ receiveStreamId ping рд╕реЗ sendStreamId рд╣реИред рд░рд┐рд▓реАрдЬрд╝ 0.9.18 рд╕реЗ рдкрд╣рд▓реЗ, pong packet рдореЗрдВ ping рдореЗрдВ рд╢рд╛рдорд┐рд▓ рдХреЛрдИ рднреА payload рд╢рд╛рдорд┐рд▓ рдирд╣реАрдВ рд╣реЛрддрд╛ рд╣реИред
рд░рд┐рд▓реАрдЬрд╝ 0.9.18 рдХреЗ рдЕрдиреБрд╕рд╛рд░, pings рдФрд░ pongs рдореЗрдВ рдПрдХ payload рд╣реЛ рд╕рдХрддрд╛ рд╣реИред ping рдореЗрдВ payload, рдЕрдзрд┐рдХрддрдо 32 bytes рддрдХ, pong рдореЗрдВ рд╡рд╛рдкрд╕ рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред
Streaming рдХреЛ рдХреЙрдиреНрдлрд╝рд┐рдЧрд░реЗрд╢рди i2p.streaming.answerPings=false рдХреЗ рд╕рд╛рде pongs рднреЗрдЬрдирд╛ рдЕрдХреНрд╖рдо рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рдХреЙрдиреНрдлрд╝рд┐рдЧрд░ рдХрд┐рдпрд╛ рдЬрд╛ рд╕рдХрддрд╛ рд╣реИред
0-RTT рдореБрджреНрджреЗ
рдЬреИрд╕рд╛ рдХрд┐ рдКрдкрд░ рдмрддрд╛рдпрд╛ рдЧрдпрд╛ рд╣реИ, TCP рдХреЗ рд╡рд┐рдкрд░реАрдд, streaming SYN packet рдореЗрдВ data рдХреЛ bundle рдХрд░рдХреЗ 0-RTT data delivery рдХреА рдЕрдиреБрдорддрд┐ рджреЗрддрд╛ рд╣реИред рдпрд╣ preferred implementation рд╣реИред рдЗрд╕рдХреЗ рдЕрддрд┐рд░рд┐рдХреНрдд, streaming рдЕрддрд┐рд░рд┐рдХреНрдд data packets (initial window size рддрдХ) рдХреЛ SYN рдХреЗ рдмрд╛рдж рднреЗрдЬрдиреЗ рдХреА рдЕрдиреБрдорддрд┐ рджреЗрддрд╛ рд╣реИ, SYN-ACK рдкреНрд░рд╛рдкреНрдд рд╣реЛрдиреЗ рд╕реЗ рдкрд╣рд▓реЗред рдЗрди packets рдХрд╛ sequence number nonzero рд╣реЛрдЧрд╛, SYN flag set рдирд╣реАрдВ рд╣реЛрдЧрд╛, рдФрд░ sendStreamID zero рд╣реЛрдЧрд╛ред
рд░рд┐рд╕реАрд╡рд░реНрд╕ рдХреЛ handshake рдХреЗ рджреМрд░рд╛рди out-of-order рдпрд╛ dropped packets рдХреЗ рд▓рд┐рдП рдбрд┐рдЬрд╝рд╛рдЗрди рдХрд░рдирд╛ рдЪрд╛рд╣рд┐рдП, рдЬрд┐рд╕рдореЗрдВ SYN рд╕реЗ рдкрд╣рд▓реЗ data packets рдХрд╛ рдЖрдирд╛ рднреА рд╢рд╛рдорд┐рд▓ рд╣реИред рдкрд╕рдВрджреАрджрд╛ implementation рдпрд╣ рд╣реИ рдХрд┐ рдЕрдЬреНрдЮрд╛рдд ID рдХреЗ рд▓рд┐рдП non-SYN packets рдХреЛ drop рди рдХрд░реЗрдВ рдмрд▓реНрдХрд┐ queue рдореЗрдВ рд░рдЦреЗрдВ, рдФрд░ SYN рдкреНрд░рд╛рдкреНрдд рд╣реЛрдиреЗ рдХреЗ рдмрд╛рдж рдЙрдиреНрд╣реЗрдВ queue рд╕реЗ retrieve рдХрд░реЗрдВред
рд╡рд┐рдкрд░реАрдд рджрд┐рд╢рд╛ рдореЗрдВ, рдЪреАрдЬреЗрдВ рд╕рдорд╛рди рд╣реИрдВред рдХрдиреЗрдХреНрд╢рди рдкреНрд░рд╛рдкреНрддрдХрд░реНрддрд╛ (Bob) рдХреЛ SYN-ACK (ACK DELAY) рднреЗрдЬрдиреЗ рдореЗрдВ рджреЗрд░реА рдХрд░рдиреА рдЪрд╛рд╣рд┐рдП рдФрд░ рдПрдкреНрд▓рд┐рдХреЗрд╢рди рд╕реЗ рдбреЗрдЯрд╛ рдХреЗ рд▓рд┐рдП рдереЛрдбрд╝рд╛ рд╕рдордп рдЗрдВрддрдЬрд╛рд░ рдХрд░рдирд╛ рдЪрд╛рд╣рд┐рдПред рдПрдкреНрд▓рд┐рдХреЗрд╢рди рд╕реЗ рдбреЗрдЯрд╛ рдкреНрд░рд╛рдкреНрдд рдХрд░рдиреЗ рдкрд░, рдЗрд╕реЗ (рдЕрдзрд┐рдХрддрдо рдкреИрдХреЗрдЯ рд╕рд╛рдЗрдЬрд╝ рддрдХ) SYN-ACK рдкреИрдХреЗрдЯ рдореЗрдВ рдбрд╛рд▓реЗрдВ рдФрд░ рднреЗрдЬреЗрдВред рдЕрддрд┐рд░рд┐рдХреНрдд рдбреЗрдЯрд╛ рдкреИрдХреЗрдЯ, рдкреНрд░рд╛рд░рдВрднрд┐рдХ рд╡рд┐рдВрдбреЛ рд╕рд╛рдЗрдЬрд╝ рддрдХ, SYN-ACK рдХреЗ ACK рдХреА рдкреНрд░рддреАрдХреНрд╖рд╛ рдХрд┐рдП рдмрд┐рдирд╛ рднреА рднреЗрдЬреЗ рдЬрд╛ рд╕рдХрддреЗ рд╣реИрдВред
рдкреНрд░рд╡рд░реНрддрдХ рдХреЛ SYN-ACK рд╕реЗ рдкрд╣рд▓реЗ рдкреНрд░рд╛рдкреНрдд рдХрд┐рд╕реА рднреА рдбреЗрдЯрд╛ рдкреИрдХреЗрдЯ рдХреЛ рдмрдлрд░ рдХрд░рдирд╛ рдЪрд╛рд╣рд┐рдП, рдЬреИрд╕рд╛ рдХрд┐ handshake рдкреВрд░реНрдг рд╣реЛрдиреЗ рдХреЗ рдмрд╛рдж out-of-order handling рдХреЗ рд╕рдорд╛рди рд╣реЛрддрд╛ рд╣реИред
рд╕реНрдЯреНрд░реАрдорд┐рдВрдЧ рд▓рд╛рдЗрдмреНрд░реЗрд░реАрдЬрд╝ рдХрд╛ рдкрд░реАрдХреНрд╖рдг
рдирдП рдпрд╛ рдмрджрд▓реЗ рдЧрдП streaming libraries рдХрд╛ рдкрд░реАрдХреНрд╖рдг рдХрд░рдиреЗ рд╡рд╛рд▓реЗ developers рдХреЗ рд▓рд┐рдП, Java I2P рдПрдХ рд╕рд░рд▓ рд╕реНрдерд╛рдиреАрдп рдкрд░реАрдХреНрд╖рдг рдЙрдкрдпреЛрдЧрд┐рддрд╛ рдкреНрд░рджрд╛рди рдХрд░рддрд╛ рд╣реИ рдЬреЛ рд╡рд╛рд╕реНрддрд╡рд┐рдХ рдиреЗрдЯрд╡рд░реНрдХ рд╕реНрдерд┐рддрд┐рдпреЛрдВ рдХреЗ рдкреНрд░рдЬрдирди рдпреЛрдЧреНрдп рдкрд░реАрдХреНрд╖рдг рдХреЗ рд▓рд┐рдП рд╣реИ, рдЬрд┐рд╕рдореЗрдВ latency, packet loss, рдФрд░ delay jitter рд╢рд╛рдорд┐рд▓ рд╣реИрдВред рдпрд╣ рдПрдХ рдЫреЛрдЯрд╛ stub рд╣реИ рдЬреЛ рдХреЗрд╡рд▓ рд╕реНрдерд╛рдиреАрдп connections рдХреЗ рд▓рд┐рдП I2CP server рдХреЛ implement рдХрд░рддрд╛ рд╣реИред
рдбреЗрд╡рд▓рдкрд░реНрд╕ рдХреЛ рд╡рд┐рд╕реНрддреГрдд рд╢реНрд░реГрдВрдЦрд▓рд╛ рдХреЗ рд╕рд╛рдорд╛рдиреНрдп рдкреИрд░рд╛рдореАрдЯрд░ рдХреЗ рд╕рд╛рде рдкрд░реАрдХреНрд╖рдг рдХрд░рдирд╛ рдЪрд╛рд╣рд┐рдП, рдЬрд┐рд╕рдореЗрдВ 10ms рд╕реЗ рдХрдо рд╕реЗ рдХрдо 15s рддрдХ рдХреА latency рдФрд░ 0 рд╕реЗ 10% рддрдХ рдХреА packet loss рд╢рд╛рдорд┐рд▓ рд╣реИред Jitter рдЬреЛрдбрд╝рдирд╛ out-of-order handling рдХрд╛ рдкрд░реАрдХреНрд╖рдг рдХрд░рдирд╛ рдЖрд╕рд╛рди рдмрдирд╛рддрд╛ рд╣реИред
рдпрд╣ buffer overflow (CHOKE/UNCHOKE) рдХреЛ test рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рднреА рдПрдХ рдЕрдЪреНрдЫрд╛ setup рд╣реИ, рджреЛ applications рдореЗрдВ рд╕реЗ рдХрд┐рд╕реА рдПрдХ рдХреЛ manually suspend рдХрд░рдХреЗред
i2p.i2p рд╕реНрд░реЛрдд рдкреИрдХреЗрдЬ рд╕реЗ:
I2PSocketManagerFactorynegotiates or reuses a router session via I2CP.- If no key is provided, a new destination is automatically generated.
- Developers can pass I2CP options (e.g., tunnel lengths, encryption types, or connection settings) through the
optionsmap. I2PSocketandI2PServerSocketmirror standard JavaSocketinterfaces, making migration straightforward.
i2p.streaming.profile рдиреЛрдЯреНрд╕
рдпрд╣ рд╡рд┐рдХрд▓реНрдк рджреЛ рдорд╛рди рд╕рдорд░реНрдерд┐рдд рдХрд░рддрд╛ рд╣реИ; 1=bulk рдФрд░ 2=interactiveред рдпрд╣ рд╡рд┐рдХрд▓реНрдк streaming library рдФрд░/рдпрд╛ router рдХреЛ рдЕрдкреЗрдХреНрд╖рд┐рдд рдЯреНрд░реИрдлрд┐рдХ рдкреИрдЯрд░реНрди рдХреЗ рдмрд╛рд░реЗ рдореЗрдВ рд╕рдВрдХреЗрдд рдкреНрд░рджрд╛рди рдХрд░рддрд╛ рд╣реИред
“Bulk” рдХрд╛ рдорддрд▓рдм рд╣реИ рдЙрдЪреНрдЪ bandwidth рдХреЗ рд▓рд┐рдП рдЕрдиреБрдХреВрд▓рди рдХрд░рдирд╛, рд╕рдВрднрд╛рд╡рд┐рдд рд░реВрдк рд╕реЗ latency рдХреА рдХреАрдордд рдкрд░ред рдпрд╣ default рд╣реИред “Interactive” рдХрд╛ рдорддрд▓рдм рд╣реИ рдХрдо latency рдХреЗ рд▓рд┐рдП рдЕрдиреБрдХреВрд▓рди рдХрд░рдирд╛, рд╕рдВрднрд╛рд╡рд┐рдд рд░реВрдк рд╕реЗ bandwidth рдпрд╛ рджрдХреНрд╖рддрд╛ рдХреА рдХреАрдордд рдкрд░ред рдЕрдиреБрдХреВрд▓рди рд░рдгрдиреАрддрд┐рдпрд╛рдВ, рдпрджрд┐ рдХреЛрдИ рд╣реИрдВ, рддреЛ implementation-dependent рд╣реИрдВ, рдФрд░ рдЗрд╕рдореЗрдВ streaming protocol рдХреЗ рдмрд╛рд╣рд░ рдХреЗ рдмрджрд▓рд╛рд╡ рднреА рд╢рд╛рдорд┐рд▓ рд╣реЛ рд╕рдХрддреЗ рд╣реИрдВред
API рд╕рдВрд╕реНрдХрд░рдг 0.9.63 рддрдХ, Java I2P 1 (bulk) рдХреЗ рдЕрд▓рд╛рд╡рд╛ рдХрд┐рд╕реА рднреА рдорд╛рди рдХреЗ рд▓рд┐рдП рдПрдХ рддреНрд░реБрдЯрд┐ рд╡рд╛рдкрд╕ рдХрд░рддрд╛ рдерд╛ рдФрд░ tunnel рд╢реБрд░реВ рд╣реЛрдиреЗ рдореЗрдВ рд╡рд┐рдлрд▓ рд╣реЛ рдЬрд╛рддрд╛ рдерд╛ред API 0.9.64 рд╕реЗ, Java I2P рдЗрд╕ рдорд╛рди рдХреЛ рдирдЬрд╝рд░рдЕрдВрджрд╛рдЬрд╝ рдХрд░рддрд╛ рд╣реИред API рд╕рдВрд╕реНрдХрд░рдг 0.9.63 рддрдХ, i2pd рдЗрд╕ рд╡рд┐рдХрд▓реНрдк рдХреЛ рдирдЬрд╝рд░рдЕрдВрджрд╛рдЬрд╝ рдХрд░рддрд╛ рдерд╛; рдпрд╣ API 0.9.64 рд╕реЗ i2pd рдореЗрдВ рд▓рд╛рдЧреВ рдХрд┐рдпрд╛ рдЧрдпрд╛ рд╣реИред
рдЬрдмрдХрд┐ streaming protocol рдореЗрдВ рдкреНрд░реЛрдлрд╛рдЗрд▓ рд╕реЗрдЯрд┐рдВрдЧ рдХреЛ рджреВрд╕рд░реЗ рдЫреЛрд░ рддрдХ рдкрд╣реБрдВрдЪрд╛рдиреЗ рдХреЗ рд▓рд┐рдП рдПрдХ flag field рд╢рд╛рдорд┐рд▓ рд╣реИ, рдпрд╣ рдХрд┐рд╕реА рднреА рдЬреНрдЮрд╛рдд router рдореЗрдВ implement рдирд╣реАрдВ рдХрд┐рдпрд╛ рдЧрдпрд╛ рд╣реИред
Control Block Sharing
streaming lib “TCP” Control Block sharing рдХрд╛ рд╕рдорд░реНрдерди рдХрд░рддреА рд╣реИред рдпрд╣ рддреАрди рдорд╣рддреНрд╡рдкреВрд░реНрдг streaming lib рдкреИрд░рд╛рдореАрдЯрд░ (window size, round trip time, round trip time variance) рдХреЛ рд╕рдорд╛рди remote peer рдХреЗ connections рдореЗрдВ рд╕рд╛рдЭрд╛ рдХрд░рддреА рд╣реИред рдЗрд╕рдХрд╛ рдЙрдкрдпреЛрдЧ connection open/close рд╕рдордп рдкрд░ “temporal” sharing рдХреЗ рд▓рд┐рдП рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИ, connection рдХреЗ рджреМрд░рд╛рди “ensemble” sharing рдХреЗ рд▓рд┐рдП рдирд╣реАрдВ (RFC 2140 рджреЗрдЦреЗрдВ)ред рдкреНрд░рддреНрдпреЗрдХ ConnectionManager (рдпрд╛рдиреА рдкреНрд░рддреНрдпреЗрдХ local Destination) рдХреЗ рд▓рд┐рдП рдПрдХ рдЕрд▓рдЧ share рд╣реИ рддрд╛рдХрд┐ рд╕рдорд╛рди router рдкрд░ рдЕрдиреНрдп Destinations рдореЗрдВ рдХреЛрдИ рдЬрд╛рдирдХрд╛рд░реА рд▓реАрдХ рди рд╣реЛред рдХрд┐рд╕реА рджрд┐рдП рдЧрдП peer рдХреЗ рд▓рд┐рдП share data рдХреБрдЫ рдорд┐рдирдЯреЛрдВ рдмрд╛рдж expire рд╣реЛ рдЬрд╛рддрд╛ рд╣реИред рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд Control Block Sharing parameters рдкреНрд░рддреНрдпреЗрдХ router рдХреЗ рд▓рд┐рдП рд╕реЗрдЯ рдХрд┐рдП рдЬрд╛ рд╕рдХрддреЗ рд╣реИрдВ:
- SYN sent тАФ initiator includes optional data.
- SYN/ACK response тАФ responder includes optional data.
- ACK finalization тАФ establishes reliability and session state.
- FIN/RESET тАФ used for orderly closure or abrupt termination.
рдЕрдиреНрдп рдкреИрд░рд╛рдореАрдЯрд░
рдирд┐рдореНрдирд▓рд┐рдЦрд┐рдд рдкреИрд░рд╛рдореАрдЯрд░ рдЕрдиреБрд╢рдВрд╕рд┐рдд рдбрд┐рдлрд╝реЙрд▓реНрдЯ рд╣реИрдВред рдбрд┐рдлрд╝реЙрд▓реНрдЯ рдЕрд▓рдЧ рд╣реЛ рд╕рдХрддреЗ рд╣реИрдВ, рдХрд╛рд░реНрдпрд╛рдиреНрд╡рдпрди рдкрд░ рдирд┐рд░реНрднрд░:
- The streaming layer continuously adapts to network latency and throughput via RTT-based feedback.
- Applications perform best when routers are contributing peers (participating tunnels enabled).
- TCP-like congestion control mechanisms prevent overloading slow peers and help balance bandwidth use across tunnels.
рдЗрддрд┐рд╣рд╛рд╕
streaming library I2P рдХреЗ рд▓рд┐рдП рдкреНрд░рд╛рдХреГрддрд┐рдХ рд░реВрдк рд╕реЗ рд╡рд┐рдХрд╕рд┐рдд рд╣реБрдИ рд╣реИ - рдкрд╣рд▓реЗ mihi рдиреЗ I2PTunnel рдХреЗ рд╣рд┐рд╕реНрд╕реЗ рдХреЗ рд░реВрдк рдореЗрдВ “mini streaming library” рдХреЛ рд▓рд╛рдЧреВ рдХрд┐рдпрд╛, рдЬреЛ 1 message рдХреЗ window size рддрдХ рд╕реАрдорд┐рдд рдереА (рдЕрдЧрд▓рд╛ рднреЗрдЬрдиреЗ рд╕реЗ рдкрд╣рд▓реЗ ACK рдХреА рдЖрд╡рд╢реНрдпрдХрддрд╛), рдФрд░ рдлрд┐рд░ рдЗрд╕реЗ рдПрдХ рд╕рд╛рдорд╛рдиреНрдп streaming interface (TCP sockets рдХреЛ рджрд░реНрд╢рд╛рддреЗ рд╣реБрдП) рдореЗрдВ рдкреБрдирд░реНрдЧрдард┐рдд рдХрд┐рдпрд╛ рдЧрдпрд╛ рдФрд░ рдкреВрд░реНрдг streaming implementation рдХреЛ sliding window protocol рдФрд░ рдЙрдЪреНрдЪ bandwidth x delay product рдХреЛ рдзреНрдпрд╛рди рдореЗрдВ рд░рдЦрддреЗ рд╣реБрдП рдЕрдиреБрдХреВрд▓рди рдХреЗ рд╕рд╛рде рддреИрдирд╛рдд рдХрд┐рдпрд╛ рдЧрдпрд╛ред рд╡реНрдпрдХреНрддрд┐рдЧрдд streams рдЕрдзрд┐рдХрддрдо packet size рдФрд░ рдЕрдиреНрдп рд╡рд┐рдХрд▓реНрдкреЛрдВ рдХреЛ рд╕рдорд╛рдпреЛрдЬрд┐рдд рдХрд░ рд╕рдХрддреА рд╣реИрдВред рдбрд┐рдлрд╝реЙрд▓реНрдЯ message size рдХреЛ рджреЛ 1K I2NP tunnel messages рдореЗрдВ рд╕рдЯреАрдХ рд░реВрдк рд╕реЗ рдлрд┐рдЯ рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП рдЪреБрдирд╛ рдЧрдпрд╛ рд╣реИ, рдФрд░ рдпрд╣ рдЦреЛрдП рд╣реБрдП messages рдХреЛ рдлрд┐рд░ рд╕реЗ рднреЗрдЬрдиреЗ рдХреА bandwidth рд▓рд╛рдЧрдд, рдФрд░ рдХрдИ messages рдХреА latency рдФрд░ overhead рдХреЗ рдмреАрдЪ рдПрдХ рдЙрдЪрд┐рдд рд╕рдордЭреМрддрд╛ рд╣реИред
Interoperability and Best Practices
рд╕реНрдЯреНрд░реАрдорд┐рдВрдЧ рд▓рд╛рдЗрдмреНрд░реЗрд░реА рдХрд╛ рд╡реНрдпрд╡рд╣рд╛рд░ рдПрдкреНрд▓рд┐рдХреЗрд╢рди-рд╕реНрддрд░реАрдп рдкреНрд░рджрд░реНрд╢рди рдкрд░ рдЧрд╣рд░рд╛ рдкреНрд░рднрд╛рд╡ рдбрд╛рд▓рддрд╛ рд╣реИ, рдФрд░ рдЗрд╕реАрд▓рд┐рдП рдпрд╣ рдЖрдЧреЗ рдХреЗ рд╡рд┐рд╢реНрд▓реЗрд╖рдг рдХреЗ рд▓рд┐рдП рдПрдХ рдорд╣рддреНрд╡рдкреВрд░реНрдг рдХреНрд╖реЗрддреНрд░ рд╣реИред
- Always test against both Java I2P and i2pd to ensure full compatibility.
- Although the protocol is standardized, minor implementation differences may exist.
- Handle older routers gracefullyтАФmany peers still run pre-2.0 versions.
- Monitor connection stats using
I2PSocket.getOptions()andgetSession()to read RTT and retransmission metrics.