- Let class N routers become floodfill
   - Scale max connections for non-O floodfills
This commit is contained in:
zzz
2013-06-10 14:45:45 +00:00
parent a70810ffae
commit 36d4b20bdc
4 changed files with 22 additions and 11 deletions

View File

@@ -1,3 +1,8 @@
2013-06-10 zzz
* Installer: Don't install Windows service by default
* NetDB: Let class N routers become floodfill; scale max connections for non-O floodfills
* Transports: Reduce idle timeouts to mitigate conn limit issues
2013-06-09 zzz
* NetDB: Prep for leasesets with different expire times
- Add new I2CP RequestVariableLeaseSetMessage
@@ -1783,7 +1788,7 @@
* i2psnark: Escape fixes
* netdb.jsp: Fix debug median calculation
20112-02-17 kytv
2012-02-17 kytv
* Add Czech language from Transifex (thanks Waseihou)
2012-02-12 str4d

View File

@@ -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 = 7;
public final static long BUILD = 8;
/** for example "-test" */
public final static String EXTRA = "";

View File

@@ -4,6 +4,7 @@ import java.util.List;
import net.i2p.data.Hash;
import net.i2p.data.RouterAddress;
import net.i2p.data.RouterInfo;
import net.i2p.router.JobImpl;
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
@@ -74,8 +75,12 @@ class FloodfillMonitorJob extends JobImpl {
if (getContext().router().getUptime() < MIN_UPTIME)
return false;
// Only if class O...
if (getContext().router().getRouterInfo().getCapabilities().indexOf("O") < 0)
RouterInfo ri = getContext().router().getRouterInfo();
if (ri == null)
return false;
char bw = ri.getBandwidthTier().charAt(0);
// Only if class N or O...
if (bw < Router.CAPABILITY_BW128 || bw > Router.CAPABILITY_BW256)
return false;
// This list will not include ourselves...

View File

@@ -42,6 +42,7 @@ import net.i2p.util.LHMCache;
import net.i2p.util.Log;
import net.i2p.util.SimpleScheduler;
import net.i2p.util.SimpleTimer;
import net.i2p.util.SystemVersion;
/**
* Defines a way to send a message to another peer and start listening for messages
@@ -113,9 +114,6 @@ public abstract class TransportImpl implements Transport {
*/
public int countActiveSendPeers() { return 0; }
/** Default for floodfills... */
private static final int DEFAULT_MAX_CONNECTIONS = 425;
/** ...and 50/100/150/200/250 for BW Tiers K/L/M/N/O */
private static final int MAX_CONNECTION_FACTOR = 50;
@@ -130,13 +128,16 @@ public abstract class TransportImpl implements Transport {
maxProp = "i2np.ntcp.maxConnections";
else // shouldn't happen
maxProp = "i2np." + style.toLowerCase(Locale.US) + ".maxConnections";
int def = DEFAULT_MAX_CONNECTIONS;
int def = MAX_CONNECTION_FACTOR;
RouterInfo ri = _context.router().getRouterInfo();
if (ri != null) {
char bw = ri.getBandwidthTier().charAt(0);
if (bw != 'U' &&
! ((FloodfillNetworkDatabaseFacade)_context.netDb()).floodfillEnabled())
def = MAX_CONNECTION_FACTOR * (1 + bw - Router.CAPABILITY_BW12);
if (bw > Router.CAPABILITY_BW12 && bw <= Router.CAPABILITY_BW256)
def *= (1 + bw - Router.CAPABILITY_BW12);
}
if (((FloodfillNetworkDatabaseFacade)_context.netDb()).floodfillEnabled()) {
// && !SystemVersion.isWindows()) {
def *= 17; def /= 10; // 425 for Class O ff
}
// increase limit for SSU, for now
if (style.equals("SSU"))