OverSim
|
Test application for KBR interface. More...
#include <KBRTestApp.h>
Classes | |
struct | MsgHandle |
type for storing seen messages in a circular buffer, holds OverlayKey of the sender and SequenceNumber More... |
Public Member Functions | |
KBRTestApp () | |
~KBRTestApp () | |
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 Types | |
typedef std::vector< MsgHandle > | MsgHandleBuf |
Private Member Functions | |
void | initializeApp (int stage) |
void | finishApp () |
void | handleTimerEvent (cMessage *msg) |
void | deliver (OverlayKey &key, cMessage *msg) |
void | forward (OverlayKey *key, cPacket **msg, NodeHandle *nextHopNode) |
bool | checkSeen (const OverlayKey &key, int seqNum) |
Checks if a message was already seen before. | |
void | evaluateData (simtime_t timeDelay, int hopCount, long int bytes) |
Analyses and records measuring data handed over from nodes that previously had been the destination for a test message from this module, called by receiver::handleMessage() at sendermodule. | |
bool | handleRpcCall (BaseCallMessage *msg) |
void | kbrTestCall (KbrTestCall *call) |
void | underlayTestCall (UnderlayTestCall *call) |
void | handleRpcResponse (BaseResponseMessage *msg, cPolymorphic *context, int rpcId, simtime_t rtt) |
void | handleRpcTimeout (BaseCallMessage *msg, const TransportAddress &dest, cPolymorphic *context, int rpcId, const OverlayKey &destKey) |
void | handleLookupResponse (LookupResponse *msg, cObject *context, simtime_t latency) |
void | pingResponse (PingResponse *response, cPolymorphic *context, int rpcId, simtime_t rtt) |
virtual void | handleNodeLeaveNotification () |
std::pair< OverlayKey, TransportAddress > | createDestKey () |
Private Attributes | |
bool | kbrOneWayTest |
bool | kbrRpcTest |
bool | kbrLookupTest |
bool | underlayTest |
int | testMsgSize |
double | mean |
mean time interval between sending test messages | |
double | deviation |
deviation of time interval | |
bool | activeNetwInitPhase |
is app active in network init phase? | |
bool | lookupNodeIds |
lookup only existing nodeIDs | |
bool | nodeIsLeavingSoon |
true if the node is going to be killed shortly | |
bool | onlyLookupInoffensiveNodes |
if true only search for inoffensive nodes (use together with lookupNodeIds) | |
int | rpcRetries |
uint32_t | numSent |
uint32_t | bytesSent |
uint32_t | numDelivered |
number of delivered packets | |
uint32_t | bytesDelivered |
number of delivered bytes | |
uint32_t | numDropped |
uint32_t | bytesDropped |
uint32_t | numRpcSent |
uint32_t | bytesRpcSent |
uint32_t | numRpcDelivered |
number of delivered packets | |
uint32_t | bytesRpcDelivered |
number of delivered bytes | |
uint32_t | numRpcDropped |
uint32_t | bytesRpcDropped |
simtime_t | rpcSuccLatencySum |
uint32_t | rpcSuccLatencyCount |
simtime_t | rpcTotalLatencySum |
uint32_t | rpcTotalLatencyCount |
uint32_t | numLookupSent |
uint32_t | numLookupSuccess |
uint32_t | numLookupFailed |
uint32_t | numUnderlaySent |
uint32_t | bytesUnderlaySent |
uint32_t | numUnderlayDelivered |
number of delivered packets | |
uint32_t | bytesUnderlayDelivered |
number of delivered bytes | |
cMessage * | onewayTimer |
cMessage * | rpcTimer |
cMessage * | lookupTimer |
cMessage * | underlayTimer |
simtime_t | failureLatency |
this latency is recorded for failed lookups and RPCs | |
uint32_t | sequenceNumber |
int | msgHandleBufSize |
how many MsgHandles to store in circular buffer | |
MsgHandleBuf | mhBuf |
circular buffer of MsgHandles | |
MsgHandleBuf::iterator | mhBufBegin |
begin of circular buffer | |
MsgHandleBuf::iterator | mhBufNext |
next element to insert | |
MsgHandleBuf::iterator | mhBufEnd |
end of circular buffer |
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 |
Test application for KBR interface.
Test application for KBR interface that sends periodically test messages to random keys or existing nodeIDs. The receiver does not send back any answer, but sender::evaluateDate() is called.
Definition at line 44 of file KBRTestApp.h.
|
private |
Definition at line 74 of file KBRTestApp.h.
KBRTestApp::KBRTestApp | ( | ) |
Definition at line 35 of file KBRTestApp.cc.
KBRTestApp::~KBRTestApp | ( | ) |
Definition at line 43 of file KBRTestApp.cc.
|
private |
Checks if a message was already seen before.
If the sequence number of the message is new for the given sender key, it is stored in a circular buffer and false is returned.
key | the OverlayKey of the sender |
seqNum | sequence number of the message to check |
Definition at line 555 of file KBRTestApp.cc.
Referenced by deliver().
|
private |
Definition at line 542 of file KBRTestApp.cc.
Referenced by handleTimerEvent().
|
private |
Definition at line 475 of file KBRTestApp.cc.
|
private |
Analyses and records measuring data handed over from nodes that previously had been the destination for a test message from this module, called by receiver::handleMessage() at sendermodule.
timeDelay | packet-delay |
hopCount | packet hop-count |
bytes | packet size in bytes |
Definition at line 576 of file KBRTestApp.cc.
|
private |
Definition at line 595 of file KBRTestApp.cc.
|
private |
Definition at line 530 of file KBRTestApp.cc.
|
private |
Definition at line 426 of file KBRTestApp.cc.
Referenced by handleRpcResponse().
|
privatevirtual |
Definition at line 470 of file KBRTestApp.cc.
|
private |
Definition at line 273 of file KBRTestApp.cc.
|
private |
Definition at line 301 of file KBRTestApp.cc.
|
private |
Definition at line 375 of file KBRTestApp.cc.
|
private |
Definition at line 160 of file KBRTestApp.cc.
|
private |
Definition at line 51 of file KBRTestApp.cc.
|
private |
Definition at line 284 of file KBRTestApp.cc.
Referenced by handleRpcCall().
|
private |
Definition at line 266 of file KBRTestApp.cc.
|
private |
Definition at line 292 of file KBRTestApp.cc.
Referenced by handleRpcCall().
|
private |
is app active in network init phase?
Definition at line 138 of file KBRTestApp.h.
Referenced by handleTimerEvent(), and initializeApp().
|
private |
number of delivered bytes
Definition at line 149 of file KBRTestApp.h.
Referenced by evaluateData(), finishApp(), and initializeApp().
|
private |
Definition at line 151 of file KBRTestApp.h.
Referenced by deliver(), finishApp(), and initializeApp().
|
private |
number of delivered bytes
Definition at line 156 of file KBRTestApp.h.
Referenced by finishApp(), handleRpcResponse(), and initializeApp().
|
private |
Definition at line 158 of file KBRTestApp.h.
Referenced by finishApp(), handleRpcResponse(), handleRpcTimeout(), and initializeApp().
|
private |
Definition at line 154 of file KBRTestApp.h.
Referenced by handleTimerEvent(), and initializeApp().
|
private |
Definition at line 147 of file KBRTestApp.h.
Referenced by handleTimerEvent(), and initializeApp().
|
private |
number of delivered bytes
Definition at line 173 of file KBRTestApp.h.
Referenced by handleRpcResponse(), and initializeApp().
|
private |
Definition at line 171 of file KBRTestApp.h.
Referenced by handleTimerEvent(), and initializeApp().
|
private |
deviation of time interval
Definition at line 137 of file KBRTestApp.h.
Referenced by handleTimerEvent(), and initializeApp().
|
private |
this latency is recorded for failed lookups and RPCs
Definition at line 182 of file KBRTestApp.h.
Referenced by handleLookupResponse(), handleRpcResponse(), handleRpcTimeout(), and initializeApp().
|
private |
Definition at line 132 of file KBRTestApp.h.
Referenced by finishApp(), and initializeApp().
|
private |
Definition at line 130 of file KBRTestApp.h.
Referenced by finishApp(), and initializeApp().
|
private |
Definition at line 131 of file KBRTestApp.h.
Referenced by finishApp(), and initializeApp().
|
private |
lookup only existing nodeIDs
Definition at line 139 of file KBRTestApp.h.
Referenced by createDestKey(), deliver(), handleLookupResponse(), handleRpcResponse(), handleTimerEvent(), and initializeApp().
|
private |
Definition at line 179 of file KBRTestApp.h.
Referenced by handleTimerEvent(), initializeApp(), KBRTestApp(), and ~KBRTestApp().
|
private |
mean time interval between sending test messages
Definition at line 136 of file KBRTestApp.h.
Referenced by handleTimerEvent(), and initializeApp().
|
private |
circular buffer of MsgHandles
Definition at line 186 of file KBRTestApp.h.
Referenced by initializeApp().
|
private |
begin of circular buffer
Definition at line 187 of file KBRTestApp.h.
Referenced by checkSeen(), and initializeApp().
|
private |
end of circular buffer
Definition at line 189 of file KBRTestApp.h.
Referenced by checkSeen(), and initializeApp().
|
private |
next element to insert
Definition at line 188 of file KBRTestApp.h.
Referenced by checkSeen(), and initializeApp().
|
private |
how many MsgHandles to store in circular buffer
Definition at line 185 of file KBRTestApp.h.
Referenced by deliver(), and initializeApp().
|
private |
true if the node is going to be killed shortly
Definition at line 140 of file KBRTestApp.h.
Referenced by handleNodeLeaveNotification(), handleTimerEvent(), and initializeApp().
|
private |
number of delivered packets
Definition at line 148 of file KBRTestApp.h.
Referenced by evaluateData(), finishApp(), and initializeApp().
|
private |
Definition at line 150 of file KBRTestApp.h.
Referenced by deliver(), finishApp(), and initializeApp().
|
private |
Definition at line 168 of file KBRTestApp.h.
Referenced by finishApp(), handleLookupResponse(), handleRpcTimeout(), and initializeApp().
|
private |
Definition at line 166 of file KBRTestApp.h.
Referenced by finishApp(), handleTimerEvent(), and initializeApp().
|
private |
Definition at line 167 of file KBRTestApp.h.
Referenced by finishApp(), handleLookupResponse(), and initializeApp().
|
private |
number of delivered packets
Definition at line 155 of file KBRTestApp.h.
Referenced by finishApp(), handleRpcResponse(), and initializeApp().
|
private |
Definition at line 157 of file KBRTestApp.h.
Referenced by finishApp(), handleRpcResponse(), handleRpcTimeout(), and initializeApp().
|
private |
Definition at line 153 of file KBRTestApp.h.
Referenced by finishApp(), handleTimerEvent(), and initializeApp().
|
private |
Definition at line 146 of file KBRTestApp.h.
Referenced by evaluateData(), finishApp(), handleTimerEvent(), and initializeApp().
|
private |
number of delivered packets
Definition at line 172 of file KBRTestApp.h.
Referenced by finishApp(), handleRpcResponse(), and initializeApp().
|
private |
Definition at line 170 of file KBRTestApp.h.
Referenced by finishApp(), handleTimerEvent(), and initializeApp().
|
private |
Definition at line 177 of file KBRTestApp.h.
Referenced by handleTimerEvent(), initializeApp(), KBRTestApp(), and ~KBRTestApp().
|
private |
if true only search for inoffensive nodes (use together with lookupNodeIds)
Definition at line 141 of file KBRTestApp.h.
Referenced by createDestKey(), and initializeApp().
|
private |
Definition at line 144 of file KBRTestApp.h.
Referenced by handleTimerEvent(), and initializeApp().
|
private |
Definition at line 161 of file KBRTestApp.h.
Referenced by finishApp(), handleRpcResponse(), and initializeApp().
|
private |
Definition at line 160 of file KBRTestApp.h.
Referenced by finishApp(), handleRpcResponse(), and initializeApp().
|
private |
Definition at line 178 of file KBRTestApp.h.
Referenced by handleTimerEvent(), initializeApp(), KBRTestApp(), and ~KBRTestApp().
|
private |
Definition at line 164 of file KBRTestApp.h.
Referenced by finishApp(), handleRpcResponse(), handleRpcTimeout(), and initializeApp().
|
private |
Definition at line 163 of file KBRTestApp.h.
Referenced by finishApp(), handleRpcResponse(), handleRpcTimeout(), and initializeApp().
|
private |
Definition at line 184 of file KBRTestApp.h.
Referenced by handleTimerEvent(), and initializeApp().
|
private |
Definition at line 135 of file KBRTestApp.h.
Referenced by handleTimerEvent(), and initializeApp().
|
private |
Definition at line 133 of file KBRTestApp.h.
Referenced by finishApp(), and initializeApp().
|
private |
Definition at line 180 of file KBRTestApp.h.
Referenced by initializeApp(), KBRTestApp(), and ~KBRTestApp().