A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::SixLowPanSimpleFlooding Class Reference

Default mesh-under forwarding policy: unconditional rebroadcast with jitter. More...

#include "sixlowpan-simple-flooding.h"

Inheritance diagram for ns3::SixLowPanSimpleFlooding:
Collaboration diagram for ns3::SixLowPanSimpleFlooding:

Public Member Functions

 SixLowPanSimpleFlooding ()
 SixLowPanSimpleFlooding (const SixLowPanSimpleFlooding &)=delete
 ~SixLowPanSimpleFlooding () override
int64_t AssignStreams (int64_t stream) override
 Assign a fixed random stream number to RNGs used by the policy.
void OnPacketForward (Ptr< Packet > packet, const Address &originator, uint8_t seqNo, uint8_t hopsLeft, ForwardCallback forwardCb) override
 Decide whether (and when) to forward a new mesh-under packet.
SixLowPanSimpleFlooding & operator= (const SixLowPanSimpleFlooding &)=delete
Public Member Functions inherited from ns3::SixLowPanMeshUnderRouting
 SixLowPanMeshUnderRouting ()
 SixLowPanMeshUnderRouting (const SixLowPanMeshUnderRouting &)=delete
 ~SixLowPanMeshUnderRouting () override
bool IsDuplicate (const Address &originator, uint8_t seqNo) const
 Check whether a (originator, sequence) pair has already been seen.
virtual void OnDuplicateReceived (const Address &originator, uint8_t seqNo)
 React to a duplicate packet reception.
SixLowPanMeshUnderRouting & operator= (const SixLowPanMeshUnderRouting &)=delete
void RecordPacket (const Address &originator, uint8_t seqNo)
 Record a (originator, sequence) pair in the cache.
Public Member Functions inherited from ns3::Object
 Object ()
 Caller graph was not generated because of its size.
 ~Object () override
 Destructor.
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
void Dispose ()
 Dispose of this Object.
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
TypeId GetInstanceTypeId () const final
 Get the most derived TypeId for this Object.
template<>
Ptr< Object > GetObject () const
 Specialization of () for objects of type ns3::Object.
template<typename T>
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
template<>
Ptr< Object > GetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
template<typename T>
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
bool IsInitialized () const
 Check if the object has been initialized.
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
uint32_t GetReferenceCount () const
 Get the reference count of the object.
SimpleRefCount & operator= (const SimpleRefCount &o)
 Assignment operator.
void Ref () const
 Increment the reference count.
void Unref () const
 Decrement the reference count.
Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
Static Public Member Functions inherited from ns3::SixLowPanMeshUnderRouting
static TypeId GetTypeId ()
 Get the type ID.
Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.

Protected Member Functions

void DoDispose () override
 Destructor implementation.
Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
virtual void DoInitialize ()
 Initialize() implementation.
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.

Private Attributes

Ptr< RandomVariableStream > m_jitter
 Random variable (in milliseconds) used to schedule each rebroadcast.

Additional Inherited Members

Public Types inherited from ns3::SixLowPanMeshUnderRouting
using ForwardCallback = Callback<void, Ptr<Packet>>
 Callback used by a policy to forward a packet.

Detailed Description

Default mesh-under forwarding policy: unconditional rebroadcast with jitter.

SixLowPanSimpleFlooding preserves the historical 6LoWPAN mesh-under behavior of unconditionally rebroadcasting every received (non-duplicate) mesh-under packet after a uniform random jitter (default Uniform[0, 10ms]).

No suppression. No listening. No counters. This policy is the default, so that the policy framework preserves the behavior of the previous in-device flooding implementation when no policy is explicitly selected by the user.

Definition at line 33 of file sixlowpan-simple-flooding.h.

Constructor & Destructor Documentation

◆ SixLowPanSimpleFlooding() [1/2]

ns3::SixLowPanSimpleFlooding::SixLowPanSimpleFlooding ( )

Definition at line 41 of file sixlowpan-simple-flooding.cc.

References NS_LOG_FUNCTION.

Referenced by SixLowPanSimpleFlooding(), GetTypeId(), and operator=().

Here is the caller graph for this function:

◆ ~SixLowPanSimpleFlooding()

ns3::SixLowPanSimpleFlooding::~SixLowPanSimpleFlooding ( )
override

Definition at line 46 of file sixlowpan-simple-flooding.cc.

References NS_LOG_FUNCTION.

◆ SixLowPanSimpleFlooding() [2/2]

ns3::SixLowPanSimpleFlooding::SixLowPanSimpleFlooding ( const SixLowPanSimpleFlooding & )
delete

References SixLowPanSimpleFlooding().

Here is the call graph for this function:

Member Function Documentation

◆ AssignStreams()

int64_t ns3::SixLowPanSimpleFlooding::AssignStreams ( int64_t stream)
overridevirtual

Assign a fixed random stream number to RNGs used by the policy.

Parameters
streamFirst stream index to use.
Returns
The number of stream indices assigned by this policy.

Implements ns3::SixLowPanMeshUnderRouting.

Definition at line 74 of file sixlowpan-simple-flooding.cc.

References m_jitter, and NS_LOG_FUNCTION.

◆ DoDispose()

void ns3::SixLowPanSimpleFlooding::DoDispose ( )
overrideprotectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Caller graph was not generated because of its size.

Reimplemented from ns3::SixLowPanMeshUnderRouting.

Definition at line 52 of file sixlowpan-simple-flooding.cc.

References ns3::SixLowPanMeshUnderRouting::DoDispose(), m_jitter, and NS_LOG_FUNCTION.

Here is the call graph for this function:

◆ GetTypeId()

TypeId ns3::SixLowPanSimpleFlooding::GetTypeId ( )
static

Get the type ID.

Returns
The object TypeId.

Definition at line 24 of file sixlowpan-simple-flooding.cc.

References ns3::SixLowPanMeshUnderRouting::SixLowPanMeshUnderRouting(), SixLowPanSimpleFlooding(), m_jitter, ns3::MakePointerAccessor(), ns3::MakePointerChecker(), and ns3::TypeId::SetParent().

Here is the call graph for this function:

◆ OnPacketForward()

void ns3::SixLowPanSimpleFlooding::OnPacketForward ( Ptr< Packet > packet,
const Address & originator,
uint8_t seqNo,
uint8_t hopsLeft,
ForwardCallback forwardCb )
overridevirtual

Decide whether (and when) to forward a new mesh-under packet.

The device calls this method when a new, non-duplicate mesh-under packet must be considered for forwarding. The policy decides if and when to invoke forwardCb to perform the actual rebroadcast.

Parameters
PacketThe mesh frame ready for retransmission (MESH and BC0 headers applied, hop count already decremented by the device).
originatorThe MESH header originator address.
seqNoThe BC0 header sequence number.
hopsLeftThe hop-count value the next-hop receiver will see (already decremented by the device).
forwardCbThe callback that performs the actual forward.

Implements ns3::SixLowPanMeshUnderRouting.

Definition at line 60 of file sixlowpan-simple-flooding.cc.

References m_jitter, ns3::MilliSeconds(), NS_LOG_FUNCTION, and ns3::Simulator::Schedule().

Here is the call graph for this function:

◆ operator=()

SixLowPanSimpleFlooding & ns3::SixLowPanSimpleFlooding::operator= ( const SixLowPanSimpleFlooding & )
delete

References SixLowPanSimpleFlooding().

Here is the call graph for this function:

Member Data Documentation

◆ m_jitter

Ptr<RandomVariableStream> ns3::SixLowPanSimpleFlooding::m_jitter
private

Random variable (in milliseconds) used to schedule each rebroadcast.

Definition at line 62 of file sixlowpan-simple-flooding.h.

Referenced by AssignStreams(), DoDispose(), GetTypeId(), and OnPacketForward().


The documentation for this class was generated from the following files: