|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
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 sendInterest(uint64_t segNum,
const Interest& interest,
bool isRetransmission);
195 afterSegmentReceivedCb(
const Interest& origInterest,
const Data& data,
196 const weak_ptr<SegmentFetcher>& weakSelf);
199 afterValidationSuccess(
const Data& data,
const Interest& origInterest,
200 std::map<uint64_t, PendingSegment>::iterator pendingSegmentIt,
201 const weak_ptr<SegmentFetcher>& weakSelf);
204 afterValidationFailure(
const Data& data,
206 const weak_ptr<SegmentFetcher>& weakSelf);
210 const weak_ptr<SegmentFetcher>& weakSelf);
213 afterTimeoutCb(
const Interest& origInterest,
214 const weak_ptr<SegmentFetcher>& weakSelf);
217 afterNackOrTimeout(
const Interest& origInterest);
229 signalError(uint32_t code,
const std::string& msg);
232 updateRetransmittedSegment(uint64_t segmentNum,
237 cancelExcessInFlightSegments();
240 checkAllSegmentsReceived();
279 enum class SegmentState {
295 static constexpr
double MIN_SSTHRESH = 2.0;
297 shared_ptr<SegmentFetcher> m_this;
307 std::queue<uint64_t> m_retxQueue;
308 Name m_versionedDataName;
309 uint64_t m_nextSegmentNum;
312 int64_t m_nSegmentsInFlight;
314 uint64_t m_highInterest;
318 int64_t m_nBytesReceived;
320 std::map<uint64_t, Buffer> m_receivedSegments;
321 std::map<uint64_t, PendingSegment> m_pendingSegments;
327 #endif // NDN_UTIL_SEGMENT_FETCHER_HPP
Validation error code and optional detailed error message.
Interface for validating data and interest packets.
Signal< SegmentFetcher, uint32_t, std::string > onError
Emits when the retrieval could not be completed due to an error.
@ NACK_ERROR
An unrecoverable Nack was received during retrieval.
@ DATA_HAS_NO_SEGMENT
One of the retrieved Data packets lacked a segment number in the last Name component (excl....
@ FINALBLOCKID_NOT_SEGMENT
A received FinalBlockId did not contain a segment component.
bool resetCwndToInit
reduce cwnd to initCwnd when loss event occurs
A handle of pending Interest.
@ INTEREST_TIMEOUT
Retrieval timed out because the maximum timeout between the successful receipt of segments was exceed...
time::milliseconds maxTimeout
maximum allowed time between successful receipt of segments
double initCwnd
initial congestion window size
Provide a communication channel with local or remote NDN forwarder.
bool useConstantInterestTimeout
if true, Interest timeout is kept at maxTimeout
provides a lightweight signal / event system
Represents an absolute name.
A handle for a scheduled event.
double initSsthresh
initial slow start threshold
Signal< SegmentFetcher > afterSegmentNacked
Emits whenever an Interest for a data segment is nacked.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
double mdCoef
multiplicative decrease coefficient
@ SEGMENT_VALIDATION_FAIL
One of the retrieved segments failed user-provided validation.
Utility class to fetch the latest version of a segmented object.
bool disableCwa
disable Conservative Window Adaptation
Signal< SegmentFetcher > afterSegmentTimedOut
Emits whenever an Interest for a data segment times out.
Represents an Interest packet.
Represents a Data packet.
Signal< SegmentFetcher, Data > afterSegmentValidated
Emits whenever a received data segment has been successfully validated.
RttEstimator::Options rttOptions
options for RTT estimator
Signal< SegmentFetcher, Data > afterSegmentReceived
Emits whenever a data segment received.
represents a Network Nack
Generic time-based scheduler.
bool useConstantCwnd
if true, window size is kept at initCwnd
ErrorCode
Error codes passed to onError.
time::milliseconds interestLifetime
lifetime of sent Interests - independent of Interest timeout
Signal< SegmentFetcher, ConstBufferPtr > onComplete
Emits upon successful retrieval of the complete data.
double aiStep
additive increase step (in segments)
Copyright (c) 2011-2015 Regents of the University of California.
bool ignoreCongMarks
disable window decrease after congestion mark received
void stop()
Stops fetching.
static shared_ptr< SegmentFetcher > start(Face &face, const Interest &baseInterest, security::v2::Validator &validator, const Options &options=Options())
Initiates segment fetching.