SOLA
|
Public Member Functions | |
JoinAlgorithmGeneral (std::shared_ptr< AccessContainer > access) | |
void | process (const MessageVariant &msg) override |
void | initiateJoin (NodeInfo &node_info) override |
void | initiateJoin (const PhysicalNodeInfo &p_node_info) override |
Public Member Functions inherited from minhton::JoinAlgorithmInterface | |
JoinAlgorithmInterface (std::shared_ptr< AccessContainer > access) | |
Public Member Functions inherited from minhton::AlgorithmInterface | |
AlgorithmInterface (std::shared_ptr< AccessContainer > access) | |
Protected Member Functions | |
virtual void | processJoin (const MessageJoin &msg)=0 |
void | processJoinAccept (const MessageJoinAccept &msg) |
void | processJoinAcceptAck (const MessageJoinAcceptAck &msg) |
void | performAcceptChild (minhton::NodeInfo entering_node, bool use_complete_balancing=false) |
void | continueAcceptChildProcedure (const minhton::MessageInformAboutNeighbors &message) noexcept(false) override |
void | performSendJoinAccept (const minhton::NodeInfo &entering_node, const minhton::NodeInfo &entering_node_adj_left, const minhton::NodeInfo &entering_node_adj_right) |
virtual uint32_t | performSendUpdateNeighborMessagesAboutEnteringNode (minhton::NodeInfo entering_node)=0 |
std::vector< minhton::NodeInfo > | getRoutingTableNeighborsForNewChild (const minhton::NodeInfo &new_child) const |
minhton::NodeInfo | calcNewChildPosition (bool use_complete_balancing=false) const |
minhton::NodeInfo | calcAdjacentLeftOfNewChild (const minhton::NodeInfo &entering_node) const |
minhton::NodeInfo | calcAdjacentRightOfNewChild (const minhton::NodeInfo &entering_node) const |
minhton::NodeInfo | calcOurNewAdjacentLeft (const minhton::NodeInfo &entering_node, const minhton::NodeInfo &entering_node_adj_right) const |
minhton::NodeInfo | calcOurNewAdjacentRight (const minhton::NodeInfo &entering_node, const minhton::NodeInfo &entering_node_adj_left) const |
bool | mustSendUpdateLeft (const minhton::NodeInfo &entering_node_adj_right) const |
bool | mustSendUpdateRight (const minhton::NodeInfo &entering_node_adj_left) const |
minhton::NodeInfo | getCloserAdjacent (const minhton::NodeInfo &entering_node, const minhton::NodeInfo &alleged_adjacent) const |
void | allUpdatesAcknowledged () |
Protected Member Functions inherited from minhton::AlgorithmInterface | |
void | send (const MessageVariant &msg) |
std::shared_ptr< RoutingInformation > | getRoutingInfo () const |
NodeInfo | getSelfNodeInfo () const |
Protected Attributes | |
PhysicalNodeInfo | last_join_info_ |
Protected Attributes inherited from minhton::AlgorithmInterface | |
std::shared_ptr< AccessContainer > | access_ |
Additional Inherited Members | |
Static Public Member Functions inherited from minhton::JoinAlgorithmInterface | |
static std::vector< MessageType > | getSupportedMessageTypes () |
|
protected |
Calculates the new adjacent left of the entering node, which we accept as our child.
Typical usage:
entering_node | the node that we accept as a child |
|
protected |
Calculates the new adjacent right of the entering node, which we accept as our child.
Typical usage:
entering_node | the node that we accept as a child |
|
protected |
Looks for the position of a new free child. The position which is horizontally closest to root is chosen when the tree has a general null balance. For complete balancing the first free position from left to right is chosen. This method is only used in the perform accept child procedure.
Typical usage:
use_complete_balancing | choose if the complete balancing (necessary for the MINHTON join algorithm) has to be used |
First we have to intialize the worst case distance to root, because we want to find the child position with the shortest horizontal distance to root.
In the for loop we are looking at each child position, which is uninitialized (nullptr). The distance to root gets calculated with the tree mapper. If our distance is shorter, we save it. In the end we create a NodeInfo object with the calculated position.
If there is no free child position, we return nullptr.
|
protected |
Calculates the new adjacent left for us, which might change when we accept the entering node as a new child.
For this we must have already calculated the new adjacent right of the entering node.
Typical usage:
entering_node | the node that we accept as a child |
Helper method to calculatet our own adjacent left in the accept child procedure
|
protected |
Calculates the new adjacent right for us, which might change when we accept the entering node as a new child.
For this we must have already calculated the new adjacent left of the entering node.
Typical usage:
entering_node | the node that we accept as a child |
Helper method to calculatet our own adjacent left in the accept child procedure
|
overrideprotectedvirtualnoexcept |
We had to pause the join accept procedure to get information about the correct adjacents for the entering node.
We received this information in the InformAboutNeighbors message and check if we now got actually the closest adjacent.
If yes we can procede and send the join accept message to the entering node.
Typical Usage:
message | the message contining information about the correct adjacents |
Implements minhton::JoinAlgorithmInterface.
|
protected |
Helper method for the join accept procedure.
With higher fanouts in some cases the parent is not able to calculate the correct adjacent neighbor of an entering node.
In this case we must check with the horizontal value if there might be another node which is closer to the entering node, than the allegedly adjacent node the parent calculated.
For this our children have to be set correctly, because we may not calculate a closer adjacent as one of our children which do not exist yet.
This method is probably taking A LOT OF TIME in bigger trees and must be optimized eventually! We iterate through almost the whole tree and calculate all tree mapper values. It should be possible to reduce the calculation to only a part of the tree.
Typical usage:
entering_node | new child of the parent which wants to enter the network |
alleged_adjacent | the closest adjacent node the parent knows for the new child |
|
protected |
Returning all existing routing table neighbor information for a new given child.
When we accept a new child we need to give it also its routing table information.
Because of the BATON theorem we have information about all the existing routing table neighbors of the new child through out routing table neighbor children, because we are its parent.
Typical usage:
new_child | that we are the parent of |
e.g. fanout 2, we are 1:0 and entering node is 2:0 if 2:1 and 2:2 will be rt routing table neighbors of 2:0 if they exist, we know them through routing table neighbor children and return them
|
overridevirtual |
Sending the initial Join message for a node to join the network. Only for join via address, not bootstrap.
p_node_info | address to send initial join to |
Implements minhton::JoinAlgorithmInterface.
|
overridevirtual |
Sending the initial Join message for a node to join the network. Only for join via nodeinfo with address, not bootstrap.
node_info | node to send initial join to |
Implements minhton::JoinAlgorithmInterface.
|
protected |
Calculates whether we have to send a update left message or not.
Typical usage:
entering_node_adj_right | the adjacent right of the entering node, as calculated previously |
Checking if we must send an update to the adjacent left in the accept child procedure
|
protected |
Calculates whether we have to send a update right message or not.
Typical usage:
entering_node_adj_left | the adjacent left of the entering node, as calculated previously |
Checking if we must send an update to the adjacent right in the accept child procedure
|
protected |
Initializing the procedure to accept a child.
Calculating all relevant information for the entering_node
/ new child and sending those information via a JOIN_ACCEPT Message to the entering_node
.
If we do not have information to the adjacents we need to send GET_NEIGHBORS messages to get the information and pause the procedure.
Typical Usage:
entering_node | the node who wants to enter the network |
use_complete_balancing | choose if the complete balancing (necessary for the MINHTON join algorithm) has to be used |
CHECK
We need to check here first that our FSM state is kConnected. Nothing else! E.g. if we are in the kConnectedReplacing, we are just trying to replace another node, and accepting a new child at the same time would be a very bad idea. How would we forward the join message backwards if this happens?
Also if we are in kConnectedAcceptingChild state, we might be accepting too many children at the same time. Important Question: What should we do, if the network is getting too many join requests at the same time, and the join algorithm is forwarding all of them to the same node - so that all join messages end up at the same node, who thinks he could accept all of them.
|
protected |
Gathering all information for the entering node and sending a JOIN_ACCEPT message.
Typical Usage:
entering_node | the node who wants to enter the network |
entering_node_adj_left | adjacent left neighbor of the entering node |
entering_node_adj_right | adjacent right neighbor of the entering node |
|
protectedpure virtual |
Helper method for the perform accept child procedure.
Sending UPDATE_ROUTING_TABLE_NEIGHBOR_CHILD messages with the entering_node as the node to inform to each of our routing table neighbors, because those nodes have the entering_node as a routing table neighbor child.
Typical Usage:
entering_node | the node who wants to enter the network |
Implemented in minhton::MinhtonJoinAlgorithm, and MinhtonJoinAlgorithmForTest.
|
overridevirtual |
Implements minhton::JoinAlgorithmInterface.
|
protectedpure virtual |
This method will be called when we receive a JOIN message.
Forwarding JOIN Messages according to the fill join algorithm.
When this node is a fitting position to accept the entering node, it will call initialize the JoinAccept procedure. Otherwise it will further forward the message to the next node.
Typical Usage:
msg | the message we received and want to process |
Algorithm | Exception if join case couldn't be handled |
Implemented in minhton::MinhtonJoinAlgorithm.
|
protected |
This method will be called when we receive a JOIN_ACCEPT message.
We previously sent a JOIN message and now get an answer from our new parent node. The message contains all relevant information about the network we need to know.
In the end we must send a processJoinAcceptAck message pack to the parent. Only after that the parent will update the network informing everybody that we joined.
Typical Usage:
msg | the message we received and want to process |
We are the entering node and received this message from our new parent.
Target contains the logical position about ourselves which our parent calculated for us.
The sender is our parent.
|
protected |
This method will be called when we receive a JOIN_ACCEPT_ACK message.
We are the parent of the entering node. Now we must send update messages to update the routing information of the whole network.
For this we sent UPDATE_NEIGHBOR messages.
Typical Usage:
msg | the message we received and want to process |
We are the parent of the node that has entered the network and now need to send around information through the network to inform other nodes about the entered node and update our own adjacent information.