A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::flame::FlameProtocol Class Reference

FLAME routing protocol. More...

#include <flame-protocol.h>

+ Inheritance diagram for ns3::flame::FlameProtocol:
+ Collaboration diagram for ns3::flame::FlameProtocol:

Classes

struct  Statistics
 

Public Member Functions

 FlameProtocol ()
 
 ~FlameProtocol ()
 
void DoDispose ()
 This method is called by Object::Dispose or by the object's destructor, whichever comes first. More...
 
Mac48Address GetAddress ()
 
bool Install (Ptr< MeshPointDevice >)
 Install FLAME on given mesh point. More...
 
bool RemoveRoutingStuff (uint32_t fromIface, const Mac48Address source, const Mac48Address destination, Ptr< Packet > packet, uint16_t &protocolType)
 Cleanup flame headers! More...
 
void Report (std::ostream &) const
 Statistics. More...
 
bool RequestRoute (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, Ptr< const Packet > packet, uint16_t protocolType, RouteReplyCallback routeReply)
 Route request, inherited from MeshL2RoutingProtocol. More...
 
void ResetStats ()
 
- Public Member Functions inherited from ns3::MeshL2RoutingProtocol
virtual ~MeshL2RoutingProtocol ()
 virtual D-tor for subclasses More...
 
Ptr< MeshPointDeviceGetMeshPoint () const
 Each mesh protocol must be installed on the mesh point to work. More...
 
void SetMeshPoint (Ptr< MeshPointDevice > mp)
 Set host mesh point, analog of SetNode (...) methods for upper layer protocols. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 
virtual ~Object ()
 
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 Run the DoDispose methods of this object and all the objects aggregated to it. More...
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 This method calls the virtual DoInitialize method on all the objects aggregated to this object. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static TypeId GetTypeId ()
 
- Static Public Member Functions inherited from ns3::MeshL2RoutingProtocol
static TypeId GetTypeId ()
 Never forget to support NS3 object model. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

 FlameProtocol (const FlameProtocol &)
 
bool HandleDataFrame (uint16_t seqno, Mac48Address source, const FlameHeader flameHdr, Mac48Address receiver, uint32_t fromIface)
 Handles a packet: adds a routing information and drops packets by TTL or Seqno. More...
 
FlameProtocoloperator= (const FlameProtocol &)
 

Private Attributes

uint8_t m_maxCost
 Max Cost value (or TTL, because cost is actually hopcount) More...
 
uint16_t m_myLastSeqno
 Sequence number: More...
 
Ptr< FlameRtablem_rtable
 Routing table: More...
 
Broadcast timers:
Time m_broadcastInterval
 
Time m_lastBroadcast
 
Statistics:
Statistics m_stats
 

Static Private Attributes

static const uint16_t FLAME_PROTOCOL = 0x4040
 LLC protocol number reserved by flame. More...
 

Information about MeshPointDeviceaddress, plugins

typedef std::map< uint32_t,
Ptr< FlameProtocolMac > > 
FlamePluginMap
 
FlamePluginMap m_interfaces
 
Mac48Address m_address
 

Additional Inherited Members

- Public Types inherited from ns3::MeshL2RoutingProtocol
typedef Callback< void, bool,
Ptr< Packet >, Mac48Address,
Mac48Address, uint16_t,
uint32_t > 
RouteReplyCallback
 Callback to be invoked when route discovery procedure is completed. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoInitialize (void)
 This method is called only once by Object::Initialize. More...
 
virtual void NotifyNewAggregate (void)
 This method is invoked whenever two sets of objects are aggregated together. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 This method is invoked once all member attributes have been initialized. More...
 
- Protected Attributes inherited from ns3::MeshL2RoutingProtocol
Ptr< MeshPointDevicem_mp
 Host mesh point. More...
 

Detailed Description

FLAME routing protocol.

Config Paths

ns3::flame::FlameProtocol is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::MeshPointDevice/RoutingProtocol/$ns3::flame::FlameProtocol

Attributes

  • BroadcastInterval: How often we must send broadcast packets
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +5000000000.0ns
    • Flags: construct write read
  • MaxCost: Cost threshold after which packet will be dropped

No TraceSources are defined for this type.

Definition at line 80 of file flame-protocol.h.

Member Typedef Documentation

typedef std::map<uint32_t, Ptr<FlameProtocolMac> > ns3::flame::FlameProtocol::FlamePluginMap
private

Definition at line 123 of file flame-protocol.h.

Constructor & Destructor Documentation

ns3::flame::FlameProtocol::FlameProtocol ( )

Definition at line 131 of file flame-protocol.cc.

ns3::flame::FlameProtocol::~FlameProtocol ( )

Definition at line 136 of file flame-protocol.cc.

ns3::flame::FlameProtocol::FlameProtocol ( const FlameProtocol )
private

Member Function Documentation

void ns3::flame::FlameProtocol::DoDispose ( void  )
virtual

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

Subclasses are expected to implement their real destruction code in an overriden 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.

Reimplemented from ns3::Object.

Definition at line 140 of file flame-protocol.cc.

References m_interfaces, ns3::MeshL2RoutingProtocol::m_mp, and m_rtable.

Mac48Address ns3::flame::FlameProtocol::GetAddress ( void  )

Definition at line 322 of file flame-protocol.cc.

References m_address.

Referenced by HandleDataFrame(), RemoveRoutingStuff(), and RequestRoute().

+ Here is the caller graph for this function:

TypeId ns3::flame::FlameProtocol::GetTypeId ( void  )
static

Definition at line 109 of file flame-protocol.cc.

References m_broadcastInterval, m_maxCost, ns3::MakeTimeChecker(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

bool ns3::flame::FlameProtocol::HandleDataFrame ( uint16_t  seqno,
Mac48Address  source,
const FlameHeader  flameHdr,
Mac48Address  receiver,
uint32_t  fromIface 
)
private

Handles a packet: adds a routing information and drops packets by TTL or Seqno.

Returns
true if packet shall be dropped

Definition at line 327 of file flame-protocol.cc.

References ns3::flame::FlameProtocol::Statistics::droppedTtl, GetAddress(), ns3::Mac48Address::GetBroadcast(), ns3::flame::FlameHeader::GetCost(), ns3::flame::FlameHeader::GetSeqno(), m_maxCost, m_rtable, m_stats, ns3::flame::FlameRtable::LookupResult::retransmitter, ns3::flame::FlameRtable::LookupResult::seqnum, and ns3::flame::FlameProtocol::Statistics::totalDropped.

Referenced by RemoveRoutingStuff(), and RequestRoute().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::flame::FlameProtocol::Install ( Ptr< MeshPointDevice mp)

Install FLAME on given mesh point.

Installing protocol cause installing its interface MAC plugins.

Also MP aggregates all installed protocols, FLAME protocol can be accessed via MeshPointDevice::GetObject<flame::FlameProtocol>();

Definition at line 292 of file flame-protocol.cc.

References ns3::Mac48Address::ConvertFrom(), first::interfaces, m_address, m_interfaces, and ns3::MeshL2RoutingProtocol::m_mp.

Referenced by ns3::FlameStack::InstallStack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

FlameProtocol& ns3::flame::FlameProtocol::operator= ( const FlameProtocol )
private
bool ns3::flame::FlameProtocol::RemoveRoutingStuff ( uint32_t  fromIface,
const Mac48Address  source,
const Mac48Address  destination,
Ptr< Packet packet,
uint16_t &  protocolType 
)
virtual
void ns3::flame::FlameProtocol::Report ( std::ostream &  os) const

Statistics.

Definition at line 364 of file flame-protocol.cc.

References ns3::Time::GetSeconds(), m_address, m_broadcastInterval, m_interfaces, m_maxCost, m_stats, and ns3::flame::FlameProtocol::Statistics::Print().

Referenced by ns3::FlameStack::Report().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::flame::FlameProtocol::RequestRoute ( uint32_t  sourceIface,
const Mac48Address  source,
const Mac48Address  destination,
Ptr< const Packet packet,
uint16_t  protocolType,
RouteReplyCallback  routeReply 
)
virtual
void ns3::flame::FlameProtocol::ResetStats ( )

Definition at line 378 of file flame-protocol.cc.

References m_interfaces, and m_stats.

Referenced by ns3::FlameStack::ResetStats().

+ Here is the caller graph for this function:

Member Data Documentation

const uint16_t ns3::flame::FlameProtocol::FLAME_PROTOCOL = 0x4040
staticprivate

LLC protocol number reserved by flame.

Definition at line 112 of file flame-protocol.h.

Referenced by RemoveRoutingStuff(), and RequestRoute().

Mac48Address ns3::flame::FlameProtocol::m_address
private

Definition at line 125 of file flame-protocol.h.

Referenced by GetAddress(), Install(), and Report().

Time ns3::flame::FlameProtocol::m_broadcastInterval
private

Definition at line 131 of file flame-protocol.h.

Referenced by GetTypeId(), RemoveRoutingStuff(), Report(), and RequestRoute().

FlamePluginMap ns3::flame::FlameProtocol::m_interfaces
private

Definition at line 124 of file flame-protocol.h.

Referenced by DoDispose(), Install(), Report(), and ResetStats().

Time ns3::flame::FlameProtocol::m_lastBroadcast
private

Definition at line 132 of file flame-protocol.h.

Referenced by RemoveRoutingStuff(), and RequestRoute().

uint8_t ns3::flame::FlameProtocol::m_maxCost
private

Max Cost value (or TTL, because cost is actually hopcount)

Definition at line 135 of file flame-protocol.h.

Referenced by GetTypeId(), HandleDataFrame(), and Report().

uint16_t ns3::flame::FlameProtocol::m_myLastSeqno
private

Sequence number:

Definition at line 137 of file flame-protocol.h.

Referenced by RequestRoute().

Ptr<FlameRtable> ns3::flame::FlameProtocol::m_rtable
private

Routing table:

Definition at line 139 of file flame-protocol.h.

Referenced by DoDispose(), HandleDataFrame(), and RequestRoute().

Statistics ns3::flame::FlameProtocol::m_stats
private

Definition at line 152 of file flame-protocol.h.

Referenced by HandleDataFrame(), Report(), RequestRoute(), and ResetStats().


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