nfd::face::LpReliability Class Reference

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

#include <daemon/face/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)
 
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 piggyback (lp::Packet &pkt, ssize_t mtu)
 Called by GenericLinkService to attach Acks onto an outgoing LpPacket. More...
 
bool processIncomingPacket (const lp::Packet &pkt)
 Extract and parse all Acks and add Ack for contained Fragment (if any) to AckQueue. More...
 
void setOptions (const Options &options)
 Set options for reliability. 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...
 

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 
)

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

Member Function Documentation

◆ 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 58 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 64 of file lp-reliability.cpp.

◆ piggyback()

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

Called by GenericLinkService to attach Acks onto an outgoing LpPacket.

Parameters
pktoutgoing LpPacket to attach Acks to
mtuMTU of the transport

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

◆ processIncomingPacket()

bool 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
Returns
whether incoming LpPacket is new and not a duplicate

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

◆ setOptions()

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

Set options for reliability.

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

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 77 of file lp-reliability.hpp.

◆ RESERVED_HEADER_SPACE

constexpr size_t nfd::face::LpReliability::RESERVED_HEADER_SPACE
staticconstexpr
Initial value:
= tlv::sizeOfVarNumber(lp::tlv::TxSequence) +
tlv::sizeOfVarNumber(sizeof(lp::Sequence)) +
sizeof(lp::Sequence)

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

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