java.lang.Object
net.i2p.client.streaming.impl.TCBShare

class TCBShareextends Object
Share important TCP Control Block parameters across Connections to the same remote peer. This is intended for "temporal" sharing at connection open/close time, not "ensemble" sharing during a connection. Ref. RFC 2140.

There is a TCB share per ConnectionManager (i.e. per local Destination) so that there is no information leakage to other Destinations on the same router.

  • Field Details

    • _context

      private final I2PAppContext _context
      The app context.
    • _log

      private final Log _log
      Logger for the streaming congestion cache.
    • _cache

      private final Map<Destination, TCBShare.Entry> _cache
      Congestion control entries, by destination.
    • _cleaner

      private final TCBShare.CleanEvent _cleaner
      Timer cleaning expired entries.
    • _rttDampening

      private final double _rttDampening
      Dampening factor applied to the round trip time.
    • _wdwDampening

      private final double _wdwDampening
      Dampening factor applied to the window.
    • _rttDevDampening

      private final double _rttDevDampening
      Dampening factor applied to the RTT deviation.
    • EXPIRE_TIME

      private static final long EXPIRE_TIME
      Time an unused entry stays in the cache.
      See Also:
    • CLEAN_TIME

      private static final long CLEAN_TIME
      Interval between cache cleanups.
      See Also:
    • RTT_DAMPENING

      private static final double RTT_DAMPENING
      // constants defined in rfc 2140 // do not change unless you know what you're doing
      See Also:
    • RTTDEV_DAMPENING

      private static final double RTTDEV_DAMPENING
      Default dampening for the RTT deviation.
      See Also:
    • WDW_DAMPENING

      private static final double WDW_DAMPENING
      Default dampening for the window.
      See Also:
    • RTT_DAMP_PROP

      private static final String RTT_DAMP_PROP
      Config key for the round trip time dampening.
      See Also:
    • WDW_DAMP_PROP

      private static final String WDW_DAMP_PROP
      Config key for the window dampening.
      See Also:
    • RTTDEV_DAMP_PROP

      private static final String RTTDEV_DAMP_PROP
      Config key for the RTT deviation dampening.
      See Also:
    • MAX_RTT

      private static final int MAX_RTT
      //
    • MAX_RTT_DEV

      private static final int MAX_RTT_DEV
      Largest RTT deviation allowed.
  • Constructor Details

    • TCBShare

      public TCBShare(I2PAppContext ctx, SimpleTimer2 timer)
      Creates a new TCB share cache.
      Parameters:
      ctx - the application context
      timer - the timer the cache's expiration sweep is scheduled on
  • Method Details

    • getMaxWindowSize

      private int getMaxWindowSize()
      Maximum window size for TCB sharing from config. Tunable via i2p.streaming.maxSlowStartWindow (default: 64).
      Returns:
      the maximum window size
    • stop

      public void stop()
      Cannot be restarted.
    • updateOptsFromShare

      public void updateOptsFromShare(Connection con)
      Retrieve cached TCB parameters and apply them to the connection's options.
      Parameters:
      con - the connection to update from the cache
    • updateShareOpts

      public void updateShareOpts(Connection con)
      Store the connection's current TCB parameters into the cache.
      Parameters:
      con - the connection whose parameters to cache