28 #ifndef NDN_UTIL_SEGMENT_FETCHER_HPP 29 #define NDN_UTIL_SEGMENT_FETCHER_HPP 163 static shared_ptr<SegmentFetcher>
178 class PendingSegment;
183 shouldStop(
const weak_ptr<SegmentFetcher>& weakSelf);
186 fetchFirstSegment(
const Interest& baseInterest,
bool isRetransmission);
189 fetchSegmentsInWindow(
const Interest& origInterest);
192 afterSegmentReceivedCb(
const Interest& origInterest,
const Data& data,
193 const weak_ptr<SegmentFetcher>& weakSelf);
196 afterValidationSuccess(
const Data& data,
const Interest& origInterest,
198 const weak_ptr<SegmentFetcher>& weakSelf);
201 afterValidationFailure(
const Data& data,
203 const weak_ptr<SegmentFetcher>& weakSelf);
207 const weak_ptr<SegmentFetcher>& weakSelf);
210 afterTimeoutCb(
const Interest& origInterest,
211 const weak_ptr<SegmentFetcher>& weakSelf);
214 afterNackOrTimeout(
const Interest& origInterest);
226 signalError(uint32_t code,
const std::string& msg);
229 updateRetransmittedSegment(uint64_t segmentNum,
230 const PendingInterestId* pendingInterest,
234 cancelExcessInFlightSegments();
237 checkAllSegmentsReceived();
276 enum class SegmentState {
287 const PendingInterestId* id;
292 static constexpr
double MIN_SSTHRESH = 2.0;
294 shared_ptr<SegmentFetcher> m_this;
301 time::milliseconds m_timeout;
304 std::queue<uint64_t> m_retxQueue;
305 Name m_versionedDataName;
306 uint64_t m_nextSegmentNum;
309 int64_t m_nSegmentsInFlight;
311 uint64_t m_highInterest;
315 int64_t m_nBytesReceived;
317 std::map<uint64_t, Buffer> m_receivedSegments;
318 std::map<uint64_t, PendingSegment> m_pendingSegments;
324 #endif // NDN_UTIL_SEGMENT_FETCHER_HPP
Copyright (c) 2011-2015 Regents of the University of California.
time::milliseconds interestLifetime
lifetime of sent Interests - independent of Interest timeout
An unrecoverable Nack was received during retrieval.
double mdCoef
multiplicative decrease coefficient
Signal< SegmentFetcher, ConstBufferPtr > onComplete
Emits upon successful retrieval of the complete data.
time::milliseconds maxTimeout
maximum allowed time between successful receipt of segments
bool useConstantInterestTimeout
if true, Interest timeout is kept at maxTimeout
Utility class to fetch the latest version of a segmented object.
Represents an Interest packet.
provides a lightweight signal / event system
void stop()
Stops fetching.
represents a Network Nack
Table::const_iterator iterator
double aiStep
additive increase step (in segments)
bool disableCwa
disable Conservative Window Adaptation
One of the retrieved segments failed user-provided validation.
ErrorCode
Error codes passed to onError.
static shared_ptr< SegmentFetcher > start(Face &face, const Interest &baseInterest, security::v2::Validator &validator, const Options &options=Options())
Initiates segment fetching.
Signal< SegmentFetcher > afterSegmentNacked
Emits whenever an Interest for a data segment is nacked.
Provide a communication channel with local or remote NDN forwarder.
Signal< SegmentFetcher, Data > afterSegmentValidated
Emits whenever a received data segment has been successfully validated.
Retrieval timed out because the maximum timeout between the successful receipt of segments was exceed...
One of the retrieved Data packets lacked a segment number in the last Name component (excl....
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Represents an absolute name.
double initSsthresh
initial slow start threshold
double initCwnd
initial congestion window size
bool ignoreCongMarks
disable window decrease after congestion mark received
bool resetCwndToInit
reduce cwnd to initCwnd when loss event occurs
Signal< SegmentFetcher, Data > afterSegmentReceived
Emits whenever a data segment received.
Signal< SegmentFetcher > afterSegmentTimedOut
Emits whenever an Interest for a data segment times out.
RttEstimator::Options rttOptions
options for RTT estimator
Validation error code and optional detailed error message.
Signal< SegmentFetcher, uint32_t, std::string > onError
Emits when the retrieval could not be completed due to an error.
A handle of scheduled event.
Represents a Data packet.
A received FinalBlockId did not contain a segment component.
bool useConstantCwnd
if true, window size is kept at initCwnd
Interface for validating data and interest packets.