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

Implementation of layer-2 (Ethernet) Ndn face. More...

#include <ndn-net-device-face.hpp>

Inheritance diagram for ns3::ndn::NetDeviceFace:
Collaboration diagram for ns3::ndn::NetDeviceFace:

Public Member Functions

 NetDeviceFace (Ptr< Node > node, const Ptr< NetDevice > &netDevice)
 Constructor. More...
 
virtual ~NetDeviceFace ()
 
virtual void sendInterest (const Interest &interest)
 
virtual void sendData (const Data &data)
 
virtual void close ()
 Close the face. More...
 
Ptr< NetDevice > GetNetDevice () const
 Get NetDevice associated with the face. More...
 
- Public Member Functions inherited from nfd::Face
 Face (const FaceUri &remoteUri, const FaceUri &localUri, bool isLocal=false, bool isMultiAccess=false)
 
virtual ~Face ()
 
virtual void sendInterest (const Interest &interest)=0
 send an Interest More...
 
virtual void sendData (const Data &data)=0
 send a Data More...
 
FaceId getId () const
 
const std::string & getDescription () const
 Get the description. More...
 
void setDescription (const std::string &description)
 Set the face description. More...
 
void setMetric (uint64_t metric)
 
uint64_t getMetric () const
 
bool isLocal () const
 Get whether face is connected to a local app. More...
 
ndn::nfd::FacePersistency getPersistency () const
 Get the persistency setting. More...
 
bool isMultiAccess () const
 Get whether packets sent by this face may reach multiple peers. More...
 
virtual bool isUp () const
 Get whether underlying communication is up. More...
 
const FaceCountersgetCounters () const
 
const FaceUrigetRemoteUri () const
 
const FaceUrigetLocalUri () const
 
template<typename FaceTraits >
void copyStatusTo (FaceTraits &traits) const
 
virtual ndn::nfd::FaceStatus getFaceStatus () const
 

Additional Inherited Members

- Public Attributes inherited from nfd::Face
signal::Signal< Face, InterestonReceiveInterest
 fires when an Interest is received More...
 
signal::Signal< Face, DataonReceiveData
 fires when a Data is received More...
 
signal::Signal< Face, InterestonSendInterest
 fires when an Interest is sent out More...
 
signal::Signal< Face, DataonSendData
 fires when a Data is sent out More...
 
signal::Signal< Face, std::string > onFail
 fires when face disconnects or fails to perform properly More...
 
- Protected Member Functions inherited from nfd::Face
void setPersistency (ndn::nfd::FacePersistency persistency)
 
bool decodeAndDispatchInput (const Block &element)
 
void fail (const std::string &reason)
 fail the face and raise onFail event if it's UP; otherwise do nothing More...
 
FaceCountersgetMutableCounters ()
 

Detailed Description

Implementation of layer-2 (Ethernet) Ndn face.

This class defines basic functionality of Ndn face. Face is core component responsible for actual delivery of data packet to and from Ndn stack

NdnNetDevice face is permanently associated with one NetDevice object and this object cannot be changed for the lifetime of the face

See also
NdnAppFace, NdnNetDeviceFace, NdnIpv4Face, NdnUdpFace

Definition at line 45 of file ndn-net-device-face.hpp.

Constructor & Destructor Documentation

ns3::ndn::NetDeviceFace::NetDeviceFace ( Ptr< Node >  node,
const Ptr< NetDevice > &  netDevice 
)

Constructor.

Parameters
nodeNode associated with the face
netDevicea smart pointer to NetDevice object to which this face will be associate

Definition at line 42 of file ndn-net-device-face.cpp.

References ns3::ndn::L3Protocol::ETHERNET_FRAME_TYPE, and nfd::Face::setMetric().

ns3::ndn::NetDeviceFace::~NetDeviceFace ( )
virtual

Definition at line 58 of file ndn-net-device-face.cpp.

References close().

Member Function Documentation

void ns3::ndn::NetDeviceFace::sendInterest ( const Interest interest)
virtual
void ns3::ndn::NetDeviceFace::close ( )
virtual

Close the face.

This terminates all communication on the face and cause onFail() method event to be invoked

Implements nfd::Face.

Definition at line 65 of file ndn-net-device-face.cpp.

References nfd::Face::fail().

Referenced by ~NetDeviceFace().

Ptr< NetDevice > ns3::ndn::NetDeviceFace::GetNetDevice ( ) const

Get NetDevice associated with the face.

Returns
smart pointer to NetDevice associated with the face

Definition at line 72 of file ndn-net-device-face.cpp.

References ns3::ndn::L3Protocol::ETHERNET_FRAME_TYPE, and ns3::ndn::FwHopCountTag::Increment().


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