26 #ifndef NFD_DAEMON_FACE_LP_RELIABILITY_HPP 27 #define NFD_DAEMON_FACE_LP_RELIABILITY_HPP 31 #include <ndn-cxx/lp/packet.hpp> 32 #include <ndn-cxx/lp/sequence.hpp> 33 #include <ndn-cxx/util/rtt-estimator.hpp> 40 class GenericLinkService;
92 handleOutgoing(std::vector<lp::Packet>& frags, lp::Packet&& pkt,
bool isInterest);
111 using UnackedFrags = std::map<lp::Sequence, UnackedFrag>;
120 assignTxSequence(lp::Packet& frag);
136 std::vector<lp::Sequence>
137 findLostLpPackets(UnackedFrags::iterator ackIt);
142 std::vector<lp::Sequence>
143 onLpPacketLost(lp::Sequence txSeq,
bool isTimeout);
153 onLpPacketAcknowledged(UnackedFrags::iterator fragIt);
163 deleteUnackedFrag(UnackedFrags::iterator fragIt);
172 UnackedFrag(lp::Packet pkt);
176 scheduler::ScopedEventId rtoTimer;
177 time::steady_clock::TimePoint sendTime;
179 size_t nGreaterSeqAcks;
180 shared_ptr<NetPkt> netPkt;
188 NetPkt(lp::Packet&& pkt,
bool isInterest);
191 std::vector<UnackedFrags::iterator> unackedFrags;
200 tlv::sizeOfVarNumber(
sizeof(lp::Sequence)) +
201 sizeof(lp::Sequence);
206 UnackedFrags m_unackedFrags;
212 UnackedFrags::iterator m_firstUnackedFrag;
213 std::queue<lp::Sequence> m_ackQueue;
214 std::map<lp::Sequence, time::steady_clock::TimePoint> m_recentRecvSeqs;
215 std::queue<lp::Sequence> m_recentRecvSeqsQueue;
216 lp::Sequence m_lastTxSeqNo;
217 scheduler::ScopedEventId m_idleAckTimer;
218 ndn::util::RttEstimator m_rttEst;
222 operator<<(std::ostream& os, const FaceLogHelper<LpReliability>& flh);
227 #endif // NFD_DAEMON_FACE_LP_RELIABILITY_HPP void piggyback(lp::Packet &pkt, ssize_t mtu)
called by GenericLinkService to attach Acks onto an outgoing LpPacket
bool isEnabled
enables link-layer reliability
GenericLinkService is a LinkService that implements the NDNLPv2 protocol.
size_t maxRetx
maximum number of retransmissions for an LpPacket
static constexpr size_t RESERVED_HEADER_SPACE
TxSequence TLV-TYPE (3 octets) + TLV-LENGTH (1 octet) + lp::Sequence (8 octets)
const GenericLinkService * getLinkService() const
size_t seqNumLossThreshold
a fragment is considered lost if this number of fragments with greater sequence numbers are acknowled...
provides for reliable sending and receiving of link-layer packets
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
LpReliability(const Options &options, GenericLinkService *linkService)
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 ...
time::nanoseconds idleAckTimerPeriod
period between sending pending Acks in an IDLE packet
void setOptions(const Options &options)
set options for reliability
signal::Signal< LpReliability, Interest > onDroppedInterest
signals on Interest dropped by reliability system for exceeding allowed number of retx ...
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
bool processIncomingPacket(const lp::Packet &pkt)
extract and parse all Acks and add Ack for contained Fragment (if any) to AckQueue ...