Public Member Functions |
virtual | ~NTree () |
virtual void | initializeOverlay (int stage) |
| Initializes derived-class-attributes.
|
virtual void | finishOverlay () |
| collects statistical data in derived class
|
virtual void | handleUDPMessage (BaseOverlayMessage *msg) |
| Processes messages from underlay.
|
virtual void | handleTimerEvent (cMessage *msg) |
virtual void | handleAppMessage (cMessage *msg) |
| Processes "timer" self-messages.
|
virtual bool | handleRpcCall (BaseCallMessage *msg) |
| Processes Remote-Procedure-Call invocation messages.
|
virtual void | handleRpcResponse (BaseResponseMessage *msg, cPolymorphic *context, int rpcId, simtime_t rtt) |
| This method is called if an RPC response has been received.
|
virtual void | handleRpcTimeout (BaseCallMessage *msg, const TransportAddress &dest, cPolymorphic *context, int rpcId, const OverlayKey &destKey) |
| This method is called if an RPC timeout has been reached.
|
| BaseOverlay () |
virtual | ~BaseOverlay () |
| Virtual destructor.
|
States | getState () |
bool | isMalicious () |
| Returns true, if node is malicious.
|
bool | isInSimpleMultiOverlayHost () |
| Returns true if overlay is one in an array, inside a SimpleMultiOverlayHost.
|
const simtime_t & | getCreationTime () |
void | join (const OverlayKey &nodeID=OverlayKey::UNSPECIFIED_KEY) |
| Join the overlay with a given nodeID.
|
virtual NodeVector * | local_lookup (const OverlayKey &key, int num, bool safe) |
| finds nodes closest to the given OverlayKey
|
virtual NodeVector * | neighborSet (int num) |
virtual bool | isSiblingFor (const NodeHandle &node, const OverlayKey &key, int numSiblings, bool *err) |
| Query if a node is among the siblings for a given key.
|
virtual int | getMaxNumSiblings () |
| Query the maximum number of siblings (nodes close to a key) that are maintained by this overlay protocol.
|
virtual int | getMaxNumRedundantNodes () |
| Query the maximum number of redundant next hop nodes that are returned by findNode().
|
void | sendMessageToUDP (const TransportAddress &dest, cPacket *msg, simtime_t delay=SIMTIME_ZERO) |
| Sends message to underlay.
|
void | sendToKey (const OverlayKey &key, BaseOverlayMessage *message, int numSiblings=1, const std::vector< TransportAddress > &sourceRoute=TransportAddress::UNSPECIFIED_NODES, RoutingType routingType=DEFAULT_ROUTING) |
| Sends a message to an overlay node, with the generic routing algorithm.
|
virtual OverlayKey | distance (const OverlayKey &x, const OverlayKey &y, bool useAlternative=false) const |
| This method should implement the distance between two keys.
|
void | registerComp (CompType compType, cModule *module) |
cModule * | getCompModule (CompType compType) |
cGate * | getCompRpcGate (CompType compType) |
void | sendMessageToAllComp (cMessage *msg, CompType srcComp) |
bool | providesKbr () |
virtual uint8_t | getBitsPerDigit () |
bool | getMeasureAuthBlock () |
BootstrapList & | getBootstrapList () const |
virtual OverlayKey | estimateMeanDistance () |
| returns mean distance between OverlayKeys in the network
|
virtual uint32_t | estimateOverlaySize () |
| estimates the current number of nodes online
|
| BaseRpc () |
const NodeHandle & | getThisNode () |
| Returns the NodeHandle of this node.
|
simtime_t | getUdpTimeout () |
virtual | ~RpcListener () |
| destructor
|
virtual void | socketDataArrived (int connId, void *yourPtr, cPacket *msg, bool urgent) |
virtual void | socketEstablished (int connId, void *yourPtr) |
virtual void | socketPeerClosed (int connId, void *yourPtr) |
virtual void | socketFailure (int connId, void *yourPtr, int code) |
virtual void | socketStatusArrived (int connId, void *yourPtr, TCPStatusInfo *status) |
| TopologyVis () |
void | showOverlayNeighborArrow (const NodeHandle &neighbor, bool flush=true, const char *displayString=NULL) |
| Draws an arrow from this node to neighbor.
|
void | deleteOverlayNeighborArrow (const NodeHandle &neighbor) |
| Removes an arrow from this node to neighbor.
|
Protected Member Functions |
void | setBootstrapedIcon () |
void | handleMove (GameAPIPositionMessage *posMsg) |
| Handles a move message from the application.
|
void | handleMoveMessage (NTreeMoveMessage *moveMsg) |
| Handles a move message from the network.
|
void | handleJoinCall (NTreeJoinCall *joinCall) |
| Handles request to join a group.
|
void | handleJoinResponse (NTreeJoinResponse *joinResp) |
| Handles the acknowledgement to join a group.
|
void | handleJoinCallTimeout (NTreeJoinCall *joinCall, const TransportAddress &oldNode) |
| Gets called if a join call times out Well try to re-join if needed.
|
void | handlePingCall (NTreePingCall *pingCall) |
| Handles a ping If the ping was send to a node in the n-tree, it is answered with information about the satte of that n-tree node (children, aggregated size)
|
void | handlePingResponse (NTreePingResponse *pingResp, NTreePingContext *context) |
| Handles a ping response.
|
void | handlePingCallTimeout (NTreePingCall *pingCall, const TransportAddress &oldNode, NTreePingContext *context) |
| Handles a ping timeout Inform others about the failed node, replace it if needed.
|
void | handleDivideCall (NTreeDivideCall *divideCall) |
| Handles a request to divide a group.
|
void | handleDivideResponse (NTreeDivideResponse *divideResp, NTreeGroupDivideContext *context) |
| Handles an acknowledgement that a group was divided as requested.
|
void | handleDivideCallTimeout (NTreeDivideCall *divideCall, const TransportAddress &oldNode, NTreeGroupDivideContext *context) |
| Gets called if a divide call times out Re-send the request to a different node.
|
void | handleAddMessage (NTreeGroupAddMessage *addMsg) |
| Handles an information message that somebody joined a group we are a member of.
|
void | handleDeleteMessage (NTreeGroupDeleteMessage *deleteMsg) |
| Handles an information message that a group we are a member of is going to be deleted.
|
void | handleLeaveMessage (NTreeLeaveMessage *leaveMsg) |
| Handles an information message that somebody left a group we are a member of.
|
void | handleCollapseMessage (NTreeCollapseMessage *collapseMsg) |
| Handles an information message that a subtree we are part of is collapsed.
|
void | handleReplaceMessage (NTreeReplaceNodeMessage *replaceMsg) |
| Handles a request to replace a failed or leaving node.
|
void | handleTakeOverMessage (NTreeTakeOverMessage *takeMsg) |
| Handles an information message that a node took over the responsibilities of a failed or leaving node.
|
void | handleNodeGracefulLeaveNotification () |
| This method gets call **.gracefulLeaveDelay seconds before it is killed if this node is among the gracefulLeaveProbability nodes.
|
void | divideNode (NTreeGroupDivideContext *context) |
| Divide a group that has gotten to large into four subgroups.
|
void | collapseTree (std::map< NTreeScope, NTreeNode >::iterator node) |
| Collapse a subtree that has too few children.
|
void | joinGroup (Vector2D position) |
| Joins the group that is responsible for a given position.
|
void | leaveGroup (Vector2D position, bool force=false) |
| Leaves a group for a given position.
|
void | pingNodes () |
| Ping all children of all groups.
|
void | checkParentTimeout () |
| Check if a parent failed to send a ping for a longer time.
|
void | routeViaNTree (const Vector2D &pos, cPacket *msg, bool forward=false) |
| Route a message through the N-Tree to the closest know node to the given position.
|
void | sendToGroup (const NTreeGroup &grp, cPacket *msg, bool keepMsg=false) |
| Sends a message to all members of a group.
|
void | sendToGroup (const std::set< NodeHandle > &grp, cPacket *msg, bool keepMsg=false) |
| Sends a message to all members of a group.
|
void | sendMessage (const TransportAddress &dest, cPacket *msg, bool forward=false) |
| Sends a message to a host.
|
void | changeState (int state) |
| Change the internal state of the protocol.
|
std::list< NTreeGroup >::iterator | findGroup (const Vector2D &pos) |
| Find a group that is responsible for the given position from the local list of groups.
|
std::list< NTreeGroup >::iterator | findGroup (const Vector2D &pos, double size) |
| Find a group that is responsible for the given position from the local list of groups Only return a group if it maches the exact scope given.
|
std::map< NTreeScope,
NTreeNode >::iterator | findNTreeNode (const Vector2D &pos) |
| Find the lowest ntree node that contains the given position.
|
std::map< NTreeScope,
NTreeNode >::iterator | findNTreeNode (const Vector2D &pos, double size) |
| Find the group that matches the given scope.
|
NodeHandle | getRandomNode (std::set< NodeHandle > invalidNodes=std::set< NodeHandle >()) |
| Return a random node.
|
int | numInitStages () const |
| Sets init stage.
|
void | bindToPort (int port) |
| Tells UDP we want to get all packets arriving on the given port.
|
virtual void | route (const OverlayKey &key, CompType destComp, CompType srcComp, cPacket *msg, const std::vector< TransportAddress > &sourceRoute=TransportAddress::UNSPECIFIED_NODES, RoutingType routingType=DEFAULT_ROUTING) |
| Routes message through overlay.
|
void | callDeliver (BaseOverlayMessage *msg, const OverlayKey &destKey) |
| Calls deliver function in application.
|
void | callForward (const OverlayKey &key, BaseRouteMessage *msg, const NodeHandle &nextHopNode) |
| Calls forward function in application.
|
void | callUpdate (const NodeHandle &node, bool joined) |
| Informs application about state changes of nodes or newly joined nodes.
|
void | handleMessage (cMessage *msg) |
| Checks for message type and calls corresponding method.
|
void | handleBaseOverlayMessage (BaseOverlayMessage *msg, const OverlayKey &destKey=OverlayKey::UNSPECIFIED_KEY) |
| Handles a BaseOverlayMessage
|
virtual void | receiveChangeNotification (int category, const cPolymorphic *details) |
| callback-method for events at the NotificationBoard
|
virtual void | handleTransportAddressChangedNotification () |
| This method gets call if the node has a new TransportAddress (IP address) because he changed his access network.
|
virtual void | handleNodeLeaveNotification () |
| This method gets call **.gracefulLeaveDelay seconds before it is killed.
|
virtual void | recordOverlaySentStats (BaseOverlayMessage *msg) |
| Collect overlay specific sent messages statistics.
|
void | setOverlayReady (bool ready) |
| Sets the overlay ready icon and register/deregisters the node at the GlobalNodeList.
|
virtual AbstractLookup * | createLookup (RoutingType routingType=DEFAULT_ROUTING, const BaseOverlayMessage *msg=NULL, const cPacket *findNodeExt=NULL, bool appLookup=false) |
| Creates an abstract iterative lookup instance.
|
virtual void | removeLookup (AbstractLookup *lookup) |
| Removes the abstract lookup instance.
|
virtual NodeVector * | findNode (const OverlayKey &key, int numRedundantNodes, int numSiblings, BaseOverlayMessage *msg=NULL) |
| Implements the find node call.
|
virtual void | joinOverlay () |
| Join the overlay with a given nodeID in thisNode.key.
|
virtual void | joinForeignPartition (const NodeHandle &node) |
| Join another overlay partition with the given node as bootstrap node.
|
virtual bool | handleFailedNode (const TransportAddress &failed) |
| Handles a failed node.
|
virtual void | lookupRpc (LookupCall *call) |
virtual void | nextHopRpc (NextHopCall *call) |
void | countFindNodeCall (const FindNodeCall *call) |
void | countFailedNodeCall (const FailedNodeCall *call) |
bool | internalHandleRpcCall (BaseCallMessage *msg) |
| Handles internal rpc requests.
|
void | internalHandleRpcResponse (BaseResponseMessage *msg, cPolymorphic *context, int rpcId, simtime_t rtt) |
| Handles rpc responses internal in base classes
|
void | internalHandleRpcTimeout (BaseCallMessage *msg, const TransportAddress &dest, cPolymorphic *context, int rpcId, const OverlayKey &destKey) |
| Handles rpc timeouts internal in base classes
|
void | internalSendRouteRpc (BaseRpcMessage *message, const OverlayKey &destKey, const std::vector< TransportAddress > &sourceRoute, RoutingType routingType) |
CompType | getThisCompType () |
| Return the component type of this module.
|
void | initRpcs () |
| Initializes Remote-Procedure state.
|
void | finishRpcs () |
| Deinitializes Remote-Procedure state.
|
virtual void | internalHandleRpcMessage (BaseRpcMessage *msg) |
| Handles incoming rpc messages and delegates them to the corresponding listeners or handlers.
|
uint32_t | sendRouteRpcCall (CompType destComp, const TransportAddress &dest, const OverlayKey &destKey, BaseCallMessage *msg, cPolymorphic *context=NULL, RoutingType routingType=DEFAULT_ROUTING, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL) |
| Routes a Remote-Procedure-Call message to an OverlayKey.
|
uint32_t | sendRouteRpcCall (CompType destComp, const OverlayKey &destKey, BaseCallMessage *msg, cPolymorphic *context=NULL, RoutingType routingType=DEFAULT_ROUTING, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL) |
| Routes a Remote-Procedure-Call message to an OverlayKey.
|
uint32_t | sendRouteRpcCall (CompType destComp, const TransportAddress &dest, BaseCallMessage *msg, cPolymorphic *context=NULL, RoutingType routingType=DEFAULT_ROUTING, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL) |
| Sends a Remote-Procedure-Call message using the overlay's UDP port
This replaces ROUTE_DIRECT calls!
|
uint32_t | sendUdpRpcCall (const TransportAddress &dest, BaseCallMessage *msg, cPolymorphic *context=NULL, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL) |
| Sends a Remote-Procedure-Call message to the underlay
|
uint32_t | sendInternalRpcCall (CompType destComp, BaseCallMessage *msg, cPolymorphic *context=NULL, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL) |
| Sends an internal Remote-Procedure-Call between two tiers
|
void | cancelRpcMessage (uint32_t nonce) |
| Cancels a Remote-Procedure-Call.
|
void | cancelAllRpcs () |
| Cancels all RPCs.
|
void | sendRpcResponse (TransportType transportType, CompType destComp, const TransportAddress &dest, const OverlayKey &destKey, BaseCallMessage *call, BaseResponseMessage *response) |
| Send Remote-Procedure response message and deletes call message.
|
void | sendRpcResponse (BaseCallMessage *call, BaseResponseMessage *response) |
| Send Remote-Procedure response message to UDP and deletes call message.
|
int | pingNode (const TransportAddress &dest, simtime_t timeout=-1, int retries=0, cPolymorphic *context=NULL, const char *caption="PING", RpcListener *rpcListener=NULL, int rpcId=-1, TransportType transportType=INVALID_TRANSPORT) |
| ping a node by its TransportAddress
|
virtual void | pingResponse (PingResponse *pingResponse, cPolymorphic *context, int rpcId, simtime_t rtt) |
virtual void | pingTimeout (PingCall *pingCall, const TransportAddress &dest, cPolymorphic *context, int rpcId) |
bool | internalHandleMessage (cMessage *msg) |
virtual void | handleRpcResponse (BaseResponseMessage *msg, const RpcState &rpcState, simtime_t rtt) |
| This method is called if an RPC response has been received.
|
virtual void | handleRpcTimeout (const RpcState &rpcState) |
| This method is called if an RPC timeout has been reached.
|
void | handleTCPMessage (cMessage *msg) |
| Member function to handle incoming TCP messages.
|
void | bindAndListenTcp (int port) |
| Member function to bind service to the specified port and listen afterwards.
|
bool | isAlreadyConnected (TransportAddress address) |
| Member function to check if the service is already connected.
|
void | establishTcpConnection (TransportAddress address) |
| Member function to establish a connection to the specified node.
|
void | sendTcpData (cPacket *msg, TransportAddress address) |
| Member function to send TCP data to the specified node.
|
virtual void | handleConnectionEvent (EvCode code, TransportAddress address) |
| Member function to handle passive connection events.
|
virtual void | handleDataReceived (TransportAddress address, cPacket *msg, bool urgent) |
| Member function to handle incoming data.
|
virtual void | handleIncomingConnection (TransportAddress address) |
| Member function to handle newly opened connections.
|
void | closeTcpConnection (TransportAddress address) |
| Member function to close an established connection.
|
void | setTcpOut (cGate *gate) |
| Member function to set local gate towards the TCP module during init phase.
|
cGate * | getTcpOut () |
| Member function to get local gate towards the TCP module.
|
void | initVis (cModule *terminal) |
A p2p protocol for MMOGs and virtual worlds.
Provides the GameAPI interface Based upon: GauthierDickey, C., Lo, V., and Zappala, D. 2005. "Using n-trees for scalable
event ordering in peer-to-peer games". In Proceedings of the international Workshop on Network and Operating Systems Support For Digital Audio and Video (Stevenson, Washington, USA, June 13 - 14, 2005). NOSSDAV '05. ACM, New York, NY, 87-92. DOI= http://doi.acm.org/10.1145/1065983.1066005
- Author
- STephan Krause
Definition at line 45 of file NTree.h.