Ndnsim 2: An Updated NDN Simulator For Ns-3
Ndnsim 2: An Updated NDN Simulator For Ns-3
Ndnsim 2: An Updated NDN Simulator For Ns-3
html
Revision 2: November 11, 2016 1
Revision 1: January 27, 2015. (https://named-data.net/wp-content/uploads/2013/07/ndn-0028-1-ndnsim-v2.pdf)
Abstract—The fundamental departure of the Named-Data Networking the following major enhancements and features compared
(NDN) communication paradigm from the IP principles requires exten- to the first release:
sive evaluation through experimentation, and simulation is a necessary
• All NDN forwarding and management is implemented
tool to enable the experimentation at scale. We released the first ver-
directly using the source code of NFD and ndn-cxx.
sion of ndnSIM, an open source NS-3-based NDN simulator, back in
• The packet format changed to the latest NDN packet
June 2012. Since then, ndnSIM has undergone substantial development
resulting in ndnSIM 2, the first version of which was released in Jan- format [9].
uary 2015. This paper reports the design and features of the updated • Real applications written against the ndn-cxx library
simulator. The goal of the updated simulator is to match the simulation can be adapted to run inside the simulated environ-
platform to the latest advancements of NDN research. Therefore, it uses ment.
the ndn-cxx library (NDN C++ library with eXperimental eXtensions) and
This version of the simulator, just like the previous one,
the NDN Forwarding Daemon (NFD) to enable experiments with real
is implemented in a modular way using different C++
code in a simulation environment.
classes to model the behavior of each NDN entity: Faces
to communicate with local applications and other simulated
1 I NTRODUCTION nodes, NFD’s Forwarding Information Table (FIB), Pending
Interest Table (PIT) and Contest Store (CS), etc. This modular
Named Data Networking (NDN) [1, 2, 3, 4] represents a structure allows the easy modification or replacement of
fundamental departure from today’s Internet architecture any component with no or minimal impact on the other
which names the communication endpoints, and aspires components. In addition, the new release provides a more
to be the successor of the TCP/IP protocol stack. As a extensive collection of interfaces and helpers to perform
result, the various design options in the NDN architecture detailed tracing of every component, as well as of the NDN
needs to be evaluated in large-scale experimentation. How- traffic flow.
ever, it is infeasible to conduct such experimentation with In order to improve the user experience even more, we
real-world infrastructure and simulation-based evaluation encourage the community to provide us valuable feedback
becomes necessary. The main goal of ndnSIM has always by submitting bug reports. We also welcome requests for
been offering the NDN community a common, user-friendly, new feature development.1 More information about the
and open-source simulation platform based on the NS-3 simulator, basic examples, and tutorials are available on the
simulator framework [5]. ndnSIM website: http://www.ndnsim.net/.
The first public release of ndnSIM took place in June
2012 [6]. Since then, ndnSIM has become a popular tool
used by many researchers around the globe. At the time of 2 D ESIGN
this writing, ndnSIM mailing list has over 400 subscribers, The design for ndnSIM 2 has been directed by our aim
and more than 290 papers have been published based on to achieve full integration with Named Data Networking
research done using ndnSIM. Since the first ndnSIM release, Forwarder (NFD) [7, 8]. In this section, we present the
the NDN team has released an updated version of the proto- overall design of ndnSIM and demostrate its main structural
col, in part featured by the new modular NDN Forwarding components and the way that they interact with each other.
Daemon (NFD) [7, 8] and ndn-cxx library (NDN C++ library
with eXperimental eXtensions) [9] that supports NFD imple-
2.1 Design summary
mentation and is used in other C++ based applications.
The goal of this new ndnSIM release is to match the ndnSIM 2 provides integration with NFD, while it also
simulation platform to the latest advancements of NDN allows the simulation of applications written against the cxx
research and consolidate the code development efforts: the library. In this way, ndnSIM offers an integrated simulation
core of ndnSIM is now fully powered by NFD and ndn- environment for researchers and developers to deploy and
cxx code with a few minor updates. With this change, the evaluate their real-world applications at large-scale.
ndnSIM 2 offers the highest fidelity of the simulation results,
1. Bug reports and feature recommendations can be submitted
as well as allow simple transfer of simulation experiments to on the NDN project issue tracking system website: http://redmine.
the real world and vice versa. To summarize, ndnSIM 2 has named-data.net/projects/ndnsim
2
it with the node. The code used for any experiments with
NDN forwarding (e.g., custom forwarding strategies) can be NDN Protocol Stack
{ndn::L3Protocol}
directly used inside ndnSIM and vice versa. Moreover, the
ability to select different forwarding strategies for different Content Store ndn-cxx
namespaces, the full-featured support for Interest selectors {ndn::cs::*} Library
ndnSIM-specific
and crypto operations, and the use of the full-featured NDN NFD ndn::Face
{ndn::Face}
packet format ensure that the simulations are maximally NFD
keeps track of Interest packets that were forwarded simulated node in a way simiar to other network protocol
upstream toward one (or more) content source(s). In stacks, such as IPv4 and IPv6. When it is installed on a NS-
this way, Data can be sent downstream to one (or 3 node, it performs the initialization of the NFD instance,
more) requester(s). creates the necessary NFD managers (FibManager, FaceM-
– nfd::Fib: the Forwarding Information Base (FIB) is anager, StrategyChoiceManager), tables (PIT, FIB, Strategy
used to forward Interest packets toward one (or Choice, Measurements), and special faces (i.e., Null Face,
more) potential source(s). Internal Face). In addition to that, the ndn::L3Protocol class
– nfd::fw::Strategy: the forwarding strategy in NFD defines an API to handle the registration of new nfd::Face
makes the decisions regarding whether, when, and instances to NFD using the AddFace method and provides
where the Interest packets will be forwarded. NS-3 TraceSource entry points of NDN-level packet tracing.
nfd::fw::Strategy is an abstract class that needs to be
implemented by all the built-in or custom forwarding 2.3 Named Data Networking Forwarding Daemon (NFD)
strategies. ndnSIM integrates the NFD codebase with a few small
– nfd::measurements::Measurements: the table, where adaptations to the simulation environment,2 . In the rest of
NFD stores measurement information regarding a this section we describe NFD structure and list the major
name prefix. It is used by the forwarding strategies. challenges we faced during the integration.
– nfd::strategy choice::StrategyChoice: this table con-
tains the forwarding strategy selected for each 2.3.1 NFD Internal Structure
namespace. The basic modules of NFD are the following [7]:
• ndn::AppLinkService: realization of the • ndn-cxx Library, Core, and Tools, which provides var-
nfd::face::LinkService abstraction to enable ious common services shared between different NFD
communication with applications. modules.
• ndn::NetDeviceLinkService: realization of the • Faces that implement communication abstraction on
nfd::face::LinkService abstraction to enable top of various lower level transport mechanisms.
communication with other simulated nodes. • Tables, realizing the Content Store (CS), the Pending
• ndn::cs::*: the Content Store (CS) structure as imple- Interest Table (PIT), the Forwarding Information Base
mented in ndnSIM 1.0. It includes a number of replace- (FIB), StrategyChoice, Measurements, and other data
ment policies and, in general, is more flexible than the structures to support forwarding of NDN Data and
current CS implementation of NFD. Interest packets.
• Basic NDN applications: implementation of built-in • Forwarding pipelines, a series of steps that operate
NDN consumer and producer applications that can on a packet or a PIT entry. Individual pipelines are
generate and sink NDN traffic. These applications in- triggered by a specific event, such as reception of the
clude parameters that can be configured by the user in Interest, detecting that the received Interest was looped,
the simulation scenario and thus generate NDN traffic when an Interest is ready to be forwarded out of the
according to a user-defined pattern. Face, etc.
• Trace helpers: a collection of trace helpers that simplify • Forwarding strategies, a decision maker about Interest
collection and aggregation of various necessary statis- forwarding, which is attached at the end or beginning
tical information about the simulation and write this of the pipelines.
information in text files. • Management, allowing applications to configure NFD
• ndnSIM helpers: a collection of helpers, which simplify and set/query NFD’s internal states.
the configuration of various parameters that will be
used during the simulation execution. 2.3.2 Challenges of NFD integration
We used the LinkService abstraction to implement the Towards this integration, we had to address the following
basic communication principles instead of implementing challenges:
our own Transport. This is a solution to optimize packet • We had to enable the use of simulation time in NFD.
processing and avoid unnecessary memory operations. Therefore, we took advantage of the CustomClock
Through this approach, we also managed to maintain the class provided by the ndn-cxx library in order to
NS3 packet tags attached to each packet sent/received by a convert ndnSIM time to system clock::time point and
simulated node, which otherwise would be lost. steady clock::time point.
• The scheduler of NFD was redirected to ns3::Simulator,
so that NFD can schedule events that will be executed
2.2 Core NDN protocol by the simulator.
The core component of the ndnSIM architecture is
2. Because of these required adaptations, the version of NFD that
ndn::L3Protocol. This component serves as a consolidator ndnSIM is based on tends to be slightly behind the latest version of
for the NDN protocol stack and can be installed in each NFD/ndn-cxx
4
Incoming
Outgoing
Interest
Interest
Outgoing
Data
Data
unsolicited
1
per-namespace forwarding strategy is registered and main- the same model. If timers are needed, EventId fields need to
tained at the Strategy Choice table. The Strategy Choice ta- be added to such data structure(s).
ble is updated through the management protocol, operated The final step is to implement at least the “After Receive
by the Strategy Choice manager. Similarly to FIB operations, Interest” trigger and any (or none) of the three other triggers
we created a Strategy Choice helper that prepares and sends listed below:
special signed Interest commands to the manager when • After Receive Interest: When an Interest is received,
strategy selection is requested in the simulation scenario. passes necessary checks, and needs to be forwarded,
The following built-in forwarding strategies are cur- the Incoming Interest pipeline invokes this trigger with
rently available: the PIT entry, incoming Interest packet, and FIB entry.
• Broadcast: Forwards every Interest to all upstream • Before Satisfy Interest: When a PIT entry is satisfied,
faces. before Data is sent to downstream faces (if any), the
• Client Control Strategy: Allows a local consumer ap- Incoming Data pipeline invokes this trigger with the
plication to choose the outgoing face of each sent Inter- PIT entry, the Data packet, and its incoming face.
est packet. • Before Expire Interest: When a PIT entry expires be-
• Best Route: Forwards an Interest packet to the up- cause it has not been satisfied before all in-records
stream face with the lowest routing cost. expire, before it is deleted, Interest Unsatisfied pipeline
• NCC: Re-implementation of the CCNx 0.7.2 default invokes this trigger with the PIT entry.
strategy. Actions are the forwarding decisions made by each
A new forwarding strategy can implement a completely forwarding strategy and are implemented as non-virtual
custom processing or override specific actions in the existing protected methods of the nfd::Strategy class. The provided
forwarding strategy. The initial step in creating a new strat- actions are listed below:
egy is to create a class, say MyStrategy that is derived from • Send Interest: It triggers when entering the Outgoing
the nfd::Strategy class. This subclass must at least override Interest pipeline.
the triggers that are marked as pure virtual and implement • Reject Pending Interest: It triggers when entering the
them with the desired strategy logic. It may also override Interest reject pipeline.
any other available triggers that are marked as just virtual. To simplify the operations of specifying the desired per-
If the strategy needs to store information, it is needed to name prefix forwarding strategy for one, more or all the
decide whether the information is related to a namespace topology nodes, we provide a Strategy Choice helper that
or an Interest. Information related to a namespace but not interacts with the Strategy Choice manager of NFD by
specific to an Interest should be stored in Measurements sending special signed Interest commands to the manager.
entries; information related to an Interest should be stored The operations of this helper are illustrated in Figure 4
in PIT entries, PIT downstream records, or PIT upstream
records. After this decision is made, a data structure derived
from StrategyInfo class needs to be declared. In the existing 2.4 Application Link Service
implementation, such data structures are declared as nested This class enables the communication of the simulated ap-
classes as it provides natural grouping and scope protection plications with the NDN network. Specifically, this abstrac-
of the strategy-specific entity, but it is not required to follow tion provides functions for sending interests, data packets
6
3 L IMITATIONS OF CURRENT VERSION AND FU - impossible thus limiting the experimental scope of this
TURE PLAN simulator.
Another recently introduced effort is Mini-CCNx [17].
Despite the fact that we provide an API to developers in Mini-CCNx is a fork of Mininet-HiFi specially customized
order to simulate real applications using ndnSIM, these to support the emulation of CCNx-NDNx nodes. Its main
applications have to satisfy certain requirements. These goal is to add a realistic behavior to the executed tests.
requirements are primarily posed by the different logic Mini-CCNx offers flexibility, because of the Container-Based
between real and simulated apps (as they need to be im- Emulation features of Mininet, and a simple configuration
plemented in NS3 and ndnSIM). A detailed list of those GUI interface. However, it is based on the packet format of
requirements is available on our website: http://ndnsim. NDNx, which is an outdated version of the NDN communi-
net/guide-to-simulate-real-apps.html#requirements. cation model. It also mainly focuses on emulating the node
NFD versions 0.4 and above handle and process NACKs hardware instead of the communication model itself.
and, thus, support NDNLPv2. In this version, ndnSIM does The affluence of computing resources across the existing
not support NDNLPv2 and, as a result, cannot be yet used research network testbeds/infrastructures (e.g., GENI [18],
to simulate network-level NACKs across simulated nodes. Open Network Lab (ONL) [19], Emulab [20], etc.) also offers
This will be addressed in the next release of ndnSIM. a valuable option for the conduction of real-time research
experiments. These testbeds provide both the hardware and
the software systems needed by researchers to evaluate their
4 R ELATED W ORK
design. However, the complexity that is introduced in order
Within the recent years, the interest for NDN research has to configure and manage all the delegated resources along
grown. As a consequence, the development of common with the limited experimental scale are two crucial reasons
and handy ways for the evaluation of the proposed NDN that lead researchers to resort to simulations.
research approaches has been absolutely necessary.
One of the first and popular approaches towards that
goal is the previous version of ndnSIM [6]. This version, 5 S UMMARY
exactly like the current one, is implemented in a modular In this updated simulator, we have focused our efforts
way and was optimized for simulation purposes. However, on providing a more realistic simulation behavior by inte-
the previous version included an independent implemen- grating the Named Data Networking Forwarding Daemon
tation of NDN packet forwarding and used a deprecated (NFD) with ndnSIM and using directly the ndn-cxx library
NDN packet format. Moreover, the ndnSIM 1.0 never imple- and the latest NDN packet format. ndnSIM provides the
mented the full-featured processing of NDN selectors and, framework for large-scale experimentation, while its modu-
as a result, has limitations regarding the accuracy of the lar design offers the flexibility to the researchers to modify
simulation results. its components with minimal, if any, changes to other parts
Another existing effort is presented by Chioccheti et of its implementation. Detailed information about the cur-
al. [10, 11]. ccnSim is a scalable chunk-level simulator rent release and additional documentation is available on
suitable for the analysis of caching performance of NDN the ndnSIM webstite: http://ndnsim.net.
networks. It is developed using the OMNeT++ framework We really hope that the NDN community will find
in C++. However, it is mainly optimized for the experi- ndnSIM a valuable tool and we are looking forward to
mentation on various cache replacement policies for NDN receiving the community’s priceless feedback in order to
routers and does not provide any flexibility of the forward- further improve the simulator.
ing process. As a result, ccnSim cannot be used for the
experimentation on a vital core component of the NDN
architecture, which is the forwarding strategy layer. 6 A PPENDIX
CCN-lite [12] is a lightweight implementation of the In this section, we present the revision history of this docu-
CCNx-NDNx protocol. It offers a simulation mode using the ment.
OMNeT++ simulation platform. CCN-lite supports schedul-
ing, both at chunk and at packet level, and packet fragmen-
6.1 Revision History
tation. It also supports possible native deployment without
any IP layer. However, this effort is mainly intended to run • Revision 2 (November 11, 2016): Updates for ndnSIM
on resource constrained devices and is not optimized to 2.1 and 2.2:
offer high performance as its data structures rely on linked – Added description of the simulation of applications
lists. written against the ndn-cxx library and the ndnSIM
The Content Centric Networking Packet Level Simulator specific ndn::Face.
(CCNPL-Sim) [13] is another NDN simulator developed – Renamed the AppFace and NetDeviceFace classes of
at Orange Labs. CCNPL-Sim makes use of the Combined ndnSIM to AppLinkService and NetDeviceLinkSer-
Broadcast and Content-Based routing scheme (CBCB) [14] vice and updated the description of each one.
implementation within the SSim simulator to handle event – Added description on the configurability support of
management and name based forwarding and routing. De- the various parameters of NFD.
spite the effectiveness of the SSim simulation scheduler, – Updated Table 1 and Figure 1 to add the
the mandatory usage of CCNB makes the evaluation of nfd::face::LinkService, ndn::AppLinkService and
other routing protocols, such as OSPFN [15] and NLSR [16], ndn::NetDeviceLinkService classes.
8
– Revised the overall paper to refer to ndnSIM 2 in [9] ——, “NDN Packet Format Specification,” Online: http:
general instead of ndnSIM 2.0. //named-data.net/doc/ndn-tlv/, 2014.
• Revision 1 (January 27, 2015): Initial release [10] D. Rossi, G. Rossini, “Caching performance of content
centric networksunder multi-path routing (and more),”
Telecom ParisTech, Tech. Rep., 2011.
R EFERENCES [11] G. Rossini and D. Rossi, “ccnSim: an highly scalable
[1] V. Jacobson, D. K. Smetters, J. D. Thornton, M. F. Plass, CCN simulator,” in IEEE ICC, 2013.
N. H. Briggs, and R. L. Braynard, “Networking named [12] C. Scherb, M. Sifalakis, and C. Tschudin, “CCN-lite,”
content,” in Proceedings of ACM CoNEXT, 2009. Available: http://www.ccn-lite.net, 2013.
[2] L. Zhang et al., “Named data networking (NDN) [13] L. Muscariello. (2011) Content centric net-
project 2010 - 2011 progress summary,” PARC, working packet level simulator. Orange Labs.
http://www.named-data.net/ndn-ar2011.html, Tech. [Online]. Available: http://perso.rd.francetelecom.fr/
Rep., November 2011. muscariello/sim.html
[3] L. Zhang et al., “Named data networking (NDN) [14] A. Carzaniga, M.J. Rutherford, and A.L. Wolf, Ed., A
project,” PARC, Tech. Rep. NDN-0001, October 2010. Routing Scheme for Content-Based Networking. IEEE
[4] L. Zhang, A. Afanasyev, J. Burke, V. Jacobson, K. Claffy, INFOCOM, March 2004.
P. Crowley, C. Papadopoulos, L. Wang, and B. Zhang, [15] L. Wang, A. Hoque, C. Yi, A. Alyyan, and B. Zhang,
“Named data networking,” ACM SIGCOMM Computer “OSPFN: An OSPF based routing protocol for Named
Communication Review, July 2014. Data Networking,” NDN, Tech. Rep NDN-0003, 2012.
[5] (2012, May) ns-3. [Online]. Available: http://www. [16] NDN Project, “NLSR - Named Data Link State Rout-
nsnam.org/ ing Protocol,” Online: http://named-data.net/doc/
[6] A. Afanasyev, I. Moiseenko, and L. Zhang, “ndnSIM: NLSR/0.1.0/, 2014.
NDN simulator for NS-3,” NDN, Technical Report [17] C. Cabral, C. E. Rothenberg, and M. F. Magalhães, “Re-
NDN-0005, October 2012. [Online]. Available: http: producing real NDN experiments using mini-CCNx,”
//named-data.net/techreports.html in Proceedings of the 3rd ACM SIGCOMM workshop on
[7] A. Afanasyev, J. Shi, B. Zhang, L. Zhang, I. Moi- Information-centric networking, 2013.
seenko, Y. Yu, W. Shang, Y. Huang, J. P. Abraham, [18] (2015, January) GENI (Global Environment for
S. DiBenedetto, C. Fan, C. Papadopoulos, D. Pesavento, Network Innovations). [Online]. Available: http:
G. Grassi, G. Pau, H. Zhang, T. Song, H. Yuan, H. B. //www.geni.net
Abraham, P. Crowley, S. O. Amin, V. Lehman, , and [19] (2015, January) Open Networking Lab. [Online].
L. Wang, “NFD developers guide,” NDN Project, Tech. Available: http://onlab.us
Rep. NDN-0021, July 2014. [20] (2015, January) Emulab - Network Emulation Testbed.
[8] NDN Project, “NFD - named data networking for- [Online]. Available: http://www.emulab.net
warding daemon,” Online: http://named-data.net/
doc/NFD/0.2.0/, 2014.