A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
ipv6-pmtu-cache.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013 Universita' di Firenze
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: Tommaso Pecorella <tommaso.pecorella@unifi.it>
18
*/
19
20
#ifndef IPV6_PMTU_CACHE_H
21
#define IPV6_PMTU_CACHE_H
22
23
#include "ns3/event-id.h"
24
#include "ns3/ipv6-address.h"
25
#include "ns3/nstime.h"
26
#include "ns3/object.h"
27
#include "ns3/type-id.h"
28
29
#include <map>
30
31
namespace
ns3
32
{
33
34
/**
35
* \ingroup ipv6
36
*
37
* \brief This class implements the Path MTU cache, as defined by \RFC{1981}.
38
*
39
* The Path MTU is stored according to the destination address, and it is
40
* cleared upon expiration (default validity time is 10 minutes).
41
*
42
* The "infinite lifetime" PMTU entry type is not implemented, since it is
43
* useful only in an very limited number of cases. See the RFC for further
44
* details.
45
*/
46
47
class
Ipv6PmtuCache
:
public
Object
48
{
49
public
:
50
class
Entry;
51
52
/**
53
* \brief Get the type ID
54
* \return type ID
55
*/
56
static
TypeId
GetTypeId
();
57
58
/**
59
* \brief Constructor.
60
*/
61
Ipv6PmtuCache
();
62
63
/**
64
* \brief Destructor.
65
*/
66
~Ipv6PmtuCache
()
override
;
67
68
/**
69
* \brief Dispose object.
70
*/
71
void
DoDispose
()
override
;
72
73
/**
74
* \brief Gets the known Path MTU for the specific destination
75
* \param dst the destination
76
* \return the Path MTU (zero if unknown)
77
*/
78
uint32_t
GetPmtu
(
Ipv6Address
dst);
79
80
/**
81
* \brief Sets the Path MTU for the specific destination
82
* \param dst the destination
83
* \param pmtu the Path MTU
84
*/
85
void
SetPmtu
(
Ipv6Address
dst,
uint32_t
pmtu);
86
87
/**
88
* \brief Gets the Path MTU validity time
89
* \return the Path MTU validity time
90
*/
91
Time
GetPmtuValidityTime
()
const
;
92
93
/**
94
* \brief Sets the Path MTU validity time (minimum is 5 minutes)
95
* \param validity the Path MTU validity time
96
* \return true if the change was successful
97
*/
98
bool
SetPmtuValidityTime
(
Time
validity);
99
100
private
:
101
/**
102
* \brief Clears the Path MTU for the specific destination
103
* \param dst the destination
104
*/
105
void
ClearPmtu
(
Ipv6Address
dst);
106
107
/**
108
* \brief Path MTU table
109
*/
110
std::map<Ipv6Address, uint32_t>
m_pathMtu
;
111
112
/**
113
* \brief Container of the IPv6 PMTU data (Ipv6 destination address and expiration event).
114
*/
115
typedef
std::map<Ipv6Address, EventId>::iterator
pathMtuTimerIter
;
116
117
/**
118
* \brief Path MTU Expiration table
119
*/
120
std::map<Ipv6Address, EventId>
m_pathMtuTimer
;
121
122
/**
123
* \brief Path MTU entry validity time
124
*/
125
Time
m_validityTime
;
126
};
127
128
}
// namespace ns3
129
130
#endif
/* IPV6_PMTU_CACHE_H */
ns3::Ipv6Address
Describes an IPv6 address.
Definition:
ipv6-address.h:49
ns3::Ipv6PmtuCache
This class implements the Path MTU cache, as defined by RFC 1981.
Definition:
ipv6-pmtu-cache.h:48
ns3::Ipv6PmtuCache::DoDispose
void DoDispose() override
Dispose object.
Definition:
ipv6-pmtu-cache.cc:57
ns3::Ipv6PmtuCache::~Ipv6PmtuCache
~Ipv6PmtuCache() override
Destructor.
Definition:
ipv6-pmtu-cache.cc:52
ns3::Ipv6PmtuCache::m_pathMtu
std::map< Ipv6Address, uint32_t > m_pathMtu
Path MTU table.
Definition:
ipv6-pmtu-cache.h:110
ns3::Ipv6PmtuCache::ClearPmtu
void ClearPmtu(Ipv6Address dst)
Clears the Path MTU for the specific destination.
Definition:
ipv6-pmtu-cache.cc:117
ns3::Ipv6PmtuCache::Ipv6PmtuCache
Ipv6PmtuCache()
Constructor.
Definition:
ipv6-pmtu-cache.cc:48
ns3::Ipv6PmtuCache::m_pathMtuTimer
std::map< Ipv6Address, EventId > m_pathMtuTimer
Path MTU Expiration table.
Definition:
ipv6-pmtu-cache.h:120
ns3::Ipv6PmtuCache::pathMtuTimerIter
std::map< Ipv6Address, EventId >::iterator pathMtuTimerIter
Container of the IPv6 PMTU data (Ipv6 destination address and expiration event).
Definition:
ipv6-pmtu-cache.h:115
ns3::Ipv6PmtuCache::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
ipv6-pmtu-cache.cc:33
ns3::Ipv6PmtuCache::GetPmtuValidityTime
Time GetPmtuValidityTime() const
Gets the Path MTU validity time.
Definition:
ipv6-pmtu-cache.cc:95
ns3::Ipv6PmtuCache::m_validityTime
Time m_validityTime
Path MTU entry validity time.
Definition:
ipv6-pmtu-cache.h:125
ns3::Ipv6PmtuCache::GetPmtu
uint32_t GetPmtu(Ipv6Address dst)
Gets the known Path MTU for the specific destination.
Definition:
ipv6-pmtu-cache.cc:68
ns3::Ipv6PmtuCache::SetPmtuValidityTime
bool SetPmtuValidityTime(Time validity)
Sets the Path MTU validity time (minimum is 5 minutes)
Definition:
ipv6-pmtu-cache.cc:102
ns3::Ipv6PmtuCache::SetPmtu
void SetPmtu(Ipv6Address dst, uint32_t pmtu)
Sets the Path MTU for the specific destination.
Definition:
ipv6-pmtu-cache.cc:80
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet
model
ipv6-pmtu-cache.h
Generated on Tue May 28 2024 23:36:01 for ns-3 by
1.9.6