A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
gtp-tunnel-app.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 GTP_TUNNEL_APP_H
21
#define GTP_TUNNEL_APP_H
22
23
#include <ns3/applications-module.h>
24
#include <ns3/core-module.h>
25
#include <ns3/csma-module.h>
26
#include <ns3/internet-module.h>
27
#include <ns3/network-module.h>
28
#include <ns3/virtual-net-device-module.h>
29
30
namespace
ns3
31
{
32
47
class
GtpTunnelApp
:
public
Application
48
{
49
public
:
55
GtpTunnelApp
(
Ptr<VirtualNetDevice>
logicalPort,
Ptr<CsmaNetDevice>
physicalDev);
56
~GtpTunnelApp
()
override
;
57
62
static
TypeId
GetTypeId
();
63
76
bool
RecvFromLogicalPort
(
Ptr<Packet>
packet,
77
const
Address
& source,
78
const
Address
& dest,
79
uint16_t protocolNo);
80
87
void
RecvFromTunnelSocket
(
Ptr<Socket>
socket);
88
89
protected
:
91
void
DoDispose
()
override
;
92
93
// Inherited from Application.
94
void
StartApplication
()
override
;
95
96
private
:
104
void
AddHeader
(
Ptr<Packet>
packet,
105
Mac48Address
source =
Mac48Address
(),
106
Mac48Address
dest =
Mac48Address
(),
107
uint16_t protocolNo =
Ipv4L3Protocol::PROT_NUMBER
);
108
109
Ptr<Socket>
m_tunnelSocket
;
110
Ptr<VirtualNetDevice>
m_logicalPort
;
111
Ptr<CsmaNetDevice>
m_physicalDev
;
112
const
uint16_t
m_port
= 2152;
113
};
114
115
}
// namespace ns3
116
#endif
/* GTP_TUNNEL_APP_H */
ns3::Address
a polymophic address class
Definition:
address.h:100
ns3::Application
The base class for all ns3 applications.
Definition:
application.h:61
ns3::GtpTunnelApp
This GTP tunnel application is responsible for implementing the logical port operations to encapsulat...
Definition:
gtp-tunnel-app.h:48
ns3::GtpTunnelApp::RecvFromLogicalPort
bool RecvFromLogicalPort(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNo)
Method to be assigned to the send callback of the VirtualNetDevice implementing the OpenFlow logical ...
Definition:
gtp-tunnel-app.cc:55
ns3::GtpTunnelApp::RecvFromTunnelSocket
void RecvFromTunnelSocket(Ptr< Socket > socket)
Method to be assigned to the receive callback of the UDP tunnel socket.
Definition:
gtp-tunnel-app.cc:94
ns3::GtpTunnelApp::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
gtp-tunnel-app.cc:47
ns3::GtpTunnelApp::StartApplication
void StartApplication() override
Application specific startup code.
Definition:
gtp-tunnel-app.cc:140
ns3::GtpTunnelApp::m_physicalDev
Ptr< CsmaNetDevice > m_physicalDev
Node physical network device.
Definition:
gtp-tunnel-app.h:111
ns3::GtpTunnelApp::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
gtp-tunnel-app.cc:130
ns3::GtpTunnelApp::m_logicalPort
Ptr< VirtualNetDevice > m_logicalPort
OpenFlow logical port device.
Definition:
gtp-tunnel-app.h:110
ns3::GtpTunnelApp::GtpTunnelApp
GtpTunnelApp(Ptr< VirtualNetDevice > logicalPort, Ptr< CsmaNetDevice > physicalDev)
Complete constructor.
Definition:
gtp-tunnel-app.cc:31
ns3::GtpTunnelApp::m_tunnelSocket
Ptr< Socket > m_tunnelSocket
UDP tunnel socket.
Definition:
gtp-tunnel-app.h:109
ns3::GtpTunnelApp::AddHeader
void AddHeader(Ptr< Packet > packet, Mac48Address source=Mac48Address(), Mac48Address dest=Mac48Address(), uint16_t protocolNo=Ipv4L3Protocol::PROT_NUMBER)
Adds the necessary Ethernet headers and trailers to a packet of data.
Definition:
gtp-tunnel-app.cc:158
ns3::GtpTunnelApp::~GtpTunnelApp
~GtpTunnelApp() override
Dummy destructor, see DoDispose.
Definition:
gtp-tunnel-app.cc:41
ns3::GtpTunnelApp::m_port
const uint16_t m_port
GTP tunnel port.
Definition:
gtp-tunnel-app.h:112
ns3::Ipv4L3Protocol::PROT_NUMBER
static const uint16_t PROT_NUMBER
Protocol number (0x0800)
Definition:
ipv4-l3-protocol.h:89
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:46
ns3::Ptr< VirtualNetDevice >
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-logical-port
gtp-tunnel-app.h
Generated on Fri Mar 31 2023 13:30:37 for ns-3 by
1.9.1