A Discrete-Event Network Simulator
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 
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,
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,
83  uint32_t xid);
84 
92  ofl_err HandleConnectionRequest(struct ofl_msg_packet_in* msg,
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 
141  uint16_t m_serverTcpPort;
146 
148  typedef std::map<Ipv4Address, Mac48Address> IpMacMap_t;
150 };
151 
152 #endif /* QOS_CONTROLLER_H */
An border OpenFlow 1.3 controller.
Address m_serverIpAddress
Virtual server IP address.
uint16_t m_serverTcpPort
Virtual server TCP port.
Address m_serverMacAddress
Border switch MAC address.
IpMacMap_t m_arpTable
ARP resolution table.
bool m_meterEnable
Enable per-flow mettering.
DataRate m_meterRate
Per-flow meter rate.
bool m_linkAggregation
Enable link aggregation.
std::map< Ipv4Address, Mac48Address > IpMacMap_t
Map saving <IPv4 address / MAC address>
a polymophic address class
Definition: address.h:100
Class for representing data rates.
Definition: data-rate.h:90
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:43
an EUI-48 address
Definition: mac48-address.h:46
OpenFlow 1.3 controller base class that can handle a collection of OpenFlow switches and provides the...
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.