- Direct Known Subclasses:
DummyNetworkDatabaseSegmentor, FloodfillNetworkDatabaseSegmentor
The benefit of this is that we can use this to provide an effective barrier against "Context-Confusion" attacks which exploit the fact that messages sent to clients can update the routing table used by a floodfill, providing evidence that the floodfill hosts the corresponding client. When applied correctly, so that every client uses a unique subDb, the entire class of attack should be neutralized.
The drawback of this is that it makes the netDb less efficient. Clients and Floodfills who share a netDb can update the tables used by those netDbs when a Client encounters an entry obtained by a Floodfill or vice-versa. Clients also must sometimes search the netDb for keys that are owned by other clients or by a co-located Floodfill, if one exists.
In some contexts, it makes sense to view all the tables at once, especially when viewing information from the UI. The functions 'getLeases*', 'getRouters*', and 'getLocalClient*' are provided for this purpose.
In the future, this could also be extended to provide Whanau-like functionality by determining when clients and the local floodfill disagree on the content of a leaseSet.
See implementation: FloodfillNetworkDatabaseSegmentor.
Constructor Summary
ConstructorsConstructorDescriptionConstructor for segmented NetDb implementations, which supply their segments after construction.Method Summary
All MethodsModifier and TypeMethodDescriptionabstract NetworkDatabaseFacadeclientNetDB(Hash dbid) A client netDb for a given client Hash identifier.abstract NetworkDatabaseFacadeThe main netDb, the one which is used if we're a floodfill.abstract voidshutdown()Shut down the network databases.abstract voidstartup()Start up the network databases.
Constructor Details
SegmentedNetworkDatabaseFacade
public SegmentedNetworkDatabaseFacade()Constructor for segmented NetDb implementations, which supply their segments after construction.
Method Details
mainNetDB
The main netDb, the one which is used if we're a floodfill.- Returns:
- may be null if main netDb is not initialized
clientNetDB
A client netDb for a given client Hash identifier. Will never return the mainNetDB.- Parameters:
dbid- the destination hash naming which client sub-database to use- Returns:
- may be null if the client netDb does not exist
shutdown
public abstract void shutdown()Shut down the network databases.startup
public abstract void startup()Start up the network databases.