C# Class Brunet.Graph.Graph

Graph provides the ability to test routing algorithms for ring-based structured p2p networks
Key features provided by Graph include support for Tunnels, latency, hop count, user specified latency, tweaking of network size, near neighbor count, shortcut count.
Afficher le fichier Open project: pstjuste/brunet Class Usage Examples

Protected Properties

Свойство Type Description
_addr_to_index int>.Dictionary
_addr_to_node GraphNode>.Dictionary
_addrs List
_latency_map List>
_rand System.Random

Méthodes publiques

Méthode Description
AllToAll ( ) : void
Average ( List data ) : double

Calculates the average of a data set.

BoundedBroadcast ( AHAddress caller, AHAddress from, AHAddress to ) : int

Performs the bounded broadcast using recursion.

Broadcast ( ) : int

Performs a broadcast to the entire overlay.

Broadcast ( AHAddress from ) : int

Performs a broadcast to the entire overlay.

BroadcastAverage ( ) : void
Crawl ( ) : void

Crawls the network using a random address in the network.

Crawl ( AHAddress start ) : void

Crawls the network using the given starting address.

DhtQuery ( AHAddress from, byte key ) : int
GetLeftNearTarget ( AHAddress address ) : AHAddress

Calculate the Left AHAddress of the given address.

GetNearTarget ( AHAddress address ) : AHAddress
Graph ( int count, int near, int shortcuts ) : Brunet.Collections
Graph ( int count, int near, int shortcuts, int seed ) : Brunet.Collections
Graph ( int count, int near, int shortcuts, int random_seed, List dataset ) : Brunet.Collections
ReadLatencyDataSet ( string dataset ) : List>

Loads a square matrix based latency data set from a file.

SendPacket ( AHAddress from, AHAddress to ) : List

Sends a packet from A to B returning the delay and hop count using the Greedy Routing Algorithm.

SendPacket ( AHAddress from, AHAddress to, ushort option ) : List

Sends a packet from A to B returning the delay and hop count.

StandardDeviation ( List data, double avg ) : double

Calculates the standard deviation given a data set and the average.

WriteGraphFile ( string outfile ) : void

Creates a Dot file which can generate an image using either neato with using the -n parameter or circo.

Méthodes protégées

Méthode Description
AddConnection ( GraphNode node1, GraphNode node2, int delay ) : void

Creates an edge and a connection from node2 to node1 including the edge. Note: this is unidirectional, this must be called twice, swapping node1 with node2 for a connection to be complete.

CalculateDelay ( GraphNode node1, GraphNode node2 ) : int

Calculates the delay between two nodes.

ComputeShortcutTarget ( AHAddress addr ) : AHAddress

Calculates a shortcut using a harmonic distribution as in a Symphony-lke shortcut.

CreateNode ( AHAddress addr ) : GraphNode

Let the inheritor create their own node types

FindNodeNearestToAddress ( AHAddress addr ) : AHAddress
FixLists ( ) : void
GenerateAddress ( ) : AHAddress
MapToRing ( byte key ) : Brunet.Util.MemBlock[]

Method Details

AddConnection() protected méthode

Creates an edge and a connection from node2 to node1 including the edge. Note: this is unidirectional, this must be called twice, swapping node1 with node2 for a connection to be complete.
protected AddConnection ( GraphNode node1, GraphNode node2, int delay ) : void
node1 GraphNode
node2 GraphNode
delay int
Résultat void

AllToAll() public méthode

public AllToAll ( ) : void
Résultat void

Average() public static méthode

Calculates the average of a data set.
public static Average ( List data ) : double
data List
Résultat double

BoundedBroadcast() public méthode

Performs the bounded broadcast using recursion.
public BoundedBroadcast ( AHAddress caller, AHAddress from, AHAddress to ) : int
caller AHAddress
from AHAddress
to AHAddress
Résultat int

Broadcast() public méthode

Performs a broadcast to the entire overlay.
public Broadcast ( ) : int
Résultat int

Broadcast() public méthode

Performs a broadcast to the entire overlay.
public Broadcast ( AHAddress from ) : int
from AHAddress
Résultat int

BroadcastAverage() public méthode

public BroadcastAverage ( ) : void
Résultat void

CalculateDelay() protected méthode

Calculates the delay between two nodes.
protected CalculateDelay ( GraphNode node1, GraphNode node2 ) : int
node1 GraphNode
node2 GraphNode
Résultat int

ComputeShortcutTarget() protected méthode

Calculates a shortcut using a harmonic distribution as in a Symphony-lke shortcut.
protected ComputeShortcutTarget ( AHAddress addr ) : AHAddress
addr AHAddress
Résultat AHAddress

Crawl() public méthode

Crawls the network using a random address in the network.
public Crawl ( ) : void
Résultat void

Crawl() public méthode

Crawls the network using the given starting address.
public Crawl ( AHAddress start ) : void
start AHAddress
Résultat void

CreateNode() protected méthode

Let the inheritor create their own node types
protected CreateNode ( AHAddress addr ) : GraphNode
addr AHAddress
Résultat GraphNode

DhtQuery() public méthode

public DhtQuery ( AHAddress from, byte key ) : int
from AHAddress
key byte
Résultat int

FindNodeNearestToAddress() protected méthode

protected FindNodeNearestToAddress ( AHAddress addr ) : AHAddress
addr AHAddress
Résultat AHAddress

FixLists() protected méthode

protected FixLists ( ) : void
Résultat void

GenerateAddress() protected méthode

protected GenerateAddress ( ) : AHAddress
Résultat AHAddress

GetLeftNearTarget() public méthode

Calculate the Left AHAddress of the given address.
public GetLeftNearTarget ( AHAddress address ) : AHAddress
address AHAddress
Résultat AHAddress

GetNearTarget() public méthode

public GetNearTarget ( AHAddress address ) : AHAddress
address AHAddress
Résultat AHAddress

Graph() public méthode

public Graph ( int count, int near, int shortcuts ) : Brunet.Collections
count int
near int
shortcuts int
Résultat Brunet.Collections

Graph() public méthode

public Graph ( int count, int near, int shortcuts, int seed ) : Brunet.Collections
count int
near int
shortcuts int
seed int
Résultat Brunet.Collections

Graph() public méthode

public Graph ( int count, int near, int shortcuts, int random_seed, List dataset ) : Brunet.Collections
count int The network size not including the clusters.
near int The amount of connections on the left or right of a ///node.
shortcuts int The amount of far connections had per node.
random_seed int
dataset List A square dataset consisting of pairwise latencies.
Résultat Brunet.Collections

MapToRing() protected méthode

protected MapToRing ( byte key ) : Brunet.Util.MemBlock[]
key byte
Résultat Brunet.Util.MemBlock[]

ReadLatencyDataSet() public static méthode

Loads a square matrix based latency data set from a file.
public static ReadLatencyDataSet ( string dataset ) : List>
dataset string
Résultat List>

SendPacket() public méthode

Sends a packet from A to B returning the delay and hop count using the Greedy Routing Algorithm.
public SendPacket ( AHAddress from, AHAddress to ) : List
from AHAddress
to AHAddress
Résultat List

SendPacket() public méthode

Sends a packet from A to B returning the delay and hop count.
public SendPacket ( AHAddress from, AHAddress to, ushort option ) : List
from AHAddress
to AHAddress
option ushort
Résultat List

StandardDeviation() public static méthode

Calculates the standard deviation given a data set and the average.
public static StandardDeviation ( List data, double avg ) : double
data List
avg double
Résultat double

WriteGraphFile() public méthode

Creates a Dot file which can generate an image using either neato with using the -n parameter or circo.
public WriteGraphFile ( string outfile ) : void
outfile string
Résultat void

Property Details

_addr_to_index protected_oe property

protected Dictionary _addr_to_index
Résultat int>.Dictionary

_addr_to_node protected_oe property

protected Dictionary _addr_to_node
Résultat GraphNode>.Dictionary

_addrs protected_oe property

protected List _addrs
Résultat List

_latency_map protected_oe property

protected List> _latency_map
Résultat List>

_rand protected_oe property

protected Random,System _rand
Résultat System.Random