A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
ofswitch13-learning-controller.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 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 OFSWITCH13_LEARNING_CONTROLLER_H
21
#define OFSWITCH13_LEARNING_CONTROLLER_H
22
23
#include "
ofswitch13-controller.h
"
24
25
namespace
ns3
26
{
27
32
class
OFSwitch13LearningController
:
public
OFSwitch13Controller
33
{
34
public
:
35
OFSwitch13LearningController
();
36
~OFSwitch13LearningController
()
override
;
37
42
static
TypeId
GetTypeId
();
43
45
void
DoDispose
()
override
;
46
57
ofl_err
HandlePacketIn
(
struct
ofl_msg_packet_in* msg,
58
Ptr<const RemoteSwitch>
swtch,
59
uint32_t xid)
override
;
60
70
ofl_err
HandleFlowRemoved
(
struct
ofl_msg_flow_removed* msg,
71
Ptr<const RemoteSwitch>
swtch,
72
uint32_t xid)
override
;
73
74
protected
:
75
// Inherited from OFSwitch13Controller
76
void
HandshakeSuccessful
(
Ptr<const RemoteSwitch>
swtch)
override
;
77
78
private
:
80
typedef
std::map<Ipv4Address, Mac48Address>
IpMacMap_t
;
81
IpMacMap_t
m_arpTable
;
82
86
//\{
88
typedef
std::map<Mac48Address, uint32_t>
L2Table_t
;
89
91
typedef
std::map<uint64_t, L2Table_t>
DatapathMap_t
;
92
94
DatapathMap_t
m_learnedInfo
;
95
//\}
96
};
97
98
}
// namespace ns3
99
#endif
/* OFSWITCH13_LEARNING_CONTROLLER_H */
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::OFSwitch13LearningController
An Learning OpenFlow 1.3 controller (works as L2 switch)
Definition:
ofswitch13-learning-controller.h:33
ns3::OFSwitch13LearningController::HandlePacketIn
ofl_err HandlePacketIn(struct ofl_msg_packet_in *msg, Ptr< const RemoteSwitch > swtch, uint32_t xid) override
Handle packet-in messages sent from switch to this controller.
ns3::OFSwitch13LearningController::HandleFlowRemoved
ofl_err HandleFlowRemoved(struct ofl_msg_flow_removed *msg, Ptr< const RemoteSwitch > swtch, uint32_t xid) override
Handle flow removed messages sent from switch to this controller.
ns3::OFSwitch13LearningController::m_learnedInfo
DatapathMap_t m_learnedInfo
Switching information for all dapataths.
Definition:
ofswitch13-learning-controller.h:94
ns3::OFSwitch13LearningController::OFSwitch13LearningController
OFSwitch13LearningController()
Default constructor.
ns3::OFSwitch13LearningController::HandshakeSuccessful
void HandshakeSuccessful(Ptr< const RemoteSwitch > swtch) override
Function invoked after a successfully handshake procedure between this controller and a remote switch...
ns3::OFSwitch13LearningController::DatapathMap_t
std::map< uint64_t, L2Table_t > DatapathMap_t
Map datapathID to L2SwitchingTable.
Definition:
ofswitch13-learning-controller.h:91
ns3::OFSwitch13LearningController::m_arpTable
IpMacMap_t m_arpTable
ARP resolution table.
Definition:
ofswitch13-learning-controller.h:81
ns3::OFSwitch13LearningController::DoDispose
void DoDispose() override
Destructor implementation.
ns3::OFSwitch13LearningController::GetTypeId
static TypeId GetTypeId()
Register this type.
ns3::OFSwitch13LearningController::L2Table_t
std::map< Mac48Address, uint32_t > L2Table_t
L2SwitchingTable: map MacAddress to port.
Definition:
ofswitch13-learning-controller.h:88
ns3::OFSwitch13LearningController::~OFSwitch13LearningController
~OFSwitch13LearningController() override
Dummy destructor.
ns3::OFSwitch13LearningController::IpMacMap_t
std::map< Ipv4Address, Mac48Address > IpMacMap_t
Map saving <IPv4 address / MAC address>
Definition:
ofswitch13-learning-controller.h:80
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.
ofswitch13-controller.h
contrib
ofswitch13
model
ofswitch13-learning-controller.h
Generated on Fri Mar 31 2023 13:30:37 for ns-3 by
1.9.1