Changeset 7e3800a


Ignore:
Timestamp:
May 20, 2008 12:48:41 PM (12 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
955e782
Parents:
6c7691c
Message:
  • Reachability:
    • Call the previously unused profile.tunnelTestFailed() (redefined to include a probability argument) and severely downgrade a peer's capacity upon failures, depending on tunnel length and direction. This will help push unreachable and malicious peers out of the High Capacity tier.
    • Put recent fail rate on profiles.jsp
  • ProfileOrganizer?: Logging cleanup
  • eepsite_index.html: Update add-host and jump links
  • HTTP Proxy: Remove trevorreznik jump server from list
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java

    r6c7691c r7e3800a  
    650650                                           // "http://orion.i2p/jump/",
    651651                                           "http://stats.i2p/cgi-bin/jump.cgi?a=",
    652                                            "http://trevorreznik.i2p/cgi-bin/jump.php?hostname=",
     652                                           // "http://trevorreznik.i2p/cgi-bin/jump.php?hostname=",
    653653                                           "http://i2jump.i2p/"
    654654                                          };
  • history.txt

    r6c7691c r7e3800a  
     12008-05-20 zzz
     2    * Reachability:
     3      - Call the previously unused profile.tunnelTestFailed()
     4        (redefined to include a probability argument)
     5        and severely downgrade a peer's capacity upon failures,
     6        depending on tunnel length and direction.
     7        This will help push unreachable and malicious peers
     8        out of the High Capacity tier.
     9      - Put recent fail rate on profiles.jsp
     10    * ProfileOrganizer: Logging cleanup
     11    * eepsite_index.html: Update add-host and jump links
     12    * HTTP Proxy: Remove trevorreznik jump server from list
     13
    1142008-05-20 welterde
    215    * implemented PrivateKeyFile
  • installer/resources/eepsite_index.html

    r6c7691c r7e3800a  
    5656     That is, you must enter
    5757     your eepsite name and key into a web interface on one or more of these sites.
    58      Here is <a href="http://stats.i2p/i2p/addkey.html">the key entry form at stats.i2p</a>,
    59      and
    60      here is <a href="http://trevorreznik.i2p/host-database/">the key entry form at trevorreznik.i2p</a>.
     58     Here is <a href="http://stats.i2p/i2p/addkey.html">the key entry form at stats.i2p</a>.
    6159     Again, your key is the entire "Local destination" key on the
    6260     <a href="http://localhost:7657/i2ptunnel/edit.jsp?tunnel=3">eepsite i2ptunnel configuration page</a>.
     
    7169     <a href="http://tino.i2p/hosts.txt">http://tino.i2p/hosts.txt</a>,
    7270     <a href="http://stats.i2p/cgi-bin/newhosts.txt">http://stats.i2p/cgi-bin/newhosts.txt</a>,
    73      <a href="http://i2jump.i2p/hosts.txt">http://i2jump.i2p/hosts.txt</a>,
    74      <a href="http://trevorreznik.i2p/hosts.txt">http://trevorreznik.i2p/hosts.txt</a> and hit "Save".
     71     <a href="http://i2host.i2p/cgi-bin/i2hostetag">http://i2host.i2p/cgi-bin/i2hostetag</a>,
     72     and hit "Save".
    7573     Now you will get updates too!
    7674 <li>If you are in a hurry and can't wait a few hours, you can tell people to use a "jump" address helper redirection service.
    77      This will work within a few minutes of your entering the key to an address book.
     75     This will work within a few minutes of your entering the key to an address book on the same site.
    7876     Test it yourself first by entering
    7977     http://stats.i2p/cgi-bin/jump.cgi?a=<i>something</i>.i2p or
    80      or http://trevorreznik.i2p/cgi-bin/jump.php?hostname=<i>something</i>.i2p into your browser.
     78     or http://i2host.i2p/cgi-bin/i2hostjump?<i>something</i>.i2p
     79     into your browser.
    8180     Once it's working, then you can tell others to use it.
    8281 <li>Some people check eepsite lists such as
  • router/java/src/net/i2p/router/ProfileManager.java

    r6c7691c r7e3800a  
    8686     *
    8787     */
    88     void tunnelFailed(Hash peer);
     88    void tunnelFailed(Hash peer, int pct);
    8989   
    9090    /**
  • router/java/src/net/i2p/router/RouterVersion.java

    r6c7691c r7e3800a  
    1818    public final static String ID = "$Revision: 1.548 $ $Date: 2008-02-10 15:00:00 $";
    1919    public final static String VERSION = "0.6.1.33";
    20     public final static long BUILD = 6;
     20    public final static long BUILD = 7;
    2121    public static void main(String args[]) {
    2222        System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
  • router/java/src/net/i2p/router/peermanager/CapacityCalculator.java

    r6c7691c r7e3800a  
    104104        double val = eventCount * stretch;
    105105        long failed = 0;
     106        // Let's say a failure is 4 times worse than a rejection.
     107        // It's actually much worse than that, but with 2-hop tunnels and a 8-peer
     108        // fast pool, for example, you have a 1/7 chance of being falsely blamed.
     109        // We also don't want to drive everybody's capacity to zero, that isn't helpful.
    106110        if (curFailed != null)
    107             failed = curFailed.getCurrentEventCount() + curFailed.getLastEventCount();
     111            failed = (long) (0.5 + (4.0 * (curFailed.getCurrentTotalValue() + curFailed.getLastTotalValue()) / 100.0));
    108112        if (failed > 0) {
    109113            //if ( (period <= 10*60*1000) && (curFailed.getCurrentEventCount() > 0) )
  • router/java/src/net/i2p/router/peermanager/ProfileManagerImpl.java

    r6c7691c r7e3800a  
    151151     * Note that the peer participated in a tunnel that failed.  Its failure may not have
    152152     * been the peer's fault however.
    153      *
    154      */
    155     public void tunnelFailed(Hash peer) {
    156         PeerProfile data = getProfile(peer);
    157         if (data == null) return;
    158         data.setLastHeardFrom(_context.clock().now());
    159         data.getTunnelHistory().incrementFailed();
     153     * Blame the peer with a probability of pct/100.
     154     *
     155     */
     156    public void tunnelFailed(Hash peer, int pct) {
     157        PeerProfile data = getProfile(peer);
     158        if (data == null) return;
     159        data.setLastHeardFrom(_context.clock().now());
     160        data.getTunnelHistory().incrementFailed(pct);
    160161    }
    161162   
  • router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java

    r6c7691c r7e3800a  
    564564                _log.info("Profiles reorganized.  averages: [integration: " + _thresholdIntegrationValue
    565565                           + ", capacity: " + _thresholdCapacityValue + ", speed: " + _thresholdSpeedValue + "]");
     566            /*****
    566567            if (_log.shouldLog(Log.DEBUG)) {
    567568                StringBuffer buf = new StringBuffer(512);
     
    573574                _log.debug("fast: " + _fastPeers.values());
    574575            }
     576            *****/
    575577        }
    576578       
     
    602604                    if (!isSelectable(cur.getPeer())) {
    603605                        // skip peers we dont have in the netDb
    604                         if (_log.shouldLog(Log.INFO))   
    605                             _log.info("skip unknown peer from fast promotion: " + cur.getPeer().toBase64());
     606                        // if (_log.shouldLog(Log.INFO))   
     607                        //     _log.info("skip unknown peer from fast promotion: " + cur.getPeer().toBase64());
    606608                        continue;
    607609                    }
    608610                    if (!cur.getIsActive()) {
    609611                        // skip inactive
    610                         if (_log.shouldLog(Log.INFO))
    611                             _log.info("skip inactive peer from fast promotion: " + cur.getPeer().toBase64());
     612                        // if (_log.shouldLog(Log.INFO))
     613                        //     _log.info("skip inactive peer from fast promotion: " + cur.getPeer().toBase64());
    612614                        continue;
    613615                    }
     616                    if (_log.shouldLog(Log.INFO))
     617                        _log.info("Fast promoting: " + cur.getPeer().toBase64());
    614618                    _fastPeers.put(cur.getPeer(), cur);
    615619                    // no need to remove it from any of the other groups, since if it is
     
    970974        if (_context.router() == null) return true;
    971975        if ( (_context.shitlist() != null) && (_context.shitlist().isShitlisted(peer)) ) {
    972             if (_log.shouldLog(Log.DEBUG))
    973                 _log.debug("Peer " + peer.toBase64() + " is shitlisted, dont select it");
     976            // if (_log.shouldLog(Log.DEBUG))
     977            //     _log.debug("Peer " + peer.toBase64() + " is shitlisted, dont select it");
    974978            return false; // never select a shitlisted peer
    975979        }
     
    984988                boolean exclude = TunnelPeerSelector.shouldExclude(_context, info);
    985989                if (exclude) {
    986                     if (_log.shouldLog(Log.WARN))
    987                         _log.warn("Peer " + peer.toBase64() + " has capabilities or other stats suggesting we avoid it");
     990                    // if (_log.shouldLog(Log.WARN))
     991                    //     _log.warn("Peer " + peer.toBase64() + " has capabilities or other stats suggesting we avoid it");
    988992                    return false;
    989993                } else {
    990                     if (_log.shouldLog(Log.INFO))
    991                         _log.info("Peer " + peer.toBase64() + " is locally known, allowing its use");
     994                    // if (_log.shouldLog(Log.INFO))
     995                    //     _log.info("Peer " + peer.toBase64() + " is locally known, allowing its use");
    992996                    return true;
    993997                }
    994998            }
    995999        } else {
    996             if (_log.shouldLog(Log.WARN))
    997                 _log.warn("Peer " + peer.toBase64() + " is NOT locally known, disallowing its use");
     1000            // if (_log.shouldLog(Log.WARN))
     1001            //    _log.warn("Peer " + peer.toBase64() + " is NOT locally known, disallowing its use");
    9981002            return false;
    9991003        }
  • router/java/src/net/i2p/router/peermanager/ProfileOrganizerRenderer.java

    r6c7691c r7e3800a  
    144144            if (prof.getIsFailing()) buf.append(" Failing");
    145145            if (_context.commSystem().wasUnreachable(peer)) buf.append(" Unreachable");
     146            Rate failed = prof.getTunnelHistory().getFailedRate().getRate(30*60*1000);
     147            long fails = failed.getCurrentEventCount() + failed.getLastEventCount();
     148            if (fails > 0) {
     149                Rate accepted = prof.getTunnelCreateResponseTime().getRate(30*60*1000);
     150                long total = fails + accepted.getCurrentEventCount() + accepted.getLastEventCount();
     151                if (total / fails <= 10)   // hide if < 10%
     152                    buf.append(' ').append(fails).append('/').append(total).append(" Test Fails");
     153            }
    146154            buf.append("&nbsp</td>");
    147155            //buf.append("<td><a href=\"/profile/").append(prof.getPeer().toBase64().substring(0, 32)).append("\">profile.txt</a> ");
  • router/java/src/net/i2p/router/peermanager/TunnelHistory.java

    r6c7691c r7e3800a  
    109109        }
    110110    }
    111     public void incrementFailed() {
     111
     112    // Define this rate as the probability it really failed
     113    // @param pct = probability * 100
     114    public void incrementFailed(int pct) {
    112115        _lifetimeFailed++;
    113         _failRate.addData(1, 1);
     116        _failRate.addData(pct, 1);
    114117        _lastFailed = _context.clock().now();
    115118    }
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java

    r6c7691c r7e3800a  
    333333       
    334334        _manager.tunnelFailed();
     335        tellProfileFailed(cfg);
    335336       
    336337        _lifetimeProcessed += cfg.getProcessedMessagesCount();
     
    341342                _context.clientManager().requestLeaseSet(_settings.getDestination(), ls);
    342343            }
     344        }
     345    }
     346
     347    // Blame all the other peers in the tunnel, with a probability
     348    // inversely related to the tunnel length
     349    private void tellProfileFailed(PooledTunnelCreatorConfig cfg) {
     350        int len = cfg.getLength();
     351        if (len < 2)
     352            return;
     353        int start = 0;
     354        int end = len;
     355        if (cfg.isInbound())
     356            end--;
     357        else
     358            start++;
     359        for (int i = start; i < end; i++) {
     360            int pct = 100/(len-1);
     361            // if inbound, it's probably the gateway's fault
     362            if (cfg.isInbound() && len > 2) {
     363                if (i == start)
     364                    pct *= 2;
     365                else
     366                    pct /= 2;
     367            }
     368            if (_log.shouldLog(Log.WARN))
     369                _log.warn(toString() + ": Blaming " + cfg.getPeer(i) + ' ' + pct + '%');
     370            _context.profileManager().tunnelFailed(cfg.getPeer(i), pct);
    343371        }
    344372    }
Note: See TracChangeset for help on using the changeset viewer.