Compound Module KademliaModules

Package: oversim.overlay.kademlia
File: src/overlay/kademlia/Kademlia.ned

Implementation of the Kademlia DHT overlay as described in "Kademlia: A peer-to-peer information system based on the XOR metric" by P. Maymounkov and D. Mazieres, published in "In Proceedings of IPTPS02"

Author: Sebastian Mies, Ingmar Baumgart, Bernhard Heep

Kademlia

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.

Gates:

Name Direction Size Description
udpIn input

gate from the UDP layer

udpOut output

gate to the UDP layer

tcpIn input

gate from the TCP layer

tcpOut output

gate to the TCP layer

appIn input

gate from the application

appOut output

gate to the application

Unassigned submodule parameters:

Name Type Default value Description
kademlia.rpcUdpTimeout double

default timeout value for direct RPCs

kademlia.rpcKeyTimeout double

default timeout value for routed RPCs

kademlia.optimizeTimeouts bool

calculate timeouts from measured RTTs and network coordinates

kademlia.rpcExponentialBackoff bool

if true, doubles the timeout for every retransmission

kademlia.localPort int

UDP port for overlay messages

kademlia.overlayId int

identifies the overlay this node belongs to (used for multiple overlays)

kademlia.debugOutput bool

enable debug output

kademlia.keyLength int

overlay key length in bits

kademlia.nodeId string

optional nodeId as string in hexadecimal notation

kademlia.useCommonAPIforward bool

enable CommonAPI forward() calls

kademlia.drawOverlayTopology bool

draw arrow to successor node?

kademlia.hopCountMax int

maximum number of overlay hops

kademlia.recNumRedundantNodes int

numRedundantNodes for recursive routing

kademlia.joinOnApplicationRequest bool

only join the overlay on application request

kademlia.collectPerHopDelay bool

delay statistics for single hops

kademlia.routeMsgAcks bool

use RPCs for route messages

kademlia.lookupRedundantNodes int

number of next hops in each step

kademlia.lookupParallelPaths int

number of parallel paths

kademlia.lookupParallelRpcs int

number of nodes to ask in parallel

kademlia.lookupVerifySiblings bool

true, if siblings need to be authenticated with a ping

kademlia.lookupMajoritySiblings bool

true, if sibling candidates are selected by a majority decision if using parallel paths

kademlia.lookupMerge bool

true, if parallel Rpc results should be merged

kademlia.lookupFailedNodeRpcs bool

communicate failed nodes

kademlia.lookupStrictParallelRpcs bool

limited the number of concurrent rpcs to parameter parallelRpcs

kademlia.lookupUseAllParallelResponses bool

merge all parallel responses from earlier steps

kademlia.lookupNewRpcOnEveryTimeout bool

send a new RPC immediately after an RPC timeouts

kademlia.lookupNewRpcOnEveryResponse bool

send a new RPC after every response, even if there was no progress

kademlia.lookupFinishOnFirstUnchanged bool

finish lookup, if the last pending RPC returned without progress

kademlia.lookupVisitOnlyOnce bool

if true, the same node is never asked twice during a single lookup

kademlia.lookupAcceptLateSiblings bool

if true, a FindNodeResponse with sibling flag set is always accepted, even if it is from a previous lookup step

kademlia.routingType string

default routing mode (iterative, semi-recursive,...)

kademlia.rejoinOnFailure bool

rejoin after loosing connection to the overlay?

kademlia.sendRpcResponseToLastHop bool

needed by KBR protocols for NAT support

kademlia.recordRoute bool

record visited hops on route

kademlia.dropFindNodeAttack bool

if node is malicious, it tries a findNode attack

kademlia.isSiblingAttack bool

if node is malicious, it tries a isSibling attack

kademlia.invalidNodesAttack bool

if node is malicious, it tries a invalidNode attack

kademlia.dropRouteMessageAttack bool

if node is malicious, it drops all received BaseRouteMessages

kademlia.measureAuthBlock bool

if true, measure the overhead of signatures in rpc messages

kademlia.restoreContext bool

if true, a node rejoins with its old nodeId and malicious state

kademlia.minSiblingTableRefreshInterval double

siblingTable refresh delay

kademlia.minBucketRefreshInterval double

bucket refresh delay

kademlia.siblingPingInterval double

interval in which all siblings get pinged (0 to disable)

kademlia.maxStaleCount int

number of timeouts before node removal

kademlia.k int

number of paths (size of k-bucket)

kademlia.b int

network diameter O(log_{2^(b)})

kademlia.s int

number of siblings

kademlia.exhaustiveRefresh bool

if true, use exhaustive-iterative lookups to refresh buckets

kademlia.pingNewSiblings bool

ping new unknown siblings?

kademlia.secureMaintenance bool

if true, ping not authenticated nodes before adding them to a bucket

kademlia.newMaintenance bool
kademlia.enableReplacementCache bool

enables the replacement cache to store nodes if a bucket is full

kademlia.replacementCachePing bool

ping the least recently used node in a full bucket, when a node is added to the replacement cache

kademlia.replacementCandidates int

maximum number of candidates in the replacement cache for each bucket

kademlia.siblingRefreshNodes int

number of redundant nodes for exhaustive sibling table refresh lookups (0 = numRedundantNodes)

kademlia.bucketRefreshNodes int

number of redundant nodes for exhaustive bucket refresh lookups (0 = numRedundantNodes)

kademlia.activePing bool

R/Kademlia

kademlia.proximityRouting bool

enable proximity routing (recursive only)

kademlia.proximityNeighborSelection bool

enable proximity neighbor selection

kademlia.altRecMode bool

use source-routing mode instead of direct mode

Source code:

//
// Implementation of the Kademlia DHT overlay as described in
// "Kademlia: A peer-to-peer information system based on the XOR metric"
// by P. Maymounkov and D. Mazieres, published in "In Proceedings of IPTPS02"
//
// @author Sebastian Mies, Ingmar Baumgart, Bernhard Heep
//
module KademliaModules like IOverlay
{
    gates:
        input udpIn;    // gate from the UDP layer
        output udpOut;  // gate to the UDP layer
        input tcpIn;    // gate from the TCP layer
        output tcpOut;    // gate to the TCP layer
        input appIn;    // gate from the application
        output appOut;  // gate to the application

    submodules:
        kademlia: Kademlia {
            parameters:
                @display("p=60,60;i=block/circle");

        }
    connections allowunconnected:
        udpIn --> kademlia.udpIn;
        udpOut <-- kademlia.udpOut;
        appIn --> kademlia.appIn;
        appOut <-- kademlia.appOut;
}