22 #include "ns3/ipv6-flow-probe.h" 23 #include "ns3/ipv6-flow-classifier.h" 25 #include "ns3/packet.h" 26 #include "ns3/flow-monitor.h" 28 #include "ns3/pointer.h" 29 #include "ns3/config.h" 30 #include "ns3/flow-id-tag.h" 61 virtual void Print (std::ostream &os)
const;
112 .SetGroupName (
"FlowMonitor")
154 :
Tag (), m_flowId (flowId), m_packetId (packetId), m_packetSize (
packetSize)
197 m_classifier (classifier)
203 if (!ipv6->TraceConnectWithoutContext (
"SendOutgoing",
208 if (!ipv6->TraceConnectWithoutContext (
"UnicastForward",
213 if (!ipv6->TraceConnectWithoutContext (
"LocalDeliver",
219 if (!ipv6->TraceConnectWithoutContext (
"Drop",
225 std::ostringstream qd;
226 qd <<
"/NodeList/" << node->
GetId () <<
"/$ns3::TrafficControlLayer/RootQueueDiscList/*/Drop";
230 std::ostringstream oss;
231 oss <<
"/NodeList/" << node->
GetId () <<
"/DeviceList/*/TxQueue/Drop";
241 .SetGroupName (
"FlowMonitor")
264 if (
m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId))
267 NS_LOG_DEBUG (
"ReportFirstTx ("<<
this<<
", "<<flowId<<
", "<<packetId<<
", "<<size<<
"); " 268 << ipHeader << *ipPayload);
290 NS_LOG_DEBUG (
"ReportForwarding ("<<
this<<
", "<<flowId<<
", "<<packetId<<
", "<<size<<
");");
291 m_flowMonitor->ReportForwarding (
this, flowId, packetId, size);
307 NS_LOG_DEBUG (
"ReportLastRx ("<<
this<<
", "<<flowId<<
", "<<packetId<<
", "<<size<<
");");
323 case Ipv6L3Protocol::DROP_BAD_CHECKSUM:
325 Ipv6Mask maski = m_ipv6->GetNetworkMask (ifIndex);
326 Ipv6Address bcast = addri.GetSubnetDirectedBroadcast (maski);
327 if (ipHeader.GetDestination () == bcast)
343 NS_LOG_DEBUG (
"Drop ("<<
this<<
", "<<flowId<<
", "<<packetId<<
", "<<size<<
", " << reason
345 <<
"HDR: " << ipHeader <<
" PKT: " << *ipPayload);
389 m_flowMonitor->ReportDrop (
this, flowId, packetId, size, myReason);
418 bool tagFound = item->GetPacket ()->FindFirstMatchingByteTag (fTag);
uint32_t FlowPacketId
Abstract identifier of a packet within a flow.
bool FindFirstMatchingByteTag(Tag &tag) const
Finds the first tag matching the parameter Tag type.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint32_t GetId(void) const
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
uint32_t m_packetSize
packet size
Packet dropped by the queue disc.
IPv6 layer implementation.
void SendOutgoingLogger(const Ipv6Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
Log a packet being sent.
uint32_t m_flowId
flow identifier
void DropLogger(const Ipv6Header &ipHeader, Ptr< const Packet > ipPayload, Ipv6L3Protocol::DropReason reason, Ptr< Ipv6 > ipv6, uint32_t ifIndex)
Log a packet being dropped.
Interface is down so can not send packet.
void QueueDiscDropLogger(Ptr< const QueueDiscItem > item)
Log a packet being dropped by a queue disc.
Tag used to allow a fast identification of the packet.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Packet dropped due to queue overflow.
uint32_t m_packetId
packet identifier
TAG_BUFFER_INLINE uint32_t ReadU32(void)
void SetPacketId(uint32_t packetId)
Set the packet identifier.
Fragment timeout exceeded.
static TypeId GetTypeId(void)
Get the type ID.
Ptr< FlowMonitor > m_flowMonitor
the FlowMonitor instance
Interface is down so can not send packet.
virtual void Print(std::ostream &os) const
virtual void Serialize(TagBuffer buf) const
void SetPacketSize(uint32_t packetSize)
Set the packet size.
DropReason
enumeration of possible reasons why a packet may be dropped
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
TAG_BUFFER_INLINE void WriteU32(uint32_t v)
Packet dropped due to missing route to the destination.
uint32_t GetPacketId(void) const
Set the packet identifier.
void ForwardUpLogger(const Ipv6Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
Log a packet being received by the destination.
uint32_t GetPacketSize(void) const
Get the packet size.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
tag a set of bytes in a packet
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void DoDispose(void)
Destructor implementation.
virtual uint32_t GetSerializedSize(void) const
The FlowProbe class is responsible for listening for packet events in a specific point of the simulat...
Describes an IPv6 address.
void SetFlowId(uint32_t flowId)
Set the flow identifier.
Packet dropped due to TTL decremented to zero during IPv4 forwarding.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Ipv6FlowProbe(Ptr< FlowMonitor > monitor, Ptr< Ipv6FlowClassifier > classifier, Ptr< Node > node)
Constructor.
uint32_t GetFlowId(void) const
Set the flow identifier.
static const uint32_t packetSize
Fallback reason (no known reason)
void ForwardLogger(const Ipv6Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
Log a packet being forwarded.
static TypeId GetTypeId(void)
Register this type.
Ptr< Ipv6FlowClassifier > m_classifier
the Ipv6FlowClassifier this probe is associated with
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void AddByteTag(const Tag &tag) const
Tag each byte included in this packet with a new byte tag.
virtual void DoDispose(void)
Destructor implementation.
void QueueDropLogger(Ptr< const Packet > ipPayload)
Log a packet being dropped by a queue.
DropReason
Reason why a packet has been dropped.
virtual void Deserialize(TagBuffer buf)
uint32_t FlowId
Abstract identifier of a packet flow.