|
OverSim
|
Routing table module. More...
#include <PastryRoutingTable.h>
Public Member Functions | |
| void | initializeTable (uint32_t bitsPerDigit, double repairTimeout, const NodeHandle &owner) |
| Initializes the routing table. | |
| const NodeHandle & | lookupNextHop (const OverlayKey &destination) |
| gets the next hop according to the Pastry routing scheme. | |
| virtual const NodeHandle & | findCloserNode (const OverlayKey &destination, bool optimize=false) |
| try to find a node numerically closer to a given key with the same shared prefix as the current node in the routing table. | |
| void | findCloserNodes (const OverlayKey &destination, NodeVector *nodes) |
| virtual const TransportAddress & | failedNode (const TransportAddress &failed) |
| tells the routing table that a node has failed | |
| virtual const TransportAddress & | repair (const PastryStateMessage *msg, const PastryStateMsgProximity *prox) |
| attempt to repair the routing using a received REPAIR message | |
| virtual void | dumpToStateMessage (PastryStateMessage *msg) const |
| dump content of the table to a PastryStateMessage | |
| virtual void | dumpRowToMessage (PastryStateMessage *msg, int row) const |
| dump content of a single row of the routing table to a state message | |
| int | getLastRow () |
| gets the number of rows in the routing table | |
| std::vector< TransportAddress > * | getRow (uint8_t row) const |
| virtual const TransportAddress & | getRandomNode (int row) |
| returns a random node from the routing table | |
| bool | mergeNode (const NodeHandle &node, simtime_t prox) |
| merge a node in the IRoutingTable | |
| bool | initStateFromHandleVector (const std::vector< PastryStateMsgHandle > &handles) |
| initialize table from vector of PastryStateMsgHandles with STATE messages received during JOIN phase. | |
| virtual void | dumpToVector (std::vector< TransportAddress > &affected) const |
| appends all routing table entries to a given vector of TransportAddresses, needed to find all Nodes to be notified after joining. | |
Public Member Functions inherited from PastryStateObject | |
| void | handleMessage (cMessage *msg) |
| int | numInitStages (void) const |
| void | initialize (int stage) |
| virtual const NodeHandle & | getDestinationNode (const OverlayKey &destination) |
| gets the final node according to the Pastry routing scheme. | |
| virtual const TransportAddress & | repair (const PastryStateMessage *msg, const PastryStateMsgProximity &prox) |
| attempt to repair state using a received REPAIR message | |
| virtual bool | mergeState (const PastryStateMessage *msg, const PastryStateMsgProximity *prox) |
| update own state based on a received PastryStateMessage | |
| bool | isCloser (const NodeHandle &test, const OverlayKey &destination, const NodeHandle &reference=NodeHandle::UNSPECIFIED_NODE) const |
| test a given NodeHandle if it is closer to a given destination | |
| bool | specialCloserCondition (const NodeHandle &test, const OverlayKey &destination, const NodeHandle &reference=NodeHandle::UNSPECIFIED_NODE) const |
| test a given NodeHandle if it is closer to a given destination, but only if the shared prefix length with the destination is at least equal to the shared prefix length with our own node | |
Public Attributes | |
| uint32_t | nodesPerRow |
Private Member Functions | |
| virtual void | earlyInit (void) |
| void | addRow (void) |
| adds a new line to the routing table | |
| uint32_t | digitAt (uint32_t n, const OverlayKey &key) const |
| returns n'th pastry digit from a key | |
| const PastryExtendedNode & | nodeAt (uint32_t row, uint32_t col) const |
| returns routing table entry at specified position | |
| void | findNextNodeToAsk (PRTTrackRepair &track) const |
| helper function, updates a PRTTrackRepair structure to point to the next node that can be asked for repair | |
Private Attributes | |
| double | repairTimeout |
| std::vector< PRTRow > | rows |
| std::vector< PRTTrackRepair > | awaitingRepair |
Additional Inherited Members | |
Static Protected Member Functions inherited from PastryStateObject | |
| static const PastryExtendedNode & | unspecNode () |
Protected Attributes inherited from PastryStateObject | |
| NodeHandle | owner |
| stores the NodeHandle of the owner of this PastryStateObject. | |
| uint32_t | bitsPerDigit |
Routing table module.
This module contains the routing table of the Chord implementation.
Definition at line 64 of file PastryRoutingTable.h.
|
private |
adds a new line to the routing table
Definition at line 354 of file PastryRoutingTable.cc.
Referenced by initializeTable(), and mergeNode().
|
private |
returns n'th pastry digit from a key
| n | which digit to return |
| key | extract digit from this key |
Definition at line 29 of file PastryRoutingTable.cc.
Referenced by addRow(), findCloserNode(), lookupNextHop(), and mergeNode().
|
virtual |
dump content of a single row of the routing table to a state message
| msg | the state message to be filled with entries |
| row | the number of the row |
Definition at line 217 of file PastryRoutingTable.cc.
Referenced by BasePastry::createStateMessage().
|
virtual |
dump content of the table to a PastryStateMessage
| msg | the PastryStateMessage to be filled with entries |
Implements PastryStateObject.
Definition at line 196 of file PastryRoutingTable.cc.
Referenced by BasePastry::createStateMessage().
|
virtual |
appends all routing table entries to a given vector of TransportAddresses, needed to find all Nodes to be notified after joining.
| affected | the vector to fill with routing table entries |
Implements PastryStateObject.
Definition at line 342 of file PastryRoutingTable.cc.
Referenced by Pastry::changeState(), and Pastry::doSecondStage().
|
privatevirtual |
Definition at line 37 of file PastryRoutingTable.cc.
|
virtual |
tells the routing table that a node has failed
| failed | the failed node |
Implements PastryStateObject.
Definition at line 378 of file PastryRoutingTable.cc.
Referenced by Bamboo::handleFailedNode(), and Pastry::handleFailedNode().
|
virtual |
try to find a node numerically closer to a given key with the same shared prefix as the current node in the routing table.
this method is to be called, when a regular next hop couldn't be found or wasn't reachable.
| destination | the destination key |
| optimize | if set, check all nodes and return the best/closest one |
Implements PastryStateObject.
Definition at line 96 of file PastryRoutingTable.cc.
Referenced by BasePastry::findNode().
|
virtual |
Implements PastryStateObject.
Definition at line 179 of file PastryRoutingTable.cc.
Referenced by BasePastry::findNode().
|
private |
helper function, updates a PRTTrackRepair structure to point to the next node that can be asked for repair
| track | the PRTTrackRepair structure |
Definition at line 466 of file PastryRoutingTable.cc.
Referenced by failedNode(), and repair().
| int PastryRoutingTable::getLastRow | ( | ) |
gets the number of rows in the routing table
Definition at line 264 of file PastryRoutingTable.cc.
Referenced by Pastry::doRoutingTableMaintenance(), Bamboo::getNextRowToMaintain(), BasePastry::getRTLastRow(), and BasePastry::handleRequestRoutingRowCall().
|
virtual |
returns a random node from the routing table
| row | the row to choose a random node from |
Definition at line 270 of file PastryRoutingTable.cc.
Referenced by Bamboo::doLocalTuning(), and Pastry::doRoutingTableMaintenance().
| std::vector< TransportAddress > * PastryRoutingTable::getRow | ( | uint8_t | row | ) | const |
Definition at line 247 of file PastryRoutingTable.cc.
Referenced by BasePastry::getRTRow().
| void PastryRoutingTable::initializeTable | ( | uint32_t | bitsPerDigit, |
| double | repairTimeout, | ||
| const NodeHandle & | owner | ||
| ) |
Initializes the routing table.
This should be called on startup
| bitsPerDigit | Pastry configuration parameter |
| repairTimeout | Pastry configuration parameter |
| owner | the node this table belongs to |
Definition at line 43 of file PastryRoutingTable.cc.
Referenced by BasePastry::baseChangeState().
| bool PastryRoutingTable::initStateFromHandleVector | ( | const std::vector< PastryStateMsgHandle > & | handles | ) |
initialize table from vector of PastryStateMsgHandles with STATE messages received during JOIN phase.
The vector has to be sorted by JoinHopCount of the messages
| handles | the vector of PastryStateMsgHandles |
Definition at line 329 of file PastryRoutingTable.cc.
Referenced by Pastry::mergeState().
| const NodeHandle & PastryRoutingTable::lookupNextHop | ( | const OverlayKey & | destination | ) |
gets the next hop according to the Pastry routing scheme.
| destination | the destination key |
Definition at line 73 of file PastryRoutingTable.cc.
Referenced by BasePastry::findNode().
|
virtual |
merge a node in the IRoutingTable
| node | the node to merge |
| prox | proximity value of the node |
Implements PastryStateObject.
Definition at line 297 of file PastryRoutingTable.cc.
Referenced by Bamboo::lookupFinished(), and BasePastry::proxCallback().
|
private |
returns routing table entry at specified position
| row | the number of the row |
| col | the number of the column |
Definition at line 63 of file PastryRoutingTable.cc.
Referenced by findCloserNode(), findCloserNodes(), findNextNodeToAsk(), lookupNextHop(), and repair().
|
virtual |
attempt to repair the routing using a received REPAIR message
| msg | the state message of type REPAIR |
| prox | record of proximity values matching the state message |
Definition at line 417 of file PastryRoutingTable.cc.
Referenced by Pastry::checkProxCache().
|
private |
Definition at line 188 of file PastryRoutingTable.h.
Referenced by failedNode(), initializeTable(), and repair().
| uint32_t PastryRoutingTable::nodesPerRow |
Definition at line 182 of file PastryRoutingTable.h.
Referenced by addRow(), dumpRowToMessage(), dumpToStateMessage(), findCloserNode(), findCloserNodes(), findNextNodeToAsk(), getRandomNode(), initializeTable(), and nodeAt().
|
private |
Definition at line 186 of file PastryRoutingTable.h.
Referenced by initializeTable(), and repair().
|
private |
Definition at line 187 of file PastryRoutingTable.h.
Referenced by addRow(), dumpRowToMessage(), dumpToStateMessage(), dumpToVector(), earlyInit(), failedNode(), findCloserNode(), findCloserNodes(), findNextNodeToAsk(), getLastRow(), getRandomNode(), getRow(), initializeTable(), lookupNextHop(), mergeNode(), and nodeAt().