I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 49565a99 authored by zzz's avatar zzz
Browse files

SSU: Redesign of the congestion control (tickets #2412, #2649, #2654, #2713),

modelled on TCP Reno (RFCs 5681 and 6298)
- Use a single timer per connection
- Resend up to half the un-acked messages per timer event instead of a single message
- Only send either old or new messages, do not mix
- Cache/avoid several timer calls
- Instead of 3 return values, allocating bandwidth is now a boolean function
- Avoid one of the iterations over all un-acked messages every packet pusher loop
- Remove 100 ms failsafe
- Fix OMF debug log NPE
With the same cpu usage the bandwidth is much higher
Significant speed improvement for lossy connections (e.g. wifi)
Patch by zlatinb
parent ee27bc3b
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,9 @@
* NetDB:
- ECIES router support for encrypted lookups and stores (proposal #156)
- Reseed after a long downtime
* SSU: Increase socket buffer size (ticket #2781)
* SSU:
- Increase socket buffer size (ticket #2781)
- Redesign of the congestion control (tickets #2412, #2649, #2654, #2713)
 
2020-10-17 zzz
* i2psnark: Remove references to "maggot" links
......
......@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 8;
public final static long BUILD = 9;
/** for example "-test" */
public final static String EXTRA = "";
......
......@@ -294,17 +294,17 @@ class OutboundMessageFragments {
// race with add()
_iterator.remove();
if (_log.shouldLog(Log.DEBUG))
_log.debug("No more pending messages for " + peer.getRemotePeer());
_log.debug("No more pending messages for " + p.getRemotePeer());
continue;
}
peersProcessed++;
states = p.allocateSend();
states = p.allocateSend(now);
if (states != null) {
peer = p;
// we have something to send and we will be returning it
break;
}
int delay = p.getNextDelay();
int delay = p.getNextDelay(now);
if (delay < nextSendDelay)
nextSendDelay = delay;
......@@ -371,6 +371,16 @@ class OutboundMessageFragments {
return packets;
}
/**
* Wakes up the packet pusher thread.
* @since 0.9.48
*/
void nudge() {
synchronized(_activePeers) {
_activePeers.notify();
}
}
/**
* @return null if state or peer is null
*/
......
......@@ -31,7 +31,6 @@ class OutboundMessageState implements CDPQEntry {
private long _fragmentAcks;
private final int _numFragments;
private final long _startedOn;
private long _nextSendTime;
private int _pushCount;
private int _maxSends;
// we can't use the ones in _message since it is null for injections
......@@ -77,7 +76,6 @@ class OutboundMessageState implements CDPQEntry {
_i2npMessage = msg;
_peer = peer;
_startedOn = _context.clock().now();
_nextSendTime = _startedOn;
_expiration = _startedOn + EXPIRATION;
//_expiration = msg.getExpiration();
......@@ -166,9 +164,6 @@ class OutboundMessageState implements CDPQEntry {
return isComplete();
}
public long getNextSendTime() { return _nextSendTime; }
public void setNextSendTime(long when) { _nextSendTime = when; }
/**
* The max number of sends for any fragment, which is the
* same as the push count, at least as it's coded now.
......
This diff is collapsed.
......@@ -345,6 +345,14 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
_context.simpleTimer2().addPeriodicEvent(new PingIntroducers(), MIN_EXPIRE_TIMEOUT * 3 / 4);
}
/**
* @returns the instance of OutboundMessageFragments
* @since 0.9.48
*/
OutboundMessageFragments getOMF() {
return _fragments;
}
/**
* Pick a port if not previously configured, so that TransportManager may
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment