Changeset af26f73


Ignore:
Timestamp:
Dec 16, 2015 2:34:05 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
8226e92
Parents:
9594660
Message:

Sybil tool tweaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/SybilRenderer.java

    r9594660 raf26f73  
    155155        buf.append("<p><b>This is an experimental network database tool for debugging and analysis. Do not panic even if you see warnings below. " +
    156156                   "Possible \"threats\" are summarized at the bottom, however these are unlikely to be real threats. " +
    157                    "If you see anything you would like to discuss with the devs, contact us on IRC #i2p-dev.</b></p>");
     157                   "If you see anything you would like to discuss with the devs, contact us on IRC #i2p-dev.</b></p>" +
     158                   "<ul><li><a href=\"#known\">FF Summary</a>" +
     159                   "</li><li><a href=\"#family\">Same Family</a>" +
     160                   "</li><li><a href=\"#ourIP\">IP close to us</a>" +
     161                   "</li><li><a href=\"#sameIP\">Same IP</a>" +
     162                   "</li><li><a href=\"#same24\">Same /24</a>" +
     163                   "</li><li><a href=\"#same16\">Same /16</a>" +
     164                   "</li><li><a href=\"#pairs\">Pair distance</a>" +
     165                   "</li><li><a href=\"#ritoday\">Close to us</a>" +
     166                   "</li><li><a href=\"#ritmrw\">Close to us tomorrow</a>" +
     167                   "</li><li><a href=\"#dht\">DHT neighbors</a>" +
     168                   "</li><li><a href=\"#dest\">Close to our destinations</a>" +
     169                   "</li><li><a href=\"#threats\">Highest threats</a>" +
     170                   "</li></ul>");
     171
    158172        renderRouterInfo(buf, _context.router().getRouterInfo(), null, true, false);
    159         buf.append("<h3>Known Floodfills: ").append(ris.size()).append("</h3>");
     173        buf.append("<h3 id=\"known\">Known Floodfills: ").append(ris.size()).append("</h3>");
    160174
    161175        double tot = 0;
     
    189203
    190204        // Distance to our router analysis
    191         buf.append("<h3>Closest Floodfills to Our Routing Key (Where we Store our RI)</h3>");
     205        buf.append("<h3 id=\"ritoday\">Closest Floodfills to Our Routing Key (Where we Store our RI)</h3>");
    192206        renderRouterInfoHTML(out, buf, ourRKey, avgMinDist, ris, points);
    193207        RouterKeyGenerator rkgen = _context.routerKeyGenerator();
    194208        Hash nkey = rkgen.getNextRoutingKey(us);
    195         buf.append("<h3>Closest Floodfills to Tomorrow's Routing Key (Where we will Store our RI)</h3>");
     209        buf.append("<h3 id=\"ritmrw\">Closest Floodfills to Tomorrow's Routing Key (Where we will Store our RI)</h3>");
    196210        renderRouterInfoHTML(out, buf, nkey, avgMinDist, ris, points);
    197211
    198         buf.append("<h3>Closest Floodfills to Our Router Hash (DHT Neighbors if we are Floodfill)</h3>");
     212        buf.append("<h3 id=\"dht\">Closest Floodfills to Our Router Hash (DHT Neighbors if we are Floodfill)</h3>");
    199213        renderRouterInfoHTML(out, buf, us, avgMinDist, ris, points);
    200214
    201215        // Distance to our published destinations analysis
     216        buf.append("<h3 id=\"dest\">Floodfills Close to Our Destinations</h3>");
    202217        Map<Hash, TunnelPool> clientInboundPools = _context.tunnelManager().getInboundClientPools();
    203218        List<Hash> destinations = new ArrayList<Hash>(clientInboundPools.keySet());
     
    228243            List<Hash> warns = new ArrayList<Hash>(points.keySet());
    229244            Collections.sort(warns, new PointsComparator(points));
    230             buf.append("<h3>Routers with Most Threat Points</h3>");
     245            buf.append("<h3 id=\"threats\">Routers with Most Threat Points</h3>");
    231246            for (Hash h : warns) {
    232247                RouterInfo ri = _context.netDb().lookupRouterInfoLocally(h);
     
    287302        buf.append("<h3>Average Floodfill Distance is ").append(fmt.format(avg)).append("</h3>");
    288303
    289         buf.append("<h3>Closest Floodfill Pairs by Hash</h3>");
     304        buf.append("<h3 id=\"pairs\">Closest Floodfill Pairs by Hash</h3>");
    290305        for (Pair p : pairs) {
    291306            double distance = biLog2(p.dist);
     
    364379        if (ourIP == null)
    365380            return;
    366         buf.append("<h3>Floodfills close to Our IP</h3>");
     381        buf.append("<h3 \"ourIP\">Floodfills close to Our IP</h3>");
    367382        boolean found = false;
    368383        for (RouterInfo info : ris) {
     
    397412
    398413    private void renderIPGroups32(Writer out, StringBuilder buf, List<RouterInfo> ris, Map<Hash, Points> points) throws IOException {
    399         buf.append("<h3>Floodfills with the Same IP</h3>");
     414        buf.append("<h3 id=\"sameIP\">Floodfills with the Same IP</h3>");
    400415        ObjectCounter<Integer> oc = new ObjectCounter<Integer>();
    401416        for (RouterInfo info : ris) {
     
    450465
    451466    private void renderIPGroups24(Writer out, StringBuilder buf, List<RouterInfo> ris, Map<Hash, Points> points) throws IOException {
    452         buf.append("<h3>Floodfills in the Same /24 (2 minimum)</h3>");
     467        buf.append("<h3 id=\"same24\">Floodfills in the Same /24 (2 minimum)</h3>");
    453468        ObjectCounter<Integer> oc = new ObjectCounter<Integer>();
    454469        for (RouterInfo info : ris) {
     
    499514
    500515    private void renderIPGroups16(Writer out, StringBuilder buf, List<RouterInfo> ris, Map<Hash, Points> points) throws IOException {
    501         buf.append("<h3>Floodfills in the Same /16 (4 minimum)</h3>");
     516        buf.append("<h3 id=\"same16\">Floodfills in the Same /16 (4 minimum)</h3>");
    502517        ObjectCounter<Integer> oc = new ObjectCounter<Integer>();
    503518        for (RouterInfo info : ris) {
     
    595610                if (heard > 0) {
    596611                    long age = Math.max(now - heard, 1);
    597                     if (age < DAY) {
    598                         // .125 point for every hour under 24, max 3 points
    599                         double point = Math.min(3.0d, (DAY - age) / (DAY / 3.0d));
     612                    if (age < 2 * DAY) {
     613                        // .125 point for every hour under 48, max 6 points
     614                        double point = Math.min(6.0d, (2 * DAY - age) / (2 * DAY / 6.0d));
    600615                        addPoints(points, h, point,
    601616                                  "First heard about: " + _t("{0} ago", DataHelper.formatDuration2(age)));
Note: See TracChangeset for help on using the changeset viewer.