OverSim
|
A simple test application for the DHT layer. More...
#include <DHTTestApp.h>
Classes | |
class | DHTStatsContext |
A container used by the DHTTestApp to store context information for statistics. More... |
Public Member Functions | |
DHTTestApp () | |
virtual | ~DHTTestApp () |
virtual destructor | |
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) |
Private Member Functions | |
void | initializeApp (int stage) |
OverlayKey | getRandomKey () |
Get a random key of the hashmap. | |
BinaryValue | generateRandomValue () |
generate a random human readable binary value | |
void | finishApp () |
virtual void | handleGetResponse (DHTgetCAPIResponse *msg, DHTStatsContext *context) |
processes get responses | |
virtual void | handlePutResponse (DHTputCAPIResponse *msg, DHTStatsContext *context) |
processes put responses | |
virtual void | handleTimerEvent (cMessage *msg) |
processes self-messages | |
virtual void | handleTraceMessage (cMessage *msg) |
handleTraceMessage gets called of handleMessage(cMessage* msg) if a message arrives at trace_in. | |
virtual void | handleNodeLeaveNotification () |
void | handleRpcResponse (BaseResponseMessage *msg, const RpcState &state, simtime_t rtt) |
Private Attributes | |
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 | |
GlobalDhtTestMap * | globalDhtTestMap |
pointer to the GlobalDhtTestMap module | |
bool | debugOutput |
debug output yes/no? | |
double | mean |
mean time interval between sending test messages | |
double | deviation |
deviation of time interval | |
int | ttl |
ttl for stored DHT records | |
bool | p2pnsTraffic |
model p2pns application traffic */ | |
bool | activeNetwInitPhase |
is app active in network init phase? | |
int | numSent |
number of sent packets | |
int | numGetSent |
number of get sent | |
int | numGetError |
number of false get responses | |
int | numGetSuccess |
number of false get responses | |
int | numPutSent |
number of put sent | |
int | numPutError |
number of error in put responses | |
int | numPutSuccess |
number of success in put responses | |
cMessage * | dhttestput_timer |
cMessage * | dhttestget_timer |
cMessage * | dhttestmod_timer |
bool | nodeIsLeavingSoon |
true if the node is going to be killed shortly |
Static Private Attributes | |
static const int | DHTTESTAPP_VALUE_LEN = 20 |
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 Member Functions inherited from BaseApp | |
int | numInitStages () const |
method to set InitStage | |
void | initialize (int stage) |
initializes base class-attributes | |
virtual void | initializeApp (int stage) |
initializes derived 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 | |
virtual void | finishApp () |
collects statistical data of derived app | |
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) |
virtual void | deliver (OverlayKey &key, cMessage *msg) |
Common API function: handles delivered messages from overlay. | |
virtual void | forward (OverlayKey *key, cPacket **msg, NodeHandle *nextHopNode) |
Common API function: handles messages from overlay to be forwarded. | |
virtual void | update (const NodeHandle &node, bool joined) |
Common API function: informs application about neighbors and own nodeID. | |
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 | handleUpperMessage (cMessage *msg) |
handleUpperMessage gets called of handleMessage(cMessage* msg) if msg arrivedOn from_upperTier (currently msg gets deleted in this function) | |
virtual void | handleUDPMessage (cMessage *msg) |
method to handle messages that come directly from the UDP gate | |
virtual void | handleReadyMessage (CompReadyMessage *msg) |
method to handle ready messages from the overlay | |
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 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 |
A simple test application for the DHT layer.
A simple test application that does random put and get calls on the DHT layer
Definition at line 50 of file DHTTestApp.h.
DHTTestApp::DHTTestApp | ( | ) |
Definition at line 46 of file DHTTestApp.cc.
|
virtual |
virtual destructor
Definition at line 39 of file DHTTestApp.cc.
|
private |
Definition at line 450 of file DHTTestApp.cc.
|
private |
generate a random human readable binary value
Definition at line 433 of file DHTTestApp.cc.
|
private |
Get a random key of the hashmap.
|
privatevirtual |
processes get responses
method to handle get responses should be overwritten in derived application if needed
msg | get response message |
context | context object used for collecting statistics |
Definition at line 173 of file DHTTestApp.cc.
|
privatevirtual |
Definition at line 445 of file DHTTestApp.cc.
|
privatevirtual |
processes put responses
method to handle put responses should be overwritten in derived application if needed
msg | put response message |
context | context object used for collecting statistics |
Definition at line 147 of file DHTTestApp.cc.
|
private |
Definition at line 121 of file DHTTestApp.cc.
|
privatevirtual |
processes self-messages
method to handle self-messages should be overwritten in derived application if needed
msg | self-message |
Definition at line 298 of file DHTTestApp.cc.
|
privatevirtual |
handleTraceMessage gets called of handleMessage(cMessage* msg) if a message arrives at trace_in.
The command included in this message should be parsed and handled.
msg | the command message to handle |
Definition at line 240 of file DHTTestApp.cc.
|
private |
Definition at line 53 of file DHTTestApp.cc.
|
private |
is app active in network init phase?
Definition at line 148 of file DHTTestApp.h.
|
private |
debug output yes/no?
Definition at line 143 of file DHTTestApp.h.
|
private |
deviation of time interval
Definition at line 145 of file DHTTestApp.h.
|
staticprivate |
Definition at line 162 of file DHTTestApp.h.
|
private |
Definition at line 159 of file DHTTestApp.h.
|
private |
Definition at line 159 of file DHTTestApp.h.
|
private |
Definition at line 159 of file DHTTestApp.h.
|
private |
pointer to the GlobalDhtTestMap module
Definition at line 140 of file DHTTestApp.h.
|
private |
pointer to GlobalNodeList in this node
Definition at line 137 of file DHTTestApp.h.
|
private |
pointer to GlobalStatistics module in this node
Definition at line 139 of file DHTTestApp.h.
|
private |
mean time interval between sending test messages
Definition at line 144 of file DHTTestApp.h.
|
private |
true if the node is going to be killed shortly
Definition at line 160 of file DHTTestApp.h.
|
private |
number of false get responses
Definition at line 153 of file DHTTestApp.h.
|
private |
number of get sent
Definition at line 152 of file DHTTestApp.h.
|
private |
number of false get responses
Definition at line 154 of file DHTTestApp.h.
|
private |
number of error in put responses
Definition at line 156 of file DHTTestApp.h.
|
private |
number of put sent
Definition at line 155 of file DHTTestApp.h.
|
private |
number of success in put responses
Definition at line 157 of file DHTTestApp.h.
|
private |
number of sent packets
Definition at line 151 of file DHTTestApp.h.
|
private |
model p2pns application traffic */
Definition at line 147 of file DHTTestApp.h.
|
private |
ttl for stored DHT records
Definition at line 146 of file DHTTestApp.h.
|
private |
pointer to UnderlayConfigurator in this node
Definition at line 135 of file DHTTestApp.h.