A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::FdNetDevice Class Reference

a NetDevice to read/write network traffic from/into a file descriptor. More...

#include <fd-net-device.h>

+ Inheritance diagram for ns3::FdNetDevice:

Public Types

enum  EncapsulationMode { DIX, LLC, DIXPI }
 
- Public Types inherited from ns3::NetDevice
enum  PacketType {
  PACKET_HOST = 1, NS3_PACKET_HOST = PACKET_HOST, PACKET_BROADCAST, NS3_PACKET_BROADCAST = PACKET_BROADCAST,
  PACKET_MULTICAST, NS3_PACKET_MULTICAST = PACKET_MULTICAST, PACKET_OTHERHOST, NS3_PACKET_OTHERHOST = PACKET_OTHERHOST
}
 
typedef Callback< bool, Ptr
< NetDevice >, Ptr< const
Packet >, uint16_t, const
Address &, const Address
&, enum PacketType
PromiscReceiveCallback
 
typedef Callback< bool, Ptr
< NetDevice >, Ptr< const
Packet >, uint16_t, const
Address & > 
ReceiveCallback
 

Public Member Functions

 FdNetDevice ()
 
virtual ~FdNetDevice ()
 
virtual void AddLinkChangeCallback (Callback< void > callback)
 
virtual Address GetAddress (void) const
 
virtual Address GetBroadcast (void) const
 
virtual Ptr< ChannelGetChannel (void) const
 
FdNetDevice::EncapsulationMode GetEncapsulationMode (void) const
 
virtual uint32_t GetIfIndex (void) const
 
virtual uint16_t GetMtu (void) const
 
virtual Address GetMulticast (Ipv4Address multicastGroup) const
 Make and return a MAC multicast address using the provided multicast group. More...
 
virtual Address GetMulticast (Ipv6Address addr) const
 Get the MAC multicast address corresponding to the IPv6 address provided. More...
 
virtual Ptr< NodeGetNode (void) const
 
virtual bool IsBridge (void) const
 Return true if the net device is acting as a bridge. More...
 
virtual bool IsBroadcast (void) const
 
virtual bool IsLinkUp (void) const
 
virtual bool IsMulticast (void) const
 
virtual bool IsPointToPoint (void) const
 Return true if the net device is on a point-to-point link. More...
 
virtual bool NeedsArp (void) const
 
virtual bool Send (Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
 
virtual bool SendFrom (Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
 
virtual void SetAddress (Address address)
 
void SetEncapsulationMode (FdNetDevice::EncapsulationMode mode)
 
void SetFileDescriptor (int fd)
 
virtual void SetIfIndex (const uint32_t index)
 
virtual void SetIsBroadcast (bool broadcast)
 
virtual void SetIsMulticast (bool multicast)
 
virtual bool SetMtu (const uint16_t mtu)
 
virtual void SetNode (Ptr< Node > node)
 
virtual void SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb)
 
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb)
 
void Start (Time tStart)
 
void Stop (Time tStop)
 
virtual bool SupportsSendFrom () const
 
- Public Member Functions inherited from ns3::Object
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
 
uint32_t GetReferenceCount (void) const
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 
void Ref (void) const
 
void Unref (void) const
 
- Public Member Functions inherited from ns3::ObjectBase
void GetAttribute (std::string name, AttributeValue &value) const
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::NetDevice
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 

Protected Member Functions

virtual void DoDispose (void)
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoInitialize (void)
 
virtual void NotifyNewAggregate (void)
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 

Private Member Functions

 FdNetDevice (FdNetDevice const &)
 
void ForwardUp (uint8_t *buf, ssize_t len)
 
void NotifyLinkUp (void)
 
void ReceiveCallback (uint8_t *buf, ssize_t len)
 
void StartDevice (void)
 
void StopDevice (void)
 
bool TransmitStart (Ptr< Packet > p)
 

Private Attributes

Mac48Address m_address
 
EncapsulationMode m_encapMode
 
int m_fd
 
Ptr< FdNetDeviceFdReaderm_fdReader
 
uint32_t m_ifIndex
 
bool m_isBroadcast
 
bool m_isMulticast
 
TracedCallback m_linkChangeCallbacks
 
bool m_linkUp
 
TracedCallback< Ptr< const
Packet > > 
m_macPromiscRxTrace
 
TracedCallback< Ptr< const
Packet > > 
m_macRxDropTrace
 
TracedCallback< Ptr< const
Packet > > 
m_macRxTrace
 
TracedCallback< Ptr< const
Packet > > 
m_macTxDropTrace
 
TracedCallback< Ptr< const
Packet > > 
m_macTxTrace
 
uint32_t m_maxPendingReads
 
uint16_t m_mtu
 
Ptr< Nodem_node
 
uint32_t m_nodeId
 
uint32_t m_pendingReadCount
 
SystemMutex m_pendingReadMutex
 
TracedCallback< Ptr< const
Packet > > 
m_phyRxDropTrace
 
TracedCallback< Ptr< const
Packet > > 
m_phyTxDropTrace
 
NetDevice::PromiscReceiveCallback m_promiscRxCallback
 
TracedCallback< Ptr< const
Packet > > 
m_promiscSnifferTrace
 
NetDevice::ReceiveCallback m_rxCallback
 
TracedCallback< Ptr< const
Packet > > 
m_snifferTrace
 
EventId m_startEvent
 
EventId m_stopEvent
 
Time m_tStart
 
Time m_tStop
 

Detailed Description

a NetDevice to read/write network traffic from/into a file descriptor.

A FdNetDevice object will read and write frames/packets from/to a file descriptor. This file descriptor might be associated to a Linux TAP/TUN device, to a socket or to a user space process, allowing the simulation to exchange traffic with the "outside-world"

Config Paths

ns3::FdNetDevice is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::FdNetDevice

Attributes

  • Address: The MAC address of this device.
  • Start: The simulation time at which to spin up the device thread.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +0.0ns
    • Flags: construct write read
  • Stop: The simulation time at which to tear down the device thread.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +0.0ns
    • Flags: construct write read
  • EncapsulationMode: The link-layer encapsulation type to use.
    • Set with class: ns3::EnumValue
    • Underlying type: Dix|Llc|DixPi
    • Initial value: Dix
    • Flags: construct write read
  • RxQueueSize: Maximum size of the read queue. This value limits number of packets that have been read from the network into a memory buffer but have not yet been processed by the simulator.

TraceSources

  • MacTx: Trace source indicating a packet has arrived for transmission by this device
  • MacTxDrop: Trace source indicating a packet has been dropped by the device before transmission
  • MacPromiscRx: A packet has been received by this device, has been passed up from the physical layer and is being forwarded up the local protocol stack. This is a promiscuous trace,
  • MacRx: A packet has been received by this device, has been passed up from the physical layer and is being forwarded up the local protocol stack. This is a non-promiscuous trace,
  • Sniffer: Trace source simulating a non-promiscuous packet sniffer attached to the device
  • PromiscSniffer: Trace source simulating a promiscuous packet sniffer attached to the device

Definition at line 82 of file fd-net-device.h.

Member Enumeration Documentation

Enumeration of the types of frames supported in the class.

Enumerator
DIX 

DIX II / Ethernet II packet

LLC 

802.2 LLC/SNAP Packet

DIXPI 

When using TAP devices, if flag IFF_NO_PI is not set on the device, IP packets will have an extra header: Flags [2 bytes] Proto [2 bytes] Raw protocol(IP, IPv6, etc) frame.

Definition at line 90 of file fd-net-device.h.

Constructor & Destructor Documentation

ns3::FdNetDevice::FdNetDevice ( )

Constructor for the FdNetDevice.

Definition at line 150 of file fd-net-device.cc.

References m_tStart, NS_LOG_FUNCTION, and Start().

ns3::FdNetDevice::~FdNetDevice ( )
virtual

Destructor for the FdNetDevice.

Definition at line 170 of file fd-net-device.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

void ns3::FdNetDevice::AddLinkChangeCallback ( Callback< void >  callback)
virtual
Parameters
callbackthe callback to invoke

Add a callback invoked whenever the link status changes to UP. This callback is typically used by the IP/ARP layer to flush the ARP cache and by IPv6 stack to flush NDISC cache whenever the link goes up.

Implements ns3::NetDevice.

Definition at line 623 of file fd-net-device.cc.

References ns3::TracedCallback< T1, T2, T3, T4, T5, T6, T7, T8 >::ConnectWithoutContext(), and m_linkChangeCallbacks.

void ns3::FdNetDevice::DoDispose ( void  )
protectedvirtual

This method is called by Object::Dispose or by the object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.

It is safe to call GetObject from within this method.

Reimplemented from ns3::Object.

Definition at line 176 of file fd-net-device.cc.

References ns3::Object::DoDispose(), NS_LOG_FUNCTION, and StopDevice().

Address ns3::FdNetDevice::GetAddress ( void  ) const
virtual
Returns
the current Address of this interface.

Implements ns3::NetDevice.

Definition at line 567 of file fd-net-device.cc.

References m_address.

Address ns3::FdNetDevice::GetBroadcast ( void  ) const
virtual
Returns
the broadcast address supported by this netdevice.

Calling this method is invalid if IsBroadcast returns not true.

Implements ns3::NetDevice.

Definition at line 641 of file fd-net-device.cc.

Ptr< Channel > ns3::FdNetDevice::GetChannel ( void  ) const
virtual
Returns
the channel this NetDevice is connected to. The value returned can be zero if the NetDevice is not yet connected to any channel or if the underlying NetDevice has no concept of a channel. i.e., callers must check for zero and be ready to handle it.

Implements ns3::NetDevice.

Definition at line 592 of file fd-net-device.cc.

FdNetDevice::EncapsulationMode ns3::FdNetDevice::GetEncapsulationMode ( void  ) const

Get the link layer encapsulation mode of this device.

Returns
The link layer encapsulation mode of this device.

Definition at line 192 of file fd-net-device.cc.

References m_encapMode, and NS_LOG_FUNCTION.

uint32_t ns3::FdNetDevice::GetIfIndex ( void  ) const
virtual
Returns
index ifIndex of the device

Implements ns3::NetDevice.

Definition at line 586 of file fd-net-device.cc.

References m_ifIndex.

uint16_t ns3::FdNetDevice::GetMtu ( void  ) const
virtual
Returns
the link-level MTU in bytes for this interface.

This value is typically used by the IP layer to perform IP fragmentation when needed.

Implements ns3::NetDevice.

Definition at line 611 of file fd-net-device.cc.

References m_mtu.

Address ns3::FdNetDevice::GetMulticast ( Ipv4Address  multicastGroup) const
virtual

Make and return a MAC multicast address using the provided multicast group.

RFC 1112 says that an Ipv4 host group address is mapped to an Ethernet multicast address by placing the low-order 23-bits of the IP address into the low-order 23 bits of the Ethernet multicast address 01-00-5E-00-00-00 (hex). Similar RFCs exist for Ipv6 and Eui64 mappings. This method performs the multicast address creation function appropriate to the underlying MAC address of the device. This MAC address is encapsulated in an abstract Address to avoid dependencies on the exact MAC address format.

In the case of net devices that do not support multicast, clients are expected to test NetDevice::IsMulticast and avoid attempting to map multicast packets. Subclasses of NetDevice that do support multicasting are expected to override this method and provide an implementation appropriate to the particular device.

Parameters
multicastGroupThe IP address for the multicast group destination of the packet.
Returns
The MAC multicast Address used to send packets to the provided multicast group.
Warning
Calling this method is invalid if IsMulticast returns not true.
See Also
Ipv4Address
Address
NetDevice::IsMulticast

Implements ns3::NetDevice.

Definition at line 659 of file fd-net-device.cc.

References ns3::Mac48Address::GetMulticast().

Address ns3::FdNetDevice::GetMulticast ( Ipv6Address  addr) const
virtual

Get the MAC multicast address corresponding to the IPv6 address provided.

Parameters
addrIPv6 address
Returns
the MAC multicast address
Warning
Calling this method is invalid if IsMulticast returns not true.

Implements ns3::NetDevice.

Definition at line 665 of file fd-net-device.cc.

References ns3::Mac48Address::GetMulticast().

Ptr< Node > ns3::FdNetDevice::GetNode ( void  ) const
virtual
Returns
the node base class which contains this network interface.

When a subclass needs to get access to the underlying node base class to print the nodeid for example, it can invoke this method.

Implements ns3::NetDevice.

Definition at line 683 of file fd-net-device.cc.

References m_node.

Referenced by StartDevice().

bool ns3::FdNetDevice::IsBridge ( void  ) const
virtual

Return true if the net device is acting as a bridge.

Returns
value of m_isBridge flag

Implements ns3::NetDevice.

Definition at line 671 of file fd-net-device.cc.

bool ns3::FdNetDevice::IsBroadcast ( void  ) const
virtual
Returns
true if this interface supports a broadcast address, false otherwise.

Implements ns3::NetDevice.

Definition at line 629 of file fd-net-device.cc.

References m_isBroadcast.

bool ns3::FdNetDevice::IsLinkUp ( void  ) const
virtual
Returns
true if link is up; false otherwise

Implements ns3::NetDevice.

Definition at line 617 of file fd-net-device.cc.

References m_linkUp.

Referenced by SendFrom().

bool ns3::FdNetDevice::IsMulticast ( void  ) const
virtual
Returns
value of m_isMulticast flag

Implements ns3::NetDevice.

Definition at line 647 of file fd-net-device.cc.

References m_isMulticast.

bool ns3::FdNetDevice::IsPointToPoint ( void  ) const
virtual

Return true if the net device is on a point-to-point link.

Returns
value of m_isPointToPoint flag

Implements ns3::NetDevice.

Definition at line 677 of file fd-net-device.cc.

bool ns3::FdNetDevice::NeedsArp ( void  ) const
virtual
Returns
true if ARP is needed, false otherwise.

Called by higher-layers to check if this NetDevice requires ARP to be used.

Implements ns3::NetDevice.

Definition at line 695 of file fd-net-device.cc.

void ns3::FdNetDevice::ReceiveCallback ( uint8_t *  buf,
ssize_t  len 
)
private

Callback to invoke when a new frame is received

Definition at line 258 of file fd-net-device.cc.

References ForwardUp(), m_maxPendingReads, m_pendingReadCount, m_pendingReadMutex, NS_LOG_FUNCTION, and ns3::Simulator::ScheduleWithContext().

bool ns3::FdNetDevice::Send ( Ptr< Packet packet,
const Address dest,
uint16_t  protocolNumber 
)
virtual
Parameters
packetpacket sent from above down to Network Device
destmac address of the destination (already resolved)
protocolNumberidentifies the type of payload contained in this packet. Used to call the right L3Protocol when the packet is received.

Called from higher layer to send packet into Network Device to the specified destination Address

Returns
whether the Send operation succeeded

Implements ns3::NetDevice.

Definition at line 470 of file fd-net-device.cc.

References m_address, NS_LOG_FUNCTION, and SendFrom().

bool ns3::FdNetDevice::SendFrom ( Ptr< Packet packet,
const Address source,
const Address dest,
uint16_t  protocolNumber 
)
virtual
Parameters
packetpacket sent from above down to Network Device
sourcesource mac address (so called "MAC spoofing")
destmac address of the destination (already resolved)
protocolNumberidentifies the type of payload contained in this packet. Used to call the right L3Protocol when the packet is received.

Called from higher layer to send packet into Network Device with the specified source and destination Addresses.

Returns
whether the Send operation succeeded

Implements ns3::NetDevice.

Definition at line 477 of file fd-net-device.cc.

References ns3::Packet::AddHeader(), ns3::Mac48Address::ConvertFrom(), ns3::Packet::CopyData(), DIXPI, ns3::Packet::GetSize(), ns3::Packet::GetUid(), IsLinkUp(), LLC, m_encapMode, m_fd, m_macTxDropTrace, m_macTxTrace, m_mtu, m_promiscSnifferTrace, m_snifferTrace, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::EthernetHeader::SetDestination(), ns3::EthernetHeader::SetLengthType(), and ns3::EthernetHeader::SetSource().

Referenced by Send().

void ns3::FdNetDevice::SetAddress ( Address  address)
virtual

Set the address of this interface

Parameters
addressaddress to set

Implements ns3::NetDevice.

Definition at line 561 of file fd-net-device.cc.

References ns3::Mac48Address::ConvertFrom(), and m_address.

void ns3::FdNetDevice::SetEncapsulationMode ( FdNetDevice::EncapsulationMode  mode)

Set the link layer encapsulation mode of this device.

Parameters
modeThe link layer encapsulation mode of this device.

Definition at line 184 of file fd-net-device.cc.

References m_encapMode, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

void ns3::FdNetDevice::SetFileDescriptor ( int  fd)

Set the associated file descriptor.

Definition at line 552 of file fd-net-device.cc.

References m_fd.

void ns3::FdNetDevice::SetIfIndex ( const uint32_t  index)
virtual
Parameters
indexifIndex of the device

Implements ns3::NetDevice.

Definition at line 580 of file fd-net-device.cc.

References m_ifIndex.

bool ns3::FdNetDevice::SetMtu ( const uint16_t  mtu)
virtual
Parameters
mtuMTU value, in bytes, to set for the device
Returns
whether the MTU value was within legal bounds

Override for default MTU defined on a per-type basis.

Implements ns3::NetDevice.

Definition at line 598 of file fd-net-device.cc.

References m_mtu.

void ns3::FdNetDevice::SetNode ( Ptr< Node node)
virtual
Parameters
nodethe node associated to this netdevice.

This method is called from ns3::Node::AddDevice.

Implements ns3::NetDevice.

Definition at line 689 of file fd-net-device.cc.

References m_node.

void ns3::FdNetDevice::SetPromiscReceiveCallback ( NetDevice::PromiscReceiveCallback  cb)
virtual
Parameters
cbcallback to invoke whenever a packet has been received in promiscuous mode and must be forwarded to the higher layers.

Enables netdevice promiscuous mode and sets the callback that will handle promiscuous mode packets. Note, promiscuous mode packets means all packets, including those packets that can be sensed by the netdevice but which are intended to be received by other hosts.

Implements ns3::NetDevice.

Definition at line 707 of file fd-net-device.cc.

References m_promiscRxCallback.

void ns3::FdNetDevice::SetReceiveCallback ( NetDevice::ReceiveCallback  cb)
virtual
Parameters
cbcallback to invoke whenever a packet has been received and must be forwarded to the higher layers.

Implements ns3::NetDevice.

Definition at line 701 of file fd-net-device.cc.

References m_rxCallback.

void ns3::FdNetDevice::Start ( Time  tStart)

Set a start time for the device.

Parameters
tStartthe start time

Definition at line 199 of file fd-net-device.cc.

References ns3::Simulator::Cancel(), NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and StartDevice().

Referenced by FdNetDevice().

void ns3::FdNetDevice::StartDevice ( void  )
private

Spin up the device

Definition at line 215 of file fd-net-device.cc.

References ns3::Node::GetId(), GetNode(), m_fd, m_fdReader, m_mtu, ns3::MakeCallback(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by Start().

void ns3::FdNetDevice::Stop ( Time  tStop)

Set a stop time for the device.

Parameters
tStopthe stop time

Definition at line 207 of file fd-net-device.cc.

References ns3::Simulator::Cancel(), NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and StopDevice().

void ns3::FdNetDevice::StopDevice ( void  )
private

Tear down the device

Definition at line 240 of file fd-net-device.cc.

References m_fd, m_fdReader, and NS_LOG_FUNCTION.

Referenced by DoDispose(), and Stop().

bool ns3::FdNetDevice::SupportsSendFrom ( ) const
virtual
Returns
true if this interface supports a bridging mode, false otherwise.

Implements ns3::NetDevice.

Definition at line 713 of file fd-net-device.cc.

bool ns3::FdNetDevice::TransmitStart ( Ptr< Packet p)
private

Start Sending a Packet Down the Wire.

Parameters
ppacket to send
Returns
true if success, false on failure

Member Data Documentation

Mac48Address ns3::FdNetDevice::m_address
private

The net device mac address.

Definition at line 270 of file fd-net-device.h.

Referenced by ForwardUp(), GetAddress(), Send(), and SetAddress().

EncapsulationMode ns3::FdNetDevice::m_encapMode
private

The typ of encapsulation of the received/transmited frames.

Definition at line 277 of file fd-net-device.h.

Referenced by ForwardUp(), GetEncapsulationMode(), SendFrom(), and SetEncapsulationMode().

int ns3::FdNetDevice::m_fd
private

The file descriptor used for receive/send network traffic.

Definition at line 256 of file fd-net-device.h.

Referenced by SendFrom(), SetFileDescriptor(), StartDevice(), and StopDevice().

Ptr<FdNetDeviceFdReader> ns3::FdNetDevice::m_fdReader
private

Reader for the file descriptor.

Definition at line 263 of file fd-net-device.h.

Referenced by StartDevice(), and StopDevice().

uint32_t ns3::FdNetDevice::m_ifIndex
private

The ns-3 interface index (in the sense of net device index) that has been assigned to this network device.

Definition at line 242 of file fd-net-device.h.

Referenced by GetIfIndex(), and SetIfIndex().

bool ns3::FdNetDevice::m_isBroadcast
private

Flag indicating whether or not the underlying net device supports broadcast.

Definition at line 300 of file fd-net-device.h.

Referenced by IsBroadcast().

bool ns3::FdNetDevice::m_isMulticast
private

Flag indicating whether or not the underlying net device supports multicast.

Definition at line 308 of file fd-net-device.h.

Referenced by IsMulticast().

TracedCallback ns3::FdNetDevice::m_linkChangeCallbacks
private

Callbacks to fire if the link changes state (up or down).

Definition at line 292 of file fd-net-device.h.

Referenced by AddLinkChangeCallback().

bool ns3::FdNetDevice::m_linkUp
private

Flag indicating whether or not the link is up. In this case, whether or not the device is connected to a channel.

Definition at line 285 of file fd-net-device.h.

Referenced by IsLinkUp().

TracedCallback<Ptr<const Packet> > ns3::FdNetDevice::m_macPromiscRxTrace
private

The trace source fired for packets successfully received by the device immediately before being forwarded up to higher layers (at the L2/L3 transition). This is a promiscuous trace.

See Also
class CallBackTraceSource

Definition at line 382 of file fd-net-device.h.

Referenced by ForwardUp().

TracedCallback<Ptr<const Packet> > ns3::FdNetDevice::m_macRxDropTrace
private

The trace source fired for packets successfully received by the device but which are dropped before being forwarded up to higher layers (at the L2/L3 transition).

See Also
class CallBackTraceSource

Definition at line 400 of file fd-net-device.h.

TracedCallback<Ptr<const Packet> > ns3::FdNetDevice::m_macRxTrace
private

The trace source fired for packets successfully received by the device immediately before being forwarded up to higher layers (at the L2/L3 transition). This is a non-promiscuous trace.

See Also
class CallBackTraceSource

Definition at line 391 of file fd-net-device.h.

Referenced by ForwardUp().

TracedCallback<Ptr<const Packet> > ns3::FdNetDevice::m_macTxDropTrace
private

The trace source fired when packets coming into the "top" of the device at the L3/L2 transition are dropped before being queued for transmission.

See Also
class CallBackTraceSource

Definition at line 373 of file fd-net-device.h.

Referenced by SendFrom().

TracedCallback<Ptr<const Packet> > ns3::FdNetDevice::m_macTxTrace
private

The trace source fired when packets come into the "top" of the device at the L3/L2 transition, before being queued for transmission.

See Also
class CallBackTraceSource

Definition at line 365 of file fd-net-device.h.

Referenced by SendFrom().

uint32_t ns3::FdNetDevice::m_maxPendingReads
private

Maximum number of packets that can be received and scheduled for read but not yeat read.

Definition at line 322 of file fd-net-device.h.

Referenced by ReceiveCallback().

uint16_t ns3::FdNetDevice::m_mtu
private

The MTU associated to the file descriptor technology

Definition at line 249 of file fd-net-device.h.

Referenced by GetMtu(), SendFrom(), SetMtu(), and StartDevice().

Ptr<Node> ns3::FdNetDevice::m_node
private

The ns-3 node associated to the net device.

Definition at line 226 of file fd-net-device.h.

Referenced by GetNode(), and SetNode().

uint32_t ns3::FdNetDevice::m_pendingReadCount
private

Number of packets that were received and scheduled for read but not yeat read.

Definition at line 315 of file fd-net-device.h.

Referenced by ForwardUp(), and ReceiveCallback().

SystemMutex ns3::FdNetDevice::m_pendingReadMutex
private

Mutex to increase pending read counter.

Definition at line 330 of file fd-net-device.h.

Referenced by ForwardUp(), and ReceiveCallback().

TracedCallback<Ptr<const Packet> > ns3::FdNetDevice::m_phyRxDropTrace
private

The trace source fired when the phy layer drops a packet it has received.

See Also
class CallBackTraceSource

Definition at line 415 of file fd-net-device.h.

Referenced by ForwardUp().

TracedCallback<Ptr<const Packet> > ns3::FdNetDevice::m_phyTxDropTrace
private

The trace source fired when the phy layer drops a packet as it tries to transmit it.

See Also
class CallBackTraceSource

Definition at line 408 of file fd-net-device.h.

NetDevice::PromiscReceiveCallback ns3::FdNetDevice::m_promiscRxCallback
private

The callback used to notify higher layers that a packet has been received in promiscuous mode.

Definition at line 357 of file fd-net-device.h.

Referenced by ForwardUp(), and SetPromiscReceiveCallback().

TracedCallback<Ptr<const Packet> > ns3::FdNetDevice::m_promiscSnifferTrace
private

A trace source that emulates a promiscuous mode protocol sniffer connected to the device. This trace source fire on packets destined for any host just like your average everyday packet sniffer.

On the transmit size, this trace hook will fire after a packet is dequeued from the device queue for transmission. In Linux, for example, this would correspond to the point just before a device hard_start_xmit where dev_queue_xmit_nit is called to dispatch the packet to the PF_PACKET ETH_P_ALL handlers.

On the receive side, this trace hook will fire when a packet is received, just before the receive callback is executed. In Linux, for example, this would correspond to the point at which the packet is dispatched to packet sniffers in netif_receive_skb.

See Also
class CallBackTraceSource

Definition at line 455 of file fd-net-device.h.

Referenced by ForwardUp(), and SendFrom().

NetDevice::ReceiveCallback ns3::FdNetDevice::m_rxCallback
private

The callback used to notify higher layers that a packet has been received.

Definition at line 352 of file fd-net-device.h.

Referenced by ForwardUp(), and SetReceiveCallback().

TracedCallback<Ptr<const Packet> > ns3::FdNetDevice::m_snifferTrace
private

A trace source that emulates a non-promiscuous protocol sniffer connected to the device. Unlike your average everyday sniffer, this trace source will not fire on PACKET_OTHERHOST events.

On the transmit size, this trace hook will fire after a packet is dequeued from the device queue for transmission. In Linux, for example, this would correspond to the point just before a device hard_start_xmit where dev_queue_xmit_nit is called to dispatch the packet to the PF_PACKET ETH_P_ALL handlers.

On the receive side, this trace hook will fire when a packet is received, just before the receive callback is executed. In Linux, for example, this would correspond to the point at which the packet is dispatched to packet sniffers in netif_receive_skb.

See Also
class CallBackTraceSource

Definition at line 435 of file fd-net-device.h.

Referenced by ForwardUp(), and SendFrom().

Time ns3::FdNetDevice::m_tStart
private

Time to start spinning up the device

Definition at line 337 of file fd-net-device.h.

Referenced by FdNetDevice().

Time ns3::FdNetDevice::m_tStop
private

Time to start tearing down the device

Definition at line 344 of file fd-net-device.h.


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