NFD: Named Data Networking Forwarding Daemon 24.07-20-gbeb9e85b documentation
Loading...
Searching...
No Matches
asf-probing-module.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2014-2024, Regents of the University of California,
4
* Arizona Board of Regents,
5
* Colorado State University,
6
* University Pierre & Marie Curie, Sorbonne University,
7
* Washington University in St. Louis,
8
* Beijing Institute of Technology,
9
* The University of Memphis.
10
*
11
* This file is part of NFD (Named Data Networking Forwarding Daemon).
12
* See AUTHORS.md for complete list of NFD authors and contributors.
13
*
14
* NFD is free software: you can redistribute it and/or modify it under the terms
15
* of the GNU General Public License as published by the Free Software Foundation,
16
* either version 3 of the License, or (at your option) any later version.
17
*
18
* NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20
* PURPOSE. See the GNU General Public License for more details.
21
*
22
* You should have received a copy of the GNU General Public License along with
23
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
24
*/
25
26
#ifndef NFD_DAEMON_FW_ASF_PROBING_MODULE_HPP
27
#define NFD_DAEMON_FW_ASF_PROBING_MODULE_HPP
28
29
#include "
asf-measurements.hpp
"
30
31
namespace
nfd::fw::asf
{
32
36
struct
FaceStats
37
{
38
Face
*
face
=
nullptr
;
39
time::nanoseconds
rtt
= 0_ns;
40
time::nanoseconds
srtt
= 0_ns;
41
uint64_t
cost
= 0;
42
};
43
47
class
ProbingModule
48
{
49
public
:
50
explicit
51
ProbingModule
(
AsfMeasurements
& measurements);
52
53
void
54
scheduleProbe
(
const
fib::Entry
& fibEntry, time::milliseconds interval);
55
56
Face
*
57
getFaceToProbe
(
const
Face
& inFace,
const
Interest& interest,
58
const
fib::Entry
& fibEntry,
const
Face
& faceUsed);
59
60
bool
61
isProbingNeeded
(
const
fib::Entry
& fibEntry,
const
Name& interestName);
62
63
void
64
afterForwardingProbe
(
const
fib::Entry
& fibEntry,
const
Name& interestName);
65
66
void
67
setProbingInterval
(time::milliseconds probingInterval);
68
69
time::milliseconds
70
getProbingInterval
()
const
71
{
72
return
m_probingInterval;
73
}
74
75
public
:
76
static
constexpr
time::milliseconds
DEFAULT_PROBING_INTERVAL
= 1_min;
77
static
constexpr
time::milliseconds
MIN_PROBING_INTERVAL
= 1_s;
78
79
struct
FaceStatsProbingCompare
80
{
81
bool
82
operator()
(
const
FaceStats
& lhs,
const
FaceStats
& rhs)
const
noexcept
;
83
};
84
using
FaceStatsProbingSet
= std::set<FaceStats, FaceStatsProbingCompare>;
85
86
private
:
87
time::milliseconds m_probingInterval;
88
AsfMeasurements
& m_measurements;
89
};
90
91
}
// namespace nfd::fw::asf
92
93
#endif
// NFD_DAEMON_FW_ASF_PROBING_MODULE_HPP
asf-measurements.hpp
nfd::face::Face
Generalization of a network interface.
Definition
face.hpp:118
nfd::fib::Entry
Represents an entry in the FIB.
Definition
fib-entry.hpp:91
nfd::fw::asf::AsfMeasurements
Helper class to retrieve and create strategy measurements.
Definition
asf-measurements.hpp:189
nfd::fw::asf::ProbingModule
ASF Probing Module.
Definition
asf-probing-module.hpp:48
nfd::fw::asf::ProbingModule::getFaceToProbe
Face * getFaceToProbe(const Face &inFace, const Interest &interest, const fib::Entry &fibEntry, const Face &faceUsed)
Definition
asf-probing-module.cpp:142
nfd::fw::asf::ProbingModule::isProbingNeeded
bool isProbingNeeded(const fib::Entry &fibEntry, const Name &interestName)
Definition
asf-probing-module.cpp:183
nfd::fw::asf::ProbingModule::getProbingInterval
time::milliseconds getProbingInterval() const
Definition
asf-probing-module.hpp:70
nfd::fw::asf::ProbingModule::MIN_PROBING_INTERVAL
static constexpr time::milliseconds MIN_PROBING_INTERVAL
Definition
asf-probing-module.hpp:77
nfd::fw::asf::ProbingModule::FaceStatsProbingSet
std::set< FaceStats, FaceStatsProbingCompare > FaceStatsProbingSet
Definition
asf-probing-module.hpp:84
nfd::fw::asf::ProbingModule::afterForwardingProbe
void afterForwardingProbe(const fib::Entry &fibEntry, const Name &interestName)
Definition
asf-probing-module.cpp:202
nfd::fw::asf::ProbingModule::setProbingInterval
void setProbingInterval(time::milliseconds probingInterval)
Definition
asf-probing-module.cpp:213
nfd::fw::asf::ProbingModule::scheduleProbe
void scheduleProbe(const fib::Entry &fibEntry, time::milliseconds interval)
Definition
asf-probing-module.cpp:44
nfd::fw::asf::ProbingModule::DEFAULT_PROBING_INTERVAL
static constexpr time::milliseconds DEFAULT_PROBING_INTERVAL
Definition
asf-probing-module.hpp:76
nfd::fw::asf
Definition
asf-measurements.cpp:29
nfd::fw::asf::FaceStats
Container for ranking-related values.
Definition
asf-probing-module.hpp:37
nfd::fw::asf::FaceStats::srtt
time::nanoseconds srtt
Definition
asf-probing-module.hpp:40
nfd::fw::asf::FaceStats::cost
uint64_t cost
Definition
asf-probing-module.hpp:41
nfd::fw::asf::FaceStats::rtt
time::nanoseconds rtt
Definition
asf-probing-module.hpp:39
nfd::fw::asf::FaceStats::face
Face * face
Definition
asf-probing-module.hpp:38
nfd::fw::asf::ProbingModule::FaceStatsProbingCompare
Definition
asf-probing-module.hpp:80
nfd::fw::asf::ProbingModule::FaceStatsProbingCompare::operator()
bool operator()(const FaceStats &lhs, const FaceStats &rhs) const noexcept
Definition
asf-probing-module.cpp:97
daemon
fw
asf-probing-module.hpp
Generated by
1.9.8