NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
generic-link-service.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014-2018, Regents of the University of California,
4  * Arizona Board of Regents,
5  * Colorado State University,
6  * University Pierre & Marie Curie, Sorbonne University,
7  * Washington University in St. Louis,
8  * Beijing Institute of Technology,
9  * The University of Memphis.
10  *
11  * This file is part of NFD (Named Data Networking Forwarding Daemon).
12  * See AUTHORS.md for complete list of NFD authors and contributors.
13  *
14  * NFD is free software: you can redistribute it and/or modify it under the terms
15  * of the GNU General Public License as published by the Free Software Foundation,
16  * either version 3 of the License, or (at your option) any later version.
17  *
18  * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20  * PURPOSE. See the GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License along with
23  * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
24  */
25 
26 #include "generic-link-service.hpp"
27 
28 #include <ndn-cxx/lp/tags.hpp>
29 
30 #include <cmath>
31 
32 namespace nfd {
33 namespace face {
34 
35 NFD_LOG_INIT("GenericLinkService");
36 
37 constexpr uint32_t DEFAULT_CONGESTION_THRESHOLD_DIVISOR = 2;
38 
40  : allowLocalFields(false)
41  , allowFragmentation(false)
42  , allowReassembly(false)
43  , allowCongestionMarking(false)
44  , baseCongestionMarkingInterval(time::milliseconds(100)) // Interval from RFC 8289 (CoDel)
45  , defaultCongestionThreshold(65536) // This default value works well for a queue capacity of 200KiB
46  , allowSelfLearning(false)
47 {
48 }
49 
51  : m_options(options)
52  , m_fragmenter(m_options.fragmenterOptions, this)
53  , m_reassembler(m_options.reassemblerOptions, this)
54  , m_reliability(m_options.reliabilityOptions, this)
55  , m_lastSeqNo(-2)
56  , m_nextMarkTime(time::steady_clock::TimePoint::max())
57  , m_lastMarkTime(time::steady_clock::TimePoint::min())
58  , m_nMarkedSinceInMarkingState(0)
59 {
60  m_reassembler.beforeTimeout.connect(bind([this] { ++this->nReassemblyTimeouts; }));
61  m_reliability.onDroppedInterest.connect([this] (const Interest& i) { this->notifyDroppedInterest(i); });
62  nReassembling.observe(&m_reassembler);
63 }
64 
65 void
67 {
68  m_options = options;
69  m_fragmenter.setOptions(m_options.fragmenterOptions);
70  m_reassembler.setOptions(m_options.reassemblerOptions);
71  m_reliability.setOptions(m_options.reliabilityOptions);
72 }
73 
74 void
75 GenericLinkService::requestIdlePacket()
76 {
77  // No need to request Acks to attach to this packet from LpReliability, as they are already
78  // attached in sendLpPacket
79  this->sendLpPacket({});
80 }
81 
82 void
83 GenericLinkService::sendLpPacket(lp::Packet&& pkt)
84 {
85  const ssize_t mtu = this->getTransport()->getMtu();
86 
87  if (m_options.reliabilityOptions.isEnabled) {
88  m_reliability.piggyback(pkt, mtu);
89  }
90 
91  if (m_options.allowCongestionMarking) {
92  checkCongestionLevel(pkt);
93  }
94 
95  Transport::Packet tp(pkt.wireEncode());
96  if (mtu != MTU_UNLIMITED && tp.packet.size() > static_cast<size_t>(mtu)) {
97  ++this->nOutOverMtu;
98  NFD_LOG_FACE_WARN("attempted to send packet over MTU limit");
99  return;
100  }
101  this->sendPacket(std::move(tp));
102 }
103 
104 void
105 GenericLinkService::doSendInterest(const Interest& interest)
106 {
107  lp::Packet lpPacket(interest.wireEncode());
108 
109  encodeLpFields(interest, lpPacket);
110 
111  this->sendNetPacket(std::move(lpPacket), true);
112 }
113 
114 void
115 GenericLinkService::doSendData(const Data& data)
116 {
117  lp::Packet lpPacket(data.wireEncode());
118 
119  encodeLpFields(data, lpPacket);
120 
121  this->sendNetPacket(std::move(lpPacket), false);
122 }
123 
124 void
125 GenericLinkService::doSendNack(const lp::Nack& nack)
126 {
127  lp::Packet lpPacket(nack.getInterest().wireEncode());
128  lpPacket.add<lp::NackField>(nack.getHeader());
129 
130  encodeLpFields(nack, lpPacket);
131 
132  this->sendNetPacket(std::move(lpPacket), false);
133 }
134 
135 void
136 GenericLinkService::encodeLpFields(const ndn::PacketBase& netPkt, lp::Packet& lpPacket)
137 {
138  if (m_options.allowLocalFields) {
139  shared_ptr<lp::IncomingFaceIdTag> incomingFaceIdTag = netPkt.getTag<lp::IncomingFaceIdTag>();
140  if (incomingFaceIdTag != nullptr) {
141  lpPacket.add<lp::IncomingFaceIdField>(*incomingFaceIdTag);
142  }
143  }
144 
145  shared_ptr<lp::CongestionMarkTag> congestionMarkTag = netPkt.getTag<lp::CongestionMarkTag>();
146  if (congestionMarkTag != nullptr) {
147  lpPacket.add<lp::CongestionMarkField>(*congestionMarkTag);
148  }
149 
150  if (m_options.allowSelfLearning) {
151  shared_ptr<lp::NonDiscoveryTag> nonDiscoveryTag = netPkt.getTag<lp::NonDiscoveryTag>();
152  if (nonDiscoveryTag != nullptr) {
153  lpPacket.add<lp::NonDiscoveryField>(*nonDiscoveryTag);
154  }
155 
156  shared_ptr<lp::PrefixAnnouncementTag> prefixAnnouncementTag = netPkt.getTag<lp::PrefixAnnouncementTag>();
157  if (prefixAnnouncementTag != nullptr) {
158  lpPacket.add<lp::PrefixAnnouncementField>(*prefixAnnouncementTag);
159  }
160  }
161 
162  shared_ptr<lp::HopCountTag> hopCountTag = netPkt.getTag<lp::HopCountTag>();
163  if (hopCountTag != nullptr) {
164  lpPacket.add<lp::HopCountTagField>(*hopCountTag);
165  }
166  else {
167  lpPacket.add<lp::HopCountTagField>(0);
168  }
169 }
170 
171 void
172 GenericLinkService::sendNetPacket(lp::Packet&& pkt, bool isInterest)
173 {
174  std::vector<lp::Packet> frags;
175  ssize_t mtu = this->getTransport()->getMtu();
176 
177  // Make space for feature fields in fragments
178  if (m_options.reliabilityOptions.isEnabled && mtu != MTU_UNLIMITED) {
180  }
181 
182  if (m_options.allowCongestionMarking && mtu != MTU_UNLIMITED) {
183  mtu -= CONGESTION_MARK_SIZE;
184  }
185 
186  BOOST_ASSERT(mtu == MTU_UNLIMITED || mtu > 0);
187 
188  if (m_options.allowFragmentation && mtu != MTU_UNLIMITED) {
189  bool isOk = false;
190  std::tie(isOk, frags) = m_fragmenter.fragmentPacket(pkt, mtu);
191  if (!isOk) {
192  // fragmentation failed (warning is logged by LpFragmenter)
193  ++this->nFragmentationErrors;
194  return;
195  }
196  }
197  else {
198  if (m_options.reliabilityOptions.isEnabled) {
199  frags.push_back(pkt);
200  }
201  else {
202  frags.push_back(std::move(pkt));
203  }
204  }
205 
206  if (frags.size() == 1) {
207  // even if indexed fragmentation is enabled, the fragmenter should not
208  // fragment the packet if it can fit in MTU
209  BOOST_ASSERT(!frags.front().has<lp::FragIndexField>());
210  BOOST_ASSERT(!frags.front().has<lp::FragCountField>());
211  }
212 
213  // Only assign sequences to fragments if packet contains more than 1 fragment
214  if (frags.size() > 1) {
215  // Assign sequences to all fragments
216  this->assignSequences(frags);
217  }
218 
219  if (m_options.reliabilityOptions.isEnabled && frags.front().has<lp::FragmentField>()) {
220  m_reliability.handleOutgoing(frags, std::move(pkt), isInterest);
221  }
222 
223  for (lp::Packet& frag : frags) {
224  this->sendLpPacket(std::move(frag));
225  }
226 }
227 
228 void
229 GenericLinkService::assignSequence(lp::Packet& pkt)
230 {
231  pkt.set<lp::SequenceField>(++m_lastSeqNo);
232 }
233 
234 void
235 GenericLinkService::assignSequences(std::vector<lp::Packet>& pkts)
236 {
237  std::for_each(pkts.begin(), pkts.end(), bind(&GenericLinkService::assignSequence, this, _1));
238 }
239 
240 void
241 GenericLinkService::checkCongestionLevel(lp::Packet& pkt)
242 {
243  ssize_t sendQueueLength = getTransport()->getSendQueueLength();
244  // This operation requires that the transport supports retrieving current send queue length
245  if (sendQueueLength < 0) {
246  return;
247  }
248 
249  // To avoid overflowing the queue, set the congestion threshold to at least half of the send
250  // queue capacity.
251  size_t congestionThreshold = m_options.defaultCongestionThreshold;
252  if (getTransport()->getSendQueueCapacity() >= 0) {
253  congestionThreshold = std::min(congestionThreshold,
254  static_cast<size_t>(getTransport()->getSendQueueCapacity()) /
256  }
257 
258  if (sendQueueLength > 0) {
259  NFD_LOG_FACE_TRACE("txqlen=" << sendQueueLength << " threshold=" << congestionThreshold <<
260  " capacity=" << getTransport()->getSendQueueCapacity());
261  }
262 
263  if (static_cast<size_t>(sendQueueLength) > congestionThreshold) { // Send queue is congested
264  const auto now = time::steady_clock::now();
265  if (now >= m_nextMarkTime || now >= m_lastMarkTime + m_options.baseCongestionMarkingInterval) {
266  // Mark at most one initial packet per baseCongestionMarkingInterval
267  if (m_nMarkedSinceInMarkingState == 0) {
268  m_nextMarkTime = now;
269  }
270 
271  // Time to mark packet
274  NFD_LOG_FACE_DEBUG("LpPacket was marked as congested");
275 
276  ++m_nMarkedSinceInMarkingState;
277  // Decrease the marking interval by the inverse of the square root of the number of packets
278  // marked in this incident of congestion
279  m_nextMarkTime += time::nanoseconds(static_cast<time::nanoseconds::rep>(
280  m_options.baseCongestionMarkingInterval.count() /
281  std::sqrt(m_nMarkedSinceInMarkingState)));
282  m_lastMarkTime = now;
283  }
284  }
285  else if (m_nextMarkTime != time::steady_clock::TimePoint::max()) {
286  // Congestion incident has ended, so reset
287  NFD_LOG_FACE_DEBUG("Send queue length dropped below congestion threshold");
288  m_nextMarkTime = time::steady_clock::TimePoint::max();
289  m_nMarkedSinceInMarkingState = 0;
290  }
291 }
292 
293 void
294 GenericLinkService::doReceivePacket(Transport::Packet&& packet)
295 {
296  try {
297  lp::Packet pkt(packet.packet);
298 
299  if (m_options.reliabilityOptions.isEnabled) {
300  m_reliability.processIncomingPacket(pkt);
301  }
302 
303  if (!pkt.has<lp::FragmentField>()) {
304  NFD_LOG_FACE_TRACE("received IDLE packet: DROP");
305  return;
306  }
307 
308  if ((pkt.has<lp::FragIndexField>() || pkt.has<lp::FragCountField>()) &&
309  !m_options.allowReassembly) {
310  NFD_LOG_FACE_WARN("received fragment, but reassembly disabled: DROP");
311  return;
312  }
313 
314  bool isReassembled = false;
315  Block netPkt;
316  lp::Packet firstPkt;
317  std::tie(isReassembled, netPkt, firstPkt) = m_reassembler.receiveFragment(packet.remoteEndpoint,
318  pkt);
319  if (isReassembled) {
320  this->decodeNetPacket(netPkt, firstPkt);
321  }
322  }
323  catch (const tlv::Error& e) {
324  ++this->nInLpInvalid;
325  NFD_LOG_FACE_WARN("packet parse error (" << e.what() << "): DROP");
326  }
327 }
328 
329 void
330 GenericLinkService::decodeNetPacket(const Block& netPkt, const lp::Packet& firstPkt)
331 {
332  try {
333  switch (netPkt.type()) {
334  case tlv::Interest:
335  if (firstPkt.has<lp::NackField>()) {
336  this->decodeNack(netPkt, firstPkt);
337  }
338  else {
339  this->decodeInterest(netPkt, firstPkt);
340  }
341  break;
342  case tlv::Data:
343  this->decodeData(netPkt, firstPkt);
344  break;
345  default:
346  ++this->nInNetInvalid;
347  NFD_LOG_FACE_WARN("unrecognized network-layer packet TLV-TYPE " << netPkt.type() << ": DROP");
348  return;
349  }
350  }
351  catch (const tlv::Error& e) {
352  ++this->nInNetInvalid;
353  NFD_LOG_FACE_WARN("packet parse error (" << e.what() << "): DROP");
354  }
355 }
356 
357 void
358 GenericLinkService::decodeInterest(const Block& netPkt, const lp::Packet& firstPkt)
359 {
360  BOOST_ASSERT(netPkt.type() == tlv::Interest);
361  BOOST_ASSERT(!firstPkt.has<lp::NackField>());
362 
363  // forwarding expects Interest to be created with make_shared
364  auto interest = make_shared<Interest>(netPkt);
365 
366  // Increment HopCount
367  if (firstPkt.has<lp::HopCountTagField>()) {
368  interest->setTag(make_shared<lp::HopCountTag>(firstPkt.get<lp::HopCountTagField>() + 1));
369  }
370 
371  if (firstPkt.has<lp::NextHopFaceIdField>()) {
372  if (m_options.allowLocalFields) {
373  interest->setTag(make_shared<lp::NextHopFaceIdTag>(firstPkt.get<lp::NextHopFaceIdField>()));
374  }
375  else {
376  NFD_LOG_FACE_WARN("received NextHopFaceId, but local fields disabled: DROP");
377  return;
378  }
379  }
380 
381  if (firstPkt.has<lp::CachePolicyField>()) {
382  ++this->nInNetInvalid;
383  NFD_LOG_FACE_WARN("received CachePolicy with Interest: DROP");
384  return;
385  }
386 
387  if (firstPkt.has<lp::IncomingFaceIdField>()) {
388  NFD_LOG_FACE_WARN("received IncomingFaceId: IGNORE");
389  }
390 
391  if (firstPkt.has<lp::CongestionMarkField>()) {
392  interest->setTag(make_shared<lp::CongestionMarkTag>(firstPkt.get<lp::CongestionMarkField>()));
393  }
394 
395  if (firstPkt.has<lp::NonDiscoveryField>()) {
396  if (m_options.allowSelfLearning) {
397  interest->setTag(make_shared<lp::NonDiscoveryTag>(firstPkt.get<lp::NonDiscoveryField>()));
398  }
399  else {
400  NFD_LOG_FACE_WARN("received NonDiscovery, but self-learning disabled: IGNORE");
401  }
402  }
403 
404  if (firstPkt.has<lp::PrefixAnnouncementField>()) {
405  ++this->nInNetInvalid;
406  NFD_LOG_FACE_WARN("received PrefixAnnouncement with Interest: DROP");
407  return;
408  }
409 
410  this->receiveInterest(*interest);
411 }
412 
413 void
414 GenericLinkService::decodeData(const Block& netPkt, const lp::Packet& firstPkt)
415 {
416  BOOST_ASSERT(netPkt.type() == tlv::Data);
417 
418  // forwarding expects Data to be created with make_shared
419  auto data = make_shared<Data>(netPkt);
420 
421  if (firstPkt.has<lp::HopCountTagField>()) {
422  data->setTag(make_shared<lp::HopCountTag>(firstPkt.get<lp::HopCountTagField>() + 1));
423  }
424 
425  if (firstPkt.has<lp::NackField>()) {
426  ++this->nInNetInvalid;
427  NFD_LOG_FACE_WARN("received Nack with Data: DROP");
428  return;
429  }
430 
431  if (firstPkt.has<lp::NextHopFaceIdField>()) {
432  ++this->nInNetInvalid;
433  NFD_LOG_FACE_WARN("received NextHopFaceId with Data: DROP");
434  return;
435  }
436 
437  if (firstPkt.has<lp::CachePolicyField>()) {
438  // CachePolicy is unprivileged and does not require allowLocalFields option.
439  // In case of an invalid CachePolicyType, get<lp::CachePolicyField> will throw,
440  // so it's unnecessary to check here.
441  data->setTag(make_shared<lp::CachePolicyTag>(firstPkt.get<lp::CachePolicyField>()));
442  }
443 
444  if (firstPkt.has<lp::IncomingFaceIdField>()) {
445  NFD_LOG_FACE_WARN("received IncomingFaceId: IGNORE");
446  }
447 
448  if (firstPkt.has<lp::CongestionMarkField>()) {
449  data->setTag(make_shared<lp::CongestionMarkTag>(firstPkt.get<lp::CongestionMarkField>()));
450  }
451 
452  if (firstPkt.has<lp::NonDiscoveryField>()) {
453  ++this->nInNetInvalid;
454  NFD_LOG_FACE_WARN("received NonDiscovery with Data: DROP");
455  return;
456  }
457 
458  if (firstPkt.has<lp::PrefixAnnouncementField>()) {
459  if (m_options.allowSelfLearning) {
460  data->setTag(make_shared<lp::PrefixAnnouncementTag>(firstPkt.get<lp::PrefixAnnouncementField>()));
461  }
462  else {
463  NFD_LOG_FACE_WARN("received PrefixAnnouncement, but self-learning disabled: IGNORE");
464  }
465  }
466 
467  this->receiveData(*data);
468 }
469 
470 void
471 GenericLinkService::decodeNack(const Block& netPkt, const lp::Packet& firstPkt)
472 {
473  BOOST_ASSERT(netPkt.type() == tlv::Interest);
474  BOOST_ASSERT(firstPkt.has<lp::NackField>());
475 
476  lp::Nack nack((Interest(netPkt)));
477  nack.setHeader(firstPkt.get<lp::NackField>());
478 
479  if (firstPkt.has<lp::NextHopFaceIdField>()) {
480  ++this->nInNetInvalid;
481  NFD_LOG_FACE_WARN("received NextHopFaceId with Nack: DROP");
482  return;
483  }
484 
485  if (firstPkt.has<lp::CachePolicyField>()) {
486  ++this->nInNetInvalid;
487  NFD_LOG_FACE_WARN("received CachePolicy with Nack: DROP");
488  return;
489  }
490 
491  if (firstPkt.has<lp::IncomingFaceIdField>()) {
492  NFD_LOG_FACE_WARN("received IncomingFaceId: IGNORE");
493  }
494 
495  if (firstPkt.has<lp::CongestionMarkField>()) {
496  nack.setTag(make_shared<lp::CongestionMarkTag>(firstPkt.get<lp::CongestionMarkField>()));
497  }
498 
499  if (firstPkt.has<lp::NonDiscoveryField>()) {
500  ++this->nInNetInvalid;
501  NFD_LOG_FACE_WARN("received NonDiscovery with Nack: DROP");
502  return;
503  }
504 
505  if (firstPkt.has<lp::PrefixAnnouncementField>()) {
506  ++this->nInNetInvalid;
507  NFD_LOG_FACE_WARN("received PrefixAnnouncement with Nack: DROP");
508  return;
509  }
510 
511  this->receiveNack(nack);
512 }
513 
514 } // namespace face
515 } // namespace nfd
LpFragmenter::Options fragmenterOptions
options for fragmentation
void setTag(shared_ptr< T > tag) const
set a tag item
Definition: tag-host.hpp:80
signal::Signal< LpReassembler, Transport::EndpointId, size_t > beforeTimeout
signals before a partial packet is dropped due to timeout
shared_ptr< T > getTag() const
get a tag item
Definition: tag-host.hpp:67
void setOptions(const Options &options)
set options for reliability
void processIncomingPacket(const lp::Packet &pkt)
extract and parse all Acks and add Ack for contained Fragment (if any) to AckQueue ...
#define NFD_LOG_FACE_TRACE(msg)
Log a message at TRACE level.
Definition: face-log.hpp:79
bool allowLocalFields
enables encoding of IncomingFaceId, and decoding of NextHopFaceId and CachePolicy ...
PacketCounter nCongestionMarked
count of outgoing LpPackets that were marked with congestion marks
Packet & set(const typename FIELD::ValueType &value)
remove all occurrences of FIELD, and add a FIELD with value
Definition: packet.hpp:141
const ssize_t MTU_UNLIMITED
indicates the transport has no limit on payload size
Definition: transport.hpp:96
static time_point now() noexcept
Definition: time.cpp:80
size_t defaultCongestionThreshold
default congestion threshold in bytes
void piggyback(lp::Packet &pkt, ssize_t mtu)
called by GenericLinkService to attach Acks onto an outgoing LpPacket
void notifyDroppedInterest(const Interest &packet)
Packet & add(const typename FIELD::ValueType &value)
add a FIELD with value
Definition: packet.hpp:153
Nack & setHeader(const NackHeader &header)
Definition: nack.hpp:77
const Transport * getTransport() 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 ...
PacketCounter nReassemblyTimeouts
count of dropped partial network-layer packets due to reassembly timeout
LpReliability::Options reliabilityOptions
options for reliability
Represents an Interest packet.
Definition: interest.hpp:42
const NackHeader & getHeader() const
Definition: nack.hpp:65
void sendPacket(Transport::Packet &&packet)
sends a lower-layer packet via Transport
bool has() const
Definition: packet.hpp:78
bool isEnabled
enables link-layer reliability
static constexpr size_t RESERVED_HEADER_SPACE
TxSequence TLV-TYPE (3 octets) + TxSequence TLV-LENGTH (1 octet) + sizeof(lp::Sequence) ...
represents a Network Nack
Definition: nack.hpp:40
void setOptions(const Options &options)
set options for fragmenter
Declare a field.
Definition: field-decl.hpp:178
provides a tag type for simple types
Definition: tag.hpp:58
#define NFD_LOG_FACE_DEBUG(msg)
Log a message at DEBUG level.
Definition: face-log.hpp:82
FIELD::ValueType get(size_t index=0) const
Definition: packet.hpp:101
PacketCounter nOutOverMtu
count of outgoing LpPackets dropped due to exceeding MTU limit
bool allowSelfLearning
enables self-learning forwarding support
bool allowCongestionMarking
enables send queue congestion detection and marking
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
time::nanoseconds baseCongestionMarkingInterval
starting value for congestion marking interval
constexpr uint32_t DEFAULT_CONGESTION_THRESHOLD_DIVISOR
void receiveNack(const lp::Nack &nack)
delivers received Nack to forwarding
base class to allow simple management of packet tags
Definition: packet-base.hpp:31
ssize_t getMtu() const
Definition: transport.hpp:459
SizeCounter< LpReassembler > nReassembling
count of network-layer packets currently being reassembled
void setOptions(const Options &options)
set options for reassembler
void setOptions(const Options &options)
sets Options used by GenericLinkService
Options that control the behavior of GenericLinkService.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Prepend wire encoding to encoder in NDN Packet Format v0.2.
Definition: interest.cpp:56
void receiveData(const Data &data)
delivers received Data to forwarding
signal::Signal< LpReliability, Interest > onDroppedInterest
signals on Interest dropped by reliability system for exceeding allowed number of retx ...
std::tuple< bool, Block, lp::Packet > receiveFragment(Transport::EndpointId remoteEndpoint, const lp::Packet &packet)
adds received fragment to buffer
PacketCounter nInNetInvalid
count of invalid reassembled network-layer packets dropped
std::tuple< bool, std::vector< lp::Packet > > fragmentPacket(const lp::Packet &packet, size_t mtu)
fragments a network-layer packet into link-layer packets
LpReassembler::Options reassemblerOptions
options for reassembly
#define NFD_LOG_INIT(name)
Definition: logger.hpp:34
virtual ssize_t getSendQueueLength()
Definition: transport.cpp:130
GenericLinkService(const Options &options=Options())
const Interest & getInterest() const
Definition: nack.hpp:53
#define NFD_LOG_FACE_WARN(msg)
Log a message at WARN level.
Definition: face-log.hpp:88
PacketCounter nInLpInvalid
count of invalid LpPackets dropped before reassembly
void receiveInterest(const Interest &interest)
delivers received Interest to forwarding
PacketCounter nFragmentationErrors
count of failed fragmentations