22 #ifndef PROPHETROUTINGEXTENSION_H_
23 #define PROPHETROUTINGEXTENSION_H_
35 #include <ibrcommon/thread/Mutex.h>
36 #include <ibrcommon/thread/Queue.h>
37 #include <ibrcommon/thread/ThreadsafeReference.h>
62 static const std::string
TAG;
66 float p_first_threshold,
float beta,
float gamma,
float delta,
67 size_t time_unit,
size_t i_typ,
71 virtual const std::string
getTag()
const throw ();
81 virtual
void raiseEvent(const dtn::core::TimeEvent &evt) throw ();
82 virtual
void raiseEvent(const dtn::core::BundlePurgeEvent &evt) throw ();
86 virtual
void eventTransferCompleted(const dtn::data::EID &peer, const dtn::data::MetaBundle &meta) throw ();
88 virtual
void eventBundleQueued(const dtn::data::EID &peer, const dtn::data::MetaBundle &meta) throw ();
109 virtual
void run() throw ();
127 void store(const ibrcommon::File &target);
132 void restore(const ibrcommon::File &source);
138 ibrcommon::Mutex _next_exchange_mutex;
139 dtn::data::
Timestamp _next_exchange_timeout;
140 dtn::data::
Timestamp _next_exchange_timestamp;
145 float p_encounter(const dtn::data::EID &neighbor) const;
147 float _p_encounter_max;
148 float _p_encounter_first;
149 float _p_first_threshold;
153 typedef std::map<dtn::data::EID, dtn::data::
Timestamp> age_map;
156 ibrcommon::File _persistent_file;
162 virtual std::string toString()
const = 0;
165 class SearchNextBundleTask :
public Task
169 virtual ~SearchNextBundleTask();
171 virtual std::string toString()
const;
176 class NextExchangeTask :
public Task
180 virtual ~NextExchangeTask();
182 virtual std::string toString()
const;
185 ibrcommon::Queue<Task* > _taskqueue;
217 unsigned int _NF_max;
219 typedef std::map<dtn::data::BundleID, unsigned int> nf_map;
226 #endif // PROPHETROUTINGEXTENSION_H_
virtual void eventDataChanged(const dtn::data::EID &peer)
GTMX_Strategy(unsigned int NF_max)
virtual void componentDown()
The GRTR forwarding strategy. Using this strategy, packets are forwarding, if the neighbor has a high...
virtual void processHandshake(const dtn::data::EID &, NodeHandshake &)
This class keeps track of the predictablities to see a specific EID.
virtual void eventTransferCompleted(const dtn::data::EID &peer, const dtn::data::MetaBundle &meta)
virtual ~ProphetRoutingExtension()
This class is a abstract base class for all prophet forwarding strategies.
virtual bool shallForward(const DeliveryPredictabilityMap &neighbor_dpm, const dtn::data::MetaBundle &bundle) const
Set of Acknowledgements, that can be serialized in node handshakes.
virtual void eventBundleQueued(const dtn::data::EID &peer, const dtn::data::MetaBundle &meta)
ibrcommon::ThreadsafeReference< const AcknowledgementSet > getAcknowledgementSet() const
virtual void componentUp()
The GTMX forwarding strategy. Using this strategy, packets are forwarding, if the neighbor has a high...
ProphetRoutingExtension(ForwardingStrategy *strategy, float p_encounter_max, float p_encounter_first, float p_first_threshold, float beta, float gamma, float delta, size_t time_unit, size_t i_typ, dtn::data::Timestamp next_exchange_timeout)
virtual void responseHandshake(const dtn::data::EID &, const NodeHandshake &, NodeHandshake &)
virtual void requestHandshake(const dtn::data::EID &, NodeHandshake &) const
virtual const std::string getTag() const
virtual void raiseEvent(const dtn::routing::NodeHandshakeEvent &evt)
ibrcommon::ThreadsafeReference< DeliveryPredictabilityMap > getDeliveryPredictabilityMap()
void addForward(const dtn::data::BundleID &id)
virtual bool shallForward(const DeliveryPredictabilityMap &neighbor_dpm, const dtn::data::MetaBundle &bundle) const
Routing extension for PRoPHET routing.
dtn::data::SDNV< Size > Timestamp