NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
nfd::face::LpReliability Class Reference

provides for reliable sending and receiving of link-layer packets More...

#include <lp-reliability.hpp>

Inheritance diagram for nfd::face::LpReliability:
Collaboration diagram for nfd::face::LpReliability:

Classes

struct  Options
 

Public Member Functions

 LpReliability (const Options &options, GenericLinkService *linkService)
 
void setOptions (const Options &options)
 set options for reliability More...
 
const GenericLinkServicegetLinkService () 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, InterestonDroppedInterest
 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...
 

Detailed Description

provides for reliable sending and receiving of link-layer packets

See also
https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2

Definition at line 45 of file lp-reliability.hpp.

Constructor & Destructor Documentation

◆ LpReliability()

nfd::face::LpReliability::LpReliability ( const Options options,
GenericLinkService linkService 
)

Member Function Documentation

◆ setOptions()

void nfd::face::LpReliability::setOptions ( const Options options)

◆ getLinkService()

const GenericLinkService * nfd::face::LpReliability::getLinkService ( ) const
Returns
GenericLinkService that owns this instance

This is only used for logging, and may be nullptr.

Definition at line 57 of file lp-reliability.cpp.

◆ handleOutgoing()

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

Parameters
fragsfragments of network packet
pktencapsulated network packet
isInterestwhether 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().

◆ processIncomingPacket()

void nfd::face::LpReliability::processIncomingPacket ( const lp::Packet pkt)

extract and parse all Acks and add Ack for contained Fragment (if any) to AckQueue

Parameters
pktincoming 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().

◆ piggyback()

void nfd::face::LpReliability::piggyback ( lp::Packet pkt,
ssize_t  mtu 
)

Member Data Documentation

◆ onDroppedInterest

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().

◆ RESERVED_HEADER_SPACE

constexpr size_t nfd::face::LpReliability::RESERVED_HEADER_SPACE
staticconstexpr
Initial value:

TxSequence TLV-TYPE (3 octets) + TLV-LENGTH (1 octet) + lp::Sequence (8 octets)

Definition at line 198 of file lp-reliability.hpp.


The documentation for this class was generated from the following files:
ndn::lp::tlv::TxSequence
@ TxSequence
Definition: tlv.hpp:50
ndn::tlv::sizeOfVarNumber
constexpr size_t sizeOfVarNumber(uint64_t number) noexcept
Get the number of bytes necessary to hold the value of number encoded as VAR-NUMBER.
Definition: tlv.hpp:450
ndn::lp::Sequence
uint64_t Sequence
represents a sequence number
Definition: sequence.hpp:35