A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ipv6-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// Modifications: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19//
20
21#ifndef IPV6_FLOW_PROBE_H
22#define IPV6_FLOW_PROBE_H
23
24#include "flow-probe.h"
26
27#include "ns3/ipv6-l3-protocol.h"
28#include "ns3/queue-item.h"
29
30namespace ns3
31{
32
33class FlowMonitor;
34class Node;
35
36/// \ingroup flow-monitor
37/// \brief Class that monitors flows at the IPv6 layer of a Node
38///
39/// For each node in the simulation, one instance of the class
40/// Ipv4FlowProbe is created to monitor that node. Ipv4FlowProbe
41/// accomplishes this by connecting callbacks to trace sources in the
42/// Ipv6L3Protocol interface of the node.
44{
45 public:
46 /// \brief Constructor
47 /// \param monitor the FlowMonitor this probe is associated with
48 /// \param classifier the Ipv4FlowClassifier this probe is associated with
49 /// \param node the Node this probe is associated with
51 ~Ipv6FlowProbe() override;
52
53 /// Register this type.
54 /// \return The TypeId.
55 static TypeId GetTypeId();
56
57 /// \brief enumeration of possible reasons why a packet may be dropped
59 {
60 /// Packet dropped due to missing route to the destination
62
63 /// Packet dropped due to TTL decremented to zero during IPv4 forwarding
65
66 /// Packet dropped due to invalid checksum in the IPv4 header
68
69 /// Packet dropped due to queue overflow. Note: only works for
70 /// NetDevices that provide a TxQueue attribute of type Queue
71 /// with a Drop trace source. It currently works with Csma and
72 /// PointToPoint devices, but not with WiFi or WiMax.
74
75 /// Packet dropped by the queue disc
77
78 DROP_INTERFACE_DOWN, /**< Interface is down so can not send packet */
79 DROP_ROUTE_ERROR, /**< Route error */
80
81 DROP_UNKNOWN_PROTOCOL, /**< Unknown L4 protocol */
82 DROP_UNKNOWN_OPTION, /**< Unknown option */
83 DROP_MALFORMED_HEADER, /**< Malformed header */
84
85 DROP_FRAGMENT_TIMEOUT, /**< Fragment timeout exceeded */
86
87 DROP_INVALID_REASON, /**< Fallback reason (no known reason) */
88 };
89
90 protected:
91 void DoDispose() override;
92
93 private:
94 /// Log a packet being sent
95 /// \param ipHeader IP header
96 /// \param ipPayload IP payload
97 /// \param interface outgoing interface
98 void SendOutgoingLogger(const Ipv6Header& ipHeader,
99 Ptr<const Packet> ipPayload,
100 uint32_t interface);
101 /// Log a packet being forwarded
102 /// \param ipHeader IP header
103 /// \param ipPayload IP payload
104 /// \param interface incoming interface
105 void ForwardLogger(const Ipv6Header& ipHeader, Ptr<const Packet> ipPayload, uint32_t interface);
106 /// Log a packet being received by the destination
107 /// \param ipHeader IP header
108 /// \param ipPayload IP payload
109 /// \param interface incoming interface
110 void ForwardUpLogger(const Ipv6Header& ipHeader,
111 Ptr<const Packet> ipPayload,
112 uint32_t interface);
113 /// Log a packet being dropped
114 /// \param ipHeader IP header
115 /// \param ipPayload IP payload
116 /// \param reason drop reason
117 /// \param ipv6 pointer to the IP object dropping the packet
118 /// \param ifIndex interface index
119 void DropLogger(const Ipv6Header& ipHeader,
120 Ptr<const Packet> ipPayload,
122 Ptr<Ipv6> ipv6,
123 uint32_t ifIndex);
124 /// Log a packet being dropped by a queue
125 /// \param ipPayload IP payload
126 void QueueDropLogger(Ptr<const Packet> ipPayload);
127 /// Log a packet being dropped by a queue disc
128 /// \param item queue disc item
130
131 Ptr<Ipv6FlowClassifier> m_classifier; //!< the Ipv6FlowClassifier this probe is associated with
132};
133
134} // namespace ns3
135
136#endif /* IPV6_FLOW_PROBE_H */
The FlowProbe class is responsible for listening for packet events in a specific point of the simulat...
Definition: flow-probe.h:41
Class that monitors flows at the IPv6 layer of a Node.
void DoDispose() override
Destructor implementation.
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.
static TypeId GetTypeId()
Register this type.
Ptr< Ipv6FlowClassifier > m_classifier
the Ipv6FlowClassifier this probe is associated with
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.
DropReason
enumeration of possible reasons why a packet may be dropped
@ DROP_TTL_EXPIRE
Packet dropped due to TTL decremented to zero during IPv4 forwarding.
@ DROP_FRAGMENT_TIMEOUT
Fragment timeout exceeded.
@ DROP_NO_ROUTE
Packet dropped due to missing route to the destination.
@ DROP_UNKNOWN_OPTION
Unknown option.
@ DROP_QUEUE_DISC
Packet dropped by the queue disc.
@ DROP_INTERFACE_DOWN
Interface is down so can not send packet.
@ DROP_BAD_CHECKSUM
Packet dropped due to invalid checksum in the IPv4 header.
@ DROP_MALFORMED_HEADER
Malformed header.
@ DROP_ROUTE_ERROR
Route error.
@ DROP_UNKNOWN_PROTOCOL
Unknown L4 protocol.
@ DROP_INVALID_REASON
Fallback reason (no known reason)
@ DROP_QUEUE
Packet dropped due to queue overflow.
void SendOutgoingLogger(const Ipv6Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t interface)
Log a packet being sent.
Packet header for IPv6.
Definition: ipv6-header.h:35
DropReason
Reason why a packet has been dropped.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.