A Discrete-Event Network Simulator
API
ipv4-flow-probe.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2009 INESC Porto
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License version 2 as
6 // published by the Free Software Foundation;
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // Author: Gustavo J. A. M. Carneiro <gjc@inescporto.pt> <gjcarneiro@gmail.com>
18 //
19 
20 #ifndef IPV4_FLOW_PROBE_H
21 #define IPV4_FLOW_PROBE_H
22 
23 #include "ns3/flow-probe.h"
24 #include "ns3/ipv4-flow-classifier.h"
25 #include "ns3/ipv4-l3-protocol.h"
26 #include "ns3/queue-item.h"
27 
28 namespace ns3
29 {
30 
31 class FlowMonitor;
32 class Node;
33 
41 class Ipv4FlowProbe : public FlowProbe
42 {
43  public:
49  ~Ipv4FlowProbe() override;
50 
53  static TypeId GetTypeId();
54 
57  {
60 
63 
66 
72 
75 
81  };
82 
83  protected:
84  void DoDispose() override;
85 
86  private:
91  void SendOutgoingLogger(const Ipv4Header& ipHeader,
92  Ptr<const Packet> ipPayload,
93  uint32_t interface);
98  void ForwardLogger(const Ipv4Header& ipHeader, Ptr<const Packet> ipPayload, uint32_t interface);
103  void ForwardUpLogger(const Ipv4Header& ipHeader,
104  Ptr<const Packet> ipPayload,
105  uint32_t interface);
112  void DropLogger(const Ipv4Header& ipHeader,
113  Ptr<const Packet> ipPayload,
115  Ptr<Ipv4> ipv4,
116  uint32_t ifIndex);
119  void QueueDropLogger(Ptr<const Packet> ipPayload);
123 
126 };
127 
128 } // namespace ns3
129 
130 #endif /* IPV4_FLOW_PROBE_H */
The FlowProbe class is responsible for listening for packet events in a specific point of the simulat...
Definition: flow-probe.h:40
Class that monitors flows at the IPv4 layer of a Node.
DropReason
enumeration of possible reasons why a packet may be dropped
@ DROP_ROUTE_ERROR
Route error.
@ DROP_BAD_CHECKSUM
Packet dropped due to invalid checksum in the IPv4 header.
@ DROP_TTL_EXPIRE
Packet dropped due to TTL decremented to zero during IPv4 forwarding.
@ DROP_INTERFACE_DOWN
Interface is down so can not send packet.
@ DROP_NO_ROUTE
Packet dropped due to missing route to the destination.
@ DROP_INVALID_REASON
Fallback reason (no known reason)
@ DROP_QUEUE_DISC
Packet dropped by the queue disc.
@ DROP_FRAGMENT_TIMEOUT
Fragment timeout exceeded.
@ DROP_QUEUE
Packet dropped due to queue overflow.
void SendOutgoingLogger(const Ipv4Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
Log a packet being sent.
void DropLogger(const Ipv4Header &ipHeader, Ptr< const Packet > ipPayload, Ipv4L3Protocol::DropReason reason, Ptr< Ipv4 > ipv4, uint32_t ifIndex)
Log a packet being dropped.
void QueueDropLogger(Ptr< const Packet > ipPayload)
Log a packet being dropped by a queue.
void ForwardUpLogger(const Ipv4Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
Log a packet being received by the destination.
Ptr< Ipv4L3Protocol > m_ipv4
the Ipv4L3Protocol this probe is bound to
static TypeId GetTypeId()
Register this type.
void DoDispose() override
Destructor implementation.
Ipv4FlowProbe(Ptr< FlowMonitor > monitor, Ptr< Ipv4FlowClassifier > classifier, Ptr< Node > node)
Constructor.
void QueueDiscDropLogger(Ptr< const QueueDiscItem > item)
Log a packet being dropped by a queue disc.
void ForwardLogger(const Ipv4Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
Log a packet being forwarded.
Ptr< Ipv4FlowClassifier > m_classifier
the Ipv4FlowClassifier this probe is associated with
Packet header for IPv4.
Definition: ipv4-header.h:34
DropReason
Reason why a packet has been dropped.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
a unique identifier for an interface.
Definition: type-id.h:60
Every class exported by the ns3 library is enclosed in the ns3 namespace.