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// SPDX-License-Identifier: GPL-2.0-only
5//
6// Author: Gustavo J. A. M. Carneiro <gjc@inescporto.pt> <gjcarneiro@gmail.com>
7// Modifications: Tommaso Pecorella <tommaso.pecorella@unifi.it>
8//
9
10#ifndef IPV6_FLOW_PROBE_H
11#define IPV6_FLOW_PROBE_H
12
13#include "flow-probe.h"
15
16#include "ns3/ipv6-l3-protocol.h"
17#include "ns3/queue-item.h"
18
19namespace ns3
20{
21
22class FlowMonitor;
23class Node;
24
25/// @ingroup flow-monitor
26/// @brief Class that monitors flows at the IPv6 layer of a Node
27///
28/// For each node in the simulation, one instance of the class
29/// Ipv4FlowProbe is created to monitor that node. Ipv4FlowProbe
30/// accomplishes this by connecting callbacks to trace sources in the
31/// Ipv6L3Protocol interface of the node.
33{
34 public:
35 /// @brief Constructor
36 /// @param monitor the FlowMonitor this probe is associated with
37 /// @param classifier the Ipv4FlowClassifier this probe is associated with
38 /// @param node the Node this probe is associated with
40 ~Ipv6FlowProbe() override;
41
42 /// Register this type.
43 /// @return The TypeId.
44 static TypeId GetTypeId();
45
46 /// @brief enumeration of possible reasons why a packet may be dropped
48 {
49 /// Packet dropped due to missing route to the destination
51
52 /// Packet dropped due to TTL decremented to zero during IPv4 forwarding
54
55 /// Packet dropped due to invalid checksum in the IPv4 header
57
58 /// Packet dropped due to queue overflow. Note: only works for
59 /// NetDevices that provide a TxQueue attribute of type Queue
60 /// with a Drop trace source. It currently works with Csma and
61 /// PointToPoint devices, but not with WiFi or WiMax.
63
64 /// Packet dropped by the queue disc
66
67 DROP_INTERFACE_DOWN, /**< Interface is down so can not send packet */
68 DROP_ROUTE_ERROR, /**< Route error */
69
70 DROP_UNKNOWN_PROTOCOL, /**< Unknown L4 protocol */
71 DROP_UNKNOWN_OPTION, /**< Unknown option */
72 DROP_MALFORMED_HEADER, /**< Malformed header */
73
74 DROP_FRAGMENT_TIMEOUT, /**< Fragment timeout exceeded */
75
76 DROP_INVALID_REASON, /**< Fallback reason (no known reason) */
77 };
78
79 protected:
80 void DoDispose() override;
81
82 private:
83 /// Log a packet being sent
84 /// @param ipHeader IP header
85 /// @param ipPayload IP payload
86 /// @param interface outgoing interface
87 void SendOutgoingLogger(const Ipv6Header& ipHeader,
88 Ptr<const Packet> ipPayload,
89 uint32_t interface);
90 /// Log a packet being forwarded
91 /// @param ipHeader IP header
92 /// @param ipPayload IP payload
93 /// @param interface incoming interface
94 void ForwardLogger(const Ipv6Header& ipHeader, Ptr<const Packet> ipPayload, uint32_t interface);
95 /// Log a packet being received by the destination
96 /// @param ipHeader IP header
97 /// @param ipPayload IP payload
98 /// @param interface incoming interface
99 void ForwardUpLogger(const Ipv6Header& ipHeader,
100 Ptr<const Packet> ipPayload,
101 uint32_t interface);
102 /// Log a packet being dropped
103 /// @param ipHeader IP header
104 /// @param ipPayload IP payload
105 /// @param reason drop reason
106 /// @param ipv6 pointer to the IP object dropping the packet
107 /// @param ifIndex interface index
108 void DropLogger(const Ipv6Header& ipHeader,
109 Ptr<const Packet> ipPayload,
111 Ptr<Ipv6> ipv6,
112 uint32_t ifIndex);
113 /// Log a packet being dropped by a queue
114 /// @param ipPayload IP payload
115 void QueueDropLogger(Ptr<const Packet> ipPayload);
116 /// Log a packet being dropped by a queue disc
117 /// @param item queue disc item
119
120 Ptr<Ipv6FlowClassifier> m_classifier; //!< the Ipv6FlowClassifier this probe is associated with
121};
122
123} // namespace ns3
124
125#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:30
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.
Ipv6FlowProbe(Ptr< FlowMonitor > monitor, Ptr< Ipv6FlowClassifier > classifier, Ptr< Node > node)
Constructor.
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:24
DropReason
Reason why a packet has been dropped.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.