prophet::Node Class Reference

Node represents a route to another Prophet node, and as such, tracks destination endpoint ID and delivery predictability (0 <= p <= 1). More...

#include <Node.h>

Inheritance diagram for prophet::Node:
dtn::ProphetNode prophet::RIBNode

List of all members.

Public Member Functions

 Node (const NodeParams *params=NULL)
 Default constructor.
 Node (const Node &node)
 Copy constructor.
 Node (const std::string &dest_id, bool relay=DEFAULT_RELAY, bool custody=DEFAULT_CUSTODY, bool internet=DEFAULT_INTERNET, const NodeParams *params=NULL)
 Constructor.
virtual ~Node ()
 Destructor.
Nodeoperator= (const Node &n)
 Assignment operator.
void update_pvalue ()
 Apply the direct contact algorithm, p.
void update_transitive (double ab, double bc)
 Apply transitive algorithm, where ab is p_value from local to peer, bc is p_value from peer to this node, p.
void update_age ()
 Routes must decrease predictability with the passing of time, p.

double p_value () const
 Accessors.
bool relay () const
 Accessors.
bool custody () const
 Accessors.
bool internet_gw () const
 Accessors.
virtual const char * dest_id () const
 Accessors.
u_int32_t age () const
 Accessors.
const NodeParamsparams () const
 Accessors.

Static Public Attributes

static const bool DEFAULT_RELAY = true
static const bool DEFAULT_CUSTODY = true
static const bool DEFAULT_INTERNET = false

Protected Member Functions

u_int time_to_units (u_int32_t diff) const
 Use NodeParams::kappa_ milliseconds per unit to convert diff to time units for use in Equation 2.

Protected Attributes

const NodeParamsparams_
 global settings for all prophet nodes
double p_value_
 predictability value for this node
bool relay_
 whether this node acts as relay
bool custody_
 whether this node accepts custody txfr
bool internet_gateway_
 whether bridge to Internet
std::string dest_id_
 string representation of route to node
u_int32_t age_
 age in seconds of last update to p_value
size_t heap_pos_
 heap index used by Table



class Table
 }
class RIBTLV
 }
size_t heap_pos ()
 Accessor and mutator for heap index used by Table and testing.
void set_heap_pos (size_t pos)
 }
void set_pvalue (double d)
 Mutators, protected for use by friend classes only.
void set_relay (bool relay)
 }
void set_custody (bool custody)
 }
void set_internet_gw (bool gw)
 }
virtual void set_dest_id (const std::string &eid)
 }
void set_age (u_int32_t age)
 }
void set_params (const NodeParams *params)
 }

Detailed Description

Node represents a route to another Prophet node, and as such, tracks destination endpoint ID and delivery predictability (0 <= p <= 1).

Pages and paragraphs refer to the Prophet Internet Draft released March 2006

Definition at line 79 of file servlib/prophet/Node.h.


Constructor & Destructor Documentation

prophet::Node::Node ( const NodeParams params = NULL  ) 

Default constructor.

Definition at line 36 of file servlib/prophet/Node.cc.

References age_, and params_.

prophet::Node::Node ( const Node node  ) 

Copy constructor.

Definition at line 51 of file servlib/prophet/Node.cc.

References params_.

prophet::Node::Node ( const std::string &  dest_id,
bool  relay = DEFAULT_RELAY,
bool  custody = DEFAULT_CUSTODY,
bool  internet = DEFAULT_INTERNET,
const NodeParams params = NULL 
)

Constructor.

Definition at line 60 of file servlib/prophet/Node.cc.

References age_, and params_.

prophet::Node::~Node (  )  [virtual]

Destructor.

Definition at line 78 of file servlib/prophet/Node.cc.

References params_.


Member Function Documentation

u_int32_t prophet::Node::age (  )  const [inline]

Accessors.

Definition at line 115 of file servlib/prophet/Node.h.

References age_.

Referenced by dtn::ProphetNodeList::load().

bool prophet::Node::custody (  )  const [inline]

Accessors.

Definition at line 112 of file servlib/prophet/Node.h.

References custody_.

Referenced by dtn::ProphetNodeList::load(), and prophet::RIBTLV::serialize().

virtual const char* prophet::Node::dest_id (  )  const [inline, virtual]
size_t prophet::Node::heap_pos (  )  [inline]

Accessor and mutator for heap index used by Table and testing.

Definition at line 154 of file servlib/prophet/Node.h.

References heap_pos_.

bool prophet::Node::internet_gw (  )  const [inline]

Accessors.

Definition at line 113 of file servlib/prophet/Node.h.

References internet_gateway_.

Referenced by dtn::ProphetNodeList::load(), and prophet::RIBTLV::serialize().

Node& prophet::Node::operator= ( const Node n  )  [inline]

Assignment operator.

Definition at line 122 of file servlib/prophet/Node.h.

References age_, custody_, dest_id_, heap_pos_, internet_gateway_, p_value_, params_, and relay_.

double prophet::Node::p_value (  )  const [inline]
const NodeParams* prophet::Node::params (  )  const [inline]

Accessors.

Definition at line 116 of file servlib/prophet/Node.h.

References params_.

bool prophet::Node::relay (  )  const [inline]

Accessors.

Definition at line 111 of file servlib/prophet/Node.h.

References relay_.

Referenced by dtn::ProphetNodeList::load(), and prophet::RIBTLV::serialize().

void prophet::Node::set_age ( u_int32_t  age  )  [inline, protected]

}

Definition at line 174 of file servlib/prophet/Node.h.

References age_.

void prophet::Node::set_custody ( bool  custody  )  [inline, protected]
virtual void prophet::Node::set_dest_id ( const std::string &  eid  )  [inline, protected, virtual]
void prophet::Node::set_heap_pos ( size_t  pos  )  [inline]

}

Definition at line 155 of file servlib/prophet/Node.h.

References heap_pos_.

Referenced by prophet::heap_pos::operator()().

void prophet::Node::set_internet_gw ( bool  gw  )  [inline, protected]
void prophet::Node::set_params ( const NodeParams params  )  [inline, protected]

}

Definition at line 175 of file servlib/prophet/Node.h.

References params_.

Referenced by prophet::Table::assign().

void prophet::Node::set_pvalue ( double  d  )  [inline, protected]

Mutators, protected for use by friend classes only.

Definition at line 163 of file servlib/prophet/Node.h.

References p_value_.

Referenced by prophet::RIBTLV::deserialize().

void prophet::Node::set_relay ( bool  relay  )  [inline, protected]
u_int prophet::Node::time_to_units ( u_int32_t  diff  )  const [protected]

Use NodeParams::kappa_ milliseconds per unit to convert diff to time units for use in Equation 2.

Definition at line 146 of file servlib/prophet/Node.cc.

References prophet::NodeParams::kappa_, and params_.

Referenced by update_age().

void prophet::Node::update_age (  ) 

Routes must decrease predictability with the passing of time, p.

9, 2.1.1, eq. 2

Definition at line 122 of file servlib/prophet/Node.cc.

References age_, prophet::NodeParams::gamma_, p_value_, params_, and time_to_units().

Referenced by prophet::Table::age_nodes().

void prophet::Node::update_pvalue (  ) 

Apply the direct contact algorithm, p.

9, 2.1.1, eq. 1

Definition at line 84 of file servlib/prophet/Node.cc.

References age_, prophet::NodeParams::encounter_, p_value_, and params_.

Referenced by prophet::Table::update_route().

void prophet::Node::update_transitive ( double  ab,
double  bc 
)

Apply transitive algorithm, where ab is p_value from local to peer, bc is p_value from peer to this node, p.

10, 2.1.1, eq. 3

Definition at line 101 of file servlib/prophet/Node.cc.

References age_, prophet::NodeParams::beta_, prophet::NodeParams::encounter_, p_value_, and params_.

Referenced by prophet::Table::update_transitive().


Friends And Related Function Documentation

friend class RIBTLV [friend]

}

Definition at line 160 of file servlib/prophet/Node.h.

friend class Table [friend]

}

Definition at line 159 of file servlib/prophet/Node.h.


Member Data Documentation

u_int32_t prophet::Node::age_ [protected]

age in seconds of last update to p_value

Definition at line 198 of file servlib/prophet/Node.h.

Referenced by age(), Node(), operator=(), dtn::ProphetNode::serialize(), set_age(), update_age(), update_pvalue(), and update_transitive().

whether this node accepts custody txfr

Definition at line 195 of file servlib/prophet/Node.h.

Referenced by custody(), operator=(), dtn::ProphetNode::serialize(), and set_custody().

const bool prophet::Node::DEFAULT_CUSTODY = true [static]

Definition at line 83 of file servlib/prophet/Node.h.

const bool prophet::Node::DEFAULT_INTERNET = false [static]

Definition at line 84 of file servlib/prophet/Node.h.

const bool prophet::Node::DEFAULT_RELAY = true [static]

Definition at line 82 of file servlib/prophet/Node.h.

std::string prophet::Node::dest_id_ [protected]

string representation of route to node

Definition at line 197 of file servlib/prophet/Node.h.

Referenced by dest_id(), prophet::Table::heap_del(), operator=(), dtn::ProphetNode::remote_eid(), dtn::ProphetNode::serialize(), and set_dest_id().

size_t prophet::Node::heap_pos_ [protected]

heap index used by Table

Definition at line 199 of file servlib/prophet/Node.h.

Referenced by prophet::Table::heap_del(), heap_pos(), operator=(), and set_heap_pos().

whether bridge to Internet

Definition at line 196 of file servlib/prophet/Node.h.

Referenced by internet_gw(), operator=(), dtn::ProphetNode::serialize(), and set_internet_gw().

double prophet::Node::p_value_ [protected]

predictability value for this node

Definition at line 193 of file servlib/prophet/Node.h.

Referenced by operator=(), p_value(), dtn::ProphetNode::serialize(), set_pvalue(), update_age(), update_pvalue(), and update_transitive().

const NodeParams* prophet::Node::params_ [protected]

global settings for all prophet nodes

Definition at line 192 of file servlib/prophet/Node.h.

Referenced by Node(), operator=(), params(), set_params(), time_to_units(), update_age(), update_pvalue(), update_transitive(), and ~Node().

whether this node acts as relay

Definition at line 194 of file servlib/prophet/Node.h.

Referenced by operator=(), relay(), dtn::ProphetNode::serialize(), and set_relay().


The documentation for this class was generated from the following files:
Generated on Sun Nov 21 11:41:16 2010 for DTN Reference Implementation by  doxygen 1.6.3