NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
generic-link-service.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_FACE_GENERIC_LINK_SERVICE_HPP
27 #define NFD_DAEMON_FACE_GENERIC_LINK_SERVICE_HPP
28 
29 #include "link-service.hpp"
30 #include "lp-fragmenter.hpp"
31 #include "lp-reassembler.hpp"
32 #include "lp-reliability.hpp"
33 
34 namespace nfd {
35 namespace face {
36 
42 {
43 public:
47 
53 
57 
61 
65 
69 
73 
78 
83 };
84 
89  , protected virtual GenericLinkServiceCounters
90 {
91 public:
94  class Options
95  {
96  public:
97  Options();
98 
99  public:
103 
107 
111 
115 
119 
123  };
124 
128 
129  explicit
130  GenericLinkService(const Options& options = Options());
131 
134  const Options&
135  getOptions() const;
136 
139  void
140  setOptions(const Options& options);
141 
142  const Counters&
143  getCounters() const override;
144 
148  void
149  requestIdlePacket();
150 
154  void
155  sendLpPacket(lp::Packet&& pkt);
156 
159  void
160  doSendInterest(const Interest& interest) override;
161 
164  void
165  doSendData(const Data& data) override;
166 
169  void
170  doSendNack(const ndn::lp::Nack& nack) override;
171 
172 private: // send path
177  void
178  encodeLpFields(const ndn::TagHost& netPkt, lp::Packet& lpPacket);
179 
183  void
184  sendNetPacket(lp::Packet&& pkt);
185 
188  void
189  assignSequence(lp::Packet& pkt);
190 
193  void
194  assignSequences(std::vector<lp::Packet>& pkts);
195 
196 private: // receive path
199  void
200  doReceivePacket(Transport::Packet&& packet) override;
201 
209  void
210  decodeNetPacket(const Block& netPkt, const lp::Packet& firstPkt);
211 
221  void
222  decodeInterest(const Block& netPkt, const lp::Packet& firstPkt);
223 
233  void
234  decodeData(const Block& netPkt, const lp::Packet& firstPkt);
235 
245  void
246  decodeNack(const Block& netPkt, const lp::Packet& firstPkt);
247 
249  Options m_options;
250  LpFragmenter m_fragmenter;
251  LpReassembler m_reassembler;
252  LpReliability m_reliability;
253  lp::Sequence m_lastSeqNo;
254 
255  friend class LpReliability;
256 };
257 
258 inline const GenericLinkService::Options&
260 {
261  return m_options;
262 }
263 
264 inline const GenericLinkService::Counters&
266 {
267  return *this;
268 }
269 
270 } // namespace face
271 } // namespace nfd
272 
273 #endif // NFD_DAEMON_FACE_GENERIC_LINK_SERVICE_HPP
LpFragmenter::Options fragmenterOptions
options for fragmentation
GenericLinkService is a LinkService that implements the NDNLPv2 protocol.
the upper part of a Face
PacketCounter nRetxExhausted
count of network-layer packets dropped because a fragment reached the maximum number of retransmissio...
bool allowLocalFields
enables encoding of IncomingFaceId, and decoding of NextHopFaceId and CachePolicy ...
Base class to store tag information (e.g., inside Interest and Data packets)
Definition: tag-host.hpp:34
stores a packet along with the remote endpoint
Definition: transport.hpp:113
PacketCounter nReassemblyTimeouts
count of dropped partial network-layer packets due to reassembly timeout
LpReliability::Options reliabilityOptions
options for reliability
const Counters & getCounters() const override
Represents a TLV element of NDN packet format.
Definition: block.hpp:42
represents an Interest packet
Definition: interest.hpp:42
const Options & getOptions() const
get Options used by GenericLinkService
represents a counter of number of packets
Definition: counter.hpp:77
Options that control the behavior of LpFragmenter.
PacketCounter nRetransmitted
count of network-layer packets that had at least one fragment retransmitted, but were eventually rece...
uint64_t Sequence
represents a sequence number
Definition: sequence.hpp:35
represents a Network Nack
Definition: nack.hpp:40
PacketCounter nOutOverMtu
count of outgoing LpPackets dropped due to exceeding MTU limit
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
counters provided by LinkService
reassembles fragmented network-layer packets
SizeCounter< LpReassembler > nReassembling
count of network-layer packets currently being reassembled
Options that control the behavior of LpReassembler.
provides a counter that observes the size of a table
Definition: counter.hpp:114
counters provided by GenericLinkService
Options that control the behavior of GenericLinkService.
PacketCounter nAcknowledged
count of network-layer packets that did not require retransmission of a fragment
PacketCounter nInNetInvalid
count of invalid reassembled network-layer packets dropped
#define PROTECTED_WITH_TESTS_ELSE_PRIVATE
Definition: common.hpp:41
LpReassembler::Options reassemblerOptions
options for reassembly
Represents a Data packet.
Definition: data.hpp:35
provides for reliable sending and receiving of link-layer packets
fragments network-layer packets into NDNLPv2 link-layer packets
PacketCounter nInLpInvalid
count of invalid LpPackets dropped before reassembly
PacketCounter nFragmentationErrors
count of failed fragmentations