| Modifier and Type | Field and Description |
|---|---|
static String |
APP_NAME
The name we register with the ClientAppManager.
|
static boolean |
DEFAULT_BLOCK |
static double |
DEFAULT_BLOCK_THRESHOLD |
static long |
DEFAULT_BLOCK_TIME |
static long |
DEFAULT_FREQUENCY |
static long |
DEFAULT_REMOVE_TIME |
static int |
MAX |
static float |
MIN_BLOCK_POINTS |
static double |
MIN_CLOSE |
static int |
PAIRMAX |
static String |
PROP_BLOCK |
static String |
PROP_BLOCKTIME |
static String |
PROP_FREQUENCY |
static String |
PROP_NONFF |
static String |
PROP_REMOVETIME |
static String |
PROP_THRESHOLD |
static long |
SHORT_REMOVE_TIME |
| Modifier and Type | Method and Description |
|---|---|
void |
addProfilePoints(List<RouterInfo> ris,
Map<Hash,Points> points)
Analyzes router profiles and adds Sybil points for banlisted, newly observed,
or poorly performing routers.
|
void |
addVersionPoints(List<RouterInfo> ris,
Map<Hash,Points> points)
Analyzes router versions and adds Sybil points for old, unreachable,
or non-floodfill routers.
|
Map<Hash,Points> |
backgroundAnalysis(boolean includeAll)
Analyze threats.
|
Map<Integer,List<RouterInfo>> |
calculateIPGroups16(List<RouterInfo> ris,
Map<Hash,Points> points)
Categorize routers by their /16 subnet to identify routers in the same /16 network.
|
Map<Integer,List<RouterInfo>> |
calculateIPGroups24(List<RouterInfo> ris,
Map<Hash,Points> points)
Categorize routers by their /24 subnet to identify routers in the same /24 network.
|
Map<Integer,List<RouterInfo>> |
calculateIPGroups32(List<RouterInfo> ris,
Map<Hash,Points> points)
Categorize routers by their IP address to identify routers sharing the same IP.
|
Map<Long,List<RouterInfo>> |
calculateIPGroups48(List<RouterInfo> ris,
Map<Hash,Points> points)
Categorize routers by their IPv6 /48 subnet to identify routers in the same /48 network.
|
Map<Long,List<RouterInfo>> |
calculateIPGroups64(List<RouterInfo> ris,
Map<Hash,Points> points)
Categorize routers by their IPv6 /64 subnet to identify routers in the same /64 network.
|
Map<String,List<RouterInfo>> |
calculateIPGroupsFamily(List<RouterInfo> ris,
Map<Hash,Points> points)
Categorize routers by their router family to identify routers in the same family.
|
void |
calculateIPGroupsUs(List<RouterInfo> ris,
Map<Hash,Points> points,
List<RouterInfo> ri32,
List<RouterInfo> ri24,
List<RouterInfo> ri16,
List<RouterInfo> ri64,
List<RouterInfo> ri48)
Categorize routers by their proximity to our IP address, grouping them by /32, /24, /16
for IPv4 and /64, /48 for IPv6.
|
double |
calculatePairDistance(List<RouterInfo> ris,
Map<Hash,Points> points,
List<Pair> pairs)
Calculate average pairwise distance between floodfills and identifies routers that are
unusually close to each other.
|
void |
calculateRouterInfo(Hash us,
String usName,
List<RouterInfo> ris,
Map<Hash,Points> points) |
List<RouterInfo> |
getAllRouters(Hash us)
Returns all routers in the network DB, excluding our own router.
|
double |
getAvgMinDist(List<RouterInfo> ris)
Calculates the average minimum distance from 200 random routing keys
to the closest router in the provided list.
|
String |
getDisplayName()
Gets the display name for this application.
|
List<RouterInfo> |
getFloodfills(Hash us)
Returns all floodfill routers, excluding our own router.
|
static Analysis |
getInstance(RouterContext ctx)
Gets the singleton Analysis instance, creating it if necessary.
|
String |
getName()
Gets the application name.
|
PersistSybil |
getPersister()
Gets the persistence handler for storing and retrieving Sybil analysis data.
|
ClientAppState |
getState()
Gets the current state of this application.
|
void |
run()
Executes the background Sybil analysis, stores results, and removes old data.
|
void |
runJob()
Actually perform the task.
|
void |
schedule()
Schedules the next Sybil analysis run based on configured frequency,
router uptime, and previous run time.
|
void |
shutdown(String[] args)
Stops the Sybil analysis service and changes state to STOPPED.
|
void |
startup()
Initializes and starts the Sybil analysis service.
|
dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringpublic static final String APP_NAME
public static final boolean DEFAULT_BLOCK
public static final double DEFAULT_BLOCK_THRESHOLD
public static final long DEFAULT_BLOCK_TIME
public static final long DEFAULT_FREQUENCY
public static final long DEFAULT_REMOVE_TIME
public static final int MAX
public static final float MIN_BLOCK_POINTS
public static final double MIN_CLOSE
public static final int PAIRMAX
public static final String PROP_BLOCK
public static final String PROP_BLOCKTIME
public static final String PROP_FREQUENCY
public static final String PROP_NONFF
public static final String PROP_REMOVETIME
public static final String PROP_THRESHOLD
public static final long SHORT_REMOVE_TIME
public void addProfilePoints(List<RouterInfo> ris, Map<Hash,Points> points)
ris - the list of router infos to analyzepoints - map to accumulate sybil pointspublic void addVersionPoints(List<RouterInfo> ris, Map<Hash,Points> points)
ris - the list of router infos to analyzepoints - map to accumulate sybil pointspublic Map<Hash,Points> backgroundAnalysis(boolean includeAll)
includeAll - false for floodfills onlypublic Map<Integer,List<RouterInfo>> calculateIPGroups16(List<RouterInfo> ris, Map<Hash,Points> points)
ris - the list of router infos to analyzepoints - map to accumulate sybil pointspublic Map<Integer,List<RouterInfo>> calculateIPGroups24(List<RouterInfo> ris, Map<Hash,Points> points)
ris - the list of router infos to analyzepoints - map to accumulate sybil pointspublic Map<Integer,List<RouterInfo>> calculateIPGroups32(List<RouterInfo> ris, Map<Hash,Points> points)
ris - the list of router infos to analyzepoints - map to accumulate sybil pointspublic Map<Long,List<RouterInfo>> calculateIPGroups48(List<RouterInfo> ris, Map<Hash,Points> points)
ris - the list of router infos to analyzepoints - map to accumulate sybil pointspublic Map<Long,List<RouterInfo>> calculateIPGroups64(List<RouterInfo> ris, Map<Hash,Points> points)
ris - the list of router infos to analyzepoints - map to accumulate sybil pointspublic Map<String,List<RouterInfo>> calculateIPGroupsFamily(List<RouterInfo> ris, Map<Hash,Points> points)
ris - the list of router infos to analyzepoints - map to accumulate sybil pointspublic void calculateIPGroupsUs(List<RouterInfo> ris, Map<Hash,Points> points, List<RouterInfo> ri32, List<RouterInfo> ri24, List<RouterInfo> ri16, List<RouterInfo> ri64, List<RouterInfo> ri48)
ris - the list of router infos to analyzepoints - map to accumulate sybil pointsri32 - out parameter for routers with same IP as usri24 - out parameter for routers in same /24 as usri16 - out parameter for routers in same /16 as usri64 - out parameter for routers in same IPv6 /64 as usri48 - out parameter for routers in same IPv6 /48 as uspublic double calculatePairDistance(List<RouterInfo> ris, Map<Hash,Points> points, List<Pair> pairs)
ris - the list of router infos to analyzepoints - map to accumulate sybil pointspairs - out parameter, sorted list of close router pairspublic void calculateRouterInfo(Hash us, String usName, List<RouterInfo> ris, Map<Hash,Points> points)
usName - HTML escapedris - will be re-sorted in placepublic List<RouterInfo> getAllRouters(Hash us)
us - our router hash to exclude from the resultspublic double getAvgMinDist(List<RouterInfo> ris)
ris - the list of router infos to analyzepublic String getDisplayName()
getDisplayName in interface ClientApppublic List<RouterInfo> getFloodfills(Hash us)
us - our router hash to exclude from the resultspublic static Analysis getInstance(RouterContext ctx)
ctx - the router contextpublic String getName()
public PersistSybil getPersister()
public ClientAppState getState()
public void run()
public void runJob()
Jobpublic void schedule()
public void shutdown(String[] args)