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

A multicast Transport that uses raw Ethernet II frames. More...

#include <ethernet-transport.hpp>

Inheritance diagram for nfd::face::DECL_CLASS_FINAL:
Collaboration diagram for nfd::face::DECL_CLASS_FINAL:

Classes

class  Error
 

Public Types

typedef WebSocketTransportCounters Counters
 counters provided by WebSocketTransport More...
 
- Public Types inherited from nfd::face::Transport
typedef uint64_t EndpointId
 identifies an endpoint on the link More...
 
typedef TransportCounters Counters
 counters provided by Transport More...
 
- Public Types inherited from nfd::face::StreamTransport< boost::asio::local::stream_protocol >
typedef boost::asio::local::stream_protocol protocol
 
- Public Types inherited from nfd::face::DatagramTransport< boost::asio::ip::udp, Unicast >
typedef boost::asio::ip::udp protocol
 
- Public Types inherited from nfd::face::StreamTransport< boost::asio::ip::tcp >
typedef boost::asio::ip::tcp protocol
 
- Public Types inherited from nfd::face::DatagramTransport< boost::asio::ip::udp, Multicast >
typedef boost::asio::ip::udp protocol
 

Public Member Functions

 EthernetTransport (const NetworkInterfaceInfo &interface, const ethernet::Address &mcastAddress)
 Creates an Ethernet-based transport for multicast communication. More...
 
 Face (unique_ptr< LinkService > service, unique_ptr< Transport > transport)
 
LinkServicegetLinkService ()
 
TransportgetTransport ()
 
void sendInterest (const Interest &interest)
 sends Interest on Face More...
 
void sendData (const Data &data)
 sends Data on Face More...
 
void sendNack (const lp::Nack &nack)
 sends Nack on Face More...
 
FaceId getId () const
 
void setId (FaceId id)
 sets face ID More...
 
void setMetric (uint64_t metric)
 
uint64_t getMetric () const
 
FaceUri getLocalUri () const
 
FaceUri getRemoteUri () const
 
ndn::nfd::FaceScope getScope () const
 
ndn::nfd::FacePersistency getPersistency () const
 
void setPersistency (ndn::nfd::FacePersistency persistency)
 changes face persistency setting More...
 
ndn::nfd::LinkType getLinkType () const
 
FaceState getState () const
 
time::steady_clock::TimePoint getExpirationTime () const
 
void close ()
 request the face to be closed More...
 
const FaceCountersgetCounters () const
 
 MulticastUdpTransport (const protocol::endpoint &localEndpoint, const protocol::endpoint &multicastGroup, protocol::socket &&recvSocket, protocol::socket &&sendSocket)
 Creates a UDP-based transport for multicast communication. More...
 
 TcpTransport (protocol::socket &&socket, ndn::nfd::FacePersistency persistency)
 
 UnicastUdpTransport (protocol::socket &&socket, ndn::nfd::FacePersistency persistency, time::nanoseconds idleTimeout)
 
 UnixStreamTransport (protocol::socket &&socket)
 
 WebSocketTransport (websocketpp::connection_hdl hdl, websocket::Server &server, time::milliseconds pingInterval)
 
virtual const CountersgetCounters () const 1
 
void receiveMessage (const std::string &msg)
 Translates a message into a Block and delivers it to the link service. More...
 
void handlePong ()
 
void handlePongTimeout ()
 
- Public Member Functions inherited from nfd::face::Transport
 Transport ()
 constructor More...
 
virtual ~Transport ()
 
void setFaceAndLinkService (Face &face, LinkService &service)
 set Face and LinkService for Transport More...
 
const Face * getFace () const
 
const LinkServicegetLinkService () const
 
LinkServicegetLinkService ()
 
void close ()
 request the transport to be closed More...
 
void send (Packet &&packet)
 send a link-layer packet More...
 
FaceUri getLocalUri () const
 
FaceUri getRemoteUri () const
 
ndn::nfd::FaceScope getScope () const
 
ndn::nfd::FacePersistency getPersistency () const
 
void setPersistency (ndn::nfd::FacePersistency persistency)
 changes face persistency setting More...
 
ndn::nfd::LinkType getLinkType () const
 
ssize_t getMtu () const
 
TransportState getState () const
 
time::steady_clock::TimePoint getExpirationTime () const
 
- Public Member Functions inherited from nfd::face::StreamTransport< boost::asio::local::stream_protocol >
 StreamTransport (typename protocol::socket &&socket)
 Construct stream transport. More...
 
- Public Member Functions inherited from nfd::face::DatagramTransport< boost::asio::ip::udp, Unicast >
 DatagramTransport (typename protocol::socket &&socket)
 Construct datagram transport. More...
 
void receiveDatagram (const uint8_t *buffer, size_t nBytesReceived, const boost::system::error_code &error)
 Receive datagram, translate buffer into packet, deliver to parent class. More...
 
- Public Member Functions inherited from nfd::face::StreamTransport< boost::asio::ip::tcp >
 StreamTransport (typename protocol::socket &&socket)
 Construct stream transport. More...
 
- Public Member Functions inherited from nfd::face::DatagramTransport< boost::asio::ip::udp, Multicast >
 DatagramTransport (typename protocol::socket &&socket)
 Construct datagram transport. More...
 
void receiveDatagram (const uint8_t *buffer, size_t nBytesReceived, const boost::system::error_code &error)
 Receive datagram, translate buffer into packet, deliver to parent class. More...
 

Public Attributes

signal::Signal< LinkService, Interest > & afterReceiveInterest
 signals on Interest received More...
 
signal::Signal< LinkService, Data > & afterReceiveData
 signals on Data received More...
 
signal::Signal< LinkService, lp::Nack > & afterReceiveNack
 signals on Nack received More...
 
signal::Signal< Transport, FaceState, FaceState > & afterStateChange
 signals after face state changed More...
 
- Public Attributes inherited from nfd::face::Transport
signal::Signal< Transport, TransportState, TransportStateafterStateChange
 signals when transport state changes More...
 

Protected Member Functions

virtual void beforeChangePersistency (ndn::nfd::FacePersistency newPersistency) DECL_FINAL
 invoked before persistency is changed More...
 
virtual void doClose () DECL_FINAL
 performs Transport specific operations to close the transport More...
 
virtual void beforeChangePersistency (ndn::nfd::FacePersistency newPersistency) DECL_FINAL
 invoked before persistency is changed More...
 
virtual void beforeChangePersistency (ndn::nfd::FacePersistency newPersistency) DECL_FINAL
 invoked before persistency is changed More...
 
virtual void beforeChangePersistency (ndn::nfd::FacePersistency newPersistency) DECL_FINAL
 invoked before persistency is changed More...
 
virtual void beforeChangePersistency (ndn::nfd::FacePersistency newPersistency) DECL_FINAL
 invoked before persistency is changed More...
 
virtual void beforeChangePersistency (ndn::nfd::FacePersistency newPersistency) DECL_FINAL
 invoked before persistency is changed More...
 
virtual void doClose () DECL_FINAL
 performs Transport specific operations to close the transport More...
 
- Protected Member Functions inherited from nfd::face::Transport
void receive (Packet &&packet)
 receive a link-layer packet More...
 
void setLocalUri (const FaceUri &uri)
 
void setRemoteUri (const FaceUri &uri)
 
void setScope (ndn::nfd::FaceScope scope)
 
void setLinkType (ndn::nfd::LinkType linkType)
 
void setMtu (ssize_t mtu)
 
void setState (TransportState newState)
 set transport state More...
 
void setExpirationTime (const time::steady_clock::TimePoint &expirationTime)
 
- Protected Member Functions inherited from nfd::face::StreamTransport< boost::asio::local::stream_protocol >
void deferredClose ()
 
void sendFromQueue ()
 
void handleSend (const boost::system::error_code &error, size_t nBytesSent)
 
void handleReceive (const boost::system::error_code &error, size_t nBytesReceived)
 
void processErrorCode (const boost::system::error_code &error)
 
 NFD_LOG_INCLASS_DECLARE ()
 
 StreamTransport (typename protocol::socket &&socket)
 Construct stream transport. More...
 
- Protected Member Functions inherited from nfd::face::DatagramTransport< boost::asio::ip::udp, Unicast >
void handleSend (const boost::system::error_code &error, size_t nBytesSent, const Block &payload)
 
void handleReceive (const boost::system::error_code &error, size_t nBytesReceived)
 
void processErrorCode (const boost::system::error_code &error)
 
bool hasBeenUsedRecently () const
 
void resetRecentUsage ()
 
Transport::EndpointId makeEndpointId (const protocol::endpoint &ep)
 
Transport::EndpointId makeEndpointId (const protocol::endpoint &ep)
 
 NFD_LOG_INCLASS_DECLARE ()
 
 DatagramTransport (typename protocol::socket &&socket)
 Construct datagram transport. More...
 
void receiveDatagram (const uint8_t *buffer, size_t nBytesReceived, const boost::system::error_code &error)
 Receive datagram, translate buffer into packet, deliver to parent class. More...
 
- Protected Member Functions inherited from nfd::face::StreamTransport< boost::asio::ip::tcp >
void deferredClose ()
 
void sendFromQueue ()
 
void handleSend (const boost::system::error_code &error, size_t nBytesSent)
 
void handleReceive (const boost::system::error_code &error, size_t nBytesReceived)
 
void processErrorCode (const boost::system::error_code &error)
 
 NFD_LOG_INCLASS_DECLARE ()
 
 StreamTransport (typename protocol::socket &&socket)
 Construct stream transport. More...
 
- Protected Member Functions inherited from nfd::face::DatagramTransport< boost::asio::ip::udp, Multicast >
void handleSend (const boost::system::error_code &error, size_t nBytesSent, const Block &payload)
 
void handleReceive (const boost::system::error_code &error, size_t nBytesReceived)
 
void processErrorCode (const boost::system::error_code &error)
 
bool hasBeenUsedRecently () const
 
void resetRecentUsage ()
 
Transport::EndpointId makeEndpointId (const protocol::endpoint &ep)
 
Transport::EndpointId makeEndpointId (const protocol::endpoint &ep)
 
 NFD_LOG_INCLASS_DECLARE ()
 
 DatagramTransport (typename protocol::socket &&socket)
 Construct datagram transport. More...
 
void receiveDatagram (const uint8_t *buffer, size_t nBytesReceived, const boost::system::error_code &error)
 Receive datagram, translate buffer into packet, deliver to parent class. More...
 

Additional Inherited Members

- Protected Types inherited from nfd::face::StreamTransport< boost::asio::local::stream_protocol >
typedef boost::asio::local::stream_protocol protocol
 
- Protected Types inherited from nfd::face::DatagramTransport< boost::asio::ip::udp, Unicast >
typedef boost::asio::ip::udp protocol
 
- Protected Types inherited from nfd::face::StreamTransport< boost::asio::ip::tcp >
typedef boost::asio::ip::tcp protocol
 
- Protected Types inherited from nfd::face::DatagramTransport< boost::asio::ip::udp, Multicast >
typedef boost::asio::ip::udp protocol
 
- Static Protected Member Functions inherited from nfd::face::DatagramTransport< boost::asio::ip::udp, Unicast >
static EndpointId makeEndpointId (const typename protocol::endpoint &ep)
 
- Static Protected Member Functions inherited from nfd::face::DatagramTransport< boost::asio::ip::udp, Multicast >
static EndpointId makeEndpointId (const typename protocol::endpoint &ep)
 
- Protected Attributes inherited from nfd::face::TransportCounters
PacketCounter nInPackets
 count of incoming packets More...
 
PacketCounter nOutPackets
 count of outgoing packets More...
 
ByteCounter nInBytes
 total incoming bytes More...
 
ByteCounter nOutBytes
 total outgoing bytes More...
 
- Protected Attributes inherited from nfd::face::WebSocketTransportCounters
PacketCounter nOutPings
 count of outgoing Pings More...
 
PacketCounter nInPongs
 count of incoming Pongs More...
 
- Protected Attributes inherited from nfd::face::StreamTransport< boost::asio::local::stream_protocol >
protocol::socket m_socket
 
- Protected Attributes inherited from nfd::face::DatagramTransport< boost::asio::ip::udp, Unicast >
protocol::socket m_socket
 
protocol::endpoint m_sender
 
- Protected Attributes inherited from nfd::face::StreamTransport< boost::asio::ip::tcp >
protocol::socket m_socket
 
- Protected Attributes inherited from nfd::face::DatagramTransport< boost::asio::ip::udp, Multicast >
protocol::socket m_socket
 
protocol::endpoint m_sender
 

Detailed Description

A multicast Transport that uses raw Ethernet II frames.

A Transport that communicates on a WebSocket connection.

A Transport that communicates on a stream-oriented Unix domain socket.

A Transport that communicates on a unicast UDP socket.

A Transport that communicates on a connected TCP socket.

A Transport that communicates on a UDP multicast group.

generalization of a network interface

A face generalizes a network interface. It provides best-effort network-layer packet delivery services on a physical interface, an overlay tunnel, or a link to a local application.

A face combines two parts: LinkService and Transport. Transport is the lower part, which provides best-effort TLV block deliveries. LinkService is the upper part, which translates between network-layer packets and TLV blocks, and may provide additional services such as fragmentation and reassembly.

Definition at line 48 of file ethernet-transport.hpp.

Member Typedef Documentation

§ Counters

counters provided by WebSocketTransport

Definition at line 60 of file websocket-transport.hpp.

Member Function Documentation

§ EthernetTransport()

nfd::face::DECL_CLASS_FINAL::EthernetTransport ( const NetworkInterfaceInfo interface,
const ethernet::Address mcastAddress 
)

Creates an Ethernet-based transport for multicast communication.

§ beforeChangePersistency() [1/6]

virtual void nfd::face::DECL_CLASS_FINAL::beforeChangePersistency ( ndn::nfd::FacePersistency  newPersistency)
protectedvirtual

invoked before persistency is changed

Exceptions
std::invalid_argumentnew persistency is not supported
std::runtime_errortransition is disallowed

Implements nfd::face::Transport.

§ doClose() [1/2]

virtual void nfd::face::DECL_CLASS_FINAL::doClose ( )
protectedvirtual

performs Transport specific operations to close the transport

This is invoked once by close() after changing state to CLOSING. It will not be invoked by Transport class if the transport is already CLOSING or CLOSED.

When the cleanup procedure is complete, this method should change state to CLOSED. This transition can happen synchronously or asynchronously.

Implements nfd::face::Transport.

§ Face()

nfd::face::DECL_CLASS_FINAL::Face ( unique_ptr< LinkService service,
unique_ptr< Transport transport 
)

§ getLinkService()

LinkService* nfd::face::DECL_CLASS_FINAL::getLinkService ( )

§ getTransport()

Transport* nfd::face::DECL_CLASS_FINAL::getTransport ( )

§ sendInterest()

void nfd::face::DECL_CLASS_FINAL::sendInterest ( const Interest interest)

sends Interest on Face

§ sendData()

void nfd::face::DECL_CLASS_FINAL::sendData ( const Data data)

sends Data on Face

§ sendNack()

void nfd::face::DECL_CLASS_FINAL::sendNack ( const lp::Nack nack)

sends Nack on Face

§ getId()

FaceId nfd::face::DECL_CLASS_FINAL::getId ( ) const
Returns
face ID

§ setId()

void nfd::face::DECL_CLASS_FINAL::setId ( FaceId  id)

sets face ID

Note
Normally, this should only be invoked by FaceTable.

§ setMetric()

void nfd::face::DECL_CLASS_FINAL::setMetric ( uint64_t  metric)

§ getMetric()

uint64_t nfd::face::DECL_CLASS_FINAL::getMetric ( ) const

§ getLocalUri()

FaceUri nfd::face::DECL_CLASS_FINAL::getLocalUri ( ) const
Returns
a FaceUri representing local endpoint

§ getRemoteUri()

FaceUri nfd::face::DECL_CLASS_FINAL::getRemoteUri ( ) const
Returns
a FaceUri representing remote endpoint

§ getScope()

ndn::nfd::FaceScope nfd::face::DECL_CLASS_FINAL::getScope ( ) const
Returns
whether face is local or non-local for scope control purpose

§ getPersistency()

ndn::nfd::FacePersistency nfd::face::DECL_CLASS_FINAL::getPersistency ( ) const
Returns
face persistency setting

§ setPersistency()

void nfd::face::DECL_CLASS_FINAL::setPersistency ( ndn::nfd::FacePersistency  persistency)

changes face persistency setting

§ getLinkType()

ndn::nfd::LinkType nfd::face::DECL_CLASS_FINAL::getLinkType ( ) const
Returns
whether face is point-to-point or multi-access

§ getState()

FaceState nfd::face::DECL_CLASS_FINAL::getState ( ) const
Returns
face state

§ getExpirationTime()

time::steady_clock::TimePoint nfd::face::DECL_CLASS_FINAL::getExpirationTime ( ) const
Returns
expiration time of the face
Return values
time::steady_clock::TimePoint::max()the face has an indefinite lifetime

§ close()

void nfd::face::DECL_CLASS_FINAL::close ( )

request the face to be closed

This operation is effective only if face is in UP or DOWN state, otherwise it has no effect. The face changes state to CLOSING, and performs cleanup procedure. The state will be changed to CLOSED when cleanup is complete, which may happen synchronously or asynchronously.

Warning
the face must not be deallocated until its state changes to CLOSED

§ getCounters() [1/2]

const FaceCounters& nfd::face::DECL_CLASS_FINAL::getCounters ( ) const
virtual

Reimplemented from nfd::face::Transport.

§ MulticastUdpTransport()

nfd::face::DECL_CLASS_FINAL::MulticastUdpTransport ( const protocol::endpoint &  localEndpoint,
const protocol::endpoint &  multicastGroup,
protocol::socket &&  recvSocket,
protocol::socket &&  sendSocket 
)

Creates a UDP-based transport for multicast communication.

Parameters
localEndpointlocal endpoint
multicastGroupmulticast group
recvSocketsocket used to receive packets
sendSocketsocket used to send to the multicast group

§ beforeChangePersistency() [2/6]

virtual void nfd::face::DECL_CLASS_FINAL::beforeChangePersistency ( ndn::nfd::FacePersistency  newPersistency)
protectedvirtual

invoked before persistency is changed

Exceptions
std::invalid_argumentnew persistency is not supported
std::runtime_errortransition is disallowed

Implements nfd::face::Transport.

§ TcpTransport()

nfd::face::DECL_CLASS_FINAL::TcpTransport ( protocol::socket &&  socket,
ndn::nfd::FacePersistency  persistency 
)

§ beforeChangePersistency() [3/6]

virtual void nfd::face::DECL_CLASS_FINAL::beforeChangePersistency ( ndn::nfd::FacePersistency  newPersistency)
protectedvirtual

invoked before persistency is changed

Exceptions
std::invalid_argumentnew persistency is not supported
std::runtime_errortransition is disallowed

Implements nfd::face::Transport.

§ UnicastUdpTransport()

nfd::face::DECL_CLASS_FINAL::UnicastUdpTransport ( protocol::socket &&  socket,
ndn::nfd::FacePersistency  persistency,
time::nanoseconds  idleTimeout 
)

§ beforeChangePersistency() [4/6]

virtual void nfd::face::DECL_CLASS_FINAL::beforeChangePersistency ( ndn::nfd::FacePersistency  newPersistency)
protectedvirtual

invoked before persistency is changed

Exceptions
std::invalid_argumentnew persistency is not supported
std::runtime_errortransition is disallowed

Implements nfd::face::Transport.

§ UnixStreamTransport()

nfd::face::DECL_CLASS_FINAL::UnixStreamTransport ( protocol::socket &&  socket)
explicit

§ beforeChangePersistency() [5/6]

virtual void nfd::face::DECL_CLASS_FINAL::beforeChangePersistency ( ndn::nfd::FacePersistency  newPersistency)
protectedvirtual

invoked before persistency is changed

Exceptions
std::invalid_argumentnew persistency is not supported
std::runtime_errortransition is disallowed

Implements nfd::face::Transport.

§ WebSocketTransport()

nfd::face::DECL_CLASS_FINAL::WebSocketTransport ( websocketpp::connection_hdl  hdl,
websocket::Server server,
time::milliseconds  pingInterval 
)

§ getCounters() [2/2]

virtual const Counters& nfd::face::DECL_CLASS_FINAL::getCounters ( ) const
virtual

Reimplemented from nfd::face::Transport.

§ receiveMessage()

void nfd::face::DECL_CLASS_FINAL::receiveMessage ( const std::string &  msg)

Translates a message into a Block and delivers it to the link service.

§ handlePong()

void nfd::face::DECL_CLASS_FINAL::handlePong ( )

§ handlePongTimeout()

void nfd::face::DECL_CLASS_FINAL::handlePongTimeout ( )

§ beforeChangePersistency() [6/6]

virtual void nfd::face::DECL_CLASS_FINAL::beforeChangePersistency ( ndn::nfd::FacePersistency  newPersistency)
protectedvirtual

invoked before persistency is changed

Exceptions
std::invalid_argumentnew persistency is not supported
std::runtime_errortransition is disallowed

Implements nfd::face::Transport.

§ doClose() [2/2]

virtual void nfd::face::DECL_CLASS_FINAL::doClose ( )
protectedvirtual

performs Transport specific operations to close the transport

This is invoked once by close() after changing state to CLOSING. It will not be invoked by Transport class if the transport is already CLOSING or CLOSED.

When the cleanup procedure is complete, this method should change state to CLOSED. This transition can happen synchronously or asynchronously.

Implements nfd::face::Transport.

Member Data Documentation

§ afterReceiveInterest

signal::Signal<LinkService, Interest>& nfd::face::DECL_CLASS_FINAL::afterReceiveInterest

signals on Interest received

Definition at line 100 of file face.hpp.

§ afterReceiveData

signal::Signal<LinkService, Data>& nfd::face::DECL_CLASS_FINAL::afterReceiveData

signals on Data received

Definition at line 104 of file face.hpp.

§ afterReceiveNack

signal::Signal<LinkService, lp::Nack>& nfd::face::DECL_CLASS_FINAL::afterReceiveNack

signals on Nack received

Definition at line 108 of file face.hpp.

§ afterStateChange

signal::Signal<Transport, FaceState, FaceState>& nfd::face::DECL_CLASS_FINAL::afterStateChange

signals after face state changed

Definition at line 166 of file face.hpp.


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