OverSim
|
#include <Nps.h>
Public Member Functions | |
Nps () | |
void | init (NeighborCache *neighborCache) |
bool | isReady () |
void | handleTimerEvent (cMessage *msg) |
virtual bool | handleRpcCall (BaseCallMessage *msg) |
Prox | getCoordinateBasedProx (const AbstractNcsNodeInfo &info) const |
AbstractNcsNodeInfo * | getUnvalidNcsInfo () const |
AbstractNcsNodeInfo * | createNcsInfo (const Coords &coords) const |
virtual const AbstractNcsNodeInfo & | getOwnNcsInfo () const |
const Coords & | getOwnCoordinates () const |
double | getOwnCoordinates (uint8_t i) const |
uint8_t | getOwnLayer () const |
Public Member Functions inherited from RpcListener | |
virtual | ~RpcListener () |
destructor | |
Public Member Functions inherited from AbstractNcs | |
virtual | ~AbstractNcs () |
virtual void | processCoordinates (const simtime_t &rtt, const AbstractNcsNodeInfo &nodeInfo) |
Protected Member Functions | |
uint8_t | computeOwnLayer (const std::vector< LandmarkDataEntry > &landmarks) |
computes this node's NPS layer (max of reference points' layers + 1) | |
Coords | computeOwnCoordinates (const std::vector< LandmarkDataEntry > &landmarks) |
methods for computing own coordinates with the received data | |
void | setOwnLayer (int8_t layer) |
announces node's NPS layer to Bootstrap Oracle and Neighbor Cache | |
void | setOwnCoordinates (const Coords &coords) |
void | sendCoordRequests () |
Get a random set of landmarks / NPS reference node and send coordinate requests to them. | |
void | sendCoordRequests (const std::vector< TransportAddress > &landmarks) |
void | sendCoordsReqCall (const TransportAddress &dest, simtime_t timeout) |
void | handleRpcResponse (BaseResponseMessage *msg, cPolymorphic *context, int rpcId, simtime_t rtt) |
This method is called if an RPC response has been received. | |
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. | |
void | coordsReqRpcResponse (CoordsReqResponse *response, cPolymorphic *context, int rpcId, simtime_t rtt) |
void | coordsReqRpc (CoordsReqCall *msg) |
std::vector< LandmarkDataEntry > | getLandmarkData () const |
std::vector< TransportAddress > | getLandmarks (uint8_t howmany) |
Askes GlobalNodeList for appropriate landmark nodes. | |
const std::vector < TransportAddress > & | getLandmarkSet () const |
uint16_t | getLandmarkSetSize () const |
bool | setLandmarkSet (uint8_t howManyLM, uint8_t maxLayer, std::vector< TransportAddress > *landmarkSet) |
bool | enoughLandmarks () |
void | updateNodeMeasurement (const TransportAddress &node, uint8_t pending=0, uint8_t sent=0, uint8_t passed=0) |
void | deleteNodeMeasurement (const TransportAddress &node) |
uint16_t | getReceivedCalls () const |
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 (const RpcState &rpcState) |
This method is called if an RPC timeout has been reached. |
Protected Attributes | |
std::vector< RttMeasurement > | nodeMeasurements |
Private Attributes | |
NeighborCache * | neighborCache |
BaseOverlay * | overlay |
GlobalNodeList * | globalNodeList |
CoordBasedRouting * | coordBasedRouting |
uint8_t | maxLayer |
uint8_t | dimensions |
simtime_t | landmarkTimeout |
GnpNpsCoordsInfo * | ownCoords |
int16_t | pendingRequests |
uint8_t | coordCalcRuns |
std::vector< TransportAddress > | landmarkSet |
uint16_t | receivedCalls |
cMessage * | landmarkTimer |
bool | ready |
Friends | |
class | Landmark |
|
protected |
methods for computing own coordinates with the received data
Definition at line 482 of file Nps.cc.
Referenced by coordsReqRpcResponse().
|
protected |
computes this node's NPS layer (max of reference points' layers + 1)
Definition at line 435 of file Nps.cc.
Referenced by coordsReqRpcResponse().
|
protected |
Definition at line 162 of file Nps.cc.
Referenced by handleRpcCall().
|
protected |
Definition at line 209 of file Nps.cc.
Referenced by handleRpcResponse().
|
virtual |
Implements AbstractNcs.
Definition at line 605 of file Nps.cc.
Referenced by coordsReqRpcResponse().
|
protected |
Definition at line 588 of file Nps.cc.
Referenced by coordsReqRpcResponse(), and handleRpcTimeout().
|
protected |
Definition at line 543 of file Nps.cc.
Referenced by handleTimerEvent().
|
virtual |
Implements AbstractNcs.
Definition at line 549 of file Nps.cc.
|
protected |
|
protected |
Askes GlobalNodeList for appropriate landmark nodes.
howmany | number of needed landmark nodes |
Definition at line 516 of file Nps.cc.
Referenced by sendCoordRequests().
|
inlineprotected |
Definition at line 175 of file Nps.h.
|
inlineprotected |
Definition at line 176 of file Nps.h.
Referenced by coordsReqRpcResponse().
|
inline |
Definition at line 117 of file Nps.h.
Referenced by coordsReqRpc(), coordsReqRpcResponse(), and handleRpcTimeout().
|
inline |
|
inline |
Definition at line 119 of file Nps.h.
Referenced by computeOwnLayer(), and coordsReqRpc().
|
inlinevirtual |
|
inlineprotected |
Definition at line 191 of file Nps.h.
|
inlinevirtual |
|
virtual |
Reimplemented from AbstractNcs.
Definition at line 152 of file Nps.cc.
|
protectedvirtual |
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 89 of file Nps.cc.
|
protectedvirtual |
This method is called if an RPC timeout has been reached.
msg | The original RPC message. |
dest | The destination node |
context | Pointer to an optional state object. The object has to be handled/deleted by the handleRpcResponse() code |
rpcId | The RPC id. |
destKey | the destination OverlayKey |
Reimplemented from RpcListener.
Definition at line 108 of file Nps.cc.
|
virtual |
Reimplemented from AbstractNcs.
Definition at line 75 of file Nps.cc.
|
virtual |
Implements AbstractNcs.
Definition at line 41 of file Nps.cc.
|
inlinevirtual |
|
protected |
Get a random set of landmarks / NPS reference node and send coordinate requests to them.
Definition at line 408 of file Nps.cc.
Referenced by handleTimerEvent().
|
protected |
|
protected |
Definition at line 424 of file Nps.cc.
Referenced by sendCoordRequests().
|
protected |
Definition at line 378 of file Nps.cc.
Referenced by coordsReqRpcResponse(), and sendCoordRequests().
|
inlineprotected |
Definition at line 136 of file Nps.h.
Referenced by coordsReqRpcResponse(), and Landmark::initializeApp().
|
protected |
announces node's NPS layer to Bootstrap Oracle and Neighbor Cache
Definition at line 447 of file Nps.cc.
Referenced by coordsReqRpcResponse(), and Landmark::initializeApp().
|
protected |
Definition at line 557 of file Nps.cc.
Referenced by coordsReqRpcResponse(), and handleRpcTimeout().
|
private |
|
private |
Definition at line 93 of file Nps.h.
Referenced by computeOwnCoordinates(), and init().
|
private |
Definition at line 87 of file Nps.h.
Referenced by computeOwnCoordinates(), coordsReqRpc(), coordsReqRpcResponse(), enoughLandmarks(), init(), and sendCoordRequests().
|
private |
Definition at line 83 of file Nps.h.
Referenced by coordsReqRpcResponse(), enoughLandmarks(), getLandmarks(), init(), and setOwnLayer().
|
private |
Definition at line 95 of file Nps.h.
Referenced by coordsReqRpcResponse(), getLandmarkSet(), getLandmarkSetSize(), init(), and sendCoordRequests().
|
private |
Definition at line 88 of file Nps.h.
Referenced by handleTimerEvent(), and init().
|
private |
Definition at line 99 of file Nps.h.
Referenced by handleTimerEvent(), and init().
|
private |
Definition at line 86 of file Nps.h.
Referenced by coordsReqRpcResponse(), getLandmarks(), init(), sendCoordRequests(), setLandmarkSet(), and setOwnLayer().
|
private |
Definition at line 81 of file Nps.h.
Referenced by coordsReqRpc(), coordsReqRpcResponse(), handleTimerEvent(), init(), sendCoordsReqCall(), setLandmarkSet(), and setOwnLayer().
|
protected |
Definition at line 182 of file Nps.h.
Referenced by deleteNodeMeasurement(), and updateNodeMeasurement().
|
private |
|
private |
Definition at line 90 of file Nps.h.
Referenced by getCoordinateBasedProx(), getOwnCoordinates(), getOwnLayer(), getOwnNcsInfo(), init(), setOwnCoordinates(), and setOwnLayer().
|
private |
Definition at line 92 of file Nps.h.
Referenced by coordsReqRpcResponse(), handleRpcTimeout(), init(), and sendCoordsReqCall().
|
private |
Definition at line 101 of file Nps.h.
Referenced by coordsReqRpcResponse(), init(), and isReady().
|
private |
Definition at line 97 of file Nps.h.
Referenced by coordsReqRpc(), getReceivedCalls(), and init().