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) |
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... | |
Static Public Attributes | |
static constexpr size_t | RESERVED_HEADER_SPACE = 3 + 1 + sizeof(lp::Sequence) |
TxSequence TLV-TYPE (3 octets) + TxSequence TLV-LENGTH (1 octet) + sizeof(lp::Sequence) 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 33 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 46 of file lp-reliability.cpp.
References 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 58 of file lp-reliability.cpp.
void nfd::face::LpReliability::handleOutgoing | ( | std::vector< lp::Packet > & | frags | ) |
observe outgoing fragment(s) of a network packet and store for potential retransmission
frags | fragments of network packet |
Definition at line 64 of file lp-reliability.cpp.
References nfd::RttEstimator::computeRto(), nfd::face::LpReliability::Options::isEnabled, ndn::time::steady_clock::now(), and nfd::scheduler::schedule().
Referenced by nfd::face::GenericLinkService::setOptions().
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 98 of file lp-reliability.cpp.
References nfd::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().
Referenced by nfd::face::GenericLinkService::setOptions().
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 146 of file lp-reliability.cpp.
References ndn::lp::tlv::Ack, ndn::lp::Packet::add(), nfd::scheduler::ScopedEventId::cancel(), nfd::RttEstimator::computeRto(), nfd::face::LpReliability::Options::idleAckTimerPeriod, nfd::face::LpReliability::Options::isEnabled, ndn::lp::tlv::LpPacket, ndn::MAX_NDN_PACKET_SIZE, nfd::face::LpReliability::Options::maxRetx, nfd::face::MTU_UNLIMITED, nfd::face::GenericLinkServiceCounters::nAcknowledged, ndn::time::steady_clock::now(), nfd::face::GenericLinkServiceCounters::nRetransmitted, nfd::face::GenericLinkServiceCounters::nRetxExhausted, nfd::scheduler::schedule(), nfd::face::LpReliability::Options::seqNumLossThreshold, ndn::lp::Packet::set(), ndn::Block::size(), ndn::tlv::sizeOfNonNegativeInteger(), ndn::tlv::sizeOfVarNumber(), ndn::Block::type(), and ndn::lp::Packet::wireEncode().
Referenced by nfd::face::GenericLinkService::setOptions().
|
static |
TxSequence TLV-TYPE (3 octets) + TxSequence TLV-LENGTH (1 octet) + sizeof(lp::Sequence)
Definition at line 191 of file lp-reliability.hpp.
Referenced by nfd::face::GenericLinkService::setOptions().