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

Class that monitors flows at the IPv6 layer of a Node. More...

#include "ipv6-flow-probe.h"

+ Inheritance diagram for ns3::Ipv6FlowProbe:
+ Collaboration diagram for ns3::Ipv6FlowProbe:

Public Types

enum  DropReason {
  DROP_NO_ROUTE = 0 , DROP_TTL_EXPIRE , DROP_BAD_CHECKSUM , DROP_QUEUE ,
  DROP_QUEUE_DISC , DROP_INTERFACE_DOWN , DROP_ROUTE_ERROR , DROP_UNKNOWN_PROTOCOL ,
  DROP_UNKNOWN_OPTION , DROP_MALFORMED_HEADER , DROP_FRAGMENT_TIMEOUT , DROP_INVALID_REASON
}
 enumeration of possible reasons why a packet may be dropped More...
 
- Public Types inherited from ns3::FlowProbe
typedef std::map< FlowId, FlowStatsStats
 Container to map FlowId -> FlowStats.
 

Public Member Functions

 Ipv6FlowProbe (Ptr< FlowMonitor > monitor, Ptr< Ipv6FlowClassifier > classifier, Ptr< Node > node)
 Constructor.
 
 ~Ipv6FlowProbe () override
 
- Public Member Functions inherited from ns3::FlowProbe
 FlowProbe (const FlowProbe &)=delete
 
 ~FlowProbe () override
 
void AddPacketDropStats (FlowId flowId, uint32_t packetSize, uint32_t reasonCode)
 Add a packet drop data to the flow stats.
 
void AddPacketStats (FlowId flowId, uint32_t packetSize, Time delayFromFirstProbe)
 Add a packet data to the flow stats.
 
Stats GetStats () const
 Get the partial flow statistics stored in this probe.
 
FlowProbeoperator= (const FlowProbe &)=delete
 
void SerializeToXmlStream (std::ostream &os, uint16_t indent, uint32_t index) const
 Serializes the results to an std::ostream in XML format.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~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 override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () 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.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
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.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (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 ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::FlowProbe
static TypeId GetTypeId ()
 Register this type.
 
- 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::FlowProbe
 FlowProbe (Ptr< FlowMonitor > flowMonitor)
 Constructor.
 
- 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 Member Functions

void DropLogger (const Ipv6Header &ipHeader, Ptr< const Packet > ipPayload, Ipv6L3Protocol::DropReason reason, Ptr< Ipv6 > ipv6, uint32_t ifIndex)
 Log a packet being dropped.
 
void ForwardLogger (const Ipv6Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
 Log a packet being forwarded.
 
void ForwardUpLogger (const Ipv6Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
 Log a packet being received by the destination.
 
void QueueDiscDropLogger (Ptr< const QueueDiscItem > item)
 Log a packet being dropped by a queue disc.
 
void QueueDropLogger (Ptr< const Packet > ipPayload)
 Log a packet being dropped by a queue.
 
void SendOutgoingLogger (const Ipv6Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
 Log a packet being sent.
 

Private Attributes

Ptr< Ipv6FlowClassifierm_classifier
 the Ipv6FlowClassifier this probe is associated with
 

Additional Inherited Members

- Protected Attributes inherited from ns3::FlowProbe
Ptr< FlowMonitorm_flowMonitor
 the FlowMonitor instance
 
Stats m_stats
 The flow stats.
 

Detailed Description

Class that monitors flows at the IPv6 layer of a Node.

For each node in the simulation, one instance of the class Ipv4FlowProbe is created to monitor that node. Ipv4FlowProbe accomplishes this by connecting callbacks to trace sources in the Ipv6L3Protocol interface of the node.

Definition at line 32 of file ipv6-flow-probe.h.

Member Enumeration Documentation

◆ DropReason

enumeration of possible reasons why a packet may be dropped

Enumerator
DROP_NO_ROUTE 

Packet dropped due to missing route to the destination.

DROP_TTL_EXPIRE 

Packet dropped due to TTL decremented to zero during IPv4 forwarding.

DROP_BAD_CHECKSUM 

Packet dropped due to invalid checksum in the IPv4 header.

DROP_QUEUE 

Packet dropped due to queue overflow.

Note: only works for NetDevices that provide a TxQueue attribute of type Queue with a Drop trace source. It currently works with Csma and PointToPoint devices, but not with WiFi or WiMax.

DROP_QUEUE_DISC 

Packet dropped by the queue disc.

DROP_INTERFACE_DOWN 

Interface is down so can not send packet.

DROP_ROUTE_ERROR 

Route error.

DROP_UNKNOWN_PROTOCOL 

Unknown L4 protocol.

DROP_UNKNOWN_OPTION 

Unknown option.

DROP_MALFORMED_HEADER 

Malformed header.

DROP_FRAGMENT_TIMEOUT 

Fragment timeout exceeded.

DROP_INVALID_REASON 

Fallback reason (no known reason)

Definition at line 47 of file ipv6-flow-probe.h.

Constructor & Destructor Documentation

◆ Ipv6FlowProbe()

ns3::Ipv6FlowProbe::Ipv6FlowProbe ( Ptr< FlowMonitor > monitor,
Ptr< Ipv6FlowClassifier > classifier,
Ptr< Node > node )

Constructor.

Parameters
monitorthe FlowMonitor this probe is associated with
classifierthe Ipv4FlowClassifier this probe is associated with
nodethe Node this probe is associated with

Definition at line 197 of file ipv6-flow-probe.cc.

References ns3::Config::ConnectWithoutContextFailSafe(), DropLogger(), ForwardLogger(), ForwardUpLogger(), ns3::MakeCallback(), NS_FATAL_ERROR, NS_LOG_FUNCTION, QueueDiscDropLogger(), QueueDropLogger(), and SendOutgoingLogger().

+ Here is the call graph for this function:

◆ ~Ipv6FlowProbe()

ns3::Ipv6FlowProbe::~Ipv6FlowProbe ( )
override

Definition at line 259 of file ipv6-flow-probe.cc.

Member Function Documentation

◆ DoDispose()

void ns3::Ipv6FlowProbe::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.

Reimplemented from ns3::FlowProbe.

Definition at line 264 of file ipv6-flow-probe.cc.

References ns3::FlowProbe::DoDispose().

+ Here is the call graph for this function:

◆ DropLogger()

void ns3::Ipv6FlowProbe::DropLogger ( const Ipv6Header & ipHeader,
Ptr< const Packet > ipPayload,
Ipv6L3Protocol::DropReason reason,
Ptr< Ipv6 > ipv6,
uint32_t ifIndex )
private

Log a packet being dropped.

Parameters
ipHeaderIP header
ipPayloadIP payload
reasondrop reason
ipv6pointer to the IP object dropping the packet
ifIndexinterface index

Definition at line 332 of file ipv6-flow-probe.cc.

References DROP_FRAGMENT_TIMEOUT, ns3::Ipv6L3Protocol::DROP_FRAGMENT_TIMEOUT, DROP_INTERFACE_DOWN, ns3::Ipv6L3Protocol::DROP_INTERFACE_DOWN, DROP_INVALID_REASON, DROP_MALFORMED_HEADER, ns3::Ipv6L3Protocol::DROP_MALFORMED_HEADER, DROP_NO_ROUTE, ns3::Ipv6L3Protocol::DROP_NO_ROUTE, DROP_ROUTE_ERROR, ns3::Ipv6L3Protocol::DROP_ROUTE_ERROR, DROP_TTL_EXPIRE, ns3::Ipv6L3Protocol::DROP_TTL_EXPIRED, DROP_UNKNOWN_OPTION, ns3::Ipv6L3Protocol::DROP_UNKNOWN_OPTION, DROP_UNKNOWN_PROTOCOL, ns3::Ipv6L3Protocol::DROP_UNKNOWN_PROTOCOL, ns3::Ipv6Header::GetDestination(), ns3::Ipv6FlowProbeTag::GetFlowId(), ns3::Ipv6FlowProbeTag::GetPacketId(), ns3::Ipv6Header::GetSerializedSize(), ns3::FlowProbe::m_flowMonitor, NS_FATAL_ERROR, and NS_LOG_DEBUG.

Referenced by Ipv6FlowProbe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ForwardLogger()

void ns3::Ipv6FlowProbe::ForwardLogger ( const Ipv6Header & ipHeader,
Ptr< const Packet > ipPayload,
uint32_t interface )
private

Log a packet being forwarded.

Parameters
ipHeaderIP header
ipPayloadIP payload
interfaceincoming interface

Definition at line 292 of file ipv6-flow-probe.cc.

References ns3::Ipv6FlowProbeTag::GetFlowId(), ns3::Ipv6FlowProbeTag::GetPacketId(), ns3::Ipv6Header::GetSerializedSize(), ns3::FlowProbe::m_flowMonitor, and NS_LOG_DEBUG.

Referenced by Ipv6FlowProbe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ForwardUpLogger()

void ns3::Ipv6FlowProbe::ForwardUpLogger ( const Ipv6Header & ipHeader,
Ptr< const Packet > ipPayload,
uint32_t interface )
private

Log a packet being received by the destination.

Parameters
ipHeaderIP header
ipPayloadIP payload
interfaceincoming interface

Definition at line 312 of file ipv6-flow-probe.cc.

References ns3::Ipv6FlowProbeTag::GetFlowId(), ns3::Ipv6FlowProbeTag::GetPacketId(), ns3::Ipv6Header::GetSerializedSize(), ns3::FlowProbe::m_flowMonitor, and NS_LOG_DEBUG.

Referenced by Ipv6FlowProbe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::Ipv6FlowProbe::GetTypeId ( )
static

Register this type.

Returns
The TypeId.

Definition at line 249 of file ipv6-flow-probe.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ QueueDiscDropLogger()

void ns3::Ipv6FlowProbe::QueueDiscDropLogger ( Ptr< const QueueDiscItem > item)
private

Log a packet being dropped by a queue disc.

Parameters
itemqueue disc item

Definition at line 436 of file ipv6-flow-probe.cc.

References DROP_QUEUE_DISC, ns3::Ipv6FlowProbeTag::GetFlowId(), ns3::Ipv6FlowProbeTag::GetPacketId(), ns3::Ipv6FlowProbeTag::GetPacketSize(), ns3::FlowProbe::m_flowMonitor, and NS_LOG_DEBUG.

Referenced by Ipv6FlowProbe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ QueueDropLogger()

void ns3::Ipv6FlowProbe::QueueDropLogger ( Ptr< const Packet > ipPayload)
private

Log a packet being dropped by a queue.

Parameters
ipPayloadIP payload

Definition at line 415 of file ipv6-flow-probe.cc.

References DROP_QUEUE, ns3::Ipv6FlowProbeTag::GetFlowId(), ns3::Ipv6FlowProbeTag::GetPacketId(), ns3::Ipv6FlowProbeTag::GetPacketSize(), ns3::FlowProbe::m_flowMonitor, and NS_LOG_DEBUG.

Referenced by Ipv6FlowProbe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendOutgoingLogger()

void ns3::Ipv6FlowProbe::SendOutgoingLogger ( const Ipv6Header & ipHeader,
Ptr< const Packet > ipPayload,
uint32_t interface )
private

Log a packet being sent.

Parameters
ipHeaderIP header
ipPayloadIP payload
interfaceoutgoing interface

Definition at line 270 of file ipv6-flow-probe.cc.

References ns3::Ipv6Header::GetSerializedSize(), m_classifier, ns3::FlowProbe::m_flowMonitor, and NS_LOG_DEBUG.

Referenced by Ipv6FlowProbe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_classifier

Ptr<Ipv6FlowClassifier> ns3::Ipv6FlowProbe::m_classifier
private

the Ipv6FlowClassifier this probe is associated with

Definition at line 120 of file ipv6-flow-probe.h.

Referenced by SendOutgoingLogger().


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