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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
7
*/
8
9
#ifndef IPV6_PMTU_CACHE_H
10
#define IPV6_PMTU_CACHE_H
11
12
#include "ns3/event-id.h"
13
#include "ns3/ipv6-address.h"
14
#include "ns3/nstime.h"
15
#include "ns3/object.h"
16
#include "ns3/type-id.h"
17
18
#include <map>
19
20
namespace
ns3
21
{
22
23
/**
24
* \ingroup ipv6
25
*
26
* \brief This class implements the Path MTU cache, as defined by \RFC{1981}.
27
*
28
* The Path MTU is stored according to the destination address, and it is
29
* cleared upon expiration (default validity time is 10 minutes).
30
*
31
* The "infinite lifetime" PMTU entry type is not implemented, since it is
32
* useful only in an very limited number of cases. See the RFC for further
33
* details.
34
*/
35
36
class
Ipv6PmtuCache
:
public
Object
37
{
38
public
:
39
class
Entry;
40
41
/**
42
* \brief Get the type ID
43
* \return type ID
44
*/
45
static
TypeId
GetTypeId
();
46
47
/**
48
* \brief Constructor.
49
*/
50
Ipv6PmtuCache
();
51
52
/**
53
* \brief Destructor.
54
*/
55
~Ipv6PmtuCache
()
override
;
56
57
/**
58
* \brief Dispose object.
59
*/
60
void
DoDispose
()
override
;
61
62
/**
63
* \brief Gets the known Path MTU for the specific destination
64
* \param dst the destination
65
* \return the Path MTU (zero if unknown)
66
*/
67
uint32_t
GetPmtu
(
Ipv6Address
dst);
68
69
/**
70
* \brief Sets the Path MTU for the specific destination
71
* \param dst the destination
72
* \param pmtu the Path MTU
73
*/
74
void
SetPmtu
(
Ipv6Address
dst,
uint32_t
pmtu);
75
76
/**
77
* \brief Gets the Path MTU validity time
78
* \return the Path MTU validity time
79
*/
80
Time
GetPmtuValidityTime
()
const
;
81
82
/**
83
* \brief Sets the Path MTU validity time (minimum is 5 minutes)
84
* \param validity the Path MTU validity time
85
* \return true if the change was successful
86
*/
87
bool
SetPmtuValidityTime
(
Time
validity);
88
89
private
:
90
/**
91
* \brief Clears the Path MTU for the specific destination
92
* \param dst the destination
93
*/
94
void
ClearPmtu
(
Ipv6Address
dst);
95
96
/**
97
* \brief Path MTU table
98
*/
99
std::map<Ipv6Address, uint32_t>
m_pathMtu
;
100
101
/**
102
* \brief Container of the IPv6 PMTU data (Ipv6 destination address and expiration event).
103
*/
104
typedef
std::map<Ipv6Address, EventId>::iterator
pathMtuTimerIter
;
105
106
/**
107
* \brief Path MTU Expiration table
108
*/
109
std::map<Ipv6Address, EventId>
m_pathMtuTimer
;
110
111
/**
112
* \brief Path MTU entry validity time
113
*/
114
Time
m_validityTime
;
115
};
116
117
}
// namespace ns3
118
119
#endif
/* IPV6_PMTU_CACHE_H */
ns3::Ipv6Address
Describes an IPv6 address.
Definition
ipv6-address.h:38
ns3::Ipv6PmtuCache
This class implements the Path MTU cache, as defined by RFC 1981 .
Definition
ipv6-pmtu-cache.h:37
ns3::Ipv6PmtuCache::DoDispose
void DoDispose() override
Dispose object.
Definition
ipv6-pmtu-cache.cc:46
ns3::Ipv6PmtuCache::~Ipv6PmtuCache
~Ipv6PmtuCache() override
Destructor.
Definition
ipv6-pmtu-cache.cc:41
ns3::Ipv6PmtuCache::m_pathMtu
std::map< Ipv6Address, uint32_t > m_pathMtu
Path MTU table.
Definition
ipv6-pmtu-cache.h:99
ns3::Ipv6PmtuCache::ClearPmtu
void ClearPmtu(Ipv6Address dst)
Clears the Path MTU for the specific destination.
Definition
ipv6-pmtu-cache.cc:106
ns3::Ipv6PmtuCache::Ipv6PmtuCache
Ipv6PmtuCache()
Constructor.
Definition
ipv6-pmtu-cache.cc:37
ns3::Ipv6PmtuCache::m_pathMtuTimer
std::map< Ipv6Address, EventId > m_pathMtuTimer
Path MTU Expiration table.
Definition
ipv6-pmtu-cache.h:109
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:104
ns3::Ipv6PmtuCache::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
ipv6-pmtu-cache.cc:22
ns3::Ipv6PmtuCache::GetPmtuValidityTime
Time GetPmtuValidityTime() const
Gets the Path MTU validity time.
Definition
ipv6-pmtu-cache.cc:84
ns3::Ipv6PmtuCache::m_validityTime
Time m_validityTime
Path MTU entry validity time.
Definition
ipv6-pmtu-cache.h:114
ns3::Ipv6PmtuCache::GetPmtu
uint32_t GetPmtu(Ipv6Address dst)
Gets the known Path MTU for the specific destination.
Definition
ipv6-pmtu-cache.cc:57
ns3::Ipv6PmtuCache::SetPmtuValidityTime
bool SetPmtuValidityTime(Time validity)
Sets the Path MTU validity time (minimum is 5 minutes)
Definition
ipv6-pmtu-cache.cc:91
ns3::Ipv6PmtuCache::SetPmtu
void SetPmtu(Ipv6Address dst, uint32_t pmtu)
Sets the Path MTU for the specific destination.
Definition
ipv6-pmtu-cache.cc:69
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
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 Fri Nov 8 2024 13:59:01 for ns-3 by
1.11.0