20 #ifndef TUNNEL_CONTROLLER_H
21 #define TUNNEL_CONTROLLER_H
23 #include <ns3/applications-module.h>
24 #include <ns3/core-module.h>
25 #include <ns3/internet-module.h>
26 #include <ns3/network-module.h>
27 #include <ns3/ofswitch13-module.h>
28 #include <ns3/virtual-net-device-module.h>
85 uint32_t xid)
override;
Ipv4 addresses are stored in host order in this class.
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.
This controller is responsible for installing the forwarding rules on the switches.
ofl_err HandleArpPacketIn(struct ofl_msg_packet_in *msg, Ptr< const RemoteSwitch > swtch, uint32_t xid)
Handle packet-in messages sent from switch with ARP message.
TunnelController()
Default constructor.
IpMacMap_t m_arpTable
ARP resolution table.
Ipv4Address ExtractIpv4Address(uint32_t oxm_of, struct ofl_match *match)
Extract an IPv4 address from packet match.
static TypeId GetTypeId()
Register this type.
void SaveTunnelEndpoint(uint64_t dpId, uint32_t portNo, Ipv4Address ipAddr)
Save the pair datapath ID + port no / IP address in tunnel endpoint table.
~TunnelController() override
Dummy destructor, see DoDispose.
void DoDispose() override
Destructor implementation.
Ipv4Address GetTunnelEndpoint(uint64_t dpId, uint32_t portNo)
Perform tunnel endpoint resolution.
Ptr< Packet > CreateArpReply(Mac48Address srcMac, Ipv4Address srcIp, Mac48Address dstMac, Ipv4Address dstIp)
Create a Packet with an ARP reply, encapsulated inside of an Ethernet frame (with header and trailer.
DpPortIpMap_t m_endpointTable
Tunnel endpoint resolution table.
Mac48Address GetArpEntry(Ipv4Address ip)
Perform ARP resolution.
ofl_err HandlePacketIn(struct ofl_msg_packet_in *msg, Ptr< const RemoteSwitch > swtch, uint32_t xid) override
Handle a packet in message sent by the switch to this controller.
std::pair< uint64_t, uint32_t > DpPortPair_t
A pair identifying OpenFlow datapath id and port number.
void SaveArpEntry(Ipv4Address ipAddr, Mac48Address macAddr)
Save the pair IP / MAC address in ARP table.
std::map< Ipv4Address, Mac48Address > IpMacMap_t
Map saving <IPv4 address / MAC address>
std::map< DpPortPair_t, Ipv4Address > DpPortIpMap_t
Map saving <DpPortPair_t / IPv4 address>
void HandshakeSuccessful(Ptr< const RemoteSwitch > swtch) override
Function invoked after a successfully handshake procedure between this controller and a remote switch...
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.