provides for reliable sending and receiving of link-layer packets More...
#include <lp-reliability.hpp>
Classes | |
struct | Options |
Public Member Functions | |
LpReliability (const Options &options, GenericLinkService *linkService) | |
void | setOptions (const Options &options) |
set options for reliability More... | |
const GenericLinkService * | getLinkService () const |
void | handleOutgoing (std::vector< lp::Packet > &frags, lp::Packet &&pkt, bool isInterest) |
observe outgoing fragment(s) of a network packet and store for potential retransmission More... | |
void | processIncomingPacket (const lp::Packet &pkt) |
extract and parse all Acks and add Ack for contained Fragment (if any) to AckQueue More... | |
void | piggyback (lp::Packet &pkt, ssize_t mtu) |
called by GenericLinkService to attach Acks onto an outgoing LpPacket More... | |
Public Attributes | |
signal::Signal< LpReliability, Interest > | onDroppedInterest |
signals on Interest dropped by reliability system for exceeding allowed number of retx More... | |
Static Public Attributes | |
static constexpr size_t | RESERVED_HEADER_SPACE |
TxSequence TLV-TYPE (3 octets) + TLV-LENGTH (1 octet) + lp::Sequence (8 octets) More... | |
provides for reliable sending and receiving of link-layer packets
Definition at line 45 of file lp-reliability.hpp.
nfd::face::LpReliability::LpReliability | ( | const Options & | options, |
GenericLinkService * | linkService | ||
) |
Definition at line 34 of file lp-reliability.cpp.
References nfd::face::LpReliability::Options::idleAckTimerPeriod.
void nfd::face::LpReliability::setOptions | ( | const Options & | options | ) |
set options for reliability
Definition at line 45 of file lp-reliability.cpp.
References ndn::detail::ScopedCancelHandle< HandleT >::cancel(), nfd::face::LpReliability::Options::idleAckTimerPeriod, and nfd::face::LpReliability::Options::isEnabled.
Referenced by nfd::face::GenericLinkService::setOptions().
const GenericLinkService * nfd::face::LpReliability::getLinkService | ( | ) | const |
This is only used for logging, and may be nullptr.
Definition at line 57 of file lp-reliability.cpp.
void nfd::face::LpReliability::handleOutgoing | ( | std::vector< lp::Packet > & | frags, |
lp::Packet && | pkt, | ||
bool | isInterest | ||
) |
observe outgoing fragment(s) of a network packet and store for potential retransmission
frags | fragments of network packet |
pkt | encapsulated network packet |
isInterest | whether the network packet is an Interest |
Definition at line 63 of file lp-reliability.cpp.
References ndn::util::RttEstimator::getEstimatedRto(), nfd::getScheduler(), nfd::face::LpReliability::Options::isEnabled, nonstd::optional_lite::std11::move(), and ndn::time::steady_clock::now().
void nfd::face::LpReliability::processIncomingPacket | ( | const lp::Packet & | pkt | ) |
extract and parse all Acks and add Ack for contained Fragment (if any) to AckQueue
pkt | incoming LpPacket |
Definition at line 97 of file lp-reliability.cpp.
References ndn::util::RttEstimator::addMeasurement(), ndn::lp::Packet::get(), ndn::lp::Packet::has(), nfd::face::LpReliability::Options::isEnabled, ndn::lp::Packet::list(), and ndn::time::steady_clock::now().
void nfd::face::LpReliability::piggyback | ( | lp::Packet & | pkt, |
ssize_t | mtu | ||
) |
called by GenericLinkService to attach Acks onto an outgoing LpPacket
pkt | outgoing LpPacket to attach Acks to |
mtu | MTU of the Transport |
Definition at line 154 of file lp-reliability.cpp.
References ndn::lp::tlv::Ack, ndn::lp::Packet::add(), nfd::face::LpReliability::Options::isEnabled, ndn::lp::tlv::LpPacket, ndn::MAX_NDN_PACKET_SIZE, nfd::face::MTU_UNLIMITED, ndn::Block::size(), ndn::tlv::sizeOfVarNumber(), ndn::Block::type(), and ndn::lp::Packet::wireEncode().
signal::Signal<LpReliability, Interest> nfd::face::LpReliability::onDroppedInterest |
signals on Interest dropped by reliability system for exceeding allowed number of retx
Definition at line 72 of file lp-reliability.hpp.
Referenced by nfd::face::GenericLinkService::GenericLinkService().
|
staticconstexpr |
TxSequence TLV-TYPE (3 octets) + TLV-LENGTH (1 octet) + lp::Sequence (8 octets)
Definition at line 198 of file lp-reliability.hpp.