author | John Abraham<john.abraham@gatech.edu> |
Sat, 14 May 2011 04:52:55 -0400 | |
changeset 7229 | 5e4a07a48a68 |
parent 7175 | 8fffa1497fba |
child 7366 | 838079534ff9 |
permissions | -rw-r--r-- |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
2 |
// |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
3 |
// Copyright (c) 2009 INESC Porto |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
4 |
// |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
5 |
// This program is free software; you can redistribute it and/or modify |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
6 |
// it under the terms of the GNU General Public License version 2 as |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
7 |
// published by the Free Software Foundation; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
8 |
// |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
9 |
// This program is distributed in the hope that it will be useful, |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
12 |
// GNU General Public License for more details. |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
13 |
// |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
14 |
// You should have received a copy of the GNU General Public License |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
15 |
// along with this program; if not, write to the Free Software |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
16 |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
17 |
// |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
18 |
// Author: Gustavo J. A. M. Carneiro <gjc@inescporto.pt> <gjcarneiro@gmail.com> |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
19 |
// |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
20 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
21 |
#include "ns3/ipv4-flow-probe.h" |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
22 |
#include "ns3/ipv4-flow-classifier.h" |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
23 |
#include "ns3/node.h" |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
24 |
#include "ns3/packet.h" |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
25 |
#include "ns3/flow-monitor.h" |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
26 |
#include "ns3/log.h" |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
27 |
#include "ns3/pointer.h" |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
28 |
#include "ns3/config.h" |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
29 |
#include "ns3/flow-id-tag.h" |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
30 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
31 |
namespace ns3 { |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
32 |
|
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
33 |
using namespace std; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
34 |
|
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
35 |
NS_LOG_COMPONENT_DEFINE ("Ipv4FlowProbe"); |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
36 |
|
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
37 |
////////////////////////////////////// |
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
38 |
// Ipv4FlowProbeTag class implementation // |
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
39 |
////////////////////////////////////// |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
40 |
|
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
41 |
class Ipv4FlowProbeTag : public Tag |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
42 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
43 |
public: |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
44 |
static TypeId GetTypeId (void); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
45 |
virtual TypeId GetInstanceTypeId (void) const; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
46 |
virtual uint32_t GetSerializedSize (void) const; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
47 |
virtual void Serialize (TagBuffer buf) const; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
48 |
virtual void Deserialize (TagBuffer buf); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
49 |
virtual void Print (std::ostream &os) const; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
50 |
Ipv4FlowProbeTag (); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
51 |
Ipv4FlowProbeTag (uint32_t flowId, uint32_t packetId, uint32_t packetSize); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
52 |
void SetFlowId (uint32_t flowId); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
53 |
void SetPacketId (uint32_t packetId); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
54 |
void SetPacketSize (uint32_t packetSize); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
55 |
uint32_t GetFlowId (void) const; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
56 |
uint32_t GetPacketId (void) const; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
57 |
uint32_t GetPacketSize (void) const; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
58 |
private: |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
59 |
uint32_t m_flowId; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
60 |
uint32_t m_packetId; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
61 |
uint32_t m_packetSize; |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
62 |
|
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
63 |
}; |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
64 |
|
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
65 |
TypeId |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
66 |
Ipv4FlowProbeTag::GetTypeId (void) |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
67 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
68 |
static TypeId tid = TypeId ("ns3::Ipv4FlowProbeTag") |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
69 |
.SetParent<Tag> () |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
70 |
.AddConstructor<Ipv4FlowProbeTag> () |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
71 |
; |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
72 |
return tid; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
73 |
} |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
74 |
TypeId |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
75 |
Ipv4FlowProbeTag::GetInstanceTypeId (void) const |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
76 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
77 |
return GetTypeId (); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
78 |
} |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
79 |
uint32_t |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
80 |
Ipv4FlowProbeTag::GetSerializedSize (void) const |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
81 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
82 |
return 4 + 4 + 4; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
83 |
} |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
84 |
void |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
85 |
Ipv4FlowProbeTag::Serialize (TagBuffer buf) const |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
86 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
87 |
buf.WriteU32 (m_flowId); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
88 |
buf.WriteU32 (m_packetId); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
89 |
buf.WriteU32 (m_packetSize); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
90 |
} |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
91 |
void |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
92 |
Ipv4FlowProbeTag::Deserialize (TagBuffer buf) |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
93 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
94 |
m_flowId = buf.ReadU32 (); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
95 |
m_packetId = buf.ReadU32 (); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
96 |
m_packetSize = buf.ReadU32 (); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
97 |
} |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
98 |
void |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
99 |
Ipv4FlowProbeTag::Print (std::ostream &os) const |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
100 |
{ |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
101 |
os << "FlowId=" << m_flowId; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
102 |
os << "PacketId=" << m_packetId; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
103 |
os << "PacketSize=" << m_packetSize; |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
104 |
} |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
105 |
Ipv4FlowProbeTag::Ipv4FlowProbeTag () |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
106 |
: Tag () |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
107 |
{ |
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
108 |
} |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
109 |
|
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
110 |
Ipv4FlowProbeTag::Ipv4FlowProbeTag (uint32_t flowId, uint32_t packetId, uint32_t packetSize) |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
111 |
: Tag (), m_flowId (flowId), m_packetId (packetId), m_packetSize (packetSize) |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
112 |
{ |
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
113 |
} |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
114 |
|
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
115 |
void |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
116 |
Ipv4FlowProbeTag::SetFlowId (uint32_t id) |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
117 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
118 |
m_flowId = id; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
119 |
} |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
120 |
void |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
121 |
Ipv4FlowProbeTag::SetPacketId (uint32_t id) |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
122 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
123 |
m_packetId = id; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
124 |
} |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
125 |
void |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
126 |
Ipv4FlowProbeTag::SetPacketSize (uint32_t size) |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
127 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
128 |
m_packetSize = size; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
129 |
} |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
130 |
uint32_t |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
131 |
Ipv4FlowProbeTag::GetFlowId (void) const |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
132 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
133 |
return m_flowId; |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
134 |
} |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
135 |
uint32_t |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
136 |
Ipv4FlowProbeTag::GetPacketId (void) const |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
137 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
138 |
return m_packetId; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
139 |
} |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
140 |
uint32_t |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
141 |
Ipv4FlowProbeTag::GetPacketSize (void) const |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
142 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
143 |
return m_packetSize; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
144 |
} |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
145 |
|
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
146 |
//////////////////////////////////////// |
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
147 |
// Ipv4FlowProbe class implementation // |
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
148 |
//////////////////////////////////////// |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
149 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
150 |
Ipv4FlowProbe::Ipv4FlowProbe (Ptr<FlowMonitor> monitor, |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
151 |
Ptr<Ipv4FlowClassifier> classifier, |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
152 |
Ptr<Node> node) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
153 |
: FlowProbe (monitor), |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
154 |
m_classifier (classifier) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
155 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
156 |
NS_LOG_FUNCTION (this << node->GetId ()); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
157 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
158 |
Ptr<Ipv4L3Protocol> ipv4 = node->GetObject<Ipv4L3Protocol> (); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
159 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
160 |
if (!ipv4->TraceConnectWithoutContext ("SendOutgoing", |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
161 |
MakeCallback (&Ipv4FlowProbe::SendOutgoingLogger, Ptr<Ipv4FlowProbe> (this)))) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
162 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
163 |
NS_FATAL_ERROR ("trace fail"); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
164 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
165 |
if (!ipv4->TraceConnectWithoutContext ("UnicastForward", |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
166 |
MakeCallback (&Ipv4FlowProbe::ForwardLogger, Ptr<Ipv4FlowProbe> (this)))) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
167 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
168 |
NS_FATAL_ERROR ("trace fail"); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
169 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
170 |
if (!ipv4->TraceConnectWithoutContext ("LocalDeliver", |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
171 |
MakeCallback (&Ipv4FlowProbe::ForwardUpLogger, Ptr<Ipv4FlowProbe> (this)))) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
172 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
173 |
NS_FATAL_ERROR ("trace fail"); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
174 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
175 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
176 |
if (!ipv4->TraceConnectWithoutContext ("Drop", |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
177 |
MakeCallback (&Ipv4FlowProbe::DropLogger, Ptr<Ipv4FlowProbe> (this)))) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
178 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
179 |
NS_FATAL_ERROR ("trace fail"); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
180 |
} |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
181 |
|
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
182 |
// code copied from point-to-point-helper.cc |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
183 |
std::ostringstream oss; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
184 |
oss << "/NodeList/" << node->GetId () << "/DeviceList/*/TxQueue/Drop"; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
185 |
Config::ConnectWithoutContext (oss.str (), MakeCallback (&Ipv4FlowProbe::QueueDropLogger, Ptr<Ipv4FlowProbe> (this))); |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
186 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
187 |
|
6325 | 188 |
Ipv4FlowProbe::~Ipv4FlowProbe () |
189 |
{ |
|
190 |
} |
|
191 |
||
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
192 |
void |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
193 |
Ipv4FlowProbe::SendOutgoingLogger (const Ipv4Header &ipHeader, Ptr<const Packet> ipPayload, uint32_t interface) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
194 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
195 |
FlowId flowId; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
196 |
FlowPacketId packetId; |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
197 |
|
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
198 |
if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
199 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
200 |
uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
201 |
NS_LOG_DEBUG ("ReportFirstTx ("<<this<<", "<<flowId<<", "<<packetId<<", "<<size<<"); " |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
202 |
<< ipHeader << *ipPayload); |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
203 |
m_flowMonitor->ReportFirstTx (this, flowId, packetId, size); |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
204 |
|
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
205 |
// tag the packet with the flow id and packet id, so that the packet can be identified even |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
206 |
// when Ipv4Header is not accessible at some non-IPv4 protocol layer |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
207 |
Ipv4FlowProbeTag fTag (flowId, packetId, size); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
208 |
ipPayload->AddPacketTag (fTag); |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
209 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
210 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
211 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
212 |
void |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
213 |
Ipv4FlowProbe::ForwardLogger (const Ipv4Header &ipHeader, Ptr<const Packet> ipPayload, uint32_t interface) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
214 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
215 |
FlowId flowId; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
216 |
FlowPacketId packetId; |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
217 |
|
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
218 |
if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
219 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
220 |
uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
221 |
NS_LOG_DEBUG ("ReportForwarding ("<<this<<", "<<flowId<<", "<<packetId<<", "<<size<<");"); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
222 |
m_flowMonitor->ReportForwarding (this, flowId, packetId, size); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
223 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
224 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
225 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
226 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
227 |
void |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
228 |
Ipv4FlowProbe::ForwardUpLogger (const Ipv4Header &ipHeader, Ptr<const Packet> ipPayload, uint32_t interface) |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
229 |
{ |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
230 |
FlowId flowId; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
231 |
FlowPacketId packetId; |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
232 |
|
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
233 |
if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
234 |
{ |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
235 |
// remove the tags that are added by Ipv4FlowProbe::SendOutgoingLogger () |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
236 |
Ipv4FlowProbeTag fTag; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
237 |
|
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
238 |
// ConstCast: see http://www.nsnam.org/bugzilla/show_bug.cgi?id=904 |
6480
2b24c68030e6
Flow Monitor: remove unnecessary assertions
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6476
diff
changeset
|
239 |
ConstCast<Packet> (ipPayload)->RemovePacketTag (fTag); |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
240 |
|
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
241 |
uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
242 |
NS_LOG_DEBUG ("ReportLastRx ("<<this<<", "<<flowId<<", "<<packetId<<", "<<size<<");"); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
243 |
m_flowMonitor->ReportLastRx (this, flowId, packetId, size); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
244 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
245 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
246 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
247 |
void |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
248 |
Ipv4FlowProbe::DropLogger (const Ipv4Header &ipHeader, Ptr<const Packet> ipPayload, |
6104 | 249 |
Ipv4L3Protocol::DropReason reason, Ptr<Ipv4> ipv4, uint32_t ifIndex) |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
250 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
251 |
#if 0 |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
252 |
switch (reason) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
253 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
254 |
case Ipv4L3Protocol::DROP_NO_ROUTE: |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
255 |
break; |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
256 |
|
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
257 |
case Ipv4L3Protocol::DROP_TTL_EXPIRED: |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
258 |
case Ipv4L3Protocol::DROP_BAD_CHECKSUM: |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
259 |
Ipv4Address addri = m_ipv4->GetAddress (ifIndex); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
260 |
Ipv4Mask maski = m_ipv4->GetNetworkMask (ifIndex); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
261 |
Ipv4Address bcast = addri.GetSubnetDirectedBroadcast (maski); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
262 |
if (ipHeader.GetDestination () == bcast) // we don't want broadcast packets |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
263 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
264 |
return; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
265 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
266 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
267 |
#endif |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
268 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
269 |
FlowId flowId; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
270 |
FlowPacketId packetId; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
271 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
272 |
if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
273 |
{ |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
274 |
// remove the tags that are added by Ipv4FlowProbe::SendOutgoingLogger () |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
275 |
Ipv4FlowProbeTag fTag; |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
276 |
|
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
277 |
// ConstCast: see http://www.nsnam.org/bugzilla/show_bug.cgi?id=904 |
6480
2b24c68030e6
Flow Monitor: remove unnecessary assertions
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6476
diff
changeset
|
278 |
ConstCast<Packet> (ipPayload)->RemovePacketTag (fTag); |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
279 |
|
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
280 |
uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
281 |
NS_LOG_DEBUG ("Drop ("<<this<<", "<<flowId<<", "<<packetId<<", "<<size<<", " << reason |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
282 |
<< ", destIp=" << ipHeader.GetDestination () << "); " |
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
283 |
<< "HDR: " << ipHeader << " PKT: " << *ipPayload); |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
284 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
285 |
DropReason myReason; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
286 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
287 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
288 |
switch (reason) |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
289 |
{ |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
290 |
case Ipv4L3Protocol::DROP_TTL_EXPIRED: |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
291 |
myReason = DROP_TTL_EXPIRE; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
292 |
NS_LOG_DEBUG ("DROP_TTL_EXPIRE"); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
293 |
break; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
294 |
case Ipv4L3Protocol::DROP_NO_ROUTE: |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
295 |
myReason = DROP_NO_ROUTE; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
296 |
NS_LOG_DEBUG ("DROP_NO_ROUTE"); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
297 |
break; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
298 |
case Ipv4L3Protocol::DROP_BAD_CHECKSUM: |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
299 |
myReason = DROP_BAD_CHECKSUM; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
300 |
NS_LOG_DEBUG ("DROP_BAD_CHECKSUM"); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
301 |
break; |
6476
d95255206be2
Bug 972 - [flow monitor] assertion fails in pv4-flow-probe.cc
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6326
diff
changeset
|
302 |
case Ipv4L3Protocol::DROP_INTERFACE_DOWN: |
d95255206be2
Bug 972 - [flow monitor] assertion fails in pv4-flow-probe.cc
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6326
diff
changeset
|
303 |
myReason = DROP_INTERFACE_DOWN; |
d95255206be2
Bug 972 - [flow monitor] assertion fails in pv4-flow-probe.cc
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6326
diff
changeset
|
304 |
NS_LOG_DEBUG ("DROP_INTERFACE_DOWN"); |
d95255206be2
Bug 972 - [flow monitor] assertion fails in pv4-flow-probe.cc
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6326
diff
changeset
|
305 |
break; |
d95255206be2
Bug 972 - [flow monitor] assertion fails in pv4-flow-probe.cc
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6326
diff
changeset
|
306 |
case Ipv4L3Protocol::DROP_ROUTE_ERROR: |
d95255206be2
Bug 972 - [flow monitor] assertion fails in pv4-flow-probe.cc
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6326
diff
changeset
|
307 |
myReason = DROP_ROUTE_ERROR; |
d95255206be2
Bug 972 - [flow monitor] assertion fails in pv4-flow-probe.cc
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6326
diff
changeset
|
308 |
NS_LOG_DEBUG ("DROP_ROUTE_ERROR"); |
d95255206be2
Bug 972 - [flow monitor] assertion fails in pv4-flow-probe.cc
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6326
diff
changeset
|
309 |
break; |
d95255206be2
Bug 972 - [flow monitor] assertion fails in pv4-flow-probe.cc
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6326
diff
changeset
|
310 |
|
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
311 |
default: |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
312 |
myReason = DROP_INVALID_REASON; |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
313 |
NS_FATAL_ERROR ("Unexpected drop reason code " << reason); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
314 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
315 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
316 |
m_flowMonitor->ReportDrop (this, flowId, packetId, size, myReason); |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
317 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
318 |
} |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
319 |
|
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
320 |
void |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
321 |
Ipv4FlowProbe::QueueDropLogger (Ptr<const Packet> ipPayload) |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
322 |
{ |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
323 |
// remove the tags that are added by Ipv4FlowProbe::SendOutgoingLogger () |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
324 |
Ipv4FlowProbeTag fTag; |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
325 |
|
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
326 |
// ConstCast: see http://www.nsnam.org/bugzilla/show_bug.cgi?id=904 |
6326
1bb22e1a2b59
fix optimized build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6325
diff
changeset
|
327 |
bool tagFound; |
1bb22e1a2b59
fix optimized build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
6325
diff
changeset
|
328 |
tagFound = ConstCast<Packet> (ipPayload)->RemovePacketTag (fTag); |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
329 |
NS_ASSERT_MSG (tagFound, "FlowProbeTag is missing"); |
7229
5e4a07a48a68
Bug 1161 - opt build flow-monitor unused variables
John Abraham<john.abraham@gatech.edu>
parents:
7175
diff
changeset
|
330 |
// cast tagFound to void, to suppress 'tagFound' set but not used compiler |
5e4a07a48a68
Bug 1161 - opt build flow-monitor unused variables
John Abraham<john.abraham@gatech.edu>
parents:
7175
diff
changeset
|
331 |
// warning in optimized builds |
5e4a07a48a68
Bug 1161 - opt build flow-monitor unused variables
John Abraham<john.abraham@gatech.edu>
parents:
7175
diff
changeset
|
332 |
(void) tagFound; |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
333 |
FlowId flowId = fTag.GetFlowId (); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
334 |
FlowPacketId packetId = fTag.GetPacketId (); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
335 |
uint32_t size = fTag.GetPacketSize (); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
336 |
|
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
337 |
NS_LOG_DEBUG ("Drop ("<<this<<", "<<flowId<<", "<<packetId<<", "<<size<<", " << DROP_QUEUE |
7175
8fffa1497fba
flow-monitor coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6939
diff
changeset
|
338 |
<< "); "); |
6323
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
339 |
|
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
340 |
m_flowMonitor->ReportDrop (this, flowId, packetId, size, DROP_QUEUE); |
2a8ec4aee3b5
Bug 854 - Support DROP_QUEUE reason-code in Ipv4FlowProbe
Wilson Thong <wilsonwk@ee.cityu.edu.hk>
parents:
6104
diff
changeset
|
341 |
} |
5205
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
342 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
343 |
} // namespace ns3 |
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
344 |
|
673aae891b2b
Add a new 'flow-monitor' module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
345 |