FLAME routing protocol. More...
#include <flame-protocol.h>
Classes | |
struct | Statistics |
Public Member Functions | |
FlameProtocol () | |
~FlameProtocol () | |
void | DoDispose () |
Mac48Address | GetAddress () |
bool | Install (Ptr< MeshPointDevice >) |
Install FLAME on given mesh point. | |
bool | RemoveRoutingStuff (uint32_t fromIface, const Mac48Address source, const Mac48Address destination, Ptr< Packet > packet, uint16_t &protocolType) |
Cleanup flame headers! | |
void | Report (std::ostream &) const |
Statistics. | |
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. | |
void | ResetStats () |
![]() | |
virtual | ~MeshL2RoutingProtocol () |
virtual D-tor for subclasses | |
Ptr< MeshPointDevice > | GetMeshPoint () const |
Each mesh protocol must be installed on the mesh point to work. | |
void | SetMeshPoint (Ptr< MeshPointDevice > mp) |
Set host mesh point, analog of SetNode (...) methods for upper layer protocols. | |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
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 | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
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 () |
This method returns the TypeId associated to ns3::flame::FlameProtocol. |
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. | |
FlameProtocol & | operator= (const FlameProtocol &) |
Private Attributes | |
uint8_t | m_maxCost |
Max Cost value (or TTL, because cost is actually hopcount) | |
uint16_t | m_myLastSeqno |
Sequence number: | |
Ptr< FlameRtable > | m_rtable |
Routing table: | |
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. |
Information about MeshPointDeviceaddress, plugins | |
typedef std::map< uint32_t, Ptr< FlameProtocolMac > > | FlamePluginMap |
FlamePluginMap | m_interfaces |
Mac48Address | m_address |
Additional Inherited Members | |
![]() | |
typedef Callback< void, bool, Ptr< Packet >, Mac48Address, Mac48Address, uint16_t, uint32_t > | RouteReplyCallback |
![]() | |
Object (const Object &o) | |
virtual void | DoStart (void) |
virtual void | NotifyNewAggregate (void) |
![]() | |
Ptr< MeshPointDevice > | m_mp |
Host mesh point. |
FLAME routing protocol.
Definition at line 80 of file flame-protocol.h.
|
private |
Definition at line 123 of file flame-protocol.h.
ns3::flame::FlameProtocol::FlameProtocol | ( | ) |
Definition at line 129 of file flame-protocol.cc.
ns3::flame::FlameProtocol::~FlameProtocol | ( | ) |
Definition at line 134 of file flame-protocol.cc.
|
private |
|
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 138 of file flame-protocol.cc.
References m_interfaces, ns3::MeshL2RoutingProtocol::m_mp, and m_rtable.
Mac48Address ns3::flame::FlameProtocol::GetAddress | ( | void | ) |
Definition at line 320 of file flame-protocol.cc.
References m_address.
Referenced by HandleDataFrame(), RemoveRoutingStuff(), and RequestRoute().
|
static |
This method returns the TypeId associated to ns3::flame::FlameProtocol.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
No TraceSources defined for this type.
Reimplemented from ns3::MeshL2RoutingProtocol.
Definition at line 107 of file flame-protocol.cc.
References m_broadcastInterval, m_maxCost, ns3::Seconds(), and ns3::TypeId::SetParent().
|
private |
Handles a packet: adds a routing information and drops packets by TTL or Seqno.
Definition at line 325 of file flame-protocol.cc.
References ns3::flame::FlameRtable::AddPath(), ns3::flame::FlameProtocol::Statistics::droppedTtl, GetAddress(), ns3::Mac48Address::GetBroadcast(), ns3::flame::FlameHeader::GetCost(), ns3::flame::FlameHeader::GetSeqno(), ns3::flame::FlameRtable::Lookup(), 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().
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 290 of file flame-protocol.cc.
References ns3::Object::AggregateObject(), ns3::Mac48Address::ConvertFrom(), ns3::MeshPointDevice::GetAddress(), ns3::MeshPointDevice::GetInterfaces(), ns3::MeshWifiInterfaceMac::InstallPlugin(), m_address, m_interfaces, ns3::MeshL2RoutingProtocol::m_mp, ns3::MeshWifiInterfaceMac::SetBeaconGeneration(), and ns3::MeshPointDevice::SetRoutingProtocol().
Referenced by ns3::FlameStack::InstallStack().
|
private |
|
virtual |
Cleanup flame headers!
Implements ns3::MeshL2RoutingProtocol.
Definition at line 256 of file flame-protocol.cc.
References FLAME_PROTOCOL, GetAddress(), ns3::Mac48Address::GetBroadcast(), ns3::flame::FlameHeader::GetSeqno(), HandleDataFrame(), m_broadcastInterval, m_lastBroadcast, ns3::MeshL2RoutingProtocol::m_mp, ns3::Now(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, ns3::Packet::RemoveHeader(), ns3::Packet::RemovePacketTag(), ns3::Seconds(), ns3::MeshPointDevice::Send(), and ns3::flame::FlameTag::transmitter.
void ns3::flame::FlameProtocol::Report | ( | std::ostream & | os | ) | const |
Definition at line 362 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().
|
virtual |
Route request, inherited from MeshL2RoutingProtocol.
Implements ns3::MeshL2RoutingProtocol.
Definition at line 145 of file flame-protocol.cc.
References ns3::flame::FlameHeader::AddCost(), ns3::Packet::AddHeader(), ns3::Packet::AddPacketTag(), ns3::Packet::Copy(), FLAME_PROTOCOL, GetAddress(), ns3::Mac48Address::GetBroadcast(), ns3::MeshPointDevice::GetIfIndex(), ns3::flame::FlameHeader::GetSeqno(), ns3::Packet::GetSize(), HandleDataFrame(), ns3::flame::FlameRtable::LookupResult::ifIndex, ns3::flame::FlameRtable::INTERFACE_ANY, ns3::flame::FlameRtable::Lookup(), m_broadcastInterval, m_lastBroadcast, ns3::MeshL2RoutingProtocol::m_mp, m_myLastSeqno, m_rtable, m_stats, ns3::Now(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, ns3::Packet::PeekPacketTag(), ns3::flame::FlameTag::receiver, ns3::Packet::RemoveHeader(), ns3::Packet::RemovePacketTag(), ns3::flame::FlameRtable::LookupResult::retransmitter, ns3::flame::FlameHeader::SetOrigDst(), ns3::flame::FlameHeader::SetOrigSrc(), ns3::flame::FlameHeader::SetProtocol(), ns3::flame::FlameHeader::SetSeqno(), ns3::flame::FlameProtocol::Statistics::totalDropped, ns3::flame::FlameTag::transmitter, ns3::flame::FlameProtocol::Statistics::txBroadcast, ns3::flame::FlameProtocol::Statistics::txBytes, and ns3::flame::FlameProtocol::Statistics::txUnicast.
void ns3::flame::FlameProtocol::ResetStats | ( | ) |
Definition at line 376 of file flame-protocol.cc.
References m_interfaces, and m_stats.
Referenced by ns3::FlameStack::ResetStats().
|
staticprivate |
LLC protocol number reserved by flame.
Definition at line 112 of file flame-protocol.h.
Referenced by RemoveRoutingStuff(), and RequestRoute().
|
private |
Definition at line 125 of file flame-protocol.h.
Referenced by GetAddress(), Install(), and Report().
|
private |
Definition at line 131 of file flame-protocol.h.
Referenced by GetTypeId(), RemoveRoutingStuff(), Report(), and RequestRoute().
|
private |
Definition at line 124 of file flame-protocol.h.
Referenced by DoDispose(), Install(), Report(), and ResetStats().
|
private |
Definition at line 132 of file flame-protocol.h.
Referenced by RemoveRoutingStuff(), and RequestRoute().
|
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().
|
private |
|
private |
Routing table:
Definition at line 139 of file flame-protocol.h.
Referenced by DoDispose(), HandleDataFrame(), and RequestRoute().
|
private |
Definition at line 152 of file flame-protocol.h.
Referenced by HandleDataFrame(), Report(), RequestRoute(), and ResetStats().