A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
qos-controller.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016 University of Campinas (Unicamp)
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: Luciano Jerez Chaves <ljerezchaves@gmail.com>
18
*/
19
20
#ifndef QOS_CONTROLLER_H
21
#define QOS_CONTROLLER_H
22
23
#include <ns3/ofswitch13-module.h>
24
25
using namespace
ns3
;
26
30
class
QosController
:
public
OFSwitch13Controller
31
{
32
public
:
33
QosController
();
34
~
QosController
()
override
;
35
37
void
DoDispose()
override
;
38
43
static
TypeId
GetTypeId();
44
53
ofl_err HandlePacketIn(
struct
ofl_msg_packet_in* msg,
54
Ptr<const RemoteSwitch>
swtch,
55
uint32_t xid)
override
;
56
57
protected
:
58
// Inherited from OFSwitch13Controller
59
void
HandshakeSuccessful(
Ptr<const RemoteSwitch>
swtch)
override
;
60
61
private
:
66
void
ConfigureBorderSwitch(
Ptr<const RemoteSwitch>
swtch);
67
72
void
ConfigureAggregationSwitch(
Ptr<const RemoteSwitch>
swtch);
73
81
ofl_err HandleArpPacketIn(
struct
ofl_msg_packet_in* msg,
82
Ptr<const RemoteSwitch>
swtch,
83
uint32_t xid);
84
92
ofl_err HandleConnectionRequest(
struct
ofl_msg_packet_in* msg,
93
Ptr<const RemoteSwitch>
swtch,
94
uint32_t xid);
95
102
Ipv4Address
ExtractIpv4Address(uint32_t oxm_of,
struct
ofl_match* match);
103
111
Ptr<Packet>
CreateArpRequest(
Mac48Address
srcMac,
Ipv4Address
srcIp,
Ipv4Address
dstIp);
112
121
Ptr<Packet>
CreateArpReply(
Mac48Address
srcMac,
122
Ipv4Address
srcIp,
123
Mac48Address
dstMac,
124
Ipv4Address
dstIp);
125
131
void
SaveArpEntry(
Ipv4Address
ipAddr,
Mac48Address
macAddr);
132
138
Mac48Address
GetArpEntry(
Ipv4Address
ip);
139
140
Address
m_serverIpAddress
;
141
uint16_t
m_serverTcpPort
;
142
Address
m_serverMacAddress
;
143
bool
m_meterEnable
;
144
DataRate
m_meterRate
;
145
bool
m_linkAggregation
;
146
148
typedef
std::map<Ipv4Address, Mac48Address>
IpMacMap_t
;
149
IpMacMap_t
m_arpTable
;
150
};
151
152
#endif
/* QOS_CONTROLLER_H */
QosController
An border OpenFlow 1.3 controller.
Definition:
qos-controller.h:31
QosController::m_serverIpAddress
Address m_serverIpAddress
Virtual server IP address.
Definition:
qos-controller.h:140
QosController::m_serverTcpPort
uint16_t m_serverTcpPort
Virtual server TCP port.
Definition:
qos-controller.h:141
QosController::m_serverMacAddress
Address m_serverMacAddress
Border switch MAC address.
Definition:
qos-controller.h:142
QosController::m_arpTable
IpMacMap_t m_arpTable
ARP resolution table.
Definition:
qos-controller.h:149
QosController::m_meterEnable
bool m_meterEnable
Enable per-flow mettering.
Definition:
qos-controller.h:143
QosController::m_meterRate
DataRate m_meterRate
Per-flow meter rate.
Definition:
qos-controller.h:144
QosController::m_linkAggregation
bool m_linkAggregation
Enable link aggregation.
Definition:
qos-controller.h:145
QosController::IpMacMap_t
std::map< Ipv4Address, Mac48Address > IpMacMap_t
Map saving <IPv4 address / MAC address>
Definition:
qos-controller.h:148
ns3::Address
a polymophic address class
Definition:
address.h:100
ns3::DataRate
Class for representing data rates.
Definition:
data-rate.h:90
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:43
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:46
ns3::OFSwitch13Controller
OpenFlow 1.3 controller base class that can handle a collection of OpenFlow switches and provides the...
Definition:
ofswitch13-controller.h:45
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:78
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:60
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
contrib
ofswitch13
examples
ofswitch13-qos-controller
qos-controller.h
Generated on Fri Mar 31 2023 13:30:37 for ns-3 by
1.9.1