21 #include "ndn-pit-impl.h"
23 #include "../../utils/trie/empty-policy.h"
24 #include "../../utils/trie/persistent-policy.h"
25 #include "../../utils/trie/random-policy.h"
26 #include "../../utils/trie/lru-policy.h"
27 #include "../../utils/trie/multi-policy.h"
28 #include "../../utils/trie/aggregate-stats-policy.h"
32 NS_LOG_COMPONENT_DEFINE (
"ndn.pit.PitImpl");
34 #include "custom-policies/serialized-size-policy.h"
36 #include "ns3/string.h"
37 #include "ns3/uinteger.h"
38 #include "ns3/simulator.h"
40 #include <boost/lambda/bind.hpp>
41 #include <boost/lambda/lambda.hpp>
44 using namespace boost::tuples;
45 using namespace boost;
46 namespace ll = boost::lambda;
48 #define NS_OBJECT_ENSURE_REGISTERED_TEMPL(type, templ) \
49 static struct X ## type ## templ ## RegistrationClass \
51 X ## type ## templ ## RegistrationClass () { \
52 ns3::TypeId tid = type<templ>::GetTypeId (); \
55 } x_ ## type ## templ ## RegistrationVariable
61 using namespace ndnSIM;
65 PitImpl<serialized_size_policy_traits>::GetCurrentSize ()
const
67 return super::getPolicy ().get_current_space_used ();
75 template class PitImpl<persistent_policy_traits>;
76 template class PitImpl<random_policy_traits>;
77 template class PitImpl<lru_policy_traits>;
78 template class PitImpl<serialized_size_policy_traits>;
80 NS_OBJECT_ENSURE_REGISTERED_TEMPL(PitImpl, persistent_policy_traits);
81 NS_OBJECT_ENSURE_REGISTERED_TEMPL(PitImpl, random_policy_traits);
82 NS_OBJECT_ENSURE_REGISTERED_TEMPL(PitImpl, lru_policy_traits);
83 NS_OBJECT_ENSURE_REGISTERED_TEMPL(PitImpl, serialized_size_policy_traits);
86 typedef multi_policy_traits< boost::mpl::vector2< persistent_policy_traits,
87 aggregate_stats_policy_traits > > PersistentWithCountsTraits;
88 typedef multi_policy_traits< boost::mpl::vector2< random_policy_traits,
89 aggregate_stats_policy_traits > > RandomWithCountsTraits;
90 typedef multi_policy_traits< boost::mpl::vector2< lru_policy_traits,
91 aggregate_stats_policy_traits > > LruWithCountsTraits;
92 typedef multi_policy_traits< boost::mpl::vector2< serialized_size_policy_traits,
93 aggregate_stats_policy_traits > > SerializedSizeWithCountsTraits;
95 template class PitImpl<PersistentWithCountsTraits>;
96 NS_OBJECT_ENSURE_REGISTERED_TEMPL(PitImpl, PersistentWithCountsTraits);
98 template class PitImpl<RandomWithCountsTraits>;
99 NS_OBJECT_ENSURE_REGISTERED_TEMPL(PitImpl, RandomWithCountsTraits);
101 template class PitImpl<LruWithCountsTraits>;
102 NS_OBJECT_ENSURE_REGISTERED_TEMPL(PitImpl, LruWithCountsTraits);
104 template class PitImpl<SerializedSizeWithCountsTraits>;
105 NS_OBJECT_ENSURE_REGISTERED_TEMPL(PitImpl, SerializedSizeWithCountsTraits);
PIT in which PIT reaches its limit, random entry (could be the newly created one) will be removed fro...
A variant of persistent PIT implementation where size of PIT is based on size of interests in bytes (...
PIT in which the least recently used entry (the oldest entry with minimum number of incoming faces) w...
PIT in which new entries will be rejected if PIT size reached its limit.