java.lang.Object
net.i2p.client.streaming.impl.TCBShare
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.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classPeriodic timer event that removes expired entries from the cache.private classA cached entry holding dampened TCB parameters for a remote peer.Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<Destination, TCBShare.Entry> Congestion control entries, by destination.private final TCBShare.CleanEventTimer cleaning expired entries.private final I2PAppContextThe app context.private final LogLogger for the streaming congestion cache.private final doubleDampening factor applied to the round trip time.private final doubleDampening factor applied to the RTT deviation.private final doubleDampening factor applied to the window.private static final longInterval between cache cleanups.private static final longTime an unused entry stays in the cache.private static final int//private static final intLargest RTT deviation allowed.private static final StringConfig key for the round trip time dampening.private static final double// constants defined in rfc 2140 // do not change unless you know what you're doingprivate static final StringConfig key for the RTT deviation dampening.private static final doubleDefault dampening for the RTT deviation.private static final StringConfig key for the window dampening.private static final doubleDefault dampening for the window.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionprivate intMaximum window size for TCB sharing from config.voidstop()Cannot be restarted.voidRetrieve cached TCB parameters and apply them to the connection's options.voidStore the connection's current TCB parameters into the cache.
Field Details
_context
The app context._log
Logger for the streaming congestion cache._cache
Congestion control entries, by destination._cleaner
Timer cleaning expired entries._rttDampening
private final double _rttDampeningDampening factor applied to the round trip time._wdwDampening
private final double _wdwDampeningDampening factor applied to the window._rttDevDampening
private final double _rttDevDampeningDampening factor applied to the RTT deviation.EXPIRE_TIME
private static final long EXPIRE_TIMETime an unused entry stays in the cache.- See Also:
CLEAN_TIME
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_DAMPENINGDefault dampening for the RTT deviation.- See Also:
WDW_DAMPENING
private static final double WDW_DAMPENINGDefault dampening for the window.- See Also:
RTT_DAMP_PROP
Config key for the round trip time dampening.- See Also:
WDW_DAMP_PROP
Config key for the window dampening.- See Also:
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_DEVLargest RTT deviation allowed.
Constructor Details
TCBShare
Creates a new TCB share cache.- Parameters:
ctx- the application contexttimer- 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 viai2p.streaming.maxSlowStartWindow(default: 64).- Returns:
- the maximum window size
stop
public void stop()Cannot be restarted.