OverSim
|
#include <Scribe.h>
Public Member Functions | |
Scribe () | |
~Scribe () | |
virtual void | initializeApp (int stage) |
initializes derived class-attributes | |
virtual void | handleUpperMessage (cMessage *msg) |
handleUpperMessage gets called of handleMessage(cMessage* msg) if msg arrivedOn from_upperTier (currently msg gets deleted in this function) | |
virtual void | handleReadyMessage (CompReadyMessage *msg) |
method to handle ready messages from the overlay | |
virtual void | handleTimerEvent (cMessage *msg) |
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 | forward (OverlayKey *key, cPacket **msg, NodeHandle *nextHopNode) |
Common API function: handles messages from overlay to be forwarded. | |
virtual void | deliver (OverlayKey &key, cMessage *msg) |
Common API function: handles delivered messages from overlay. | |
virtual void | update (const NodeHandle &node, bool joined) |
Common API function: informs application about neighbors and own nodeID. | |
virtual void | finishApp () |
collects statistical data of derived app | |
Public Member Functions inherited from BaseApp | |
BaseApp () | |
virtual | ~BaseApp () |
virtual destructor | |
Public Member Functions inherited from BaseRpc | |
BaseRpc () | |
const NodeHandle & | getThisNode () |
Returns the NodeHandle of this node. | |
simtime_t | getUdpTimeout () |
Public Member Functions inherited from RpcListener | |
virtual | ~RpcListener () |
destructor | |
Public Member Functions inherited from BaseTcpSupport | |
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) |
Protected Member Functions | |
void | handleJoinResponse (ScribeJoinResponse *joinResponse) |
Handles a response to a join call send by this node. | |
void | handleJoinCall (ScribeJoinCall *joinMsg) |
Handles a join request from another node. | |
void | handlePublishCall (ScribePublishCall *publishCall) |
Handles a publish call from another node. | |
void | handlePublishResponse (ScribePublishResponse *publishResponse) |
Handles a response to a publish call send b this node. | |
void | handleJoinMessage (ScribeJoinCall *joinMsg, bool amIRoot) |
Handles join requests from other nodes. | |
void | handleLeaveMessage (ScribeLeaveMessage *leaveMsg) |
Handles leave requests from other nodes. | |
void | subscribeToGroup (const OverlayKey &groupId) |
Gets called if the local node wants to subscribe to a multicast group. | |
void | leaveGroup (const OverlayKey &group) |
Gets called if the local node wants to leave a multicast group. | |
void | startTimer (ScribeTimer *timer) |
Starts a local timer. | |
void | addChildToGroup (const NodeHandle &child, ScribeGroup &group) |
Adds a child to a multicast group. | |
void | removeChildFromGroup (const NodeHandle &child, ScribeGroup &group) |
Removes a child from a multicast group. | |
void | removeChildFromGroup (ScribeTimer *timer) |
Removes a child from a multicast group. | |
void | checkGroupEmpty (ScribeGroup &group) |
Chechs wheter there are any subscibers left to a given root. | |
void | refreshChildTimer (NodeHandle &child, OverlayKey &groupId) |
Refreshes a child timer. | |
void | deliverALMDataToGroup (ScribeDataMessage *dataMsg) |
Delivers a multicast message to all children in the multicast group. | |
void | deliverALMDataToRoot (ALMMulticastMessage *mcastMsg) |
Delivers a multicast message to the tree's root. | |
Protected Member Functions inherited from BaseApp | |
int | numInitStages () const |
method to set InitStage | |
void | initialize (int stage) |
initializes base class-attributes | |
void | handleMessage (cMessage *msg) |
checks for message type and calls corresponding method | |
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 | handleNodeGracefulLeaveNotification () |
This method gets call **.gracefulLeaveDelay seconds before it is killed if this node is among the gracefulLeaveProbability nodes. | |
void | finish () |
collects statistical data | |
void | callRoute (const OverlayKey &key, cPacket *msg, const TransportAddress &hint=TransportAddress::UNSPECIFIED_NODE, RoutingType routingType=DEFAULT_ROUTING) |
Common API function: calls route-method in overlay. | |
void | callRoute (const OverlayKey &key, cPacket *msg, const std::vector< TransportAddress > &sourceRoute, RoutingType routingType=DEFAULT_ROUTING) |
NodeVector * | callLocalLookup (const OverlayKey &key, int num, bool safe) |
Common API function: produces a list of nodes that can be used as next hops towards key. | |
NodeVector * | callNeighborSet (int num) |
Common API function: produces a list of neighbor nodes. | |
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 void | handleLowerMessage (cMessage *msg) |
processes self-messages | |
virtual void | handleUDPMessage (cMessage *msg) |
method to handle messages that come directly from the UDP gate | |
virtual void | bindToPort (int port) |
Tells UDP we want to get all packets arriving on the given port. | |
virtual void | sendMessageToUDP (const TransportAddress &destAddr, cPacket *msg, simtime_t delay=SIMTIME_ZERO) |
Sends a packet over UDP. | |
virtual void | handleTraceMessage (cMessage *msg) |
handleTraceMessage gets called of handleMessage(cMessage* msg) if a message arrives at trace_in. | |
void | sendMessageToLowerTier (cPacket *msg) |
sends non-commonAPI message to the lower tier | |
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 | internalSendRouteRpc (BaseRpcMessage *message, const OverlayKey &destKey, const std::vector< TransportAddress > &sourceRoute, RoutingType routingType) |
virtual CompType | getThisCompType () |
Return the component type of this module. | |
void | sendReadyMessage (bool ready=true, const OverlayKey &nodeId=OverlayKey::UNSPECIFIED_KEY) |
Protected Member Functions inherited from BaseRpc | |
virtual void | internalHandleRpcTimeout (BaseCallMessage *msg, const TransportAddress &dest, cPolymorphic *context, int rpcId, const OverlayKey &destKey) |
Handles rpc timeouts internal in base classes | |
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) |
Protected Member Functions inherited from RpcListener | |
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 (BaseCallMessage *msg, const TransportAddress &dest, cPolymorphic *context, int rpcId, const OverlayKey &destKey) |
This method is called if an RPC timeout has been reached. | |
virtual void | handleRpcTimeout (const RpcState &rpcState) |
This method is called if an RPC timeout has been reached. | |
Protected Member Functions inherited from BaseTcpSupport | |
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. |
Private Types | |
typedef std::map< OverlayKey, ScribeGroup > | GroupList |
typedef std::multimap < NodeHandle, ScribeTimer * > | ChildTimeoutList |
Private Attributes | |
GroupList | groupList |
ChildTimeoutList | childTimeoutList |
int | childTimeout |
int | parentTimeout |
ScribeTimer * | subscriptionTimer |
int | numJoins |
int | numChildTimeout |
int | numParentTimeout |
int | numForward |
int | forwardBytes |
int | numReceived |
int | receivedBytes |
int | numHeartbeat |
int | heartbeatBytes |
int | numSubscriptionRefresh |
int | subscriptionRefreshBytes |
Additional Inherited Members | |
Public Types inherited from BaseTcpSupport | |
enum | EvCode { NO_EST_CONNECTION, PEER_CLOSED, PEER_TIMEDOUT, PEER_REFUSED, CONNECTION_RESET, CONNECTION_SUCC_ClOSED } |
Protected Attributes inherited from BaseApp | |
UnderlayConfigurator * | underlayConfigurator |
pointer to UnderlayConfigurator in this node | |
GlobalNodeList * | globalNodeList |
pointer to GlobalNodeList in this node | |
GlobalStatistics * | globalStatistics |
pointer to GlobalStatistics module in this node | |
NotificationBoard * | notificationBoard |
pointer to NotificationBoard in this node | |
bool | debugOutput |
debug output yes/no? | |
int | numOverlaySent |
number of sent packets to overlay | |
int | bytesOverlaySent |
number of sent bytes to overlay | |
int | numOverlayReceived |
number of received packets from overlay | |
int | bytesOverlayReceived |
number of received bytes from overlay | |
int | numUdpSent |
number of sent packets to UDP | |
int | bytesUdpSent |
number of sent bytes to UDP | |
int | numUdpReceived |
number of received packets from UDP | |
int | bytesUdpReceived |
number of received bytes from UDP | |
simtime_t | creationTime |
simTime when the App has been created |
|
private |
|
private |
Scribe::Scribe | ( | ) |
Definition at line 36 of file Scribe.cc.
Scribe::~Scribe | ( | ) |
|
protected |
Adds a child to a multicast group.
Definition at line 490 of file Scribe.cc.
|
protected |
Chechs wheter there are any subscibers left to a given root.
Definition at line 565 of file Scribe.cc.
|
virtual |
Common API function: handles delivered messages from overlay.
method to handle decapsulated KBRdeliver messages from overlay module, should be overwritten in derived application
key | destination key |
msg | delivered message |
Reimplemented from BaseApp.
Definition at line 178 of file Scribe.cc.
|
protected |
Delivers a multicast message to all children in the multicast group.
Definition at line 664 of file Scribe.cc.
|
protected |
Delivers a multicast message to the tree's root.
This method gets called when the local app wants to publish some data to the multiacst group.
Definition at line 624 of file Scribe.cc.
|
virtual |
collects statistical data of derived app
Reimplemented from BaseApp.
Definition at line 84 of file Scribe.cc.
|
virtual |
Common API function: handles messages from overlay to be forwarded.
method to handle decapsulated KBRdeliver messages from overlay module, should be overwritten in derived application if needed
key | destination key |
msg | message to forward |
nextHopNode | next hop |
Reimplemented from BaseApp.
Definition at line 113 of file Scribe.cc.
|
protected |
Handles a join request from another node.
This method only gets called if the local node is the root of the multicast group. It only calls handlePublishCall with amIRoot parameter set to "true"
|
protected |
Handles join requests from other nodes.
Definition at line 329 of file Scribe.cc.
|
protected |
Handles a response to a join call send by this node.
Definition at line 410 of file Scribe.cc.
|
protected |
Handles leave requests from other nodes.
Definition at line 450 of file Scribe.cc.
|
protected |
Handles a publish call from another node.
Publish calls are used to send multicast messages to the root of the multicast tree.
Definition at line 375 of file Scribe.cc.
|
protected |
Handles a response to a publish call send b this node.
Publish calls are used to send multicast messages to the root of the multicast tree.
Definition at line 433 of file Scribe.cc.
|
virtual |
method to handle ready messages from the overlay
msg | message to handle |
Reimplemented from BaseApp.
Definition at line 227 of file Scribe.cc.
|
virtual |
Processes Remote-Procedure-Call invocation messages.
This method should be overloaded when the overlay provides RPC functionality.
Reimplemented from BaseRpc.
Definition at line 149 of file Scribe.cc.
|
virtual |
This method is called if an RPC response has been received.
msg | The response message. |
context | Pointer to an optional state object. The object has to be handled/deleted by the handleRpcResponse() code |
rpcId | The RPC id. |
rtt | The Round-Trip-Time of this RPC |
Reimplemented from RpcListener.
Definition at line 158 of file Scribe.cc.
|
virtual |
Reimplemented from BaseRpc.
Definition at line 244 of file Scribe.cc.
|
virtual |
handleUpperMessage gets called of handleMessage(cMessage* msg) if msg arrivedOn from_upperTier (currently msg gets deleted in this function)
msg | the message to handle |
Reimplemented from BaseApp.
Definition at line 192 of file Scribe.cc.
|
virtual |
initializes derived class-attributes
stage | the init stage |
Reimplemented from BaseApp.
Definition at line 60 of file Scribe.cc.
|
protected |
Gets called if the local node wants to leave a multicast group.
group | the ID of the group to leave |
Definition at line 481 of file Scribe.cc.
|
protected |
Refreshes a child timer.
If a child sends a subscribtion refresh, this method gets called. It finds the subscriptionTimeout timer for the group and reschedules it.
Definition at line 584 of file Scribe.cc.
|
protected |
Removes a child from a multicast group.
Definition at line 515 of file Scribe.cc.
|
protected |
Removes a child from a multicast group.
Both the child and the group are determined from the timer message This method gets calld if a subscription timer of a child expires.
Definition at line 538 of file Scribe.cc.
|
protected |
Starts a local timer.
This method automaticly determines the type of the timer and schedules it accordingly. If the timer is already scheduled, it gets canceled before getting rescheduled.
Definition at line 600 of file Scribe.cc.
|
protected |
Gets called if the local node wants to subscribe to a multicast group.
groupId | the ID of the group to join |
Definition at line 459 of file Scribe.cc.
|
virtual |
Common API function: informs application about neighbors and own nodeID.
node | new or lost neighbor |
joined | new or lost? |
Reimplemented from BaseApp.
Definition at line 129 of file Scribe.cc.
|
private |
|
private |