NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ns3::ndn::L3Protocol Class Reference

Implementation network-layer of NDN stack. More...

#include <ndn-l3-protocol.hpp>

Inheritance diagram for ns3::ndn::L3Protocol:
Collaboration diagram for ns3::ndn::L3Protocol:

Classes

class  Impl
 

Public Types

typedef std::function< std::unique_ptr< nfd::cs::Policy >)> PolicyCreationCallback
 
typedef void(* InterestTraceCallback) (const Interest &, const Face &)
 
typedef void(* DataTraceCallback) (const Data &, const Face &)
 
typedef void(* SatisfiedInterestsCallback) (const nfd::pit::Entry &pitEntry, const Face &inFace, const Data &data)
 
typedef void(* TimedOutInterestsCallback) (const nfd::pit::Entry &pitEntry)
 

Public Member Functions

 L3Protocol ()
 Default constructor. More...
 
virtual ~L3Protocol ()
 
shared_ptr< nfd::ForwardergetForwarder ()
 Get smart pointer to nfd::Forwarder installed on the node. More...
 
shared_ptr< nfd::FibManagergetFibManager ()
 Get smart pointer to nfd::FibManager, used by node's NFD. More...
 
shared_ptr< nfd::StrategyChoiceManagergetStrategyChoiceManager ()
 Get smart pointer to nfd::StrategyChoiceManager, used by node's NFD. More...
 
nfd::FaceId addFace (shared_ptr< Face > face)
 Add face to NDN stack. More...
 
shared_ptr< FacegetFaceById (nfd::FaceId face) const
 Get face by face ID. More...
 
shared_ptr< FacegetFaceByNetDevice (Ptr< NetDevice > netDevice) const
 Remove face from ndn stack (remove callbacks) More...
 
nfd::ConfigSectiongetConfig ()
 Get NFD config (boost::property_tree) More...
 
void injectInterest (const Interest &interest)
 Inject interest through internal Face. More...
 
void setCsReplacementPolicy (const PolicyCreationCallback &policy)
 Set the replacement policy of NFD's CS. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Interface ID. More...
 
static Ptr< L3ProtocolgetL3Protocol (Ptr< Object > node)
 

Static Public Attributes

static const uint16_t ETHERNET_FRAME_TYPE = 0x7777
 Ethernet Frame Type of Ndn. More...
 
static const uint16_t IP_STACK_PORT = 9695
 TCP/UDP port for NDN stack. More...
 

Protected Member Functions

virtual void DoDispose (void)
 Do cleanup. More...
 
virtual void NotifyNewAggregate ()
 This function will notify other components connected to the node that a new stack member is now connected This will be used to notify Layer 3 protocol of layer 4 protocol stack to connect them together. More...
 

Detailed Description

Implementation network-layer of NDN stack.

This class defines the API to manipulate the following aspects of the NDN stack implementation:

  1. register a face (Face-derived object) for use by the NDN layer

Each Face-derived object has conceptually a single NDN interface associated with it.

In addition, this class defines NDN packet coding constants

See also
Face, ForwardingStrategy

Definition at line 77 of file ndn-l3-protocol.hpp.

Member Typedef Documentation

◆ PolicyCreationCallback

typedef std::function<std::unique_ptr<nfd::cs::Policy>)> ns3::ndn::L3Protocol::PolicyCreationCallback

Definition at line 159 of file ndn-l3-protocol.hpp.

◆ InterestTraceCallback

typedef void(* ns3::ndn::L3Protocol::InterestTraceCallback) (const Interest &, const Face &)

Definition at line 172 of file ndn-l3-protocol.hpp.

◆ DataTraceCallback

typedef void(* ns3::ndn::L3Protocol::DataTraceCallback) (const Data &, const Face &)

Definition at line 173 of file ndn-l3-protocol.hpp.

◆ SatisfiedInterestsCallback

typedef void(* ns3::ndn::L3Protocol::SatisfiedInterestsCallback) (const nfd::pit::Entry &pitEntry, const Face &inFace, const Data &data)

Definition at line 175 of file ndn-l3-protocol.hpp.

◆ TimedOutInterestsCallback

typedef void(* ns3::ndn::L3Protocol::TimedOutInterestsCallback) (const nfd::pit::Entry &pitEntry)

Definition at line 176 of file ndn-l3-protocol.hpp.

Constructor & Destructor Documentation

◆ L3Protocol()

ns3::ndn::L3Protocol::L3Protocol ( )

Default constructor.

Creates an empty stack without forwarding strategy set

Definition at line 195 of file ndn-l3-protocol.cpp.

◆ ~L3Protocol()

ns3::ndn::L3Protocol::~L3Protocol ( )
virtual

Definition at line 201 of file ndn-l3-protocol.cpp.

Member Function Documentation

◆ GetTypeId()

TypeId ns3::ndn::L3Protocol::GetTypeId ( void  )
static

Interface ID.

Returns
interface ID

Definition at line 70 of file ndn-l3-protocol.cpp.

◆ getForwarder()

shared_ptr< nfd::Forwarder > ns3::ndn::L3Protocol::getForwarder ( )

◆ getFibManager()

shared_ptr< nfd::FibManager > ns3::ndn::L3Protocol::getFibManager ( )

Get smart pointer to nfd::FibManager, used by node's NFD.

Definition at line 370 of file ndn-l3-protocol.cpp.

◆ getStrategyChoiceManager()

shared_ptr< nfd::StrategyChoiceManager > ns3::ndn::L3Protocol::getStrategyChoiceManager ( )

Get smart pointer to nfd::StrategyChoiceManager, used by node's NFD.

Definition at line 376 of file ndn-l3-protocol.cpp.

◆ addFace()

nfd::FaceId ns3::ndn::L3Protocol::addFace ( shared_ptr< Face face)

Add face to NDN stack.

Parameters
facesmart pointer to Face-derived object (AppFace, NetDeviceFace)
Returns
nfd::FaceId
See also
AppFace, NetDeviceFace

Definition at line 426 of file ndn-l3-protocol.cpp.

References ndn::tlv::Data, and ndn::tlv::Interest.

◆ getFaceById()

shared_ptr< Face > ns3::ndn::L3Protocol::getFaceById ( nfd::FaceId  face) const

Get face by face ID.

Parameters
faceThe face ID number
Returns
The Face associated with the Ndn face number.

Definition at line 483 of file ndn-l3-protocol.cpp.

◆ getFaceByNetDevice()

shared_ptr< Face > ns3::ndn::L3Protocol::getFaceByNetDevice ( Ptr< NetDevice >  netDevice) const

Remove face from ndn stack (remove callbacks)

Get face for NetDevice

Definition at line 489 of file ndn-l3-protocol.cpp.

◆ getConfig()

nfd::ConfigSection & ns3::ndn::L3Protocol::getConfig ( )

Get NFD config (boost::property_tree)

Definition at line 382 of file ndn-l3-protocol.cpp.

◆ injectInterest()

void ns3::ndn::L3Protocol::injectInterest ( const Interest &  interest)

Inject interest through internal Face.

Definition at line 246 of file ndn-l3-protocol.cpp.

◆ setCsReplacementPolicy()

void ns3::ndn::L3Protocol::setCsReplacementPolicy ( const PolicyCreationCallback policy)

Set the replacement policy of NFD's CS.

Definition at line 252 of file ndn-l3-protocol.cpp.

◆ getL3Protocol()

Ptr< L3Protocol > ns3::ndn::L3Protocol::getL3Protocol ( Ptr< Object >  node)
static

Definition at line 503 of file ndn-l3-protocol.cpp.

◆ DoDispose()

void ns3::ndn::L3Protocol::DoDispose ( void  )
protectedvirtual

Do cleanup.

Definition at line 411 of file ndn-l3-protocol.cpp.

References nfd::scheduler::getGlobalScheduler().

◆ NotifyNewAggregate()

void ns3::ndn::L3Protocol::NotifyNewAggregate ( )
protectedvirtual

This function will notify other components connected to the node that a new stack member is now connected This will be used to notify Layer 3 protocol of layer 4 protocol stack to connect them together.

Definition at line 392 of file ndn-l3-protocol.cpp.

Member Data Documentation

◆ ETHERNET_FRAME_TYPE

const uint16_t ns3::ndn::L3Protocol::ETHERNET_FRAME_TYPE = 0x7777
static

Ethernet Frame Type of Ndn.

Definition at line 87 of file ndn-l3-protocol.hpp.

Referenced by ns3::ndn::NetDeviceTransport::NetDeviceTransport().

◆ IP_STACK_PORT

const uint16_t ns3::ndn::L3Protocol::IP_STACK_PORT = 9695
static

TCP/UDP port for NDN stack.

Definition at line 88 of file ndn-l3-protocol.hpp.


The documentation for this class was generated from the following files: